Exemplo n.º 1
0
 public void createBCode(CodeGeneration gen) {
   super.createBCode(gen);
   if (hasResult()) {
     TypeDecl type = null;
     BodyDecl b = enclosingBodyDecl();
     if (b instanceof MethodDecl) {
       type = ((MethodDecl) b).type();
     } else {
       throw new Error("Can not create code that returns value within non method");
     }
     getResult().createBCode(gen);
     getResult().type().emitCastTo(gen, type);
     if (!finallyList().isEmpty()) {
       type.emitStoreLocal(gen, resultSaveLocalNum());
     }
     for (Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
       FinallyHost stmt = (FinallyHost) iter.next();
       gen.emitJsr(stmt.label_finally_block());
     }
     if (!finallyList().isEmpty()) {
       type.emitLoadLocal(gen, resultSaveLocalNum());
     }
     type.emitReturn(gen);
   } else {
     for (Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
       FinallyHost stmt = (FinallyHost) iter.next();
       gen.emitJsr(stmt.label_finally_block());
     }
     gen.emitReturn();
   }
 }
Exemplo n.º 2
0
 public void flushCache() {
   super.flushCache();
   isDAafter_Variable_values = null;
   isDUafter_Variable_values = null;
   canCompleteNormally_computed = false;
   else_branch_label_computed = false;
   then_branch_label_computed = false;
 }
Exemplo n.º 3
0
 public void flushCache() {
   super.flushCache();
   finallyList_computed = false;
   finallyList_value = null;
   isDAafter_Variable_values = null;
   isDUafterReachedFinallyBlocks_Variable_values = null;
   isDAafterReachedFinallyBlocks_Variable_values = null;
   isDUafter_Variable_values = null;
   canCompleteNormally_computed = false;
   resultSaveLocalNum_computed = false;
 }
Exemplo n.º 4
0
 /** @apilevel low-level */
 public void flushCache() {
   super.flushCache();
   isDAafter_Variable_values = null;
   isDUafter_Variable_values = null;
   canCompleteNormally_computed = false;
   typeNullPointerException_computed = false;
   typeNullPointerException_value = null;
   handlesException_TypeDecl_values = null;
   typeThrowable_computed = false;
   typeThrowable_value = null;
   typeNull_computed = false;
   typeNull_value = null;
 }
Exemplo n.º 5
0
 public void createBCode(CodeGeneration gen) {
   super.createBCode(gen);
   int elseBranch = else_branch_label();
   int thenBranch = then_branch_label();
   int endBranch = hostType().constantPool().newLabel();
   getCondition().emitEvalBranch(gen);
   gen.addLabel(thenBranch);
   // if(getCondition().canBeTrue()) {
   getThen().createBCode(gen);
   if (getThen().canCompleteNormally() && hasElse() /*&& getCondition().canBeFalse()*/)
     gen.emitGoto(endBranch);
   // }
   gen.addLabel(elseBranch);
   if (hasElse() /*&& getCondition().canBeFalse()*/) getElse().createBCode(gen);
   gen.addLabel(endBranch);
 }
Exemplo n.º 6
0
 /**
  * @ast method
  * @aspect CreateBCode
  * @declaredat /home/uoji/JastAddJ/Java1.4Backend/CreateBCode.jrag:1189
  */
 public void createBCode(CodeGeneration gen) {
   super.createBCode(gen);
 }
Exemplo n.º 7
0
 /** @apilevel internal */
 public void flushCollectionCache() {
   super.flushCollectionCache();
 }
Exemplo n.º 8
0
 public void flushCache() {
   super.flushCache();
   canCompleteNormally_computed = false;
 }
Exemplo n.º 9
0
 /**
  * @ast method
  * @aspect AnonymousClasses
  * @declaredat
  *     /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:207
  */
 protected void collectExceptions(Collection c, ASTNode target) {
   super.collectExceptions(c, target);
   TypeDecl exceptionType = getExpr().type();
   if (exceptionType == typeNull()) exceptionType = typeNullPointerException();
   c.add(exceptionType);
 }