Commit 34f922be authored by Kevin Modzelewski's avatar Kevin Modzelewski

bjit can now pass prime_summing

parent da2a9964
......@@ -631,8 +631,10 @@ Value ASTInterpreter::visit_branch(AST_Branch* node) {
ASSERT(v.o == True || v.o == False, "Should have called NONZERO before this branch");
if (jit) {
// Special note: emitSideExit decrefs v for us.
// TODO: since the value is always True or False, maybe could optimize by putting the decref
// before the conditional instead of after.
jit->emitSideExit(v, v.o, v.o == True ? node->iffalse : node->iftrue);
v.var->decref();
}
if (v.o == True)
......
......@@ -986,6 +986,8 @@ void JitFragmentWriter::_emitSideExit(RewriterVar* var, RewriterVar* val_constan
{
assembler::ForwardJump jne(*assembler, assembler::COND_EQUAL);
_decref(var);
for (auto v : local_syms) {
if (v.second)
_decref(v.second);
......@@ -1001,6 +1003,8 @@ void JitFragmentWriter::_emitSideExit(RewriterVar* var, RewriterVar* val_constan
}
}
_decref(var);
var->bumpUse();
val_constant->bumpUse();
......
......@@ -265,7 +265,7 @@ public:
void emitSetItemName(BoxedString* s, RewriterVar* v);
void emitSetItem(RewriterVar* target, RewriterVar* slice, RewriterVar* value);
void emitSetLocal(InternedString s, int vreg, bool set_closure, RewriterVar* v);
void emitSideExit(RewriterVar* v, Box* cmp_value, CFGBlock* next_block);
void emitSideExit(STOLEN(RewriterVar*) v, Box* cmp_value, CFGBlock* next_block);
void emitUncacheExcInfo();
void abortCompilation();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment