dostmt.java

来自「JDK1.4编译器后端」· Java 代码 · 共 479 行 · 第 1/2 页

JAVA
479
字号
    protected java.util.Map isDUbeforeCondition_Variable_values = new java.util.HashMap(4); @SuppressWarnings({"unchecked", "cast"})     public boolean isDUbeforeCondition(Variable v) {        Object _parameters = v;if(isDUbeforeCondition_Variable_visited == null) isDUbeforeCondition_Variable_visited = new java.util.HashMap(4);if(isDUbeforeCondition_Variable_values == null) isDUbeforeCondition_Variable_values = new java.util.HashMap(4);        if(isDUbeforeCondition_Variable_computed.contains(_parameters))            return ((Boolean)isDUbeforeCondition_Variable_values.get(_parameters)).booleanValue();        if (!isDUbeforeCondition_Variable_initialized.contains(_parameters)) {            isDUbeforeCondition_Variable_initialized.add(_parameters);            isDUbeforeCondition_Variable_values.put(_parameters, Boolean.valueOf(true));        }        if (!IN_CIRCLE) {            IN_CIRCLE = true;            int num = boundariesCrossed;        boolean isFinal = this.is$Final();            CIRCLE_INDEX = 1;            boolean new_isDUbeforeCondition_Variable_value;            do {                isDUbeforeCondition_Variable_visited.put(_parameters, new Integer(CIRCLE_INDEX));                CHANGE = false;                new_isDUbeforeCondition_Variable_value = isDUbeforeCondition_compute(v);                if (new_isDUbeforeCondition_Variable_value!=((Boolean)isDUbeforeCondition_Variable_values.get(_parameters)).booleanValue())                    CHANGE = true;                isDUbeforeCondition_Variable_values.put(_parameters, Boolean.valueOf(new_isDUbeforeCondition_Variable_value));                CIRCLE_INDEX++;            } while (CHANGE);            if(isFinal && num == boundariesCrossed){            isDUbeforeCondition_Variable_computed.add(_parameters);            }            else {            RESET_CYCLE = true;            isDUbeforeCondition_compute(v);            RESET_CYCLE = false;            isDUbeforeCondition_Variable_computed.remove(_parameters);            isDUbeforeCondition_Variable_initialized.remove(_parameters);            }            IN_CIRCLE = false;             return new_isDUbeforeCondition_Variable_value;        }        if(!new Integer(CIRCLE_INDEX).equals(isDUbeforeCondition_Variable_visited.get(_parameters))) {            isDUbeforeCondition_Variable_visited.put(_parameters, new Integer(CIRCLE_INDEX));            if (RESET_CYCLE) {                isDUbeforeCondition_Variable_computed.remove(_parameters);                isDUbeforeCondition_Variable_initialized.remove(_parameters);                return ((Boolean)isDUbeforeCondition_Variable_values.get(_parameters)).booleanValue();            }            boolean new_isDUbeforeCondition_Variable_value = isDUbeforeCondition_compute(v);            if (new_isDUbeforeCondition_Variable_value!=((Boolean)isDUbeforeCondition_Variable_values.get(_parameters)).booleanValue())                CHANGE = true;            isDUbeforeCondition_Variable_values.put(_parameters, Boolean.valueOf(new_isDUbeforeCondition_Variable_value));            return new_isDUbeforeCondition_Variable_value;        }        return ((Boolean)isDUbeforeCondition_Variable_values.get(_parameters)).booleanValue();    }    private boolean isDUbeforeCondition_compute(Variable v) {    if(!getStmt().isDUafter(v))      return false;    else {      for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {        ContinueStmt stmt = (ContinueStmt)iter.next();        if(!stmt.isDUafterReachedFinallyBlocks(v))          return false;      }    }    return true;  }    // Declared in NameCheck.jrag at line 399 @SuppressWarnings({"unchecked", "cast"})     public boolean continueLabel() {        boolean continueLabel_value = continueLabel_compute();        return continueLabel_value;    }    private boolean continueLabel_compute() {  return true;  }    // Declared in UnreachableStatements.jrag at line 88 @SuppressWarnings({"unchecked", "cast"})     public boolean canCompleteNormally() {        if(canCompleteNormally_computed)            return canCompleteNormally_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        canCompleteNormally_value = canCompleteNormally_compute();        if(isFinal && num == boundariesCrossed)            canCompleteNormally_computed = true;        return canCompleteNormally_value;    }    private boolean canCompleteNormally_compute() {  return getStmt().canCompleteNormally() && (!getCondition().isConstant() || !getCondition().isTrue())    || reachableContinue() && (!getCondition().isConstant() || !getCondition().isTrue()) || reachableBreak();  }    // Declared in CreateBCode.jrag at line 939 @SuppressWarnings({"unchecked", "cast"})     public boolean definesLabel() {        boolean definesLabel_value = definesLabel_compute();        return definesLabel_value;    }    private boolean definesLabel_compute() {  return true;  }    protected boolean begin_label_computed = false;    protected int begin_label_value;    // Declared in CreateBCode.jrag at line 1339 @SuppressWarnings({"unchecked", "cast"})     public int begin_label() {        if(begin_label_computed)            return begin_label_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        begin_label_value = begin_label_compute();        if(isFinal && num == boundariesCrossed)            begin_label_computed = true;        return begin_label_value;    }    private int begin_label_compute() {  return hostType().constantPool().newLabel();  }    protected boolean cond_label_computed = false;    protected int cond_label_value;    // Declared in CreateBCode.jrag at line 1340 @SuppressWarnings({"unchecked", "cast"})     public int cond_label() {        if(cond_label_computed)            return cond_label_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        cond_label_value = cond_label_compute();        if(isFinal && num == boundariesCrossed)            cond_label_computed = true;        return cond_label_value;    }    private int cond_label_compute() {  return hostType().constantPool().newLabel();  }    protected boolean end_label_computed = false;    protected int end_label_value;    // Declared in CreateBCode.jrag at line 1341 @SuppressWarnings({"unchecked", "cast"})     public int end_label() {        if(end_label_computed)            return end_label_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        end_label_value = end_label_compute();        if(isFinal && num == boundariesCrossed)            end_label_computed = true;        return end_label_value;    }    private int end_label_compute() {  return hostType().constantPool().newLabel();  }    // Declared in CreateBCode.jrag at line 1383 @SuppressWarnings({"unchecked", "cast"})     public int break_label() {        int break_label_value = break_label_compute();        return break_label_value;    }    private int break_label_compute() {  return end_label();  }    // Declared in CreateBCode.jrag at line 1402 @SuppressWarnings({"unchecked", "cast"})     public int continue_label() {        int continue_label_value = continue_label_compute();        return continue_label_value;    }    private int continue_label_compute() {  return cond_label();  }    // Declared in NameCheck.jrag at line 367    public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) {        if(caller == getStmtNoTransform()) {            return true;        }        return getParent().Define_boolean_insideLoop(this, caller);    }    // Declared in CreateBCode.jrag at line 948    public int Define_int_condition_true_label(ASTNode caller, ASTNode child) {        if(caller == getConditionNoTransform()) {            return begin_label();        }        return getParent().Define_int_condition_true_label(this, caller);    }    // Declared in CreateBCode.jrag at line 947    public int Define_int_condition_false_label(ASTNode caller, ASTNode child) {        if(caller == getConditionNoTransform()) {            return end_label();        }        return getParent().Define_int_condition_false_label(this, caller);    }    // Declared in UnreachableStatements.jrag at line 150    public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) {        if(caller == getStmtNoTransform()) {            return reachable();        }        return getParent().Define_boolean_reportUnreachable(this, caller);    }    // Declared in UnreachableStatements.jrag at line 100    public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {        if(caller == getStmtNoTransform()) {            return reachable();        }        return getParent().Define_boolean_reachable(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 601    public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getConditionNoTransform()){    if(!getStmt().isDAafter(v))      return false;    for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {      ContinueStmt stmt = (ContinueStmt)iter.next();      if(!stmt.isDAafterReachedFinallyBlocks(v))        return false;    }    return true;  }        if(caller == getStmtNoTransform()) {            return isDAbefore(v);        }        return getParent().Define_boolean_isDAbefore(this, caller, v);    }    // Declared in DefiniteAssignment.jrag at line 1085    public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getConditionNoTransform()) {            return isDUbeforeCondition(v);        }        if(caller == getStmtNoTransform()) {            return isDUbefore(v) && getCondition().isDUafterTrue(v);        }        return getParent().Define_boolean_isDUbefore(this, caller, v);    }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?