OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2627 __ AddP(sp, sp, r0); | 2627 __ AddP(sp, sp, r0); |
2628 } | 2628 } |
2629 | 2629 |
2630 __ Ret(); | 2630 __ Ret(); |
2631 } | 2631 } |
2632 | 2632 |
2633 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2633 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2634 Register context = ToRegister(instr->context()); | 2634 Register context = ToRegister(instr->context()); |
2635 Register result = ToRegister(instr->result()); | 2635 Register result = ToRegister(instr->result()); |
2636 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); | 2636 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); |
| 2637 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2638 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 2639 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2640 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole); |
| 2641 } else { |
| 2642 Label skip; |
| 2643 __ bne(&skip, Label::kNear); |
| 2644 __ mov(result, Operand(factory()->undefined_value())); |
| 2645 __ bind(&skip); |
| 2646 } |
| 2647 } |
2637 } | 2648 } |
2638 | 2649 |
2639 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2650 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2640 Register context = ToRegister(instr->context()); | 2651 Register context = ToRegister(instr->context()); |
2641 Register value = ToRegister(instr->value()); | 2652 Register value = ToRegister(instr->value()); |
2642 Register scratch = scratch0(); | 2653 Register scratch = scratch0(); |
2643 MemOperand target = ContextMemOperand(context, instr->slot_index()); | 2654 MemOperand target = ContextMemOperand(context, instr->slot_index()); |
2644 | 2655 |
| 2656 Label skip_assignment; |
| 2657 |
| 2658 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2659 __ LoadP(scratch, target); |
| 2660 __ CompareRoot(scratch, Heap::kTheHoleValueRootIndex); |
| 2661 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2662 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole); |
| 2663 } else { |
| 2664 __ bne(&skip_assignment); |
| 2665 } |
| 2666 } |
| 2667 |
2645 __ StoreP(value, target); | 2668 __ StoreP(value, target); |
2646 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2669 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2647 SmiCheck check_needed = instr->hydrogen()->value()->type().IsHeapObject() | 2670 SmiCheck check_needed = instr->hydrogen()->value()->type().IsHeapObject() |
2648 ? OMIT_SMI_CHECK | 2671 ? OMIT_SMI_CHECK |
2649 : INLINE_SMI_CHECK; | 2672 : INLINE_SMI_CHECK; |
2650 __ RecordWriteContextSlot(context, target.offset(), value, scratch, | 2673 __ RecordWriteContextSlot(context, target.offset(), value, scratch, |
2651 GetLinkRegisterState(), kSaveFPRegs, | 2674 GetLinkRegisterState(), kSaveFPRegs, |
2652 EMIT_REMEMBERED_SET, check_needed); | 2675 EMIT_REMEMBERED_SET, check_needed); |
2653 } | 2676 } |
| 2677 |
| 2678 __ bind(&skip_assignment); |
2654 } | 2679 } |
2655 | 2680 |
2656 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2681 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2657 HObjectAccess access = instr->hydrogen()->access(); | 2682 HObjectAccess access = instr->hydrogen()->access(); |
2658 int offset = access.offset(); | 2683 int offset = access.offset(); |
2659 Register object = ToRegister(instr->object()); | 2684 Register object = ToRegister(instr->object()); |
2660 | 2685 |
2661 if (access.IsExternalMemory()) { | 2686 if (access.IsExternalMemory()) { |
2662 Register result = ToRegister(instr->result()); | 2687 Register result = ToRegister(instr->result()); |
2663 MemOperand operand = MemOperand(object, offset); | 2688 MemOperand operand = MemOperand(object, offset); |
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5553 __ LoadP(result, | 5578 __ LoadP(result, |
5554 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5579 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5555 __ bind(deferred->exit()); | 5580 __ bind(deferred->exit()); |
5556 __ bind(&done); | 5581 __ bind(&done); |
5557 } | 5582 } |
5558 | 5583 |
5559 #undef __ | 5584 #undef __ |
5560 | 5585 |
5561 } // namespace internal | 5586 } // namespace internal |
5562 } // namespace v8 | 5587 } // namespace v8 |
OLD | NEW |