| 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/builtins/builtins-constructor.h" | 10 #include "src/builtins/builtins-constructor.h" |
| (...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2641 } | 2641 } |
| 2642 | 2642 |
| 2643 EmitReturn(instr); | 2643 EmitReturn(instr); |
| 2644 } | 2644 } |
| 2645 | 2645 |
| 2646 | 2646 |
| 2647 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2647 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2648 Register context = ToRegister(instr->context()); | 2648 Register context = ToRegister(instr->context()); |
| 2649 Register result = ToRegister(instr->result()); | 2649 Register result = ToRegister(instr->result()); |
| 2650 __ mov(result, ContextOperand(context, instr->slot_index())); | 2650 __ mov(result, ContextOperand(context, instr->slot_index())); |
| 2651 | |
| 2652 if (instr->hydrogen()->RequiresHoleCheck()) { | |
| 2653 __ cmp(result, factory()->the_hole_value()); | |
| 2654 if (instr->hydrogen()->DeoptimizesOnHole()) { | |
| 2655 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole); | |
| 2656 } else { | |
| 2657 Label is_not_hole; | |
| 2658 __ j(not_equal, &is_not_hole, Label::kNear); | |
| 2659 __ mov(result, factory()->undefined_value()); | |
| 2660 __ bind(&is_not_hole); | |
| 2661 } | |
| 2662 } | |
| 2663 } | 2651 } |
| 2664 | 2652 |
| 2665 | 2653 |
| 2666 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2654 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2667 Register context = ToRegister(instr->context()); | 2655 Register context = ToRegister(instr->context()); |
| 2668 Register value = ToRegister(instr->value()); | 2656 Register value = ToRegister(instr->value()); |
| 2669 | |
| 2670 Label skip_assignment; | |
| 2671 | |
| 2672 Operand target = ContextOperand(context, instr->slot_index()); | 2657 Operand target = ContextOperand(context, instr->slot_index()); |
| 2673 if (instr->hydrogen()->RequiresHoleCheck()) { | |
| 2674 __ cmp(target, factory()->the_hole_value()); | |
| 2675 if (instr->hydrogen()->DeoptimizesOnHole()) { | |
| 2676 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole); | |
| 2677 } else { | |
| 2678 __ j(not_equal, &skip_assignment, Label::kNear); | |
| 2679 } | |
| 2680 } | |
| 2681 | 2658 |
| 2682 __ mov(target, value); | 2659 __ mov(target, value); |
| 2683 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2660 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2684 SmiCheck check_needed = | 2661 SmiCheck check_needed = |
| 2685 instr->hydrogen()->value()->type().IsHeapObject() | 2662 instr->hydrogen()->value()->type().IsHeapObject() |
| 2686 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2663 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 2687 Register temp = ToRegister(instr->temp()); | 2664 Register temp = ToRegister(instr->temp()); |
| 2688 int offset = Context::SlotOffset(instr->slot_index()); | 2665 int offset = Context::SlotOffset(instr->slot_index()); |
| 2689 __ RecordWriteContextSlot(context, offset, value, temp, kSaveFPRegs, | 2666 __ RecordWriteContextSlot(context, offset, value, temp, kSaveFPRegs, |
| 2690 EMIT_REMEMBERED_SET, check_needed); | 2667 EMIT_REMEMBERED_SET, check_needed); |
| 2691 } | 2668 } |
| 2692 | |
| 2693 __ bind(&skip_assignment); | |
| 2694 } | 2669 } |
| 2695 | 2670 |
| 2696 | 2671 |
| 2697 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2672 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2698 HObjectAccess access = instr->hydrogen()->access(); | 2673 HObjectAccess access = instr->hydrogen()->access(); |
| 2699 int offset = access.offset(); | 2674 int offset = access.offset(); |
| 2700 | 2675 |
| 2701 if (access.IsExternalMemory()) { | 2676 if (access.IsExternalMemory()) { |
| 2702 Register result = ToRegister(instr->result()); | 2677 Register result = ToRegister(instr->result()); |
| 2703 MemOperand operand = instr->object()->IsConstantOperand() | 2678 MemOperand operand = instr->object()->IsConstantOperand() |
| (...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5652 __ bind(deferred->exit()); | 5627 __ bind(deferred->exit()); |
| 5653 __ bind(&done); | 5628 __ bind(&done); |
| 5654 } | 5629 } |
| 5655 | 5630 |
| 5656 #undef __ | 5631 #undef __ |
| 5657 | 5632 |
| 5658 } // namespace internal | 5633 } // namespace internal |
| 5659 } // namespace v8 | 5634 } // namespace v8 |
| 5660 | 5635 |
| 5661 #endif // V8_TARGET_ARCH_X87 | 5636 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |