diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-12-11 21:12:20 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-12-11 21:12:20 +0000 |
commit | 806edf6f84118787a36900c145e9af13d7e97a5b (patch) | |
tree | 97a0118b0746b64b1ab592c1dc2d5e06c3c7946e /src/compiler | |
parent | 61b353255e80babd2b00d5299cb6c5c5cade109f (diff) | |
download | scala-806edf6f84118787a36900c145e9af13d7e97a5b.tar.gz scala-806edf6f84118787a36900c145e9af13d7e97a5b.tar.bz2 scala-806edf6f84118787a36900c145e9af13d7e97a5b.zip |
Added experimental invoke dynamic support (JSR2...
Added experimental invoke dynamic support (JSR292).
Diffstat (limited to 'src/compiler')
3 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 5a257571a8..bf7df094ff 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -844,6 +844,12 @@ abstract class GenICode extends SubComponent { ctx1 } + case ApplyDynamic(qual, args) => + val ctx1 = genLoad(qual, ctx, ANY_REF_CLASS) + genLoadArguments(args, tree.symbol.info.paramTypes, ctx1) + ctx1.bb.emit(CALL_METHOD(tree.symbol, InvokeDynamic), tree.pos) + ctx1 + case This(qual) => assert(tree.symbol == ctx.clazz.symbol || tree.symbol.isModuleClass, "Trying to access the this of another class: " + diff --git a/src/compiler/scala/tools/nsc/backend/icode/Members.scala b/src/compiler/scala/tools/nsc/backend/icode/Members.scala index a1fd3c7ae5..1048af0861 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Members.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Members.scala @@ -121,6 +121,7 @@ trait Members { self: ICodes => var fields: List[IField] = Nil var methods: List[IMethod] = Nil var cunit: CompilationUnit = _ + var bootstrapClass: Option[String] = None def addField(f: IField): this.type = { fields = f :: fields; diff --git a/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala b/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala index f53be450d9..9b11c588d0 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala @@ -630,8 +630,12 @@ trait Opcodes { self: ICodes => } } + /** Virtual calls */ case object Dynamic extends InvokeStyle + /** InvokeDynamic a la JSR 292 (experimental). */ + case object InvokeDynamic extends InvokeStyle + /** * Special invoke. Static(true) is used for calls to private * members. |