Skip to content

Commit 1471dbd

Browse files
committed
Use direct iteration targets for comprehensions
1 parent 6de63ae commit 1471dbd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/bytecode_dsl

‎graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/bytecode_dsl/RootNodeCompiler.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ private void emitComprehension(ComprehensionTy[] generators, int index, Builder
13991399
statementCompiler.emitAsyncFor(iter, comp.target, null, true, index,
14001400
(stmtComp, idx) -> emitComprehensionBody(generators, idx, type, collection, accumulateProducer, stmtComp));
14011401
} else {
1402-
BytecodeLocal localValue = beginTemporaryLocal(b);
1402+
BytecodeLocal localValue = beginTemporaryLocalOrGetLocal(comp.target, b);
14031403

14041404
b.beginBlock();
14051405
b.beginBindStackValue();
@@ -1428,14 +1428,13 @@ private void emitComprehension(ComprehensionTy[] generators, int index, Builder
14281428

14291429
b.beginBlock();
14301430

1431-
comp.target.accept(statementCompiler.new StoreVisitor(() -> b.emitLoadLocal(localValue)));
1431+
statementCompiler.storeTemporaryLocalToTarget(localValue, comp.target, b);
14321432
emitComprehensionBody(generators, index, type, collection, accumulateProducer, statementCompiler);
14331433

14341434
b.endBlock();
14351435
b.endWhile();
14361436

14371437
b.endBlock();
1438-
assert RootNodeCompiler.this.isTemporaryLocal(localValue);
14391438
endTemporaryLocal(localValue, b);
14401439
}
14411440

0 commit comments

Comments
 (0)