trystmt.java

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

JAVA
940
字号
        canCompleteNormally_value = canCompleteNormally_compute();        if(isFinal && num == boundariesCrossed)            canCompleteNormally_computed = true;        return canCompleteNormally_value;    }    private boolean canCompleteNormally_compute() {     boolean anyCatchClauseCompleteNormally = false;     for(int i = 0; i < getNumCatchClause() && !anyCatchClauseCompleteNormally; i++)       anyCatchClauseCompleteNormally = getCatchClause(i).getBlock().canCompleteNormally();     return (getBlock().canCompleteNormally() || anyCatchClauseCompleteNormally) &&       (!hasFinally() || getFinally().canCompleteNormally());  }    // Declared in CreateBCode.jrag at line 1386 @SuppressWarnings({"unchecked", "cast"})     public int break_label() {        int break_label_value = break_label_compute();        return break_label_value;    }    private int break_label_compute() {  return label_finally();  }    // Declared in CreateBCode.jrag at line 1404 @SuppressWarnings({"unchecked", "cast"})     public int continue_label() {        int continue_label_value = continue_label_compute();        return continue_label_value;    }    private int continue_label_compute() {  return label_finally();  }    protected boolean label_begin_computed = false;    protected int label_begin_value;    // Declared in CreateBCode.jrag at line 1456 @SuppressWarnings({"unchecked", "cast"})     public int label_begin() {        if(label_begin_computed)            return label_begin_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_begin_value = label_begin_compute();        if(isFinal && num == boundariesCrossed)            label_begin_computed = true;        return label_begin_value;    }    private int label_begin_compute() {  return hostType().constantPool().newLabel();  }    protected boolean label_block_end_computed = false;    protected int label_block_end_value;    // Declared in CreateBCode.jrag at line 1457 @SuppressWarnings({"unchecked", "cast"})     public int label_block_end() {        if(label_block_end_computed)            return label_block_end_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_block_end_value = label_block_end_compute();        if(isFinal && num == boundariesCrossed)            label_block_end_computed = true;        return label_block_end_value;    }    private int label_block_end_compute() {  return hostType().constantPool().newLabel();  }    protected boolean label_end_computed = false;    protected int label_end_value;    // Declared in CreateBCode.jrag at line 1458 @SuppressWarnings({"unchecked", "cast"})     public int label_end() {        if(label_end_computed)            return label_end_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_end_value = label_end_compute();        if(isFinal && num == boundariesCrossed)            label_end_computed = true;        return label_end_value;    }    private int label_end_compute() {  return hostType().constantPool().newLabel();  }    protected boolean label_finally_computed = false;    protected int label_finally_value;    // Declared in CreateBCode.jrag at line 1459 @SuppressWarnings({"unchecked", "cast"})     public int label_finally() {        if(label_finally_computed)            return label_finally_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_finally_value = label_finally_compute();        if(isFinal && num == boundariesCrossed)            label_finally_computed = true;        return label_finally_value;    }    private int label_finally_compute() {  return hostType().constantPool().newLabel();  }    protected boolean label_finally_block_computed = false;    protected int label_finally_block_value;    // Declared in CreateBCode.jrag at line 1460 @SuppressWarnings({"unchecked", "cast"})     public int label_finally_block() {        if(label_finally_block_computed)            return label_finally_block_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_finally_block_value = label_finally_block_compute();        if(isFinal && num == boundariesCrossed)            label_finally_block_computed = true;        return label_finally_block_value;    }    private int label_finally_block_compute() {  return hostType().constantPool().newLabel();  }    protected boolean label_exception_handler_computed = false;    protected int label_exception_handler_value;    // Declared in CreateBCode.jrag at line 1461 @SuppressWarnings({"unchecked", "cast"})     public int label_exception_handler() {        if(label_exception_handler_computed)            return label_exception_handler_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_exception_handler_value = label_exception_handler_compute();        if(isFinal && num == boundariesCrossed)            label_exception_handler_computed = true;        return label_exception_handler_value;    }    private int label_exception_handler_compute() {  return hostType().constantPool().newLabel();  }    protected boolean label_catch_end_computed = false;    protected int label_catch_end_value;    // Declared in CreateBCode.jrag at line 1462 @SuppressWarnings({"unchecked", "cast"})     public int label_catch_end() {        if(label_catch_end_computed)            return label_catch_end_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        label_catch_end_value = label_catch_end_compute();        if(isFinal && num == boundariesCrossed)            label_catch_end_computed = true;        return label_catch_end_value;    }    private int label_catch_end_compute() {  return hostType().constantPool().newLabel();  }    protected java.util.Map handlesException_TypeDecl_values;    // Declared in ExceptionHandling.jrag at line 35 @SuppressWarnings({"unchecked", "cast"})     public boolean handlesException(TypeDecl exceptionType) {        Object _parameters = exceptionType;if(handlesException_TypeDecl_values == null) handlesException_TypeDecl_values = new java.util.HashMap(4);        if(handlesException_TypeDecl_values.containsKey(_parameters))            return ((Boolean)handlesException_TypeDecl_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType);        if(isFinal && num == boundariesCrossed)            handlesException_TypeDecl_values.put(_parameters, Boolean.valueOf(handlesException_TypeDecl_value));        return handlesException_TypeDecl_value;    }    protected boolean typeError_computed = false;    protected TypeDecl typeError_value;    // Declared in UnreachableStatements.jrag at line 136 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl typeError() {        if(typeError_computed)            return typeError_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        typeError_value = getParent().Define_TypeDecl_typeError(this, null);        if(isFinal && num == boundariesCrossed)            typeError_computed = true;        return typeError_value;    }    protected boolean typeRuntimeException_computed = false;    protected TypeDecl typeRuntimeException_value;    // Declared in UnreachableStatements.jrag at line 137 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl typeRuntimeException() {        if(typeRuntimeException_computed)            return typeRuntimeException_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        typeRuntimeException_value = getParent().Define_TypeDecl_typeRuntimeException(this, null);        if(isFinal && num == boundariesCrossed)            typeRuntimeException_computed = true;        return typeRuntimeException_value;    }    // Declared in CodeGeneration.jrag at line 798 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl typeThrowable() {        TypeDecl typeThrowable_value = getParent().Define_TypeDecl_typeThrowable(this, null);        return typeThrowable_value;    }    // Declared in LocalNum.jrag at line 118    public int Define_int_localNum(ASTNode caller, ASTNode child) {        if(caller == getFinallyOptNoTransform()) {            return localNum() + 2;        }        return getParent().Define_int_localNum(this, caller);    }    // Declared in ExceptionHandling.jrag at line 179    public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {        if(caller == getBlockNoTransform()){    for(int i = 0; i < getNumCatchClause(); i++)      if(getCatchClause(i).handles(exceptionType))        return true;    if(hasFinally() && !getFinally().canCompleteNormally())      return true;    return handlesException(exceptionType);  }        if(caller == getCatchClauseListNoTransform()) {    int childIndex = caller.getIndexOfChild(child);{    if(hasFinally() && !getFinally().canCompleteNormally())      return true;    return handlesException(exceptionType);  }}        return getParent().Define_boolean_handlesException(this, caller, exceptionType);    }    // Declared in UnreachableStatements.jrag at line 154    public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) {        if(caller == getFinallyOptNoTransform()) {            return reachable();        }        if(caller == getCatchClauseListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return reachable();        }        if(caller == getBlockNoTransform()) {            return reachable();        }        return getParent().Define_boolean_reportUnreachable(this, caller);    }    // Declared in UnreachableStatements.jrag at line 121    public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {        if(caller == getFinallyOptNoTransform()) {            return reachable();        }        if(caller == getBlockNoTransform()) {            return reachable();        }        return getParent().Define_boolean_reachable(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 666    public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getFinallyOptNoTransform()) {            return isDAbefore(v);        }        if(caller == getCatchClauseListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return getBlock().isDAbefore(v);        }        if(caller == getBlockNoTransform()) {            return isDAbefore(v);        }        return getParent().Define_boolean_isDAbefore(this, caller, v);    }    // Declared in UnreachableStatements.jrag at line 125    public boolean Define_boolean_reachableCatchClause(ASTNode caller, ASTNode child) {        if(caller == getCatchClauseListNoTransform()) {    int childIndex = caller.getIndexOfChild(child);{    TypeDecl type = getCatchClause(childIndex).getParameter().type();    for(int i = 0; i < childIndex; i++)      if(getCatchClause(i).handles(type))        return false;    if(reachableThrow(getCatchClause(childIndex)))      return true;    if(type.mayCatch(typeError()) || type.mayCatch(typeRuntimeException()))      return true;    return false;  }}        return getParent().Define_boolean_reachableCatchClause(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 1216    public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getFinallyOptNoTransform()){    if(!getBlock().isDUeverywhere(v))      return false;    for(int i = 0; i < getNumCatchClause(); i++)      if(!getCatchClause(i).getBlock().unassignedEverywhere(v, this))        return false;    return true;  }        if(caller == getCatchClauseListNoTransform()) {    int childIndex = caller.getIndexOfChild(child);{    if(!getBlock().isDUafter(v))      return false;    if(!getBlock().isDUeverywhere(v))      return false;    return true;  }}        if(caller == getBlockNoTransform()) {            return isDUbefore(v);        }        return getParent().Define_boolean_isDUbefore(this, caller, v);    }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

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