コード例 #1
0
ファイル: StatementGenerator.java プロジェクト: sba1/teavm
 private Statement generateJumpStatement(SwitchStatement stmt, int target) {
   Statement body = generateJumpStatement(program.basicBlockAt(target));
   if (body == null) {
     BreakStatement breakStmt = new BreakStatement();
     breakStmt.setTarget(stmt);
     body = breakStmt;
   }
   return body;
 }
コード例 #2
0
ファイル: StatementGenerator.java プロジェクト: sba1/teavm
 Statement generateJumpStatement(BasicBlock target) {
   if (nextBlock == target && blockMap[target.getIndex()] == null) {
     return null;
   }
   Decompiler.Block block = blockMap[target.getIndex()];
   if (block == null) {
     throw new IllegalStateException("Could not find block for basic block $" + target.getIndex());
   }
   if (target.getIndex() == indexer.nodeAt(block.end)) {
     BreakStatement breakStmt = new BreakStatement();
     breakStmt.setLocation(currentLocation);
     breakStmt.setTarget(block.statement);
     return breakStmt;
   } else {
     ContinueStatement contStmt = new ContinueStatement();
     contStmt.setLocation(currentLocation);
     contStmt.setTarget(block.statement);
     return contStmt;
   }
 }