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:
zhengxing.li 2016-02-28 19:29:18 -08:00 committed by Commit bot
parent 008888c8cb
commit 2aa5341050

View File

@ -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);