当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeNode.getRequest方法代码示例

本文整理汇总了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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:JSONWriter.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:LocalVariableTypesCalculator.java

示例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());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:CodeGenerator.java

示例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());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:CodeGenerator.java


注:本文中的jdk.nashorn.internal.ir.RuntimeNode.getRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。