OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "src/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
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 2951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2962 __ Bind(label->label()); | 2962 __ Bind(label->label()); |
2963 current_block_ = label->block_id(); | 2963 current_block_ = label->block_id(); |
2964 DoGap(label); | 2964 DoGap(label); |
2965 } | 2965 } |
2966 | 2966 |
2967 | 2967 |
2968 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2968 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2969 Register context = ToRegister(instr->context()); | 2969 Register context = ToRegister(instr->context()); |
2970 Register result = ToRegister(instr->result()); | 2970 Register result = ToRegister(instr->result()); |
2971 __ Ldr(result, ContextMemOperand(context, instr->slot_index())); | 2971 __ Ldr(result, ContextMemOperand(context, instr->slot_index())); |
2972 if (instr->hydrogen()->RequiresHoleCheck()) { | |
2973 if (instr->hydrogen()->DeoptimizesOnHole()) { | |
2974 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, | |
2975 DeoptimizeReason::kHole); | |
2976 } else { | |
2977 Label not_the_hole; | |
2978 __ JumpIfNotRoot(result, Heap::kTheHoleValueRootIndex, ¬_the_hole); | |
2979 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | |
2980 __ Bind(¬_the_hole); | |
2981 } | |
2982 } | |
2983 } | 2972 } |
2984 | 2973 |
2985 | 2974 |
2986 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2975 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2987 Register function = ToRegister(instr->function()); | 2976 Register function = ToRegister(instr->function()); |
2988 Register result = ToRegister(instr->result()); | 2977 Register result = ToRegister(instr->result()); |
2989 Register temp = ToRegister(instr->temp()); | 2978 Register temp = ToRegister(instr->temp()); |
2990 | 2979 |
2991 // Get the prototype or initial map from the function. | 2980 // Get the prototype or initial map from the function. |
2992 __ Ldr(result, FieldMemOperand(function, | 2981 __ Ldr(result, FieldMemOperand(function, |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4676 __ Str(temp, FieldMemOperand(function, JSFunction::kCodeEntryOffset)); | 4665 __ Str(temp, FieldMemOperand(function, JSFunction::kCodeEntryOffset)); |
4677 } | 4666 } |
4678 | 4667 |
4679 | 4668 |
4680 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 4669 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
4681 Register context = ToRegister(instr->context()); | 4670 Register context = ToRegister(instr->context()); |
4682 Register value = ToRegister(instr->value()); | 4671 Register value = ToRegister(instr->value()); |
4683 Register scratch = ToRegister(instr->temp()); | 4672 Register scratch = ToRegister(instr->temp()); |
4684 MemOperand target = ContextMemOperand(context, instr->slot_index()); | 4673 MemOperand target = ContextMemOperand(context, instr->slot_index()); |
4685 | 4674 |
4686 Label skip_assignment; | |
4687 | |
4688 if (instr->hydrogen()->RequiresHoleCheck()) { | |
4689 __ Ldr(scratch, target); | |
4690 if (instr->hydrogen()->DeoptimizesOnHole()) { | |
4691 DeoptimizeIfRoot(scratch, Heap::kTheHoleValueRootIndex, instr, | |
4692 DeoptimizeReason::kHole); | |
4693 } else { | |
4694 __ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, &skip_assignment); | |
4695 } | |
4696 } | |
4697 | |
4698 __ Str(value, target); | 4675 __ Str(value, target); |
4699 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4676 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4700 SmiCheck check_needed = | 4677 SmiCheck check_needed = |
4701 instr->hydrogen()->value()->type().IsHeapObject() | 4678 instr->hydrogen()->value()->type().IsHeapObject() |
4702 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4679 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4703 __ RecordWriteContextSlot(context, static_cast<int>(target.offset()), value, | 4680 __ RecordWriteContextSlot(context, static_cast<int>(target.offset()), value, |
4704 scratch, GetLinkRegisterState(), kSaveFPRegs, | 4681 scratch, GetLinkRegisterState(), kSaveFPRegs, |
4705 EMIT_REMEMBERED_SET, check_needed); | 4682 EMIT_REMEMBERED_SET, check_needed); |
4706 } | 4683 } |
4707 __ Bind(&skip_assignment); | |
4708 } | 4684 } |
4709 | 4685 |
4710 | 4686 |
4711 void LCodeGen::DoStoreKeyedExternal(LStoreKeyedExternal* instr) { | 4687 void LCodeGen::DoStoreKeyedExternal(LStoreKeyedExternal* instr) { |
4712 Register ext_ptr = ToRegister(instr->elements()); | 4688 Register ext_ptr = ToRegister(instr->elements()); |
4713 Register key = no_reg; | 4689 Register key = no_reg; |
4714 Register scratch; | 4690 Register scratch; |
4715 ElementsKind elements_kind = instr->elements_kind(); | 4691 ElementsKind elements_kind = instr->elements_kind(); |
4716 | 4692 |
4717 bool key_is_smi = instr->hydrogen()->key()->representation().IsSmi(); | 4693 bool key_is_smi = instr->hydrogen()->key()->representation().IsSmi(); |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5591 // Index is equal to negated out of object property index plus 1. | 5567 // Index is equal to negated out of object property index plus 1. |
5592 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5568 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5593 __ Ldr(result, FieldMemOperand(result, | 5569 __ Ldr(result, FieldMemOperand(result, |
5594 FixedArray::kHeaderSize - kPointerSize)); | 5570 FixedArray::kHeaderSize - kPointerSize)); |
5595 __ Bind(deferred->exit()); | 5571 __ Bind(deferred->exit()); |
5596 __ Bind(&done); | 5572 __ Bind(&done); |
5597 } | 5573 } |
5598 | 5574 |
5599 } // namespace internal | 5575 } // namespace internal |
5600 } // namespace v8 | 5576 } // namespace v8 |
OLD | NEW |