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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 300893003: Refactor HType to get rid of various hacks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix compilation. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm64/lithium-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 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "arm/lithium-codegen-arm.h" 7 #include "arm/lithium-codegen-arm.h"
8 #include "arm/lithium-gap-resolver-arm.h" 8 #include "arm/lithium-gap-resolver-arm.h"
9 #include "code-stubs.h" 9 #include "code-stubs.h"
10 #include "stub-cache.h" 10 #include "stub-cache.h"
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 2521
2522 return lt; 2522 return lt;
2523 } 2523 }
2524 2524
2525 2525
2526 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { 2526 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
2527 Register reg = ToRegister(instr->value()); 2527 Register reg = ToRegister(instr->value());
2528 Register temp1 = ToRegister(instr->temp()); 2528 Register temp1 = ToRegister(instr->temp());
2529 2529
2530 SmiCheck check_needed = 2530 SmiCheck check_needed =
2531 instr->hydrogen()->value()->IsHeapObject() 2531 instr->hydrogen()->value()->type().IsHeapObject()
2532 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2532 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2533 Condition true_cond = 2533 Condition true_cond =
2534 EmitIsString(reg, temp1, instr->FalseLabel(chunk_), check_needed); 2534 EmitIsString(reg, temp1, instr->FalseLabel(chunk_), check_needed);
2535 2535
2536 EmitBranch(instr, true_cond); 2536 EmitBranch(instr, true_cond);
2537 } 2537 }
2538 2538
2539 2539
2540 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { 2540 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
2541 Register input_reg = EmitLoadRegister(instr->value(), ip); 2541 Register input_reg = EmitLoadRegister(instr->value(), ip);
2542 __ SmiTst(input_reg); 2542 __ SmiTst(input_reg);
2543 EmitBranch(instr, eq); 2543 EmitBranch(instr, eq);
2544 } 2544 }
2545 2545
2546 2546
2547 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { 2547 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
2548 Register input = ToRegister(instr->value()); 2548 Register input = ToRegister(instr->value());
2549 Register temp = ToRegister(instr->temp()); 2549 Register temp = ToRegister(instr->temp());
2550 2550
2551 if (!instr->hydrogen()->value()->IsHeapObject()) { 2551 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2552 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2552 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2553 } 2553 }
2554 __ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset)); 2554 __ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset));
2555 __ ldrb(temp, FieldMemOperand(temp, Map::kBitFieldOffset)); 2555 __ ldrb(temp, FieldMemOperand(temp, Map::kBitFieldOffset));
2556 __ tst(temp, Operand(1 << Map::kIsUndetectable)); 2556 __ tst(temp, Operand(1 << Map::kIsUndetectable));
2557 EmitBranch(instr, ne); 2557 EmitBranch(instr, ne);
2558 } 2558 }
2559 2559
2560 2560
2561 static Condition ComputeCompareCondition(Token::Value op) { 2561 static Condition ComputeCompareCondition(Token::Value op) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 if (from == FIRST_TYPE) return ls; 2610 if (from == FIRST_TYPE) return ls;
2611 UNREACHABLE(); 2611 UNREACHABLE();
2612 return eq; 2612 return eq;
2613 } 2613 }
2614 2614
2615 2615
2616 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { 2616 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
2617 Register scratch = scratch0(); 2617 Register scratch = scratch0();
2618 Register input = ToRegister(instr->value()); 2618 Register input = ToRegister(instr->value());
2619 2619
2620 if (!instr->hydrogen()->value()->IsHeapObject()) { 2620 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2621 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2621 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2622 } 2622 }
2623 2623
2624 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 2624 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2625 EmitBranch(instr, BranchCondition(instr->hydrogen())); 2625 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2626 } 2626 }
2627 2627
2628 2628
2629 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { 2629 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2630 Register input = ToRegister(instr->value()); 2630 Register input = ToRegister(instr->value());
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 if (instr->hydrogen()->DeoptimizesOnHole()) { 3012 if (instr->hydrogen()->DeoptimizesOnHole()) {
3013 DeoptimizeIf(eq, instr->environment()); 3013 DeoptimizeIf(eq, instr->environment());
3014 } else { 3014 } else {
3015 __ b(ne, &skip_assignment); 3015 __ b(ne, &skip_assignment);
3016 } 3016 }
3017 } 3017 }
3018 3018
3019 __ str(value, target); 3019 __ str(value, target);
3020 if (instr->hydrogen()->NeedsWriteBarrier()) { 3020 if (instr->hydrogen()->NeedsWriteBarrier()) {
3021 SmiCheck check_needed = 3021 SmiCheck check_needed =
3022 instr->hydrogen()->value()->IsHeapObject() 3022 instr->hydrogen()->value()->type().IsHeapObject()
3023 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 3023 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
3024 __ RecordWriteContextSlot(context, 3024 __ RecordWriteContextSlot(context,
3025 target.offset(), 3025 target.offset(),
3026 value, 3026 value,
3027 scratch, 3027 scratch,
3028 GetLinkRegisterState(), 3028 GetLinkRegisterState(),
3029 kSaveFPRegs, 3029 kSaveFPRegs,
3030 EMIT_REMEMBERED_SET, 3030 EMIT_REMEMBERED_SET,
3031 check_needed); 3031 check_needed);
3032 } 3032 }
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
4318 if (instr->hydrogen()->key()->representation().IsSmi()) { 4318 if (instr->hydrogen()->key()->representation().IsSmi()) {
4319 __ add(scratch, elements, Operand::PointerOffsetFromSmiKey(key)); 4319 __ add(scratch, elements, Operand::PointerOffsetFromSmiKey(key));
4320 } else { 4320 } else {
4321 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); 4321 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2));
4322 } 4322 }
4323 } 4323 }
4324 __ str(value, MemOperand(store_base, offset)); 4324 __ str(value, MemOperand(store_base, offset));
4325 4325
4326 if (instr->hydrogen()->NeedsWriteBarrier()) { 4326 if (instr->hydrogen()->NeedsWriteBarrier()) {
4327 SmiCheck check_needed = 4327 SmiCheck check_needed =
4328 instr->hydrogen()->value()->IsHeapObject() 4328 instr->hydrogen()->value()->type().IsHeapObject()
4329 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4329 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4330 // Compute address of modified element and store it into key register. 4330 // Compute address of modified element and store it into key register.
4331 __ add(key, store_base, Operand(offset)); 4331 __ add(key, store_base, Operand(offset));
4332 __ RecordWrite(elements, 4332 __ RecordWrite(elements,
4333 key, 4333 key,
4334 value, 4334 value,
4335 GetLinkRegisterState(), 4335 GetLinkRegisterState(),
4336 kSaveFPRegs, 4336 kSaveFPRegs,
4337 EMIT_REMEMBERED_SET, 4337 EMIT_REMEMBERED_SET,
4338 check_needed); 4338 check_needed);
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
5015 5015
5016 5016
5017 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { 5017 void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
5018 LOperand* input = instr->value(); 5018 LOperand* input = instr->value();
5019 __ SmiTst(ToRegister(input)); 5019 __ SmiTst(ToRegister(input));
5020 DeoptimizeIf(ne, instr->environment()); 5020 DeoptimizeIf(ne, instr->environment());
5021 } 5021 }
5022 5022
5023 5023
5024 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { 5024 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
5025 if (!instr->hydrogen()->value()->IsHeapObject()) { 5025 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
5026 LOperand* input = instr->value(); 5026 LOperand* input = instr->value();
5027 __ SmiTst(ToRegister(input)); 5027 __ SmiTst(ToRegister(input));
5028 DeoptimizeIf(eq, instr->environment()); 5028 DeoptimizeIf(eq, instr->environment());
5029 } 5029 }
5030 } 5030 }
5031 5031
5032 5032
5033 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { 5033 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
5034 Register input = ToRegister(instr->value()); 5034 Register input = ToRegister(instr->value());
5035 Register scratch = scratch0(); 5035 Register scratch = scratch0();
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
5820 __ ldr(result, FieldMemOperand(scratch, 5820 __ ldr(result, FieldMemOperand(scratch,
5821 FixedArray::kHeaderSize - kPointerSize)); 5821 FixedArray::kHeaderSize - kPointerSize));
5822 __ bind(deferred->exit()); 5822 __ bind(deferred->exit());
5823 __ bind(&done); 5823 __ bind(&done);
5824 } 5824 }
5825 5825
5826 5826
5827 #undef __ 5827 #undef __
5828 5828
5829 } } // namespace v8::internal 5829 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698