int ival = ((Number) tree.rhs.type.constValue()).intValue(); if (tree.tag == JCTree.MINUS_ASG) ival = -ival; ((LocalItem)l).incr(ival); result = l; return;
retVar.store();
if (od instanceof LocalItem && (operator.opcode == iadd || operator.opcode == isub)) { ((LocalItem)od).incr(tree.hasTag(PREINC) ? 1 : -1); result = od; } else { (operator.opcode == iadd || operator.opcode == isub)) { Item res = od.load(); ((LocalItem)od).incr(tree.hasTag(POSTINC) ? 1 : -1); result = res; } else {
retVar.store();
if (od instanceof LocalItem && (operator.opcode == iadd || operator.opcode == isub)) { ((LocalItem)od).incr(tree.getTag() == JCTree.PREINC ? 1 : -1); result = od; } else { (operator.opcode == iadd || operator.opcode == isub)) { Item res = od.load(); ((LocalItem)od).incr(tree.getTag() == JCTree.POSTINC ? 1 : -1); result = res; } else {
if (od instanceof LocalItem && (operator.opcode == iadd || operator.opcode == isub)) { ((LocalItem)od).incr(tree.hasTag(PREINC) ? 1 : -1); result = od; } else { (operator.opcode == iadd || operator.opcode == isub)) { Item res = od.load(); ((LocalItem)od).incr(tree.hasTag(POSTINC) ? 1 : -1); result = res; } else {
if (od instanceof LocalItem && (operator.opcode == iadd || operator.opcode == isub)) { ((LocalItem)od).incr(tree.tag == JCTree.PREINC ? 1 : -1); result = od; } else { (operator.opcode == iadd || operator.opcode == isub)) { Item res = od.load(); ((LocalItem)od).incr(tree.tag == JCTree.POSTINC ? 1 : -1); result = res; } else {
int limit = code.nextreg; int exlocal = code.newLocal(exparam); items.makeLocalItem(exparam).store(); code.statBegin(TreeInfo.firstStatPos(tree.body)); genStat(tree.body, env, CRT_BLOCK);
int limit = code.nextreg; int exlocal = code.newLocal(exparam); items.makeLocalItem(exparam).store(); code.statBegin(TreeInfo.firstStatPos(tree.body)); genStat(tree.body, env, CRT_BLOCK);
int ival = ((Number) tree.rhs.type.constValue()).intValue(); if (tree.hasTag(MINUS_ASG)) ival = -ival; ((LocalItem)l).incr(ival); result = l; return;
int ival = ((Number) tree.rhs.type.constValue()).intValue(); if (tree.hasTag(MINUS_ASG)) ival = -ival; ((LocalItem)l).incr(ival); result = l; return;
int ival = ((Number) tree.rhs.type.constValue()).intValue(); if (tree.getTag() == JCTree.MINUS_ASG) ival = -ival; ((LocalItem)l).incr(ival); result = l; return;
int limit = code.nextreg; int exlocal = code.newLocal(exparam); items.makeLocalItem(exparam).store(); code.statBegin(TreeInfo.firstStatPos(tree.body)); genStat(tree.body, env, CRT_BLOCK);
int limit = code.nextreg; int exlocal = code.newLocal(exparam); items.makeLocalItem(exparam).store(); code.statBegin(TreeInfo.firstStatPos(tree.body)); genStat(tree.body, env, CRT_BLOCK);
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 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); }