本文整理汇总了Java中jdk.nashorn.internal.ir.RuntimeNode.getRequest方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeNode.getRequest方法的具体用法?Java RuntimeNode.getRequest怎么用?Java RuntimeNode.getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.ir.RuntimeNode
的用法示例。
在下文中一共展示了RuntimeNode.getRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enterRuntimeNode
import jdk.nashorn.internal.ir.RuntimeNode; //导入方法依赖的package包/类
@Override
public boolean enterRuntimeNode(final RuntimeNode runtimeNode) {
final RuntimeNode.Request req = runtimeNode.getRequest();
if (req == RuntimeNode.Request.DEBUGGER) {
enterDefault(runtimeNode);
type("DebuggerStatement");
return leave();
}
return false;
}
示例2: leaveRuntimeNode
import jdk.nashorn.internal.ir.RuntimeNode; //导入方法依赖的package包/类
@Override
public Node leaveRuntimeNode(final RuntimeNode runtimeNode) {
final Request request = runtimeNode.getRequest();
final boolean isEqStrict = request == Request.EQ_STRICT;
if(isEqStrict || request == Request.NE_STRICT) {
return createIsUndefined(runtimeNode, runtimeNode.getArgs().get(0), runtimeNode.getArgs().get(1),
isEqStrict ? Request.IS_UNDEFINED : Request.IS_NOT_UNDEFINED);
}
return runtimeNode;
}
示例3: loadRuntimeNode
import jdk.nashorn.internal.ir.RuntimeNode; //导入方法依赖的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());
}
示例4: loadRuntimeNode
import jdk.nashorn.internal.ir.RuntimeNode; //导入方法依赖的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());
}