use of com.github.anba.es6draft.runtime.types.builtins.BuiltinFunction in project es6draft by anba.
the class Bootstrap method callSetup.
private static MethodHandle callSetup(MutableCallSite callsite, Object function, ExecutionContext cx, Object thisValue, Object[] arguments) {
MethodHandle target, test;
if (function instanceof FunctionObject) {
FunctionObject fn = (FunctionObject) function;
test = MethodHandles.insertArguments(testFunctionObjectMH, 1, fn.getMethodInfo());
target = fn.getCallMethod();
} else if (function instanceof BuiltinFunction) {
BuiltinFunction fn = (BuiltinFunction) function;
test = MethodHandles.insertArguments(testBuiltinFunctionMH, 1, fn.getMethodInfo());
target = fn.getCallMethod();
} else {
target = test = null;
}
return setCallSiteTarget(callsite, target, test, callGenericMH);
}
use of com.github.anba.es6draft.runtime.types.builtins.BuiltinFunction in project es6draft by anba.
the class Properties method createFunction.
private static void createFunction(Realm realm, OrdinaryObject target, FunctionLayout layout) {
BuiltinFunction fun;
if (layout.isTailCall()) {
fun = new NativeTailCallFunction(realm, layout.name, layout.arity, layout.methodHandle);
} else {
fun = new NativeFunction(realm, layout.name, layout.arity, layout.nativeId, layout.methodHandle);
}
defineProperty(target, layout, valueProperty(layout, fun));
}
Aggregations