diff options
author | schinz <schinz@epfl.ch> | 2003-09-29 14:24:47 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2003-09-29 14:24:47 +0000 |
commit | 066d81e7b6dd33ef919f27b9297841017756c9ea (patch) | |
tree | 089564548394215cf37946015cee26ba7985b705 /sources | |
parent | 419261187e6108607b07e91c9a09821a9bc26ec3 (diff) | |
download | scala-066d81e7b6dd33ef919f27b9297841017756c9ea.tar.gz scala-066d81e7b6dd33ef919f27b9297841017756c9ea.tar.bz2 scala-066d81e7b6dd33ef919f27b9297841017756c9ea.zip |
- bug fix [#98]: only treat top-level modules s...
- bug fix [#98]: only treat top-level modules specially, since they
are the only ones to need special treatment at this stage, - removed
Matthias' comments after reviewing the code somewhat, and replaced tabs
by spaces
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/backend/jvm/GenJVM.java | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index 7c38224780..de2f1594ba 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -492,8 +492,6 @@ class GenJVM { break; case Literal(Object value): - // MZ: I added the missing cases, but I am not sure if this - // is a good idea (in particular the way generatedType is set) if (value instanceof Integer) { generatedType = JType.INT; ctx.code.emitPUSH((Integer)value); @@ -759,17 +757,15 @@ class GenJVM { int arity = args.length; int resTypeIdx = getTypeIndex(resType); - // MZ: This code looks very dangerous; why are arguments - // loaded with an expected type that corresponds to resType? - // At least for the long shift instructions this is wrong. - if ((prim == Primitive.LSL) || - (prim == Primitive.LSR) || - (prim == Primitive.ASR)) { - genLoad(ctx, args[0], resType); - genLoad(ctx, args[1], JType.INT); - } else - for (int i = 0; i < arity; ++i) + if ((prim == Primitive.LSL) + || (prim == Primitive.LSR) + || (prim == Primitive.ASR)) { + genLoad(ctx, args[0], resType); + genLoad(ctx, args[1], JType.INT); + } else { + for (int i = 0; i < arity; ++i) genLoad(ctx, args[i], resType); + } if (prim == Primitive.NOT) { if (resType == JType.LONG) { @@ -1486,7 +1482,7 @@ class GenJVM { interfaceNames, ctx.sourceFileName); - return ctx.withClass(cls, cSym.isModuleClass()); + return ctx.withClass(cls, cSym.isModuleClass() && ctx.clazz == null); } protected HashSet seenClasses = new HashSet(); |