Skip to content

Commit

Permalink
Use our conditional jmp machinery to make IterInit nice.
Browse files Browse the repository at this point in the history
We were emitting slightly bad code for IterInit. The same trick
we do for other conditional branches can improve it.
  • Loading branch information
kma authored and Joel Pobar committed Sep 28, 2012
1 parent ac85dff commit 34bc484
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/runtime/vm/translator/translator-x64.cpp
Expand Up @@ -12618,13 +12618,7 @@ TranslatorX64::translateIterInit(const Tracelet& t,
// new_iter returns 0 if an iterator was not created, otherwise it
// returns 1
a. test_reg64_reg64(rax, rax);
TCA toPatch = a.code.frontier;
a. jz(a.code.frontier); // 1f
emitBindJmp(notTaken);
// 1:
a.patchJcc(toPatch, a.code.frontier);
emitBindJmp(taken);
translator_not_reached(a);
emitCondJmp(taken, notTaken, CC_Z);
}

void
Expand Down

0 comments on commit 34bc484

Please sign in to comment.