X87: [runtime] Unify comparison operator runtime entries.
port 55b4df7357557eb16377ad9227e4e0a4224b7885(r34303) original commit message: Only use one set of %StrictEquals/%StrictNotEquals and %Equals/%NotEquals runtime entries for both the interpreter and the old-style CompareICStub. The long-term plan is to update the CompareICStub to also return boolean values, and even allow some more code sharing with the interpreter there. BUG= Review URL: https://codereview.chromium.org/1743123002 Cr-Commit-Position: refs/heads/master@{#34352}
This commit is contained in:
parent
008888c8cb
commit
2aa5341050
@ -1150,21 +1150,26 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
|
||||
}
|
||||
__ bind(&runtime_call);
|
||||
|
||||
// Push arguments below the return address.
|
||||
__ pop(ecx);
|
||||
__ push(edx);
|
||||
__ push(eax);
|
||||
|
||||
// Figure out which native to call and setup the arguments.
|
||||
if (cc == equal) {
|
||||
__ push(ecx);
|
||||
__ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
|
||||
{
|
||||
FrameScope scope(masm, StackFrame::INTERNAL);
|
||||
__ Push(edx);
|
||||
__ Push(eax);
|
||||
__ CallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
|
||||
}
|
||||
// Turn true into 0 and false into some non-zero value.
|
||||
STATIC_ASSERT(EQUAL == 0);
|
||||
__ sub(eax, Immediate(isolate()->factory()->true_value()));
|
||||
__ Ret();
|
||||
} else {
|
||||
// Push arguments below the return address.
|
||||
__ pop(ecx);
|
||||
__ push(edx);
|
||||
__ push(eax);
|
||||
__ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc))));
|
||||
|
||||
// Restore return address on the stack.
|
||||
__ push(ecx);
|
||||
|
||||
// Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
|
||||
// tagged as a small integer.
|
||||
__ TailCallRuntime(Runtime::kCompare);
|
||||
|
Loading…
Reference in New Issue
Block a user