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/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3001 __ B(ne, &done); | 3001 __ B(ne, &done); |
3002 | 3002 |
3003 // Get the prototype from the initial map. | 3003 // Get the prototype from the initial map. |
3004 __ Ldr(result, FieldMemOperand(result, Map::kPrototypeOffset)); | 3004 __ Ldr(result, FieldMemOperand(result, Map::kPrototypeOffset)); |
3005 | 3005 |
3006 // All done. | 3006 // All done. |
3007 __ Bind(&done); | 3007 __ Bind(&done); |
3008 } | 3008 } |
3009 | 3009 |
3010 | 3010 |
3011 template <class T> | |
3012 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | |
3013 Register vector_register = ToRegister(instr->temp_vector()); | |
3014 Register slot_register = LoadWithVectorDescriptor::SlotRegister(); | |
3015 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | |
3016 DCHECK(slot_register.is(x0)); | |
3017 | |
3018 AllowDeferredHandleDereference vector_structure_check; | |
3019 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
3020 __ Mov(vector_register, vector); | |
3021 // No need to allocate this register. | |
3022 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
3023 int index = vector->GetIndex(slot); | |
3024 __ Mov(slot_register, Smi::FromInt(index)); | |
3025 } | |
3026 | |
3027 | |
3028 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( | 3011 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( |
3029 Register key, | 3012 Register key, |
3030 Register base, | 3013 Register base, |
3031 Register scratch, | 3014 Register scratch, |
3032 bool key_is_smi, | 3015 bool key_is_smi, |
3033 bool key_is_constant, | 3016 bool key_is_constant, |
3034 int constant_key, | 3017 int constant_key, |
3035 ElementsKind elements_kind, | 3018 ElementsKind elements_kind, |
3036 int base_offset) { | 3019 int base_offset) { |
3037 int element_size_shift = ElementsKindToShiftSize(elements_kind); | 3020 int element_size_shift = ElementsKindToShiftSize(elements_kind); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3266 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); | 3249 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); |
3267 __ Cmp(result, Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); | 3250 __ Cmp(result, Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); |
3268 DeoptimizeIf(ne, instr, DeoptimizeReason::kHole); | 3251 DeoptimizeIf(ne, instr, DeoptimizeReason::kHole); |
3269 } | 3252 } |
3270 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 3253 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
3271 __ Bind(&done); | 3254 __ Bind(&done); |
3272 } | 3255 } |
3273 } | 3256 } |
3274 | 3257 |
3275 | 3258 |
3276 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | |
3277 DCHECK(ToRegister(instr->context()).is(cp)); | |
3278 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | |
3279 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | |
3280 | |
3281 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
3282 | |
3283 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); | |
3284 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3285 | |
3286 DCHECK(ToRegister(instr->result()).Is(x0)); | |
3287 } | |
3288 | |
3289 | |
3290 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 3259 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
3291 HObjectAccess access = instr->hydrogen()->access(); | 3260 HObjectAccess access = instr->hydrogen()->access(); |
3292 int offset = access.offset(); | 3261 int offset = access.offset(); |
3293 Register object = ToRegister(instr->object()); | 3262 Register object = ToRegister(instr->object()); |
3294 | 3263 |
3295 if (access.IsExternalMemory()) { | 3264 if (access.IsExternalMemory()) { |
3296 Register result = ToRegister(instr->result()); | 3265 Register result = ToRegister(instr->result()); |
3297 __ Load(result, MemOperand(object, offset), access.representation()); | 3266 __ Load(result, MemOperand(object, offset), access.representation()); |
3298 return; | 3267 return; |
3299 } | 3268 } |
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5634 // Index is equal to negated out of object property index plus 1. | 5603 // Index is equal to negated out of object property index plus 1. |
5635 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5604 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5636 __ Ldr(result, FieldMemOperand(result, | 5605 __ Ldr(result, FieldMemOperand(result, |
5637 FixedArray::kHeaderSize - kPointerSize)); | 5606 FixedArray::kHeaderSize - kPointerSize)); |
5638 __ Bind(deferred->exit()); | 5607 __ Bind(deferred->exit()); |
5639 __ Bind(&done); | 5608 __ Bind(&done); |
5640 } | 5609 } |
5641 | 5610 |
5642 } // namespace internal | 5611 } // namespace internal |
5643 } // namespace v8 | 5612 } // namespace v8 |
OLD | NEW |