summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-28 08:03:10 +0000
committerPaul Phillips <paulp@improving.org>2011-11-28 08:03:10 +0000
commit0bea2ab5f6b211a83bbf14ea46fe57b8163c6334 (patch)
tree1eda4c329deee6b43d82f5922fc58f3de878638d /src/library
parente4c5e04b06fc434eace07798486a108b6e2d4ae7 (diff)
downloadscala-0bea2ab5f6b211a83bbf14ea46fe57b8163c6334.tar.gz
scala-0bea2ab5f6b211a83bbf14ea46fe57b8163c6334.tar.bz2
scala-0bea2ab5f6b211a83bbf14ea46fe57b8163c6334.zip
Fix for erroneous bytecode generation.
A remedy for an IllegalAccessError where generated bytecode referred to an inaccessible type. Closes SI-1430. Bonus materials: - tore out all the invokedynamic support. The shipped jdk7 implementation shows limited resemblance to the one this was written against; the code mostly serves to distract. (I think I could get invokedynamic working pretty quickly, except that it would mean having a codebase for java7 and one for 5-6, which is not a yak I wish to shave today.) - gave NullClass and NothingClass objects of their own, which allowed a nice polymorphic simplification of isSubClass, plus a couple other streamlinings.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/runtime/DynamicDispatch.java-notyet42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/library/scala/runtime/DynamicDispatch.java-notyet b/src/library/scala/runtime/DynamicDispatch.java-notyet
deleted file mode 100644
index 744ee79264..0000000000
--- a/src/library/scala/runtime/DynamicDispatch.java-notyet
+++ /dev/null
@@ -1,42 +0,0 @@
-package scala.runtime;
-
-import java.dyn.CallSite;
-import java.dyn.MethodHandle;
-
-/**
- * This class resolves calls through refinement types. The
- * bootstrap method is called when an invokedynamic is found
- * by the Java VM.
- *
- * Note: Requires Java 7 with invoke dynamic support (see JSR 292)
- *
- * @author Iulian Dragos
- * @see JSR292
- */
-public class DynamicDispatch {
-
- /**
- * Resolve an invoke dynamic in Scala code. invokedynamic calls appear
- * when a method defined by a refinement type is called. It is resolved
- * by looking up a method with the same name and types in the receiver
- * object. It is guaranteed by the type checker that such a method
- * exists.
- *
- * The current implementation is not correct, a call site being
- * always bootstrapped to a method handle. A bound call site should be
- * guarded by a test on the receiver type. Such code should either
- * be generated by the compiler, or by this bootstrap method using
- * one of the code combinators provided in java.dyn.*.
- *
- * ATM, they are not yet available in the JVM.
- */
- public static Object bootstrapInvokeDynamic(CallSite cs, Object... args) {
- println(cs);
-
- MethodHandle mh = MethodHandles.findVirtual(cs.callerClass(),
- cs.name(),
- cs.type());
- cs.setTarget(mh);
- return mh(args);
- }
-}