mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1171945: IonMonkey - Part 6: Use binarystub in jsop_binary_arith, r=jandem
This commit is contained in:
parent
0d5a8f63d7
commit
ccebbfbc56
@ -4671,6 +4671,36 @@ IonBuilder::binaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::binaryArithTrySharedStub(bool* emitted, JSOp op,
|
||||
MDefinition* left, MDefinition* right)
|
||||
{
|
||||
MOZ_ASSERT(*emitted == false);
|
||||
|
||||
// Try to emit a shared stub cache.
|
||||
|
||||
if (js_JitOptions.disableSharedStubs)
|
||||
return true;
|
||||
|
||||
// It is not possible for shared stubs to impersonate another op.
|
||||
if (JSOp(*pc) != op)
|
||||
return true;
|
||||
|
||||
MBinarySharedStub *stub = MBinarySharedStub::New(alloc(), left, right);
|
||||
current->add(stub);
|
||||
current->push(stub);
|
||||
|
||||
// Decrease type from 'any type' to 'empty type' when one of the operands
|
||||
// is 'empty typed'.
|
||||
maybeMarkEmpty(stub);
|
||||
|
||||
if (!resumeAfter(stub))
|
||||
return false;
|
||||
|
||||
*emitted = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_binary_arith(JSOp op, MDefinition* left, MDefinition* right)
|
||||
{
|
||||
@ -4687,6 +4717,9 @@ IonBuilder::jsop_binary_arith(JSOp op, MDefinition* left, MDefinition* right)
|
||||
return emitted;
|
||||
}
|
||||
|
||||
if (!binaryArithTrySharedStub(&emitted, op, left, right) || emitted)
|
||||
return emitted;
|
||||
|
||||
// Not possible to optimize. Do a slow vm call.
|
||||
MDefinition::Opcode def_op = JSOpToMDefinition(op);
|
||||
MBinaryArithInstruction* ins = MBinaryArithInstruction::New(alloc(), def_op, left, right);
|
||||
|
@ -489,6 +489,7 @@ class IonBuilder
|
||||
bool binaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* left, MDefinition* right);
|
||||
bool binaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op, MDefinition* left,
|
||||
MDefinition* right);
|
||||
bool binaryArithTrySharedStub(bool* emitted, JSOp op, MDefinition* left, MDefinition* right);
|
||||
|
||||
// binary data lookup helpers.
|
||||
TypedObjectPrediction typedObjectPrediction(MDefinition* typedObj);
|
||||
|
Loading…
Reference in New Issue
Block a user