本文整理汇总了Java中jdk.nashorn.internal.ir.RuntimeNode.Request.isUndefinedCheck方法的典型用法代码示例。如果您正苦于以下问题:Java Request.isUndefinedCheck方法的具体用法?Java Request.isUndefinedCheck怎么用?Java Request.isUndefinedCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.ir.RuntimeNode.Request
的用法示例。
在下文中一共展示了Request.isUndefinedCheck方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadRuntimeNode
import jdk.nashorn.internal.ir.RuntimeNode.Request; //导入方法依赖的package包/类
private void loadRuntimeNode(final RuntimeNode runtimeNode) {
final List<Expression> args = new ArrayList<>(runtimeNode.getArgs());
if (nullCheck(runtimeNode, args)) {
return;
} else if(undefinedCheck(runtimeNode, args)) {
return;
}
// Revert a false undefined check to a strict equality check
final RuntimeNode newRuntimeNode;
final Request request = runtimeNode.getRequest();
if (Request.isUndefinedCheck(request)) {
newRuntimeNode = runtimeNode.setRequest(request == Request.IS_UNDEFINED ? Request.EQ_STRICT : Request.NE_STRICT);
} else {
newRuntimeNode = runtimeNode;
}
new OptimisticOperation(newRuntimeNode, TypeBounds.UNBOUNDED) {
@Override
void loadStack() {
for (final Expression arg : args) {
loadExpression(arg, TypeBounds.OBJECT);
}
}
@Override
void consumeStack() {
method.invokestatic(
CompilerConstants.className(ScriptRuntime.class),
newRuntimeNode.getRequest().toString(),
new FunctionSignature(
false,
false,
newRuntimeNode.getType(),
args.size()).toString());
}
}.emit();
method.convert(newRuntimeNode.getType());
}
示例2: loadRuntimeNode
import jdk.nashorn.internal.ir.RuntimeNode.Request; //导入方法依赖的package包/类
private void loadRuntimeNode(final RuntimeNode runtimeNode) {
final List<Expression> args = new ArrayList<>(runtimeNode.getArgs());
if (nullCheck(runtimeNode, args)) {
return;
} else if(undefinedCheck(runtimeNode, args)) {
return;
}
// Revert a false undefined check to a strict equality check
final RuntimeNode newRuntimeNode;
final Request request = runtimeNode.getRequest();
if (Request.isUndefinedCheck(request)) {
newRuntimeNode = runtimeNode.setRequest(request == Request.IS_UNDEFINED ? Request.EQ_STRICT : Request.NE_STRICT);
} else {
newRuntimeNode = runtimeNode;
}
for (final Expression arg : args) {
loadExpression(arg, TypeBounds.OBJECT);
}
method.invokestatic(
CompilerConstants.className(ScriptRuntime.class),
newRuntimeNode.getRequest().toString(),
new FunctionSignature(
false,
false,
newRuntimeNode.getType(),
args.size()).toString());
method.convert(newRuntimeNode.getType());
}