Skip to content

Commit 4da2e3d

Browse files
mtbrandyCommit bot
authored andcommitted
PPC: [runtime] Unify comparison operator runtime entries.
Port 55b4df7 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. [email protected], [email protected], [email protected], [email protected] BUG= Review URL: https://codereview.chromium.org/1737853002 Cr-Commit-Position: refs/heads/master@{#34306}
1 parent 66b87c0 commit 4da2e3d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ppc/code-stubs-ppc.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,11 +698,19 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
698698

699699
__ bind(&slow);
700700

701-
__ Push(lhs, rhs);
702-
// Figure out which native to call and setup the arguments.
703701
if (cc == eq) {
704-
__ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
702+
{
703+
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
704+
__ Push(lhs, rhs);
705+
__ CallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
706+
}
707+
// Turn true into 0 and false into some non-zero value.
708+
STATIC_ASSERT(EQUAL == 0);
709+
__ LoadRoot(r4, Heap::kTrueValueRootIndex);
710+
__ sub(r3, r3, r4);
711+
__ Ret();
705712
} else {
713+
__ Push(lhs, rhs);
706714
int ncr; // NaN compare result
707715
if (cc == lt || cc == le) {
708716
ncr = GREATER;

0 commit comments

Comments
 (0)