- modify exception checks to jump ahead if the exception is to be thrown as it limits static misprediction
This commit is contained in:
parent
a7ef178284
commit
e6023c55a8
5 changed files with 77 additions and 93 deletions
|
|
@ -678,11 +678,9 @@ void JitCompiler::EmitPopFrame()
|
|||
|
||||
void JitCompiler::EmitNullPointerThrow(int index, EVMAbortException reason)
|
||||
{
|
||||
auto label = cc.newLabel();
|
||||
auto label = EmitThrowExceptionLabel(reason);
|
||||
cc.test(regA[index], regA[index]);
|
||||
cc.jne(label);
|
||||
EmitThrowException(reason);
|
||||
cc.bind(label);
|
||||
cc.je(label);
|
||||
}
|
||||
|
||||
void JitCompiler::ThrowException(VMScriptFunction *func, VMOP *line, int reason)
|
||||
|
|
@ -705,6 +703,16 @@ void JitCompiler::EmitThrowException(EVMAbortException reason)
|
|||
call->setArg(2, asmjit::imm(reason));
|
||||
}
|
||||
|
||||
asmjit::Label JitCompiler::EmitThrowExceptionLabel(EVMAbortException reason)
|
||||
{
|
||||
auto label = cc.newLabel();
|
||||
auto cursor = cc.getCursor();
|
||||
cc.bind(label);
|
||||
EmitThrowException(reason);
|
||||
cc.setCursor(cursor);
|
||||
return label;
|
||||
}
|
||||
|
||||
asmjit::X86Gp JitCompiler::CheckRegD(int r0, int r1)
|
||||
{
|
||||
if (r0 != r1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue