diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2009-09-02 14:55:19 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2009-09-02 14:55:19 +0000 |
commit | 68c9e7c9249c61ee686ffaafe54b4baa27aa9679 (patch) | |
tree | 3f22c273b057d484d82db01264e9661ef35bbb96 | |
parent | b5618b224a02c6cdc7c76fb459a76ae2b3d6af19 (diff) | |
download | scala-68c9e7c9249c61ee686ffaafe54b4baa27aa9679.tar.gz scala-68c9e7c9249c61ee686ffaafe54b4baa27aa9679.tar.bz2 scala-68c9e7c9249c61ee686ffaafe54b4baa27aa9679.zip |
Added an alias for '-optimize' and fixed the op...
Added an alias for '-optimize' and fixed the optimized build.
-rw-r--r-- | src/compiler/scala/tools/nsc/Settings.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala | 6 |
2 files changed, 6 insertions, 2 deletions
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:<strategy>") 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))) |