| OLD | NEW |
| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "x87/lithium-codegen-x87.h" | 9 #include "x87/lithium-codegen-x87.h" |
| 10 #include "ic.h" | 10 #include "ic.h" |
| (...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2526 | 2526 |
| 2527 return cond; | 2527 return cond; |
| 2528 } | 2528 } |
| 2529 | 2529 |
| 2530 | 2530 |
| 2531 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { | 2531 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
| 2532 Register reg = ToRegister(instr->value()); | 2532 Register reg = ToRegister(instr->value()); |
| 2533 Register temp = ToRegister(instr->temp()); | 2533 Register temp = ToRegister(instr->temp()); |
| 2534 | 2534 |
| 2535 SmiCheck check_needed = | 2535 SmiCheck check_needed = |
| 2536 instr->hydrogen()->value()->IsHeapObject() | 2536 instr->hydrogen()->value()->type().IsHeapObject() |
| 2537 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2537 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2538 | 2538 |
| 2539 Condition true_cond = EmitIsString( | 2539 Condition true_cond = EmitIsString( |
| 2540 reg, temp, instr->FalseLabel(chunk_), check_needed); | 2540 reg, temp, instr->FalseLabel(chunk_), check_needed); |
| 2541 | 2541 |
| 2542 EmitBranch(instr, true_cond); | 2542 EmitBranch(instr, true_cond); |
| 2543 } | 2543 } |
| 2544 | 2544 |
| 2545 | 2545 |
| 2546 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { | 2546 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
| 2547 Operand input = ToOperand(instr->value()); | 2547 Operand input = ToOperand(instr->value()); |
| 2548 | 2548 |
| 2549 __ test(input, Immediate(kSmiTagMask)); | 2549 __ test(input, Immediate(kSmiTagMask)); |
| 2550 EmitBranch(instr, zero); | 2550 EmitBranch(instr, zero); |
| 2551 } | 2551 } |
| 2552 | 2552 |
| 2553 | 2553 |
| 2554 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { | 2554 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
| 2555 Register input = ToRegister(instr->value()); | 2555 Register input = ToRegister(instr->value()); |
| 2556 Register temp = ToRegister(instr->temp()); | 2556 Register temp = ToRegister(instr->temp()); |
| 2557 | 2557 |
| 2558 if (!instr->hydrogen()->value()->IsHeapObject()) { | 2558 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
| 2559 STATIC_ASSERT(kSmiTag == 0); | 2559 STATIC_ASSERT(kSmiTag == 0); |
| 2560 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); | 2560 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); |
| 2561 } | 2561 } |
| 2562 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); | 2562 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); |
| 2563 __ test_b(FieldOperand(temp, Map::kBitFieldOffset), | 2563 __ test_b(FieldOperand(temp, Map::kBitFieldOffset), |
| 2564 1 << Map::kIsUndetectable); | 2564 1 << Map::kIsUndetectable); |
| 2565 EmitBranch(instr, not_zero); | 2565 EmitBranch(instr, not_zero); |
| 2566 } | 2566 } |
| 2567 | 2567 |
| 2568 | 2568 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2616 if (from == FIRST_TYPE) return below_equal; | 2616 if (from == FIRST_TYPE) return below_equal; |
| 2617 UNREACHABLE(); | 2617 UNREACHABLE(); |
| 2618 return equal; | 2618 return equal; |
| 2619 } | 2619 } |
| 2620 | 2620 |
| 2621 | 2621 |
| 2622 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { | 2622 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
| 2623 Register input = ToRegister(instr->value()); | 2623 Register input = ToRegister(instr->value()); |
| 2624 Register temp = ToRegister(instr->temp()); | 2624 Register temp = ToRegister(instr->temp()); |
| 2625 | 2625 |
| 2626 if (!instr->hydrogen()->value()->IsHeapObject()) { | 2626 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
| 2627 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); | 2627 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); |
| 2628 } | 2628 } |
| 2629 | 2629 |
| 2630 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); | 2630 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); |
| 2631 EmitBranch(instr, BranchCondition(instr->hydrogen())); | 2631 EmitBranch(instr, BranchCondition(instr->hydrogen())); |
| 2632 } | 2632 } |
| 2633 | 2633 |
| 2634 | 2634 |
| 2635 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { | 2635 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
| 2636 Register input = ToRegister(instr->value()); | 2636 Register input = ToRegister(instr->value()); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3022 if (instr->hydrogen()->DeoptimizesOnHole()) { | 3022 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 3023 DeoptimizeIf(equal, instr->environment()); | 3023 DeoptimizeIf(equal, instr->environment()); |
| 3024 } else { | 3024 } else { |
| 3025 __ j(not_equal, &skip_assignment, Label::kNear); | 3025 __ j(not_equal, &skip_assignment, Label::kNear); |
| 3026 } | 3026 } |
| 3027 } | 3027 } |
| 3028 | 3028 |
| 3029 __ mov(target, value); | 3029 __ mov(target, value); |
| 3030 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3030 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 3031 SmiCheck check_needed = | 3031 SmiCheck check_needed = |
| 3032 instr->hydrogen()->value()->IsHeapObject() | 3032 instr->hydrogen()->value()->type().IsHeapObject() |
| 3033 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3033 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 3034 Register temp = ToRegister(instr->temp()); | 3034 Register temp = ToRegister(instr->temp()); |
| 3035 int offset = Context::SlotOffset(instr->slot_index()); | 3035 int offset = Context::SlotOffset(instr->slot_index()); |
| 3036 __ RecordWriteContextSlot(context, | 3036 __ RecordWriteContextSlot(context, |
| 3037 offset, | 3037 offset, |
| 3038 value, | 3038 value, |
| 3039 temp, | 3039 temp, |
| 3040 EMIT_REMEMBERED_SET, | 3040 EMIT_REMEMBERED_SET, |
| 3041 check_needed); | 3041 check_needed); |
| 3042 } | 3042 } |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4140 Handle<Object> handle_value = ToHandle(operand_value); | 4140 Handle<Object> handle_value = ToHandle(operand_value); |
| 4141 __ mov(operand, handle_value); | 4141 __ mov(operand, handle_value); |
| 4142 } | 4142 } |
| 4143 } | 4143 } |
| 4144 | 4144 |
| 4145 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4145 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4146 ASSERT(instr->value()->IsRegister()); | 4146 ASSERT(instr->value()->IsRegister()); |
| 4147 Register value = ToRegister(instr->value()); | 4147 Register value = ToRegister(instr->value()); |
| 4148 ASSERT(!instr->key()->IsConstantOperand()); | 4148 ASSERT(!instr->key()->IsConstantOperand()); |
| 4149 SmiCheck check_needed = | 4149 SmiCheck check_needed = |
| 4150 instr->hydrogen()->value()->IsHeapObject() | 4150 instr->hydrogen()->value()->type().IsHeapObject() |
| 4151 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4151 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 4152 // Compute address of modified element and store it into key register. | 4152 // Compute address of modified element and store it into key register. |
| 4153 __ lea(key, operand); | 4153 __ lea(key, operand); |
| 4154 __ RecordWrite(elements, | 4154 __ RecordWrite(elements, |
| 4155 key, | 4155 key, |
| 4156 value, | 4156 value, |
| 4157 EMIT_REMEMBERED_SET, | 4157 EMIT_REMEMBERED_SET, |
| 4158 check_needed); | 4158 check_needed); |
| 4159 } | 4159 } |
| 4160 } | 4160 } |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4821 | 4821 |
| 4822 | 4822 |
| 4823 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { | 4823 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
| 4824 LOperand* input = instr->value(); | 4824 LOperand* input = instr->value(); |
| 4825 __ test(ToOperand(input), Immediate(kSmiTagMask)); | 4825 __ test(ToOperand(input), Immediate(kSmiTagMask)); |
| 4826 DeoptimizeIf(not_zero, instr->environment()); | 4826 DeoptimizeIf(not_zero, instr->environment()); |
| 4827 } | 4827 } |
| 4828 | 4828 |
| 4829 | 4829 |
| 4830 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { | 4830 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
| 4831 if (!instr->hydrogen()->value()->IsHeapObject()) { | 4831 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
| 4832 LOperand* input = instr->value(); | 4832 LOperand* input = instr->value(); |
| 4833 __ test(ToOperand(input), Immediate(kSmiTagMask)); | 4833 __ test(ToOperand(input), Immediate(kSmiTagMask)); |
| 4834 DeoptimizeIf(zero, instr->environment()); | 4834 DeoptimizeIf(zero, instr->environment()); |
| 4835 } | 4835 } |
| 4836 } | 4836 } |
| 4837 | 4837 |
| 4838 | 4838 |
| 4839 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { | 4839 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
| 4840 Register input = ToRegister(instr->value()); | 4840 Register input = ToRegister(instr->value()); |
| 4841 Register temp = ToRegister(instr->temp()); | 4841 Register temp = ToRegister(instr->temp()); |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5691 __ bind(deferred->exit()); | 5691 __ bind(deferred->exit()); |
| 5692 __ bind(&done); | 5692 __ bind(&done); |
| 5693 } | 5693 } |
| 5694 | 5694 |
| 5695 | 5695 |
| 5696 #undef __ | 5696 #undef __ |
| 5697 | 5697 |
| 5698 } } // namespace v8::internal | 5698 } } // namespace v8::internal |
| 5699 | 5699 |
| 5700 #endif // V8_TARGET_ARCH_X87 | 5700 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |