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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-types.cc ('k') | src/ia32/lithium-ia32.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 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "ia32/lithium-codegen-ia32.h" 9 #include "ia32/lithium-codegen-ia32.h"
10 #include "ic.h" 10 #include "ic.h"
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 2391
2392 return cond; 2392 return cond;
2393 } 2393 }
2394 2394
2395 2395
2396 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { 2396 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
2397 Register reg = ToRegister(instr->value()); 2397 Register reg = ToRegister(instr->value());
2398 Register temp = ToRegister(instr->temp()); 2398 Register temp = ToRegister(instr->temp());
2399 2399
2400 SmiCheck check_needed = 2400 SmiCheck check_needed =
2401 instr->hydrogen()->value()->IsHeapObject() 2401 instr->hydrogen()->value()->type().IsHeapObject()
2402 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2402 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2403 2403
2404 Condition true_cond = EmitIsString( 2404 Condition true_cond = EmitIsString(
2405 reg, temp, instr->FalseLabel(chunk_), check_needed); 2405 reg, temp, instr->FalseLabel(chunk_), check_needed);
2406 2406
2407 EmitBranch(instr, true_cond); 2407 EmitBranch(instr, true_cond);
2408 } 2408 }
2409 2409
2410 2410
2411 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { 2411 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
2412 Operand input = ToOperand(instr->value()); 2412 Operand input = ToOperand(instr->value());
2413 2413
2414 __ test(input, Immediate(kSmiTagMask)); 2414 __ test(input, Immediate(kSmiTagMask));
2415 EmitBranch(instr, zero); 2415 EmitBranch(instr, zero);
2416 } 2416 }
2417 2417
2418 2418
2419 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { 2419 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
2420 Register input = ToRegister(instr->value()); 2420 Register input = ToRegister(instr->value());
2421 Register temp = ToRegister(instr->temp()); 2421 Register temp = ToRegister(instr->temp());
2422 2422
2423 if (!instr->hydrogen()->value()->IsHeapObject()) { 2423 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2424 STATIC_ASSERT(kSmiTag == 0); 2424 STATIC_ASSERT(kSmiTag == 0);
2425 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2425 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2426 } 2426 }
2427 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); 2427 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
2428 __ test_b(FieldOperand(temp, Map::kBitFieldOffset), 2428 __ test_b(FieldOperand(temp, Map::kBitFieldOffset),
2429 1 << Map::kIsUndetectable); 2429 1 << Map::kIsUndetectable);
2430 EmitBranch(instr, not_zero); 2430 EmitBranch(instr, not_zero);
2431 } 2431 }
2432 2432
2433 2433
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2481 if (from == FIRST_TYPE) return below_equal; 2481 if (from == FIRST_TYPE) return below_equal;
2482 UNREACHABLE(); 2482 UNREACHABLE();
2483 return equal; 2483 return equal;
2484 } 2484 }
2485 2485
2486 2486
2487 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { 2487 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
2488 Register input = ToRegister(instr->value()); 2488 Register input = ToRegister(instr->value());
2489 Register temp = ToRegister(instr->temp()); 2489 Register temp = ToRegister(instr->temp());
2490 2490
2491 if (!instr->hydrogen()->value()->IsHeapObject()) { 2491 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2492 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2492 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2493 } 2493 }
2494 2494
2495 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); 2495 __ CmpObjectType(input, TestType(instr->hydrogen()), temp);
2496 EmitBranch(instr, BranchCondition(instr->hydrogen())); 2496 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2497 } 2497 }
2498 2498
2499 2499
2500 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { 2500 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2501 Register input = ToRegister(instr->value()); 2501 Register input = ToRegister(instr->value());
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 if (instr->hydrogen()->DeoptimizesOnHole()) { 2887 if (instr->hydrogen()->DeoptimizesOnHole()) {
2888 DeoptimizeIf(equal, instr->environment()); 2888 DeoptimizeIf(equal, instr->environment());
2889 } else { 2889 } else {
2890 __ j(not_equal, &skip_assignment, Label::kNear); 2890 __ j(not_equal, &skip_assignment, Label::kNear);
2891 } 2891 }
2892 } 2892 }
2893 2893
2894 __ mov(target, value); 2894 __ mov(target, value);
2895 if (instr->hydrogen()->NeedsWriteBarrier()) { 2895 if (instr->hydrogen()->NeedsWriteBarrier()) {
2896 SmiCheck check_needed = 2896 SmiCheck check_needed =
2897 instr->hydrogen()->value()->IsHeapObject() 2897 instr->hydrogen()->value()->type().IsHeapObject()
2898 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2898 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2899 Register temp = ToRegister(instr->temp()); 2899 Register temp = ToRegister(instr->temp());
2900 int offset = Context::SlotOffset(instr->slot_index()); 2900 int offset = Context::SlotOffset(instr->slot_index());
2901 __ RecordWriteContextSlot(context, 2901 __ RecordWriteContextSlot(context,
2902 offset, 2902 offset,
2903 value, 2903 value,
2904 temp, 2904 temp,
2905 kSaveFPRegs, 2905 kSaveFPRegs,
2906 EMIT_REMEMBERED_SET, 2906 EMIT_REMEMBERED_SET,
2907 check_needed); 2907 check_needed);
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 Handle<Object> handle_value = ToHandle(operand_value); 4203 Handle<Object> handle_value = ToHandle(operand_value);
4204 __ mov(operand, handle_value); 4204 __ mov(operand, handle_value);
4205 } 4205 }
4206 } 4206 }
4207 4207
4208 if (instr->hydrogen()->NeedsWriteBarrier()) { 4208 if (instr->hydrogen()->NeedsWriteBarrier()) {
4209 ASSERT(instr->value()->IsRegister()); 4209 ASSERT(instr->value()->IsRegister());
4210 Register value = ToRegister(instr->value()); 4210 Register value = ToRegister(instr->value());
4211 ASSERT(!instr->key()->IsConstantOperand()); 4211 ASSERT(!instr->key()->IsConstantOperand());
4212 SmiCheck check_needed = 4212 SmiCheck check_needed =
4213 instr->hydrogen()->value()->IsHeapObject() 4213 instr->hydrogen()->value()->type().IsHeapObject()
4214 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4214 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4215 // Compute address of modified element and store it into key register. 4215 // Compute address of modified element and store it into key register.
4216 __ lea(key, operand); 4216 __ lea(key, operand);
4217 __ RecordWrite(elements, 4217 __ RecordWrite(elements,
4218 key, 4218 key,
4219 value, 4219 value,
4220 kSaveFPRegs, 4220 kSaveFPRegs,
4221 EMIT_REMEMBERED_SET, 4221 EMIT_REMEMBERED_SET,
4222 check_needed); 4222 check_needed);
4223 } 4223 }
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
4854 4854
4855 4855
4856 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { 4856 void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
4857 LOperand* input = instr->value(); 4857 LOperand* input = instr->value();
4858 __ test(ToOperand(input), Immediate(kSmiTagMask)); 4858 __ test(ToOperand(input), Immediate(kSmiTagMask));
4859 DeoptimizeIf(not_zero, instr->environment()); 4859 DeoptimizeIf(not_zero, instr->environment());
4860 } 4860 }
4861 4861
4862 4862
4863 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { 4863 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
4864 if (!instr->hydrogen()->value()->IsHeapObject()) { 4864 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
4865 LOperand* input = instr->value(); 4865 LOperand* input = instr->value();
4866 __ test(ToOperand(input), Immediate(kSmiTagMask)); 4866 __ test(ToOperand(input), Immediate(kSmiTagMask));
4867 DeoptimizeIf(zero, instr->environment()); 4867 DeoptimizeIf(zero, instr->environment());
4868 } 4868 }
4869 } 4869 }
4870 4870
4871 4871
4872 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { 4872 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
4873 Register input = ToRegister(instr->value()); 4873 Register input = ToRegister(instr->value());
4874 Register temp = ToRegister(instr->temp()); 4874 Register temp = ToRegister(instr->temp());
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
5658 __ bind(deferred->exit()); 5658 __ bind(deferred->exit());
5659 __ bind(&done); 5659 __ bind(&done);
5660 } 5660 }
5661 5661
5662 5662
5663 #undef __ 5663 #undef __
5664 5664
5665 } } // namespace v8::internal 5665 } } // namespace v8::internal
5666 5666
5667 #endif // V8_TARGET_ARCH_IA32 5667 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-types.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698