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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 1347063004: [ic] Introduce BOOLEAN state for CompareIC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3338 matching lines...) Expand 10 before | Expand all | Expand 10 after
3349 __ Assert(equal, kExpectedAllocationSite); 3349 __ Assert(equal, kExpectedAllocationSite);
3350 } 3350 }
3351 3351
3352 // Tail call into the stub that handles binary operations with allocation 3352 // Tail call into the stub that handles binary operations with allocation
3353 // sites. 3353 // sites.
3354 BinaryOpWithAllocationSiteStub stub(isolate(), state()); 3354 BinaryOpWithAllocationSiteStub stub(isolate(), state());
3355 __ TailCallStub(&stub); 3355 __ TailCallStub(&stub);
3356 } 3356 }
3357 3357
3358 3358
3359 void CompareICStub::GenerateBooleans(MacroAssembler* masm) {
3360 DCHECK_EQ(CompareICState::BOOLEAN, state());
3361 Label miss;
3362 Label::Distance const miss_distance =
3363 masm->emit_debug_code() ? Label::kFar : Label::kNear;
3364
3365 __ JumpIfSmi(rdx, &miss, miss_distance);
3366 __ movp(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
3367 __ JumpIfSmi(rax, &miss, miss_distance);
3368 __ movp(rbx, FieldOperand(rax, HeapObject::kMapOffset));
3369 __ JumpIfNotRoot(rcx, Heap::kBooleanMapRootIndex, &miss, miss_distance);
3370 __ JumpIfNotRoot(rbx, Heap::kBooleanMapRootIndex, &miss, miss_distance);
3371 if (op() != Token::EQ_STRICT && is_strong(strength())) {
3372 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1);
3373 } else {
3374 if (!Token::IsEqualityOp(op())) {
3375 __ movp(rax, FieldOperand(rax, Oddball::kToNumberOffset));
3376 __ AssertSmi(rax);
3377 __ movp(rdx, FieldOperand(rdx, Oddball::kToNumberOffset));
3378 __ AssertSmi(rdx);
3379 __ xchgp(rax, rdx);
3380 }
3381 __ subp(rax, rdx);
3382 __ Ret();
3383 }
3384
3385 __ bind(&miss);
3386 GenerateMiss(masm);
3387 }
3388
3389
3359 void CompareICStub::GenerateSmis(MacroAssembler* masm) { 3390 void CompareICStub::GenerateSmis(MacroAssembler* masm) {
3360 DCHECK(state() == CompareICState::SMI); 3391 DCHECK(state() == CompareICState::SMI);
3361 Label miss; 3392 Label miss;
3362 __ JumpIfNotBothSmi(rdx, rax, &miss, Label::kNear); 3393 __ JumpIfNotBothSmi(rdx, rax, &miss, Label::kNear);
3363 3394
3364 if (GetCondition() == equal) { 3395 if (GetCondition() == equal) {
3365 // For equality we do not care about the sign of the result. 3396 // For equality we do not care about the sign of the result.
3366 __ subp(rax, rdx); 3397 __ subp(rax, rdx);
3367 } else { 3398 } else {
3368 Label done; 3399 Label done;
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
5541 kStackSpace, nullptr, return_value_operand, NULL); 5572 kStackSpace, nullptr, return_value_operand, NULL);
5542 } 5573 }
5543 5574
5544 5575
5545 #undef __ 5576 #undef __
5546 5577
5547 } // namespace internal 5578 } // namespace internal
5548 } // namespace v8 5579 } // namespace v8
5549 5580
5550 #endif // V8_TARGET_ARCH_X64 5581 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698