Created
May 4, 2010 19:39
-
-
Save headius/389864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java b/src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java | |
index 1d8f325..67ae557 100644 | |
--- a/src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java | |
+++ b/src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java | |
@@ -24,8 +24,8 @@ public class InvokeDynamicSupport { | |
public static class JRubyCallSite extends CallSite { | |
private final CallType callType; | |
- public JRubyCallSite(Class caller, String name, MethodType type, CallType callType) { | |
- super(caller, name, type); | |
+ public JRubyCallSite(CallType callType) { | |
+ super(null); | |
this.callType = callType; | |
} | |
@@ -36,20 +36,22 @@ public class InvokeDynamicSupport { | |
public static CallSite bootstrap(Class caller, String name, MethodType type) { | |
JRubyCallSite site; | |
- | |
- if (name == "call") { | |
- site = new JRubyCallSite(caller, name, type, CallType.NORMAL); | |
+ | |
+ if (name.equals("call")) { | |
+ site = new JRubyCallSite(CallType.NORMAL); | |
} else { | |
- site = new JRubyCallSite(caller, name, type, CallType.FUNCTIONAL); | |
+ site = new JRubyCallSite(CallType.FUNCTIONAL); | |
} | |
- | |
+ | |
MethodType fallbackType = type.insertParameterType(0, JRubyCallSite.class); | |
MethodHandle myFallback = MethodHandles.insertArguments( | |
MethodHandles.lookup().findStatic(InvokeDynamicSupport.class, "fallback", | |
fallbackType), | |
0, | |
site); | |
+ | |
site.setTarget(myFallback); | |
+ | |
return site; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment