Java 类jdk.nashorn.internal.ir.FunctionNode.CompilationState 实例源码

项目:OpenJSharp    文件:AssignSymbols.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    final FunctionNode finalizedFunction;
    if (isUnparsedFunction(functionNode)) {
        finalizedFunction = functionNode;
    } else {
        finalizedFunction =
           markProgramBlock(
           removeUnusedSlots(
           createSyntheticInitializers(
           finalizeParameters(
                   lc.applyTopFlags(functionNode))))
                   .setThisProperties(lc, thisProperties.pop().size()));
    }
    return finalizedFunction.setState(lc, CompilationState.SYMBOLS_ASSIGNED);
}
项目:kaziranga    文件:AssignSymbols.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    final FunctionNode finalizedFunction;
    if (isUnparsedFunction(functionNode)) {
        finalizedFunction = functionNode;
    } else {
        finalizedFunction =
           markProgramBlock(
           removeUnusedSlots(
           createSyntheticInitializers(
           finalizeParameters(
                   lc.applyTopFlags(functionNode))))
                   .setThisProperties(lc, thisProperties.pop().size()));
    }
    return finalizedFunction.setState(lc, CompilationState.SYMBOLS_ASSIGNED);
}
项目:infobip-open-jdk-8    文件:AssignSymbols.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    final FunctionNode finalizedFunction;
    if (isUnparsedFunction(functionNode)) {
        finalizedFunction = functionNode;
    } else {
        finalizedFunction =
           markProgramBlock(
           removeUnusedSlots(
           createSyntheticInitializers(
           finalizeParameters(
                   lc.applyTopFlags(functionNode))))
                   .setThisProperties(lc, thisProperties.pop().size()));
    }
    return finalizedFunction.setState(lc, CompilationState.SYMBOLS_ASSIGNED);
}
项目:OLD-OpenJDK8    文件:CodeGenerator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    try {
        if(emittedMethods.add(functionNode.getName())) {
            method.end(); // wrap up this method
            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
            method = lc.popMethodEmitter(method);
            LOG.info("=== END ", functionNode.getName());
        }

        final FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.EMITTED);
        newFunctionObject(newFunctionNode, functionNode);
        return newFunctionNode;
    } catch (final Throwable t) {
        Context.printStackTrace(t);
        final VerifyError e = new VerifyError("Code generation bug in \"" + functionNode.getName() + "\": likely stack misaligned: " + t + " " + functionNode.getSource().getName());
        e.initCause(t);
        throw e;
    }
}
项目:nashorn-backport    文件:CodeGenerator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    try {
        if(emittedMethods.add(functionNode.getName())) {
            method.end(); // wrap up this method
            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
            method = lc.popMethodEmitter(method);
            LOG.info("=== END ", functionNode.getName());
        }

        final FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.EMITTED);
        newFunctionObject(newFunctionNode, functionNode);
        return newFunctionNode;
    } catch (final Throwable t) {
        Context.printStackTrace(t);
        final VerifyError e = new VerifyError("Code generation bug in \"" + functionNode.getName() + "\": likely stack misaligned: " + t + " " + functionNode.getSource().getName());
        e.initCause(t);
        throw e;
    }
}
项目:nashorn    文件:CodeGenerator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    try {
        if(emittedMethods.add(functionNode.getName())) {
            method.end(); // wrap up this method
            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
            method = lc.popMethodEmitter(method);
            LOG.info("=== END ", functionNode.getName());
        }

        final FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.EMITTED);
        newFunctionObject(newFunctionNode, functionNode);
        return newFunctionNode;
    } catch (final Throwable t) {
        Context.printStackTrace(t);
        final VerifyError e = new VerifyError("Code generation bug in \"" + functionNode.getName() + "\": likely stack misaligned: " + t + " " + functionNode.getSource().getName());
        e.initCause(t);
        throw e;
    }
}
项目:OpenJSharp    文件:Parser.java   
private FunctionNode restoreFunctionNode(final FunctionNode functionNode, final long lastToken) {
    final Block newBody = restoreBlock(lc.getFunctionBody(functionNode));

    return lc.pop(functionNode).
        setBody(lc, newBody).
        setLastToken(lc, lastToken).
        setState(lc, errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED);
}
项目:OpenJSharp    文件:ApplySpecialization.java   
/**
 * Try to do the apply to call transformation
 * @return true if successful, false otherwise
 */
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    FunctionNode newFunctionNode = functionNode;
    final String functionName = newFunctionNode.getName();

    if (changed.contains(newFunctionNode.getId())) {
        newFunctionNode = newFunctionNode.clearFlag(lc, FunctionNode.USES_ARGUMENTS).
                setFlag(lc, FunctionNode.HAS_APPLY_TO_CALL_SPECIALIZATION).
                setParameters(lc, explodedArguments.peek());

        if (log.isEnabled()) {
            log.info("Success: ",
                    massageURL(newFunctionNode.getSource().getURL()),
                    '.',
                    functionName,
                    "' id=",
                    newFunctionNode.getId(),
                    " params=",
                    callSiteTypes.peek());
        }
    }

    callSiteTypes.pop();
    explodedArguments.pop();

    return newFunctionNode.setState(lc, CompilationState.BUILTINS_TRANSFORMED);
}
项目:OpenJSharp    文件:CodeGenerator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    try {
        final boolean markOptimistic;
        if (emittedMethods.add(functionNode.getName())) {
            markOptimistic = generateUnwarrantedOptimismExceptionHandlers(functionNode);
            generateContinuationHandler();
            method.end(); // wrap up this method
            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
            popMethodEmitter();
            log.info("=== END ", functionNode.getName());
        } else {
            markOptimistic = false;
        }

        FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.BYTECODE_GENERATED);
        if (markOptimistic) {
            newFunctionNode = newFunctionNode.setFlag(lc, FunctionNode.IS_DEOPTIMIZABLE);
        }

        newFunctionObject(newFunctionNode, true);
        return newFunctionNode;
    } catch (final Throwable t) {
        Context.printStackTrace(t);
        final VerifyError e = new VerifyError("Code generation bug in \"" + functionNode.getName() + "\": likely stack misaligned: " + t + " " + functionNode.getSource().getName());
        e.initCause(t);
        throw e;
    }
}
项目:kaziranga    文件:Parser.java   
private FunctionNode restoreFunctionNode(final FunctionNode functionNode, final long lastToken) {
    final Block newBody = restoreBlock(lc.getFunctionBody(functionNode));

    return lc.pop(functionNode).
        setBody(lc, newBody).
        setLastToken(lc, lastToken).
        setState(lc, errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED);
}
项目:kaziranga    文件:ApplySpecialization.java   
/**
 * Try to do the apply to call transformation
 * @return true if successful, false otherwise
 */
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    FunctionNode newFunctionNode = functionNode;
    final String functionName = newFunctionNode.getName();

    if (changed.contains(newFunctionNode.getId())) {
        newFunctionNode = newFunctionNode.clearFlag(lc, FunctionNode.USES_ARGUMENTS).
                setFlag(lc, FunctionNode.HAS_APPLY_TO_CALL_SPECIALIZATION).
                setParameters(lc, explodedArguments.peek());

        if (log.isEnabled()) {
            log.info("Success: ",
                    massageURL(newFunctionNode.getSource().getURL()),
                    '.',
                    functionName,
                    "' id=",
                    newFunctionNode.getId(),
                    " params=",
                    callSiteTypes.peek());
        }
    }

    callSiteTypes.pop();
    explodedArguments.pop();

    return newFunctionNode.setState(lc, CompilationState.BUILTINS_TRANSFORMED);
}
项目:kaziranga    文件:CodeGenerator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    try {
        final boolean markOptimistic;
        if (emittedMethods.add(functionNode.getName())) {
            markOptimistic = generateUnwarrantedOptimismExceptionHandlers(functionNode);
            generateContinuationHandler();
            method.end(); // wrap up this method
            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
            popMethodEmitter();
            log.info("=== END ", functionNode.getName());
        } else {
            markOptimistic = false;
        }

        FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.BYTECODE_GENERATED);
        if (markOptimistic) {
            newFunctionNode = newFunctionNode.setFlag(lc, FunctionNode.IS_DEOPTIMIZABLE);
        }

        newFunctionObject(newFunctionNode, true);
        return newFunctionNode;
    } catch (final Throwable t) {
        Context.printStackTrace(t);
        final VerifyError e = new VerifyError("Code generation bug in \"" + functionNode.getName() + "\": likely stack misaligned: " + t + " " + functionNode.getSource().getName());
        e.initCause(t);
        throw e;
    }
}
项目:infobip-open-jdk-8    文件:Parser.java   
private FunctionNode restoreFunctionNode(final FunctionNode functionNode, final long lastToken) {
    final Block newBody = restoreBlock(lc.getFunctionBody(functionNode));

    return lc.pop(functionNode).
        setBody(lc, newBody).
        setLastToken(lc, lastToken).
        setState(lc, errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED);
}
项目:infobip-open-jdk-8    文件:ApplySpecialization.java   
/**
 * Try to do the apply to call transformation
 * @return true if successful, false otherwise
 */
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    FunctionNode newFunctionNode = functionNode;
    final String functionName = newFunctionNode.getName();

    if (changed.contains(newFunctionNode.getId())) {
        newFunctionNode = newFunctionNode.clearFlag(lc, FunctionNode.USES_ARGUMENTS).
                setFlag(lc, FunctionNode.HAS_APPLY_TO_CALL_SPECIALIZATION).
                setParameters(lc, explodedArguments.peek());

        if (log.isEnabled()) {
            log.info("Success: ",
                    massageURL(newFunctionNode.getSource().getURL()),
                    '.',
                    functionName,
                    "' id=",
                    newFunctionNode.getId(),
                    " params=",
                    callSiteTypes.peek());
        }
    }

    callSiteTypes.pop();
    explodedArguments.pop();

    return newFunctionNode.setState(lc, CompilationState.BUILTINS_TRANSFORMED);
}
项目:infobip-open-jdk-8    文件:CodeGenerator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    try {
        final boolean markOptimistic;
        if (emittedMethods.add(functionNode.getName())) {
            markOptimistic = generateUnwarrantedOptimismExceptionHandlers(functionNode);
            generateContinuationHandler();
            method.end(); // wrap up this method
            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
            popMethodEmitter();
            log.info("=== END ", functionNode.getName());
        } else {
            markOptimistic = false;
        }

        FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.BYTECODE_GENERATED);
        if (markOptimistic) {
            newFunctionNode = newFunctionNode.setFlag(lc, FunctionNode.IS_DEOPTIMIZABLE);
        }

        newFunctionObject(newFunctionNode, true);
        return newFunctionNode;
    } catch (final Throwable t) {
        Context.printStackTrace(t);
        final VerifyError e = new VerifyError("Code generation bug in \"" + functionNode.getName() + "\": likely stack misaligned: " + t + " " + functionNode.getSource().getName());
        e.initCause(t);
        throw e;
    }
}
项目:OLD-OpenJDK8    文件:Parser.java   
private FunctionNode restoreFunctionNode(final FunctionNode functionNode, final long lastToken) {
final Block newBody = restoreBlock(lc.getFunctionBody(functionNode));

return lc.pop(functionNode).
    setBody(lc, newBody).
    setLastToken(lc, lastToken).
    setState(lc, errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED).
    snapshot(lc);
}
项目:nashorn-backport    文件:Parser.java   
private FunctionNode restoreFunctionNode(final FunctionNode functionNode, final long lastToken) {
final Block newBody = restoreBlock(lc.getFunctionBody(functionNode));

return lc.pop(functionNode).
    setBody(lc, newBody).
    setLastToken(lc, lastToken).
    setState(lc, errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED).
    snapshot(lc);
}
项目:nashorn    文件:Parser.java   
private FunctionNode restoreFunctionNode(final FunctionNode functionNode, final long lastToken) {
final Block newBody = restoreBlock(lc.getFunctionBody(functionNode));

return lc.pop(functionNode).
    setBody(lc, newBody).
    setLastToken(lc, lastToken).
    setState(lc, errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED).
    snapshot(lc);
}
项目:OpenJSharp    文件:ReplaceCompileUnits.java   
@Override
public Node leaveFunctionNode(final FunctionNode node) {
    return node.setCompileUnit(lc, getExistingReplacement(node)).setState(lc, CompilationState.COMPILE_UNITS_REUSED);
}
项目:OpenJSharp    文件:FoldConstants.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
}
项目:OpenJSharp    文件:Lower.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    log.info("END FunctionNode: ", functionNode.getName());
    return functionNode.setState(lc, CompilationState.LOWERED);
}
项目:OpenJSharp    文件:OptimisticTypesCalculator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    neverOptimistic.pop();
    return functionNode.setState(lc, CompilationState.OPTIMISTIC_TYPES_ASSIGNED);
}
项目:kaziranga    文件:ReplaceCompileUnits.java   
@Override
public Node leaveFunctionNode(final FunctionNode node) {
    return node.setCompileUnit(lc, getExistingReplacement(node)).setState(lc, CompilationState.COMPILE_UNITS_REUSED);
}
项目:kaziranga    文件:FoldConstants.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
}
项目:kaziranga    文件:Lower.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    log.info("END FunctionNode: ", functionNode.getName());
    return functionNode.setState(lc, CompilationState.LOWERED);
}
项目:kaziranga    文件:OptimisticTypesCalculator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    neverOptimistic.pop();
    return functionNode.setState(lc, CompilationState.OPTIMISTIC_TYPES_ASSIGNED);
}
项目:infobip-open-jdk-8    文件:ReplaceCompileUnits.java   
@Override
public Node leaveFunctionNode(final FunctionNode node) {
    return node.setCompileUnit(lc, getExistingReplacement(node)).setState(lc, CompilationState.COMPILE_UNITS_REUSED);
}
项目:infobip-open-jdk-8    文件:FoldConstants.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
}
项目:infobip-open-jdk-8    文件:Lower.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    log.info("END FunctionNode: ", functionNode.getName());
    return functionNode.setState(lc, CompilationState.LOWERED);
}
项目:infobip-open-jdk-8    文件:OptimisticTypesCalculator.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    neverOptimistic.pop();
    return functionNode.setState(lc, CompilationState.OPTIMISTIC_TYPES_ASSIGNED);
}
项目:OLD-OpenJDK8    文件:FoldConstants.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
}
项目:OLD-OpenJDK8    文件:FinalizeTypes.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.FINALIZED);
}
项目:OLD-OpenJDK8    文件:Lower.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    LOG.info("END FunctionNode: ", functionNode.getName());
    return functionNode.setState(lc, CompilationState.LOWERED);
}
项目:nashorn-backport    文件:FoldConstants.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
}
项目:nashorn-backport    文件:FinalizeTypes.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.FINALIZED);
}
项目:nashorn-backport    文件:Lower.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    LOG.info("END FunctionNode: ", functionNode.getName());
    return functionNode.setState(lc, CompilationState.LOWERED);
}
项目:nashorn    文件:FoldConstants.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.CONSTANT_FOLDED);
}
项目:nashorn    文件:FinalizeTypes.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    return functionNode.setState(lc, CompilationState.FINALIZED);
}
项目:nashorn    文件:Lower.java   
@Override
public Node leaveFunctionNode(final FunctionNode functionNode) {
    LOG.info("END FunctionNode: ", functionNode.getName());
    return functionNode.setState(lc, CompilationState.LOWERED);
}