/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/lookup/ |
H A D | Lookup.java | 51 public static final MethodHandleFunctionality MH = MethodHandleFactory.getFunctionality(); field in class:Lookup 66 public static final MethodType GET_OBJECT_TYPE = MH.type(Object.class, Object.class); 69 public static final MethodType SET_OBJECT_TYPE = MH.type(void.class, Object.class, Object.class); 72 public static final MethodType GET_PRIMITIVE_TYPE = MH.type(long.class, Object.class); 75 public static final MethodType SET_PRIMITIVE_TYPE = MH.type(void.class, Object.class, long.class); 150 return MH.filterArguments(mh, n, JSType.TO_INT32_L.methodHandle()); 155 return MH.filterArguments(mh, n, JSType.TO_INT32_D.methodHandle()); 157 return MH.filterArguments(mh, n, JSType.TO_UINT32_D.methodHandle()); 162 return MH.filterArguments(mh, n, JSType.TO_INT32.methodHandle()); 164 return MH [all...] |
/openjdk10/hotspot/test/compiler/profiling/ |
H A D | TestMethodHandleInvokesIntrinsic.java | 48 MethodHandle MH = null; 50 MH = lookup.findStatic(System.class, "nanoTime", mt); 58 mh_nanoTime = MH; 61 MH = null; 63 MH = lookup.findVirtual(Object.class, "getClass", mt); 71 mh_getClass = MH;
|
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ |
H A D | SetMethodCreator.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 158 final MethodHandle slowSetter = MH.insertArguments(ScriptObject.DECLARE_AND_SET, 1, getName()).asType(fastSetter.type()); 161 MethodHandle casMap = MH.insertArguments(ScriptObject.CAS_MAP, 1, oldMap, newMap); 162 casMap = MH.dropArguments(casMap, 1, type); 163 casMap = MH.asType(casMap, casMap.type().changeParameterType(0, Object.class)); 164 methodHandle = MH.guardWithTest(casMap, fastSetter, slowSetter); 183 return new SetMethod(MH.filterArguments(global.addSpill(type, getName()), 0, ScriptObject.GLOBALFILTER), null); 205 slowSetter = MH.insertArguments(slowSetter, 3, NashornCallSiteDescriptor.getFlags(desc)); 206 slowSetter = MH.insertArguments(slowSetter, 1, name); 207 slowSetter = MH [all...] |
H A D | SpillProperty.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 41 private static final MethodHandle PARRAY_GETTER = MH.asType(MH.getter(LOOKUP, ScriptObject.class, "primitiveSpill", long[].class), MH.type(long[].class, Object.class)); 42 private static final MethodHandle OARRAY_GETTER = MH.asType(MH.getter(LOOKUP, ScriptObject.class, "objectSpill", Object[].class), MH.type(Object[].class, Object.class)); 44 private static final MethodHandle OBJECT_GETTER = MH.filterArguments(MH.arrayElementGetter(Object[].class), 0, OARRAY_GETTER); 45 private static final MethodHandle PRIMITIVE_GETTER = MH [all...] |
H A D | AccessorProperty.java | 33 import static jdk.nashorn.internal.lookup.Lookup.MH; 96 objectGetters[i] = MH.asType(MH.getter(LOOKUP, structure, fieldName, typeClass), Lookup.GET_OBJECT_TYPE); 97 objectSetters[i] = MH.asType(MH.setter(LOOKUP, structure, fieldName, typeClass), Lookup.SET_OBJECT_TYPE); 104 primitiveGetters[i] = MH.asType(MH.getter(LOOKUP, structure, fieldNamePrimitive, typeClass), Lookup.GET_PRIMITIVE_TYPE); 105 primitiveSetters[i] = MH.asType(MH.setter(LOOKUP, structure, fieldNamePrimitive, typeClass), Lookup.SET_PRIMITIVE_TYPE); 225 primitiveGetter = MH [all...] |
H A D | GlobalFunctions.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 46 public static final MethodHandle PARSEINT_Z = MH.dropArguments(MH.dropArguments(MH.constant(double.class, Double.NaN), 0, boolean.class), 0, Object.class); 49 public static final MethodHandle PARSEINT_I = MH.dropArguments(MH.identity(int.class), 0, Object.class); 58 public static final MethodHandle IS_NAN_I = MH.dropArguments(MH.constant(boolean.class, false), 0, Object.class); 61 public static final MethodHandle IS_NAN_J = MH.dropArguments(MH [all...] |
H A D | FindProperty.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 94 getter = MH.insertArguments(getter, 1, UserAccessorProperty.getINVOKE_UA_GETTER(type, programPoint)); 96 getter = MH.insertArguments(getter, 1, programPoint); 119 setter = MH.insertArguments(setter, 1, UserAccessorProperty.getINVOKE_UA_SETTER(type), strict ? property.getKey() : null); 135 superGetter = MH.filterArguments(superGetter, 0, wrapFilter.asType(wrapFilter.type().changeReturnType(superGetter.type().parameterType(0)))); 137 superGetter = MH.asType(superGetter, superGetter.type().changeParameterType(0, Object.class)); 139 return MH.foldArguments(mh, superGetter);
|
H A D | ScriptFunction.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 118 private static final MethodHandle WRAP_THIS = MH.findStatic(MethodHandles.lookup(), ScriptFunctionData.class, "wrapThis", MH.type(Object.class, Object.class)); 413 final MethodHandle mh = MH.insertArguments(ScriptFunction.INVOKE_SYNC, 0, this, sync); 633 return MH.bindTo(bindToCalleeIfNeeded(data.getGenericInvoker(scope)), self); 646 return ScriptFunctionData.needsCallee(methodHandle) ? MH.bindTo(methodHandle, this) : methodHandle; 889 handle = MH.asCollector(ScriptRuntime.APPLY.methodHandle(), Object[].class, type.parameterCount() - 2); 955 boundHandle = MH.filterArguments(callHandle, 1, SCRIPTFUNCTION_GLOBALFILTER); 963 boundHandle = MH.dropArguments(MH [all...] |
H A D | Undefined.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 126 private static final MethodHandle SET_METHOD = MH.insertArguments(findOwnMH("set", void.class, Object.class, Object.class, int.class), 3, NashornCallSiteDescriptor.CALLSITE_STRICT); 129 return new GuardedInvocation(MH.insertArguments(GET_METHOD, 1, NashornCallSiteDescriptor.getOperand(desc)), UNDEFINED_GUARD).asType(desc); 137 return new GuardedInvocation(MH.insertArguments(SET_METHOD, 1, NashornCallSiteDescriptor.getOperand(desc)), UNDEFINED_GUARD).asType(desc); 170 return MH.findVirtual(MethodHandles.lookup(), Undefined.class, name, MH.type(rtype, types));
|
H A D | PrototypeObject.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 116 return MH.findStatic(MethodHandles.lookup(), PrototypeObject.class, name, MH.type(rtype, types));
|
H A D | GlobalConstants.java | 30 import static jdk.nashorn.internal.lookup.Lookup.MH; 386 final MethodHandle boundInvalidator = MH.bindTo(INVALIDATE_SP, this); 387 final MethodHandle invalidator = MH.asType(boundInvalidator, boundInvalidator.type().changeParameterType(0, receiverType).changeReturnType(receiverType)); 388 final MethodHandle mh = MH.filterArguments(inv.getInvocation(), 0, MH.insertArguments(invalidator, 1, acc)); 402 return MH.dropArguments(JSType.unboxConstant(c), 0, Object.class); 462 mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); 465 mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); 475 guard = MH [all...] |
H A D | WithObject.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 249 MH.foldArguments( 288 final MethodHandle filter = MH.asType(receiverFilter, 297 return MH.filterArguments(mh, 0, receiverFilter.asType(receiverFilter.type().changeReturnType(mh.type().parameterType(0)))); 337 return MH.insertArguments(WITHEXPRESSIONGUARD, 1, map, sp); 374 return MH.findStatic(MethodHandles.lookup(), WithObject.class, name, MH.type(rtype, types));
|
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/ |
H A D | LinkerCallSite.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 66 private static final MethodHandle INCREASE_MISS_COUNTER = MH.findStatic(MethodHandles.lookup(), LinkerCallSite.class, "increaseMissCount", MH.type(Object.class, String.class, Object.class)); 121 return MH.filterArguments(relink, 0, getIncreaseMissCounter(relink.type().parameterType(0))); 127 final MethodHandle missCounterWithDesc = MH.bindTo(INCREASE_MISS_COUNTER, getDescriptor().getOperation() + " @ " + getScriptLocation()); 131 return MH.asType(missCounterWithDesc, missCounterWithDesc.type().changeParameterType(0, type).changeReturnType(type)); 180 private static final MethodHandle PROFILEENTRY = MH.findVirtual(LOOKUP, ProfilingLinkerCallSite.class, "profileEntry", MH.type(Object.class, Object.class)); 181 private static final MethodHandle PROFILEEXIT = MH.findVirtual(LOOKUP, ProfilingLinkerCallSite.class, "profileExit", MH [all...] |
H A D | PrimitiveLookup.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 55 MH.type(void.class, ScriptObject.class, Object.class, Object.class, boolean.class, Object.class)); 126 final MethodHandle adaptedInvocation = MH.asType(invocation, invocation.type().changeParameterType(0, Object.class)); 127 final MethodHandle method = MH.filterArguments(adaptedInvocation, 0, protoFilter); 128 final MethodHandle protoGuard = MH.filterArguments(link.getGuard(), 0, protoFilter); 147 method = MH.filterArguments(method, 0, MH.asType(wrapFilter, wrapType.changeReturnType(receiverType))); 158 MethodHandle filter = MH.asType(wrapFilter, wrapFilter.type().changeReturnType(ScriptObject.class)); 162 filter = MH.dropArguments(filter, 1, Object.class, Object.class); 163 target = MH [all...] |
H A D | NashornGuards.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 114 return MH.insertArguments(explicitInstanceOfCheck ? IS_MAP_SCRIPTOBJECT : IS_MAP, 1, map); 164 return MH.insertArguments(SAME_OBJECT, 1, new WeakReference<>(sobj)); 198 return MH.guardWithTest(guard1, guard2, MH.dropArguments(MH.constant(boolean.class, false), 0, Object.class)); 239 return MH.findStatic(MethodHandles.lookup(), NashornGuards.class, name, MH.type(rtype, types));
|
H A D | BrowserJSObjectLinker.java | 110 final MethodHandle getter = MH.insertArguments(JSOBJECT_GETMEMBER, 1, name); 115 final MethodHandle getter = MH.insertArguments(JSOBJECTLINKER_GET, 0, inv.getInvocation()); 123 final MethodHandle getter = MH.insertArguments(JSOBJECT_SETMEMBER, 1, name); 132 final MethodHandle call = MH.insertArguments(JSOBJECT_CALL, 1, "call"); 133 return new GuardedInvocation(MH.asCollector(call, Object[].class, desc.getMethodType().parameterCount() - 1), IS_JSOBJECT_GUARD); 176 private static final MethodHandleFunctionality MH = MethodHandleFactory.getFunctionality(); field in class:BrowserJSObjectLinker 183 return MH.findStatic(MethodHandles.lookup(), BrowserJSObjectLinker.class, name, MH.type(rtype, types)); 191 static final MethodHandle JSOBJECT_GETMEMBER = findJSObjectMH_V("getMember", Object.class, String.class).asType(MH.type(Object.class, Object.class, String.class)); 192 static final MethodHandle JSOBJECT_GETSLOT = findJSObjectMH_V("getSlot", Object.class, int.class).asType(MH [all...] |
H A D | JSObjectLinker.java | 130 final MethodHandle getter = MH.insertArguments(JSOBJECT_GETMEMBER, 1, name); 135 final MethodHandle getter = MH.insertArguments(JSOBJECTLINKER_GET, 0, inv.getInvocation()); 140 final MethodHandle getter = MH.insertArguments(JSOBJECT_SETMEMBER, 1, name); 151 mh = MH.insertArguments(JSOBJECT_CALL_TO_APPLY, 0, mh); 156 MH.asCollector(mh, Object[].class, type.parameterCount() - 2); 161 final MethodHandle func = MH.asCollector(JSOBJECT_NEW, Object[].class, desc.getMethodType().parameterCount() - 1); 242 private static final MethodHandleFunctionality MH = MethodHandleFactory.getFunctionality(); field in class:JSObjectLinker 258 return MH.findVirtual(MethodHandles.lookup(), JSObject.class, name, MH.type(rtype, types)); 262 return MH [all...] |
H A D | JavaArgumentConverters.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 236 return MH.findStatic(MethodHandles.lookup(), JavaArgumentConverters.class, name, MH.type(rtype, types)); 266 CONVERTERS.put(primitive, MH.explicitCastArguments(JSType.TO_NUMBER.methodHandle(), JSType.TO_NUMBER.methodHandle().type().changeReturnType(primitive))); 267 CONVERTERS.put(targetType, MH.filterReturnValue(TO_DOUBLE, findOwnMH(primitive.getName() + "Value", targetType, Double.class))); 272 CONVERTERS.put(primitive, MH.explicitCastArguments(TO_LONG_PRIMITIVE, TO_LONG_PRIMITIVE.type().changeReturnType(primitive))); 273 CONVERTERS.put(targetType, MH.filterReturnValue(TO_LONG, findOwnMH(primitive.getName() + "Value", targetType, Long.class)));
|
H A D | NashornBottomLinker.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 80 MH.dropArguments(MH.constant(Object.class, UNDEFINED), 0, Object.class); 82 MH.dropArguments(EMPTY_PROP_GETTER, 0, Object.class); 84 MH.asType(EMPTY_ELEM_GETTER, EMPTY_ELEM_GETTER.type().changeReturnType(void.class)); 86 MH.dropArguments(EMPTY_PROP_SETTER, 0, Object.class); 177 return gi == null ? null : gi.asType(MH.type(targetType, sourceType));
|
H A D | NashornLinker.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 120 return gi == null ? null : gi.asType(MH.type(targetType, sourceType)); 207 // for these in the converter MH and must bind it here with 214 mhWithLookup = MH.insertArguments(mh, 1, 244 final MethodHandle typeBoundConverter = MH.insertArguments(converterCall.methodHandle(), 1, componentType); 245 return MH.asType(typeBoundConverter, typeBoundConverter.type().changeReturnType(type)); 322 private static final MethodHandle IS_SCRIPT_OBJECT = Guards.isInstance(ScriptObject.class, MH.type(Boolean.TYPE, Object.class)); 324 private static final MethodHandle IS_NATIVE_ARRAY = Guards.isOfClass(NativeArray.class, MH.type(Boolean.TYPE, Object.class)); 362 return MH.findStatic(MethodHandles.lookup(), NashornLinker.class, name, MH [all...] |
/openjdk10/hotspot/test/compiler/jsr292/ |
H A D | LongReferenceCastingTest.java | 27 * @summary Test correct casting of MH arguments during inlining. 40 static final MethodHandle MH; field in class:LongReferenceCastingTest 46 MH = lookup.findVirtual(LongReferenceCastingTest.class, "myMethod", mt); 78 return (String) MH.invokeExact(this, 0L, (Object)this, MY_STRING);
|
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ |
H A D | ContinuousArrayData.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 180 mh = MH.insertArguments(ArrayData.THROW_UNWARRANTED.methodHandle(), 1, programPoint); 183 mh = MH.asType(mh, mh.type().changeReturnType(returnType).changeParameterType(0, clazz)); 200 return MH.asType(setHas, setHas.type().changeParameterType(2, elementType).changeParameterType(0, clazz)); 206 MH.dropArguments( 243 getElement = MH.filterArguments(getElement, 0, MH.asType(getArray, getArray.type().changeReturnType(clazz))); 244 final MethodHandle guard = MH.insertArguments(FAST_ACCESS_GUARD, 0, clazz); 274 getArray = MH.asType(getArray, getArray.type().changeReturnType(getClass())); 275 setElement = MH [all...] |
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/ |
H A D | ShellFunctions.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 99 return MH.findStatic(MethodHandles.lookup(), ShellFunctions.class, name, MH.type(rtype, types));
|
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ |
H A D | ObjectClassGenerator.java | 38 import static jdk.nashorn.internal.lookup.Lookup.MH; 505 MH.explicitCastArguments(MH.findStatic(MethodHandles.publicLookup(), Double.class, "doubleToRawLongBits", MH.type(long.class, double.class)), MH.type(long.class, double.class)); 509 MH.findStatic(MethodHandles.publicLookup(), Double.class, "longBitsToDouble", MH.type(double.class, long.class)); 517 final MethodHandle mh = MH.asType(sameTypeGetter, sameTypeGetter.type().changeReturnType(Object.class)); 536 return MH.explicitCastArguments(primitiveGetter, primitiveGetter.type().changeReturnType(int.class)); 538 return MH [all...] |
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/ |
H A D | NativeBoolean.java | 28 import static jdk.nashorn.internal.lookup.Lookup.MH; 55 static final MethodHandle WRAPFILTER = findOwnMH("wrapFilter", MH.type(NativeBoolean.class, Object.class)); 57 private static final MethodHandle PROTOFILTER = findOwnMH("protoFilter", MH.type(Object.class, Object.class)); 187 return MH.findStatic(MethodHandles.lookup(), NativeBoolean.class, name, type);
|