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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 1313
1314 __ bind(&undetectable); 1314 __ bind(&undetectable);
1315 __ testb(FieldOperand(rcx, Map::kBitFieldOffset), 1315 __ testb(FieldOperand(rcx, Map::kBitFieldOffset),
1316 Immediate(1 << Map::kIsUndetectable)); 1316 Immediate(1 << Map::kIsUndetectable));
1317 __ j(zero, &return_unequal); 1317 __ j(zero, &return_unequal);
1318 __ Set(rax, EQUAL); 1318 __ Set(rax, EQUAL);
1319 __ ret(0); 1319 __ ret(0);
1320 } 1320 }
1321 __ bind(&runtime_call); 1321 __ bind(&runtime_call);
1322 1322
1323 // Push arguments below the return address to prepare jump to builtin.
1324 __ PopReturnAddressTo(rcx);
1325 __ Push(rdx);
1326 __ Push(rax);
1327
1328 // Figure out which native to call and setup the arguments.
1329 if (cc == equal) { 1323 if (cc == equal) {
1330 __ PushReturnAddressFrom(rcx); 1324 {
1331 __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals); 1325 FrameScope scope(masm, StackFrame::INTERNAL);
1326 __ Push(rdx);
1327 __ Push(rax);
1328 __ CallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
1329 }
1330 // Turn true into 0 and false into some non-zero value.
1331 STATIC_ASSERT(EQUAL == 0);
1332 __ LoadRoot(rdx, Heap::kTrueValueRootIndex);
1333 __ subp(rax, rdx);
1334 __ Ret();
1332 } else { 1335 } else {
1336 // Push arguments below the return address to prepare jump to builtin.
1337 __ PopReturnAddressTo(rcx);
1338 __ Push(rdx);
1339 __ Push(rax);
1333 __ Push(Smi::FromInt(NegativeComparisonResult(cc))); 1340 __ Push(Smi::FromInt(NegativeComparisonResult(cc)));
1334 __ PushReturnAddressFrom(rcx); 1341 __ PushReturnAddressFrom(rcx);
1335 __ TailCallRuntime(Runtime::kCompare); 1342 __ TailCallRuntime(Runtime::kCompare);
1336 } 1343 }
1337 1344
1338 __ bind(&miss); 1345 __ bind(&miss);
1339 GenerateMiss(masm); 1346 GenerateMiss(masm);
1340 } 1347 }
1341 1348
1342 1349
(...skipping 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after
5636 NULL); 5643 NULL);
5637 } 5644 }
5638 5645
5639 5646
5640 #undef __ 5647 #undef __
5641 5648
5642 } // namespace internal 5649 } // namespace internal
5643 } // namespace v8 5650 } // namespace v8
5644 5651
5645 #endif // V8_TARGET_ARCH_X64 5652 #endif // V8_TARGET_ARCH_X64
OLDNEW
« 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