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 } | |
2648 } | 2637 } |
2649 | 2638 |
2650 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2639 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2651 Register context = ToRegister(instr->context()); | 2640 Register context = ToRegister(instr->context()); |
2652 Register value = ToRegister(instr->value()); | 2641 Register value = ToRegister(instr->value()); |
2653 Register scratch = scratch0(); | 2642 Register scratch = scratch0(); |
2654 MemOperand target = ContextMemOperand(context, instr->slot_index()); | 2643 MemOperand target = ContextMemOperand(context, instr->slot_index()); |
2655 | 2644 |
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 | |
2668 __ StoreP(value, target); | 2645 __ StoreP(value, target); |
2669 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2646 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2670 SmiCheck check_needed = instr->hydrogen()->value()->type().IsHeapObject() | 2647 SmiCheck check_needed = instr->hydrogen()->value()->type().IsHeapObject() |
2671 ? OMIT_SMI_CHECK | 2648 ? OMIT_SMI_CHECK |
2672 : INLINE_SMI_CHECK; | 2649 : INLINE_SMI_CHECK; |
2673 __ RecordWriteContextSlot(context, target.offset(), value, scratch, | 2650 __ RecordWriteContextSlot(context, target.offset(), value, scratch, |
2674 GetLinkRegisterState(), kSaveFPRegs, | 2651 GetLinkRegisterState(), kSaveFPRegs, |
2675 EMIT_REMEMBERED_SET, check_needed); | 2652 EMIT_REMEMBERED_SET, check_needed); |
2676 } | 2653 } |
2677 | |
2678 __ bind(&skip_assignment); | |
2679 } | 2654 } |
2680 | 2655 |
2681 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2656 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2682 HObjectAccess access = instr->hydrogen()->access(); | 2657 HObjectAccess access = instr->hydrogen()->access(); |
2683 int offset = access.offset(); | 2658 int offset = access.offset(); |
2684 Register object = ToRegister(instr->object()); | 2659 Register object = ToRegister(instr->object()); |
2685 | 2660 |
2686 if (access.IsExternalMemory()) { | 2661 if (access.IsExternalMemory()) { |
2687 Register result = ToRegister(instr->result()); | 2662 Register result = ToRegister(instr->result()); |
2688 MemOperand operand = MemOperand(object, offset); | 2663 MemOperand operand = MemOperand(object, offset); |
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5578 __ LoadP(result, | 5553 __ LoadP(result, |
5579 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5554 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5580 __ bind(deferred->exit()); | 5555 __ bind(deferred->exit()); |
5581 __ bind(&done); | 5556 __ bind(&done); |
5582 } | 5557 } |
5583 | 5558 |
5584 #undef __ | 5559 #undef __ |
5585 | 5560 |
5586 } // namespace internal | 5561 } // namespace internal |
5587 } // namespace v8 | 5562 } // namespace v8 |
OLD | NEW |