summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-03-08 06:33:12 -0800
committerJames Iry <jamesiry@gmail.com>2013-03-14 14:26:41 -0700
commite78896f0ab7240e9bdcd98c51cbf6bc0ea277950 (patch)
tree4a269b3fd2b99745790e87d853ba972511eb7ca6 /src/reflect
parentb7b4f877326acd6a8a24ff60fa1638cc18143c45 (diff)
downloadscala-e78896f0ab7240e9bdcd98c51cbf6bc0ea277950.tar.gz
scala-e78896f0ab7240e9bdcd98c51cbf6bc0ea277950.tar.bz2
scala-e78896f0ab7240e9bdcd98c51cbf6bc0ea277950.zip
Read version 51 (JDK 7) class files.
This commit makes the ClassFileReader/ICodeReader parse class files from JDK 7 (class file version 51). It does that by skipping over the method handle related entries in the constant pool and by doing some dummy processing on invoke dynamic instructions. The inliner is updated to not try to inline a method with an invoke dynamic instruction. A place holder INVOKE_DYNAMIC instruction is added to ICode but it is designed to create an error if there's ever any attempt to analyze it. Because the inliner is the only phase that ever tries to analyze ICode instructions not generated from Scala source and because Scala source will never emit an INVOKE_DYNAMIC, the place holder INVOKE_DYNAMIC should never cause any errors. A test is included that generates a class file with INVOKE_DYNAMIC and then compiles Scala code that depends on it.
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/ClassfileConstants.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/ClassfileConstants.scala b/src/reflect/scala/reflect/internal/ClassfileConstants.scala
index 7ccb661426..c198271fb1 100644
--- a/src/reflect/scala/reflect/internal/ClassfileConstants.scala
+++ b/src/reflect/scala/reflect/internal/ClassfileConstants.scala
@@ -72,6 +72,9 @@ object ClassfileConstants {
final val CONSTANT_METHODREF = 10
final val CONSTANT_INTFMETHODREF = 11
final val CONSTANT_NAMEANDTYPE = 12
+ final val CONSTANT_METHODHANDLE = 15
+ final val CONSTANT_METHODTYPE = 16
+ final val CONSTANT_INVOKEDYNAMIC = 18
// tags describing the type of a literal in attribute values
final val BYTE_TAG = 'B'
@@ -306,7 +309,7 @@ object ClassfileConstants {
final val invokespecial = 0xb7
final val invokestatic = 0xb8
final val invokeinterface = 0xb9
- final val xxxunusedxxxx = 0xba
+ final val invokedynamic = 0xba
final val new_ = 0xbb
final val newarray = 0xbc