46 import jdk.internal.dynalink.linker.MethodTypeConversionStrategy; |
46 import jdk.internal.dynalink.linker.MethodTypeConversionStrategy; |
47 import jdk.internal.dynalink.support.TypeUtilities; |
47 import jdk.internal.dynalink.support.TypeUtilities; |
48 import jdk.nashorn.api.scripting.JSObject; |
48 import jdk.nashorn.api.scripting.JSObject; |
49 import jdk.nashorn.internal.codegen.CompilerConstants.Call; |
49 import jdk.nashorn.internal.codegen.CompilerConstants.Call; |
50 import jdk.nashorn.internal.codegen.ObjectClassGenerator; |
50 import jdk.nashorn.internal.codegen.ObjectClassGenerator; |
51 import jdk.nashorn.internal.codegen.RuntimeCallSite; |
|
52 import jdk.nashorn.internal.lookup.MethodHandleFactory; |
51 import jdk.nashorn.internal.lookup.MethodHandleFactory; |
53 import jdk.nashorn.internal.lookup.MethodHandleFunctionality; |
52 import jdk.nashorn.internal.lookup.MethodHandleFunctionality; |
54 import jdk.nashorn.internal.objects.ScriptFunctionImpl; |
53 import jdk.nashorn.internal.objects.ScriptFunctionImpl; |
55 import jdk.nashorn.internal.runtime.ECMAException; |
54 import jdk.nashorn.internal.runtime.ECMAException; |
56 import jdk.nashorn.internal.runtime.JSType; |
55 import jdk.nashorn.internal.runtime.JSType; |
205 * @param flags flags for call type, trace/profile etc. |
204 * @param flags flags for call type, trace/profile etc. |
206 * @return CallSite with MethodHandle to appropriate method or null if not found. |
205 * @return CallSite with MethodHandle to appropriate method or null if not found. |
207 */ |
206 */ |
208 public static CallSite bootstrap(final Lookup lookup, final String opDesc, final MethodType type, final int flags) { |
207 public static CallSite bootstrap(final Lookup lookup, final String opDesc, final MethodType type, final int flags) { |
209 return dynamicLinker.link(LinkerCallSite.newLinkerCallSite(lookup, opDesc, type, flags)); |
208 return dynamicLinker.link(LinkerCallSite.newLinkerCallSite(lookup, opDesc, type, flags)); |
210 } |
|
211 |
|
212 /** |
|
213 * Bootstrapper for a specialized Runtime call |
|
214 * |
|
215 * @param lookup lookup |
|
216 * @param initialName initial name for callsite |
|
217 * @param type method type for call site |
|
218 * |
|
219 * @return callsite for a runtime node |
|
220 */ |
|
221 public static CallSite runtimeBootstrap(final MethodHandles.Lookup lookup, final String initialName, final MethodType type) { |
|
222 return new RuntimeCallSite(type, initialName); |
|
223 } |
209 } |
224 |
210 |
225 /** |
211 /** |
226 * Boostrapper for math calls that may overflow |
212 * Boostrapper for math calls that may overflow |
227 * @param lookup lookup |
213 * @param lookup lookup |