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

Side by Side Diff: src/mips/code-stubs-mips.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/ic/ic-state.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after
3511 __ Assert(eq, kExpectedAllocationSite, t0, Operand(at)); 3511 __ Assert(eq, kExpectedAllocationSite, t0, Operand(at));
3512 } 3512 }
3513 3513
3514 // Tail call into the stub that handles binary operations with allocation 3514 // Tail call into the stub that handles binary operations with allocation
3515 // sites. 3515 // sites.
3516 BinaryOpWithAllocationSiteStub stub(isolate(), state()); 3516 BinaryOpWithAllocationSiteStub stub(isolate(), state());
3517 __ TailCallStub(&stub); 3517 __ TailCallStub(&stub);
3518 } 3518 }
3519 3519
3520 3520
3521 void CompareICStub::GenerateBooleans(MacroAssembler* masm) {
3522 DCHECK_EQ(CompareICState::BOOLEAN, state());
3523 Label miss;
3524
3525 __ CheckMap(a1, a2, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK);
3526 __ CheckMap(a0, a3, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK);
3527 if (op() != Token::EQ_STRICT && is_strong(strength())) {
3528 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1);
3529 } else {
3530 if (!Token::IsEqualityOp(op())) {
3531 __ lw(a1, FieldMemOperand(a1, Oddball::kToNumberOffset));
3532 __ AssertSmi(a1);
3533 __ lw(a0, FieldMemOperand(a0, Oddball::kToNumberOffset));
3534 __ AssertSmi(a0);
3535 }
3536 __ Ret(USE_DELAY_SLOT);
3537 __ Subu(v0, a1, a0);
3538 }
3539
3540 __ bind(&miss);
3541 GenerateMiss(masm);
3542 }
3543
3544
3521 void CompareICStub::GenerateSmis(MacroAssembler* masm) { 3545 void CompareICStub::GenerateSmis(MacroAssembler* masm) {
3522 DCHECK(state() == CompareICState::SMI); 3546 DCHECK(state() == CompareICState::SMI);
3523 Label miss; 3547 Label miss;
3524 __ Or(a2, a1, a0); 3548 __ Or(a2, a1, a0);
3525 __ JumpIfNotSmi(a2, &miss); 3549 __ JumpIfNotSmi(a2, &miss);
3526 3550
3527 if (GetCondition() == eq) { 3551 if (GetCondition() == eq) {
3528 // For equality we do not care about the sign of the result. 3552 // For equality we do not care about the sign of the result.
3529 __ Ret(USE_DELAY_SLOT); 3553 __ Ret(USE_DELAY_SLOT);
3530 __ Subu(v0, a0, a1); 3554 __ Subu(v0, a0, a1);
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
5724 MemOperand(fp, 6 * kPointerSize), NULL); 5748 MemOperand(fp, 6 * kPointerSize), NULL);
5725 } 5749 }
5726 5750
5727 5751
5728 #undef __ 5752 #undef __
5729 5753
5730 } // namespace internal 5754 } // namespace internal
5731 } // namespace v8 5755 } // namespace v8
5732 5756
5733 #endif // V8_TARGET_ARCH_MIPS 5757 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ic-state.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698