X87: [runtime] Replace the EQUALS builtin with proper Object::Equals.
authorchunyang.dai <chunyang.dai@intel.com>
Thu, 17 Sep 2015 01:21:46 +0000 (18:21 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 17 Sep 2015 01:21:53 +0000 (01:21 +0000)
port 54bab695f5de5bf5948c5b50b217628a00d60f91 (r30747).

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.

BUG=

Review URL: https://codereview.chromium.org/1349623002

Cr-Commit-Position: refs/heads/master@{#30780}

src/x87/code-stubs-x87.cc

index c763401..5ec6929 100644 (file)
@@ -1574,26 +1574,22 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
   __ push(eax);
 
   // Figure out which native to call and setup the arguments.
-  if (cc == equal && strict()) {
+  if (cc == equal) {
     __ push(ecx);
-    __ TailCallRuntime(Runtime::kStrictEquals, 2, 1);
+    __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals, 2,
+                       1);
   } else {
-    int context_index;
-    if (cc == equal) {
-      context_index = Context::EQUALS_BUILTIN_INDEX;
-    } else {
-      context_index = is_strong(strength())
-                          ? Context::COMPARE_STRONG_BUILTIN_INDEX
-                          : Context::COMPARE_BUILTIN_INDEX;
-      __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc))));
-    }
+    int native_context_index = is_strong(strength())
+                                   ? Context::COMPARE_STRONG_BUILTIN_INDEX
+                                   : Context::COMPARE_BUILTIN_INDEX;
+    __ 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.
-    __ InvokeBuiltin(context_index, JUMP_FUNCTION);
+    __ InvokeBuiltin(native_context_index, JUMP_FUNCTION);
   }
 
   __ bind(&miss);