本文整理汇总了Java中jdk.nashorn.internal.ir.JoinPredecessor类的典型用法代码示例。如果您正苦于以下问题:Java JoinPredecessor类的具体用法?Java JoinPredecessor怎么用?Java JoinPredecessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JoinPredecessor类属于jdk.nashorn.internal.ir包,在下文中一共展示了JoinPredecessor类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: enterTernaryNode
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
@Override
public boolean enterTernaryNode(final TernaryNode ternaryNode) {
final Expression test = ternaryNode.getTest();
final Expression trueExpr = ternaryNode.getTrueExpression();
final Expression falseExpr = ternaryNode.getFalseExpression();
test.accept(this);
final Map<Symbol, LvarType> testExitLvarTypes = localVariableTypes;
if(!isAlwaysFalse(test)) {
trueExpr.accept(this);
}
final Map<Symbol, LvarType> trueExitLvarTypes = localVariableTypes;
localVariableTypes = testExitLvarTypes;
if(!isAlwaysTrue(test)) {
falseExpr.accept(this);
}
final Map<Symbol, LvarType> falseExitLvarTypes = localVariableTypes;
localVariableTypes = getUnionTypes(trueExitLvarTypes, falseExitLvarTypes);
setConversion((JoinPredecessor)trueExpr, trueExitLvarTypes, localVariableTypes);
setConversion((JoinPredecessor)falseExpr, falseExitLvarTypes, localVariableTypes);
return false;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:LocalVariableTypesCalculator.java
示例2: beforeJoinPoint
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
void beforeJoinPoint(final JoinPredecessor joinPredecessor) {
LocalVariableConversion next = joinPredecessor.getLocalVariableConversion();
while(next != null) {
final Symbol symbol = next.getSymbol();
if(next.isLive()) {
emitLocalVariableConversion(next, true);
} else {
markDeadLocalVariable(symbol);
}
next = next.getNext();
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:MethodEmitter.java
示例3: jumpToCatchBlock
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
/**
* If we're in a try/catch block, add an edge from the specified node to the try node's pre-catch label.
*/
private void jumpToCatchBlock(final JoinPredecessor jumpOrigin) {
final Label currentCatchLabel = catchLabels.peek();
if(currentCatchLabel != null) {
jumpToLabel(jumpOrigin, currentCatchLabel);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LocalVariableTypesCalculator.java
示例4: enterBinaryNode
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
@Override
public boolean enterBinaryNode(final BinaryNode binaryNode) {
// NOTE: regardless of operator's lexical associativity, lhs is always evaluated first.
final Expression lhs = binaryNode.lhs();
final LvarType lhsType;
if (!(lhs instanceof IdentNode && binaryNode.isTokenType(TokenType.ASSIGN))) {
lhsType = visitExpression(lhs);
} else {
// Can't visit IdentNode on LHS of a simple assignment, as visits imply use, and this is def.
// The type is irrelevant, as only RHS is used to determine the type anyway.
lhsType = LvarType.UNDEFINED;
}
final boolean isLogical = binaryNode.isLogical();
final Label joinLabel = isLogical ? new Label("") : null;
if(isLogical) {
jumpToLabel((JoinPredecessor)lhs, joinLabel);
}
final Expression rhs = binaryNode.rhs();
final LvarType rhsType = visitExpression(rhs);
if(isLogical) {
jumpToLabel((JoinPredecessor)rhs, joinLabel);
}
joinOnLabel(joinLabel);
final LvarType type = toLvarType(binaryNode.setOperands(lhsType.typeExpression, rhsType.typeExpression).getType());
if(binaryNode.isAssignment() && lhs instanceof IdentNode) {
if(binaryNode.isSelfModifying()) {
onSelfAssignment((IdentNode)lhs, type);
} else {
onAssignment((IdentNode)lhs, type);
}
}
typeStack.push(type);
return false;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:LocalVariableTypesCalculator.java
示例5: enterTernaryNode
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
@Override
public boolean enterTernaryNode(final TernaryNode ternaryNode) {
final Expression test = ternaryNode.getTest();
final Expression trueExpr = ternaryNode.getTrueExpression();
final Expression falseExpr = ternaryNode.getFalseExpression();
visitExpression(test);
final Map<Symbol, LvarType> testExitLvarTypes = localVariableTypes;
final LvarType trueType;
if(!isAlwaysFalse(test)) {
trueType = visitExpression(trueExpr);
} else {
trueType = null;
}
final Map<Symbol, LvarType> trueExitLvarTypes = localVariableTypes;
localVariableTypes = testExitLvarTypes;
final LvarType falseType;
if(!isAlwaysTrue(test)) {
falseType = visitExpression(falseExpr);
} else {
falseType = null;
}
final Map<Symbol, LvarType> falseExitLvarTypes = localVariableTypes;
localVariableTypes = getUnionTypes(trueExitLvarTypes, falseExitLvarTypes);
setConversion((JoinPredecessor)trueExpr, trueExitLvarTypes, localVariableTypes);
setConversion((JoinPredecessor)falseExpr, falseExitLvarTypes, localVariableTypes);
typeStack.push(trueType != null ? falseType != null ? widestLvarType(trueType, falseType) : trueType : assertNotNull(falseType));
return false;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:LocalVariableTypesCalculator.java
示例6: printLocalVariableConversion
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
private void printLocalVariableConversion(final JoinPredecessor joinPredecessor) {
LocalVariableConversion.toString(joinPredecessor.getLocalVariableConversion(), sb);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:PrintVisitor.java
示例7: JumpOrigin
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
JumpOrigin(final JoinPredecessor node, final Map<Symbol, LvarType> types) {
this.node = node;
this.types = types;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:LocalVariableTypesCalculator.java
示例8: addOrigin
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
void addOrigin(final JoinPredecessor originNode, final Map<Symbol, LvarType> originTypes) {
origins.add(new JumpOrigin(originNode, originTypes));
this.types = getUnionTypes(this.types, originTypes);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:LocalVariableTypesCalculator.java
示例9: jumpToLabel
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
private void jumpToLabel(final JoinPredecessor jumpOrigin, final Label label) {
jumpToLabel(jumpOrigin, label, localVariableTypes);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:LocalVariableTypesCalculator.java
示例10: setLocalVariableConversion
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <T extends JoinPredecessor> T setLocalVariableConversion(final JoinPredecessor original, final T jp) {
// NOTE: can't use Map.remove() as our copy-on-write AST semantics means some nodes appear twice (in
// finally blocks), so we need to be able to access conversions for them multiple times.
return (T)jp.setLocalVariableConversion(lc, localVariableConversions.get(original));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:LocalVariableTypesCalculator.java
示例11: addOrigin
import jdk.nashorn.internal.ir.JoinPredecessor; //导入依赖的package包/类
void addOrigin(final JoinPredecessor originNode, final Map<Symbol, LvarType> originTypes, final LocalVariableTypesCalculator calc) {
origins.add(new JumpOrigin(originNode, originTypes));
this.types = calc.getUnionTypes(this.types, originTypes);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:LocalVariableTypesCalculator.java
注:本文中的jdk.nashorn.internal.ir.JoinPredecessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论