PPC: [runtime] Replace the EQUALS builtin with proper Object::Equals.

Port 54bab695f5

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}
This commit is contained in:
mbrandy 2015-09-17 10:16:43 -07:00 committed by Commit bot
parent b82efa8290
commit 92eed98b14

View File

@ -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.