use of com.github.anba.es6draft.runtime.types.Type in project es6draft by anba.
the class Bootstrap method relCmpSetup.
@SuppressWarnings("unused")
private static MethodHandle relCmpSetup(MutableCallSite callsite, RelationalOperator op, Object arg1, Object arg2, ExecutionContext cx) {
Type type = getType(arg1, arg2);
MethodHandle target;
if (type == Type.String) {
target = filterReturnValue(relCmpStringMH, op);
} else if (type == Type.Number) {
target = filterReturnValue(relCmpNumberMH, op);
} else {
target = null;
}
return setCallSiteTarget(callsite, target, getTestFor(type), filterReturnValue(MethodHandles.insertArguments(relCmpGenericMH, 2, op), op));
}
use of com.github.anba.es6draft.runtime.types.Type in project es6draft by anba.
the class Bootstrap method addSetup.
@SuppressWarnings("unused")
private static MethodHandle addSetup(MutableCallSite callsite, Object arg1, Object arg2, ExecutionContext cx) {
Type type = getType(arg1, arg2);
MethodHandle target;
if (type == Type.String) {
target = addStringMH;
} else if (type == Type.Number) {
target = addNumberMH;
} else {
target = null;
}
return setCallSiteTarget(callsite, target, getTestFor(type), addGenericMH);
}
use of com.github.anba.es6draft.runtime.types.Type in project es6draft by anba.
the class Bootstrap method strictEqCmpSetup.
@SuppressWarnings("unused")
private static MethodHandle strictEqCmpSetup(MutableCallSite callsite, Object arg1, Object arg2) {
Type type = getType(arg1, arg2);
MethodHandle target;
if (type == Type.String) {
target = strictEqCmpStringMH;
} else if (type == Type.Number) {
target = strictEqCmpNumberMH;
} else if (type == Type.Boolean) {
target = strictEqCmpBooleanMH;
} else {
target = null;
}
return setCallSiteTarget(callsite, target, getTestFor(type), strictEqCmpGenericMH);
}
use of com.github.anba.es6draft.runtime.types.Type in project es6draft by anba.
the class Bootstrap method eqCmpSetup.
@SuppressWarnings("unused")
private static MethodHandle eqCmpSetup(MutableCallSite callsite, Object arg1, Object arg2, ExecutionContext cx) {
Type type = getType(arg1, arg2);
MethodHandle target;
if (type == Type.String) {
target = eqCmpStringMH;
} else if (type == Type.Number) {
target = eqCmpNumberMH;
} else if (type == Type.Boolean) {
target = eqCmpBooleanMH;
} else {
target = null;
}
return setCallSiteTarget(callsite, target, getTestFor(type), eqCmpGenericMH);
}
Aggregations