- workaround bug in asmjit's register allocator for calls where the return register is already allocated in a physical register needed by one of the call arguments

This commit is contained in:
Magnus Norddahl 2018-10-07 06:29:54 +02:00
commit d47988202a
5 changed files with 78 additions and 27 deletions

View file

@ -56,14 +56,16 @@ void JitCompiler::EmitVTBL()
EmitThrowException(X_READ_NIL);
cc.bind(notnull);
auto result = cc.newIntPtr();
auto call = CreateCall<VMFunction*, DObject*, int>([](DObject *o, int c) -> VMFunction* {
auto p = o->GetClass();
assert(c < (int)p->Virtuals.Size());
return p->Virtuals[c];
});
call->setRet(0, regA[A]);
call->setRet(0, result);
call->setArg(0, regA[B]);
call->setArg(1, asmjit::Imm(C));
cc.mov(regA[A], result);
}
void JitCompiler::EmitSCOPE()