diff options
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(); |