List<JCExpressionStatement> step, boolean testFirst) { Env<GenContext> loopEnv = env.dup(loop, new GenContext()); int startpc = code.entryPoint(); if (testFirst) {
List<JCExpressionStatement> step, boolean testFirst) { Env<GenContext> loopEnv = env.dup(loop, new GenContext()); int startpc = code.entryPoint(); if (testFirst) {
List<JCExpressionStatement> step, boolean testFirst) { Env<GenContext> loopEnv = env.dup(loop, new GenContext()); int startpc = code.entryPoint(); if (testFirst) { //while or for loop
pool.reset(); Env<GenContext> localEnv = new Env<GenContext>(cdef, new GenContext()); localEnv.toplevel = env.toplevel; localEnv.enclClass = cdef;
public void visitTry(final JCTry tree) { final Env<GenContext> tryEnv = env.dup(tree, new GenContext()); final Env<GenContext> oldEnv = env; if (!useJsrLocally) {
public void visitTry(final JCTry tree) { final Env<GenContext> tryEnv = env.dup(tree, new GenContext()); final Env<GenContext> oldEnv = env; if (!useJsrLocally) {
public void visitTry(final JCTry tree) { final Env<GenContext> tryEnv = env.dup(tree, new GenContext()); final Env<GenContext> oldEnv = env; if (!useJsrLocally) {
public void visitTry(final JCTry tree) { final Env<GenContext> tryEnv = env.dup(tree, new GenContext()); final Env<GenContext> oldEnv = env; if (!useJsrLocally) {
public void visitSynchronized(JCSynchronized tree) { int limit = code.nextreg; // Generate code to evaluate lock and save in temporary variable. final LocalItem lockVar = makeTemp(syms.objectType); genExpr(tree.lock, tree.lock.type).load().duplicate(); lockVar.store(); // Generate code to enter monitor. code.emitop0(monitorenter); code.state.lock(lockVar.reg); // Generate code for a try statement with given body, no catch clauses // in a new environment with the "exit-monitor" operation as finalizer. final Env<GenContext> syncEnv = env.dup(tree, new GenContext()); syncEnv.info.finalize = new GenFinalizer() { void gen() { genLast(); assert syncEnv.info.gaps.length() % 2 == 0; syncEnv.info.gaps.append(code.curPc()); } void genLast() { if (code.isAlive()) { lockVar.load(); code.emitop0(monitorexit); code.state.unlock(lockVar.reg); } } }; syncEnv.info.gaps = new ListBuffer<Integer>(); genTry(tree.body, List.<JCCatch>nil(), syncEnv); code.endScopes(limit); }
public void visitSynchronized(JCSynchronized tree) { int limit = code.nextreg; // Generate code to evaluate lock and save in temporary variable. final LocalItem lockVar = makeTemp(syms.objectType); genExpr(tree.lock, tree.lock.type).load().duplicate(); lockVar.store(); // Generate code to enter monitor. code.emitop0(monitorenter); code.state.lock(lockVar.reg); // Generate code for a try statement with given body, no catch clauses // in a new environment with the "exit-monitor" operation as finalizer. final Env<GenContext> syncEnv = env.dup(tree, new GenContext()); syncEnv.info.finalize = new GenFinalizer() { void gen() { genLast(); assert syncEnv.info.gaps.length() % 2 == 0; syncEnv.info.gaps.append(code.curPc()); } void genLast() { if (code.isAlive()) { lockVar.load(); code.emitop0(monitorexit); code.state.unlock(lockVar.reg); } } }; syncEnv.info.gaps = new ListBuffer<Integer>(); genTry(tree.body, List.<JCCatch>nil(), syncEnv); code.endScopes(limit); }
public void visitSynchronized(JCSynchronized tree) { int limit = code.nextreg; // Generate code to evaluate lock and save in temporary variable. final LocalItem lockVar = makeTemp(syms.objectType); genExpr(tree.lock, tree.lock.type).load().duplicate(); lockVar.store(); // Generate code to enter monitor. code.emitop0(monitorenter); code.state.lock(lockVar.reg); // Generate code for a try statement with given body, no catch clauses // in a new environment with the "exit-monitor" operation as finalizer. final Env<GenContext> syncEnv = env.dup(tree, new GenContext()); syncEnv.info.finalize = new GenFinalizer() { void gen() { genLast(); Assert.check(syncEnv.info.gaps.length() % 2 == 0); syncEnv.info.gaps.append(code.curCP()); } void genLast() { if (code.isAlive()) { lockVar.load(); code.emitop0(monitorexit); code.state.unlock(lockVar.reg); } } }; syncEnv.info.gaps = new ListBuffer<Integer>(); genTry(tree.body, List.<JCCatch>nil(), syncEnv); code.endScopes(limit); }
public void visitSynchronized(JCSynchronized tree) { int limit = code.nextreg; // Generate code to evaluate lock and save in temporary variable. final LocalItem lockVar = makeTemp(syms.objectType); genExpr(tree.lock, tree.lock.type).load().duplicate(); lockVar.store(); // Generate code to enter monitor. code.emitop0(monitorenter); code.state.lock(lockVar.reg); // Generate code for a try statement with given body, no catch clauses // in a new environment with the "exit-monitor" operation as finalizer. final Env<GenContext> syncEnv = env.dup(tree, new GenContext()); syncEnv.info.finalize = new GenFinalizer() { void gen() { genLast(); Assert.check(syncEnv.info.gaps.length() % 2 == 0); syncEnv.info.gaps.append(code.curCP()); } void genLast() { if (code.isAlive()) { lockVar.load(); code.emitop0(monitorexit); code.state.unlock(lockVar.reg); } } }; syncEnv.info.gaps = new ListBuffer<Integer>(); genTry(tree.body, List.<JCCatch>nil(), syncEnv); code.endScopes(limit); }
public void visitBlock(JCBlock tree) { int limit = code.nextreg; Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStats(tree.stats, localEnv); // End the scope of all block-local variables in variable info. if (env.tree.getTag() != JCTree.METHODDEF) { code.statBegin(tree.endpos); code.endScopes(limit); code.pendingStatPos = Position.NOPOS; } }
public void visitBlock(JCBlock tree) { int limit = code.nextreg; Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStats(tree.stats, localEnv); // End the scope of all block-local variables in variable info. if (env.tree.tag != JCTree.METHODDEF) { code.statBegin(tree.endpos); code.endScopes(limit); code.pendingStatPos = Position.NOPOS; } }
public void visitLabelled(JCLabeledStatement tree) { Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStat(tree.body, localEnv, CRT_STATEMENT); code.resolve(localEnv.info.exit); }
public void visitBlock(JCBlock tree) { int limit = code.nextreg; Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStats(tree.stats, localEnv); // End the scope of all block-local variables in variable info. if (!env.tree.hasTag(METHODDEF)) { code.statBegin(tree.endpos); code.endScopes(limit); code.pendingStatPos = Position.NOPOS; } }
public void visitLabelled(JCLabeledStatement tree) { Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStat(tree.body, localEnv, CRT_STATEMENT); code.resolve(localEnv.info.exit); }
public void visitBlock(JCBlock tree) { int limit = code.nextreg; Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStats(tree.stats, localEnv); // End the scope of all block-local variables in variable info. if (!env.tree.hasTag(METHODDEF)) { code.statBegin(tree.endpos); code.endScopes(limit); code.pendingStatPos = Position.NOPOS; } }
public void visitLabelled(JCLabeledStatement tree) { Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStat(tree.body, localEnv, CRT_STATEMENT); code.resolve(localEnv.info.exit); }
public void visitLabelled(JCLabeledStatement tree) { Env<GenContext> localEnv = env.dup(tree, new GenContext()); genStat(tree.body, localEnv, CRT_STATEMENT); code.resolve(localEnv.info.exit); }