From 68c9e7c9249c61ee686ffaafe54b4baa27aa9679 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Wed, 2 Sep 2009 14:55:19 +0000 Subject: Added an alias for '-optimize' and fixed the op... Added an alias for '-optimize' and fixed the optimized build. --- src/compiler/scala/tools/nsc/Settings.scala | 2 +- src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index 061b64d911..3225a62049 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -723,7 +723,7 @@ trait ScalacSettings { val make = ChoiceSetting ("-make", "Specify recompilation detection strategy", List("all", "changed", "immediate", "transitive"), "all") . withHelpSyntax("-make:") val nowarnings = BooleanSetting ("-nowarn", "Generate no warnings") - val XO = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program") + val XO = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program").withAbbreviation("-optimize") val printLate = BooleanSetting ("-print", "Print program with all Scala-specific features removed") val sourcepath = StringSetting ("-sourcepath", "path", "Specify where to find input source files", "") val target = ChoiceSetting ("-target", "Specify for which target object files should be built", List("jvm-1.5", "msil"), "jvm-1.5") diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala index b11d1b74a4..47ab0328f3 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala @@ -339,7 +339,11 @@ abstract class ICodeReader extends ClassfileParser { case JVM.dstore_1 => code.emit(STORE_LOCAL(code.getLocal(1, DOUBLE))) case JVM.dstore_2 => code.emit(STORE_LOCAL(code.getLocal(2, DOUBLE))) case JVM.dstore_3 => code.emit(STORE_LOCAL(code.getLocal(3, DOUBLE))) - case JVM.astore_0 => code.emit(STORE_LOCAL(code.getLocal(0, OBJECT))) + case JVM.astore_0 => + if (method.isStatic) + code.emit(STORE_LOCAL(code.getLocal(0, OBJECT))) + else + code.emit(STORE_THIS(OBJECT)) case JVM.astore_1 => code.emit(STORE_LOCAL(code.getLocal(1, OBJECT))) case JVM.astore_2 => code.emit(STORE_LOCAL(code.getLocal(2, OBJECT))) case JVM.astore_3 => code.emit(STORE_LOCAL(code.getLocal(3, OBJECT))) -- cgit v1.2.3