Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1738883002: [runtime] Unify comparison operator runtime entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-operators.cc ('k') | test/unittests/runtime/runtime-interpreter-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 4b3d02841b28341dc8332c9d1568034a787f8773..d879c7096149b9bac17214a9acd5acd65be83a46 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -1320,16 +1320,23 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
}
__ bind(&runtime_call);
- // Push arguments below the return address to prepare jump to builtin.
- __ PopReturnAddressTo(rcx);
- __ Push(rdx);
- __ Push(rax);
-
- // Figure out which native to call and setup the arguments.
if (cc == equal) {
- __ PushReturnAddressFrom(rcx);
- __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
+ {
+ FrameScope scope(masm, StackFrame::INTERNAL);
+ __ Push(rdx);
+ __ Push(rax);
+ __ CallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
+ }
+ // Turn true into 0 and false into some non-zero value.
+ STATIC_ASSERT(EQUAL == 0);
+ __ LoadRoot(rdx, Heap::kTrueValueRootIndex);
+ __ subp(rax, rdx);
+ __ Ret();
} else {
+ // Push arguments below the return address to prepare jump to builtin.
+ __ PopReturnAddressTo(rcx);
+ __ Push(rdx);
+ __ Push(rax);
__ Push(Smi::FromInt(NegativeComparisonResult(cc)));
__ PushReturnAddressFrom(rcx);
__ TailCallRuntime(Runtime::kCompare);
« no previous file with comments | « src/runtime/runtime-operators.cc ('k') | test/unittests/runtime/runtime-interpreter-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698