diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2012-09-27 13:18:45 -0400 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2012-09-27 13:18:45 -0400 |
commit | 6d39c9529d1018801a4fda95466bf8720416abad (patch) | |
tree | 6880f41a6368a6e130ee7ab428ae87698ce4930e /src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | |
parent | 6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede (diff) | |
parent | 709bb01175c512d124da9874dcaea50022374715 (diff) | |
download | scala-6d39c9529d1018801a4fda95466bf8720416abad.tar.gz scala-6d39c9529d1018801a4fda95466bf8720416abad.tar.bz2 scala-6d39c9529d1018801a4fda95466bf8720416abad.zip |
Merge 2.10.x into master to fix breaking tests and keep things up-to-date.
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 18e9ae620e..85ad5a6884 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -2413,8 +2413,9 @@ abstract class GenASM extends SubComponent with BytecodeWriters { import asm.Opcodes (instr.category: @scala.annotation.switch) match { - case icodes.localsCat => - def genLocalInstr = (instr: @unchecked) match { + + case icodes.localsCat => + def genLocalInstr() = (instr: @unchecked) match { case THIS(_) => jmethod.visitVarInsn(Opcodes.ALOAD, 0) case LOAD_LOCAL(local) => jcode.load(indexOf(local), local.kind) case STORE_LOCAL(local) => jcode.store(indexOf(local), local.kind) @@ -2446,8 +2447,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genLocalInstr - case icodes.stackCat => - def genStackInstr = (instr: @unchecked) match { + case icodes.stackCat => + def genStackInstr() = (instr: @unchecked) match { case LOAD_MODULE(module) => // assert(module.isModule, "Expected module: " + module) @@ -2474,8 +2475,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { case icodes.arilogCat => genPrimitive(instr.asInstanceOf[CALL_PRIMITIVE].primitive, instr.pos) - case icodes.castsCat => - def genCastInstr = (instr: @unchecked) match { + case icodes.castsCat => + def genCastInstr() = (instr: @unchecked) match { case IS_INSTANCE(tpe) => val jtyp: asm.Type = @@ -2504,9 +2505,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genCastInstr - case icodes.objsCat => - def genObjsInstr = (instr: @unchecked) match { - + case icodes.objsCat => + def genObjsInstr() = (instr: @unchecked) match { case BOX(kind) => val MethodNameAndType(mname, mdesc) = jBoxTo(kind) jcode.invokestatic(BoxesRunTime, mname, mdesc) @@ -2524,8 +2524,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genObjsInstr - case icodes.fldsCat => - def genFldsInstr = (instr: @unchecked) match { + case icodes.fldsCat => + def genFldsInstr() = (instr: @unchecked) match { case lf @ LOAD_FIELD(field, isStatic) => var owner = javaName(lf.hostClass) @@ -2545,8 +2545,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genFldsInstr - case icodes.mthdsCat => - def genMethodsInstr = (instr: @unchecked) match { + case icodes.mthdsCat => + def genMethodsInstr() = (instr: @unchecked) match { /** Special handling to access native Array.clone() */ case call @ CALL_METHOD(definitions.Array_clone, Dynamic) => @@ -2558,8 +2558,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genMethodsInstr - case icodes.arraysCat => - def genArraysInstr = (instr: @unchecked) match { + case icodes.arraysCat => + def genArraysInstr() = (instr: @unchecked) match { case LOAD_ARRAY_ITEM(kind) => jcode.aload(kind) case STORE_ARRAY_ITEM(kind) => jcode.astore(kind) case CREATE_ARRAY(elem, 1) => jcode newarray elem @@ -2567,8 +2567,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genArraysInstr - case icodes.jumpsCat => - def genJumpInstr = (instr: @unchecked) match { + case icodes.jumpsCat => + def genJumpInstr() = (instr: @unchecked) match { case sw @ SWITCH(tagss, branches) => assert(branches.length == tagss.length + 1, sw) @@ -2697,8 +2697,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genJumpInstr - case icodes.retCat => - def genRetInstr = (instr: @unchecked) match { + case icodes.retCat => + def genRetInstr() = (instr: @unchecked) match { case RETURN(kind) => jcode emitRETURN kind case THROW(_) => emit(Opcodes.ATHROW) } @@ -2788,7 +2788,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { case Negation(kind) => jcode.neg(kind) case Arithmetic(op, kind) => - def genArith = { + def genArith() = { op match { case ADD => jcode.add(kind) @@ -2817,9 +2817,9 @@ abstract class GenASM extends SubComponent with BytecodeWriters { // TODO Logical's 2nd elem should be declared ValueTypeKind, to better approximate its allowed values (isIntSized, its comments appears to convey) // TODO GenICode uses `toTypeKind` to define that elem, `toValueTypeKind` would be needed instead. // TODO How about adding some asserts to Logical and similar ones to capture the remaining constraint (UNIT not allowed). - case Logical(op, kind) => - def genLogical = op match { - case AND => + case Logical(op, kind) => + def genLogical() = op match { + case AND => kind match { case LONG => emit(Opcodes.LAND) case INT => emit(Opcodes.IAND) @@ -2845,9 +2845,9 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } } genLogical - - case Shift(op, kind) => - def genShift = op match { + + case Shift(op, kind) => + def genShift() = op match { case LSL => kind match { case LONG => emit(Opcodes.LSHL) @@ -2875,8 +2875,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genShift - case Comparison(op, kind) => - def genCompare = op match { + case Comparison(op, kind) => + def genCompare() = op match { case CMP => (kind: @unchecked) match { case LONG => emit(Opcodes.LCMP) |