diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-05-14 09:03:05 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-05-20 14:54:19 +0200 |
commit | 2cd8f4535a82ea0df919c06fd1ea73ee02f9bad9 (patch) | |
tree | d7bbdfccd7e314bbdca288b3cbc68ca26beda651 /test/files | |
parent | 051456c94b45057c617ae802a427533b9c8590b6 (diff) | |
download | scala-2cd8f4535a82ea0df919c06fd1ea73ee02f9bad9.tar.gz scala-2cd8f4535a82ea0df919c06fd1ea73ee02f9bad9.tar.bz2 scala-2cd8f4535a82ea0df919c06fd1ea73ee02f9bad9.zip |
Upgrade ASM to 5.0.2
This commit is a squashed version of all commits in PR #3747.
For future upgrades, consult the README and check the commits in
https://github.com/scala/scala/pull/3747/commits
There's one bug in ASM 5.0.2 that breaks scalac:
http://forge.ow2.org/tracker/?func=detail&aid=317200&group_id=23&atid=100023
This bug is fixed in ASM trunk, the patch has been merged into this
commit. A future upgrade of ASM should contain the fix.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/classfile-format-51.scala | 14 | ||||
-rw-r--r-- | test/files/run/large_class.check | 3 | ||||
-rw-r--r-- | test/files/run/large_class.scala | 27 |
3 files changed, 37 insertions, 7 deletions
diff --git a/test/files/run/classfile-format-51.scala b/test/files/run/classfile-format-51.scala index f92382d89b..24b1ee8397 100644 --- a/test/files/run/classfile-format-51.scala +++ b/test/files/run/classfile-format-51.scala @@ -32,7 +32,7 @@ object Test extends DirectTest { val constructor = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null) constructor.visitCode() constructor.visitVarInsn(ALOAD, 0) - constructor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V") + constructor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false) constructor.visitInsn(RETURN) constructor.visitMaxs(1, 1) constructor.visitEnd() @@ -47,19 +47,19 @@ object Test extends DirectTest { val bootstrap = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, bootstrapMethodName, bootStrapMethodType, null, null) bootstrap.visitCode() // val lookup = MethodHandles.lookup(); - bootstrap.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandles", "lookup", "()Ljava/lang/invoke/MethodHandles$Lookup;") + bootstrap.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandles", "lookup", "()Ljava/lang/invoke/MethodHandles$Lookup;", false) bootstrap.visitVarInsn(ASTORE, 3) // lookup // val clazz = lookup.lookupClass(); bootstrap.visitVarInsn(ALOAD, 3) // lookup - bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandles$Lookup", "lookupClass", "()Ljava/lang/Class;") + bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandles$Lookup", "lookupClass", "()Ljava/lang/Class;", false) bootstrap.visitVarInsn(ASTORE, 4) // clazz // val methodType = MethodType.fromMethodDescriptorString("()Ljava/lang/String, clazz.getClassLoader()") bootstrap.visitLdcInsn("()Ljava/lang/String;") bootstrap.visitVarInsn(ALOAD, 4) // CLAZZ - bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getClassLoader", "()Ljava/lang/ClassLoader;") - bootstrap.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodType", "fromMethodDescriptorString", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/invoke/MethodType;") + bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getClassLoader", "()Ljava/lang/ClassLoader;", false) + bootstrap.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodType", "fromMethodDescriptorString", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/invoke/MethodType;", false) bootstrap.visitVarInsn(ASTORE, 5) // methodType // val methodHandle = lookup.findStatic(thisClass, "target", methodType) @@ -67,14 +67,14 @@ object Test extends DirectTest { bootstrap.visitVarInsn(ALOAD, 4) // clazz bootstrap.visitLdcInsn("target") bootstrap.visitVarInsn(ALOAD, 5) // methodType - bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandles$Lookup", "findStatic", "(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;") + bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandles$Lookup", "findStatic", "(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;", false) bootstrap.visitVarInsn(ASTORE, 6) // methodHandle // new ConstantCallSite(methodHandle) bootstrap.visitTypeInsn(NEW, "java/lang/invoke/ConstantCallSite") bootstrap.visitInsn(DUP) bootstrap.visitVarInsn(ALOAD, 6) // methodHandle - bootstrap.visitMethodInsn(INVOKESPECIAL, "java/lang/invoke/ConstantCallSite", "<init>", "(Ljava/lang/invoke/MethodHandle;)V") + bootstrap.visitMethodInsn(INVOKESPECIAL, "java/lang/invoke/ConstantCallSite", "<init>", "(Ljava/lang/invoke/MethodHandle;)V", false) bootstrap.visitInsn(ARETURN) bootstrap.visitMaxs(4,7) bootstrap.visitEnd() diff --git a/test/files/run/large_class.check b/test/files/run/large_class.check new file mode 100644 index 0000000000..0585c267ac --- /dev/null +++ b/test/files/run/large_class.check @@ -0,0 +1,3 @@ +newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large! +class BigEnoughToFail { + ^ diff --git a/test/files/run/large_class.scala b/test/files/run/large_class.scala new file mode 100644 index 0000000000..aa486ef8f7 --- /dev/null +++ b/test/files/run/large_class.scala @@ -0,0 +1,27 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +// a cold run of partest takes about 15s for this test on my laptop +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp -d " + testOutput.path + + def s(n: Int) = "\""+n+"\"" + + override def code + = s""" + |class BigEnoughToFail { + | def m(a: String, b: String, c: String, d: String, e: String, f: String) = null + | ${(1 to 5500) map (n => "def f"+n+" = m("+ s(n+10000)+","+ + s(n+20000)+","+ + s(n+30000)+","+ + s(n+40000)+","+ + s(n+50000)+","+ + s(n+60000)+")") mkString ";"} + |}""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} |