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

Side by Side Diff: src/arm/code-stubs-arm.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 | « no previous file | src/arm64/code-stubs-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 3342 matching lines...) Expand 10 before | Expand all | Expand 10 after
3353 __ Assert(eq, kExpectedAllocationSite); 3353 __ Assert(eq, kExpectedAllocationSite);
3354 } 3354 }
3355 3355
3356 // Tail call into the stub that handles binary operations with allocation 3356 // Tail call into the stub that handles binary operations with allocation
3357 // sites. 3357 // sites.
3358 BinaryOpWithAllocationSiteStub stub(isolate(), state()); 3358 BinaryOpWithAllocationSiteStub stub(isolate(), state());
3359 __ TailCallStub(&stub); 3359 __ TailCallStub(&stub);
3360 } 3360 }
3361 3361
3362 3362
3363 void CompareICStub::GenerateBooleans(MacroAssembler* masm) {
3364 DCHECK_EQ(CompareICState::BOOLEAN, state());
3365 Label miss;
3366
3367 __ CheckMap(r1, r2, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK);
3368 __ CheckMap(r0, r3, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK);
3369 if (op() != Token::EQ_STRICT && is_strong(strength())) {
3370 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1);
3371 } else {
3372 if (!Token::IsEqualityOp(op())) {
3373 __ ldr(r1, FieldMemOperand(r1, Oddball::kToNumberOffset));
3374 __ AssertSmi(r1);
3375 __ ldr(r0, FieldMemOperand(r0, Oddball::kToNumberOffset));
3376 __ AssertSmi(r0);
3377 }
3378 __ sub(r0, r1, r0);
3379 __ Ret();
3380 }
3381
3382 __ bind(&miss);
3383 GenerateMiss(masm);
3384 }
3385
3386
3363 void CompareICStub::GenerateSmis(MacroAssembler* masm) { 3387 void CompareICStub::GenerateSmis(MacroAssembler* masm) {
3364 DCHECK(state() == CompareICState::SMI); 3388 DCHECK(state() == CompareICState::SMI);
3365 Label miss; 3389 Label miss;
3366 __ orr(r2, r1, r0); 3390 __ orr(r2, r1, r0);
3367 __ JumpIfNotSmi(r2, &miss); 3391 __ JumpIfNotSmi(r2, &miss);
3368 3392
3369 if (GetCondition() == eq) { 3393 if (GetCondition() == eq) {
3370 // For equality we do not care about the sign of the result. 3394 // For equality we do not care about the sign of the result.
3371 __ sub(r0, r0, r1, SetCC); 3395 __ sub(r0, r0, r1, SetCC);
3372 } else { 3396 } else {
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
5524 MemOperand(fp, 6 * kPointerSize), NULL); 5548 MemOperand(fp, 6 * kPointerSize), NULL);
5525 } 5549 }
5526 5550
5527 5551
5528 #undef __ 5552 #undef __
5529 5553
5530 } // namespace internal 5554 } // namespace internal
5531 } // namespace v8 5555 } // namespace v8
5532 5556
5533 #endif // V8_TARGET_ARCH_ARM 5557 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698