Commit bf582fb6 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Just make this an xdecref for now

xdecref is a fair bit slower than decref (especially as it's implemented right
now as a helper function), but I think this will be ok once we get the llvm
jit up and running with refcounting.
parent 2e0b2c58
...@@ -580,15 +580,17 @@ void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closur ...@@ -580,15 +580,17 @@ void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closur
#endif #endif
v); v);
} else { } else {
RewriterVar* prev = vregs_array->getAttr(8 * vreg)->setType(RefType::OWNED); RewriterVar* prev = vregs_array->getAttr(8 * vreg);
v->stealRef(); v->stealRef();
vregs_array->setAttr(8 * vreg, v); vregs_array->setAttr(8 * vreg, v);
v->decvref(); v->decvref();
// XXX: this either needs to be an xdecref or we should check liveness analysis.
// keeping it like this for some performance testing but we need to fix this (will segfault // TODO With definedness analysis, we could know whether we can skip this check (definitely defined)
// on non-osr entries to the bjit) // or not even load the previous value (definitely undefined).
prev->decvref(); // The issue is that definedness analysis is somewhat expensive to compute, so we don't compute it
//prev->xdecvref(); // for the bjit. We could try calculating it (which would require some re-plumbing), which might help
// but I suspect is not that big a deal as long as the llvm jit implements this kind of optimization.
prev->xdecref();
} }
if (LOG_BJIT_ASSEMBLY) comment("BJIT: emitSetLocal() end"); if (LOG_BJIT_ASSEMBLY) comment("BJIT: emitSetLocal() end");
} }
......
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