- modify exception checks to jump ahead if the exception is to be thrown as it limits static misprediction

This commit is contained in:
Magnus Norddahl 2018-11-10 22:48:20 +01:00
commit e6023c55a8
5 changed files with 77 additions and 93 deletions

View file

@ -78,11 +78,9 @@ void JitCompiler::EmitLFP()
void JitCompiler::EmitMETA()
{
auto label = cc.newLabel();
auto label = EmitThrowExceptionLabel(X_READ_NIL);
cc.test(regA[B], regA[B]);
cc.jne(label);
EmitThrowException(X_READ_NIL);
cc.bind(label);
cc.je(label);
auto result = newResultIntPtr();
auto call = CreateCall<uint8_t*, DObject*>([](DObject *o) { return o->GetClass()->Meta; });
@ -93,11 +91,9 @@ void JitCompiler::EmitMETA()
void JitCompiler::EmitCLSS()
{
auto label = cc.newLabel();
auto label = EmitThrowExceptionLabel(X_READ_NIL);
cc.test(regA[B], regA[B]);
cc.jne(label);
EmitThrowException(X_READ_NIL);
cc.bind(label);
cc.je(label);
auto result = newResultIntPtr();
auto call = CreateCall<PClass*, DObject*>([](DObject *o) { return o->GetClass(); });