From: mbrandy Date: Thu, 17 Sep 2015 17:16:43 +0000 (-0700) Subject: PPC: [runtime] Replace the EQUALS builtin with proper Object::Equals. X-Git-Tag: upstream/4.7.83~230 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92eed98b144b5683ba821257aa7f8a519363fdb1;p=platform%2Fupstream%2Fv8.git PPC: [runtime] Replace the EQUALS builtin with proper Object::Equals. Port 54bab695f5de5bf5948c5b50b217628a00d60f91 Original commit message: Move the implementation of the Abstract Equality Comparison to the runtime and thereby remove the EQUALS dispatcher builtin. Also remove the various runtime entry points that were only used to support the EQUALS builtin. Now the Abstract Equality Comparison is also using the correct ToPrimitive implementation, which properly supports @@toPrimitive. R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, dstence@us.ibm.com BUG=v8:4307 LOG=n Review URL: https://codereview.chromium.org/1357493002 Cr-Commit-Position: refs/heads/master@{#30810} --- diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc index 5aad74a10..2233961da 100644 --- a/src/ppc/code-stubs-ppc.cc +++ b/src/ppc/code-stubs-ppc.cc @@ -707,26 +707,22 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) { __ Push(lhs, rhs); // Figure out which native to call and setup the arguments. - if (cc == eq && strict()) { - __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); + if (cc == eq) { + __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals, 2, + 1); } else { - int context_index; - if (cc == eq) { - context_index = Context::EQUALS_BUILTIN_INDEX; + int context_index = is_strong(strength()) + ? Context::COMPARE_STRONG_BUILTIN_INDEX + : Context::COMPARE_BUILTIN_INDEX; + int ncr; // NaN compare result + if (cc == lt || cc == le) { + ncr = GREATER; } else { - context_index = is_strong(strength()) - ? Context::COMPARE_STRONG_BUILTIN_INDEX - : Context::COMPARE_BUILTIN_INDEX; - int ncr; // NaN compare result - if (cc == lt || cc == le) { - ncr = GREATER; - } else { - DCHECK(cc == gt || cc == ge); // remaining cases - ncr = LESS; - } - __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); - __ push(r3); + DCHECK(cc == gt || cc == ge); // remaining cases + ncr = LESS; } + __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); + __ push(r3); // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) // tagged as a small integer.