Commit 5b5a069a authored by Kevin Modzelewski's avatar Kevin Modzelewski

Don't use helper for decref. still kinda slow

parent bf8a7e2d
...@@ -534,8 +534,28 @@ void Rewriter::_incref(RewriterVar* var) { ...@@ -534,8 +534,28 @@ void Rewriter::_incref(RewriterVar* var) {
void Rewriter::_decref(RewriterVar* var) { void Rewriter::_decref(RewriterVar* var) {
//assembler->trap(); //assembler->trap();
this->_call(NULL, true, (void*)Helper::decref, llvm::ArrayRef<RewriterVar*>(&var, 1), //this->_call(NULL, true, (void*)Helper::decref, llvm::ArrayRef<RewriterVar*>(&var, 1),
llvm::ArrayRef<RewriterVar*>(NULL, (int)0)); //llvm::ArrayRef<RewriterVar*>(NULL, (int)0));
#ifdef Py_REF_DEBUG
//assembler->trap();
assembler->decl(assembler::Immediate(&_Py_RefTotal));
#endif
_setupCall(true, llvm::ArrayRef<RewriterVar*>(&var, 1), llvm::ArrayRef<RewriterVar*>(NULL, (int)0), assembler::RAX);
// _setupCall doesn't remember that it added the arg regs to the location set
auto reg = assembler::RDI;
//auto reg = var->getInReg();
assembler->decl(assembler::Indirect(reg, offsetof(Box, ob_refcnt)));
{
assembler::ForwardJump jnz(*assembler, assembler::COND_NOT_ZERO);
//assembler->trap();
assembler->mov(assembler::Indirect(reg, offsetof(Box, cls)), assembler::RAX);
assembler->mov(assembler::Indirect(assembler::RAX, offsetof(BoxedClass, tp_dealloc)), assembler::R11);
assembler->callq(assembler::R11);
}
// Doesn't call bumpUse, since this function is designed to be callable from other emitting functions. // Doesn't call bumpUse, since this function is designed to be callable from other emitting functions.
// (ie the caller should call bumpUse) // (ie the caller should call bumpUse)
......
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