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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3334 AllowDeferredHandleDereference vector_structure_check; | 3334 AllowDeferredHandleDereference vector_structure_check; |
3335 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3335 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3336 __ Mov(vector_register, vector); | 3336 __ Mov(vector_register, vector); |
3337 // No need to allocate this register. | 3337 // No need to allocate this register. |
3338 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); | 3338 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); |
3339 int index = vector->GetIndex(slot); | 3339 int index = vector->GetIndex(slot); |
3340 __ Mov(slot_register, Smi::FromInt(index)); | 3340 __ Mov(slot_register, Smi::FromInt(index)); |
3341 } | 3341 } |
3342 | 3342 |
3343 | 3343 |
| 3344 template <class T> |
| 3345 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { |
| 3346 Register vector_register = ToRegister(instr->temp_vector()); |
| 3347 Register slot_register = ToRegister(instr->temp_slot()); |
| 3348 |
| 3349 AllowDeferredHandleDereference vector_structure_check; |
| 3350 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 3351 __ Mov(vector_register, vector); |
| 3352 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); |
| 3353 int index = vector->GetIndex(slot); |
| 3354 __ Mov(slot_register, Smi::FromInt(index)); |
| 3355 } |
| 3356 |
| 3357 |
3344 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3358 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
3345 DCHECK(ToRegister(instr->context()).is(cp)); | 3359 DCHECK(ToRegister(instr->context()).is(cp)); |
3346 DCHECK(ToRegister(instr->global_object()) | 3360 DCHECK(ToRegister(instr->global_object()) |
3347 .is(LoadDescriptor::ReceiverRegister())); | 3361 .is(LoadDescriptor::ReceiverRegister())); |
3348 DCHECK(ToRegister(instr->result()).Is(x0)); | 3362 DCHECK(ToRegister(instr->result()).Is(x0)); |
3349 __ Mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3363 __ Mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3350 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3364 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
3351 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3365 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
3352 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 3366 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
3353 PREMONOMORPHIC).code(); | 3367 PREMONOMORPHIC).code(); |
(...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5272 } | 5286 } |
5273 } | 5287 } |
5274 | 5288 |
5275 | 5289 |
5276 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 5290 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
5277 DCHECK(ToRegister(instr->context()).is(cp)); | 5291 DCHECK(ToRegister(instr->context()).is(cp)); |
5278 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 5292 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
5279 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 5293 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
5280 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 5294 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
5281 | 5295 |
| 5296 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 5297 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); |
| 5298 } |
| 5299 |
5282 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | 5300 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( |
5283 isolate(), instr->language_mode(), | 5301 isolate(), instr->language_mode(), |
5284 instr->hydrogen()->initialization_state()).code(); | 5302 instr->hydrogen()->initialization_state()).code(); |
5285 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5303 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
5286 } | 5304 } |
5287 | 5305 |
5288 | 5306 |
5289 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 5307 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
5290 class DeferredMaybeGrowElements final : public LDeferredCode { | 5308 class DeferredMaybeGrowElements final : public LDeferredCode { |
5291 public: | 5309 public: |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5468 instr->hydrogen()->PointersToHereCheckForValue()); | 5486 instr->hydrogen()->PointersToHereCheckForValue()); |
5469 } | 5487 } |
5470 } | 5488 } |
5471 | 5489 |
5472 | 5490 |
5473 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 5491 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
5474 DCHECK(ToRegister(instr->context()).is(cp)); | 5492 DCHECK(ToRegister(instr->context()).is(cp)); |
5475 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 5493 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
5476 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 5494 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
5477 | 5495 |
| 5496 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 5497 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); |
| 5498 } |
| 5499 |
5478 __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 5500 __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
5479 Handle<Code> ic = | 5501 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( |
5480 StoreIC::initialize_stub(isolate(), instr->language_mode(), | 5502 isolate(), instr->language_mode(), |
5481 instr->hydrogen()->initialization_state()); | 5503 instr->hydrogen()->initialization_state()).code(); |
5482 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5504 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
5483 } | 5505 } |
5484 | 5506 |
5485 | 5507 |
5486 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 5508 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
5487 DCHECK(ToRegister(instr->context()).is(cp)); | 5509 DCHECK(ToRegister(instr->context()).is(cp)); |
5488 DCHECK(ToRegister(instr->left()).Is(x1)); | 5510 DCHECK(ToRegister(instr->left()).Is(x1)); |
5489 DCHECK(ToRegister(instr->right()).Is(x0)); | 5511 DCHECK(ToRegister(instr->right()).Is(x0)); |
5490 StringAddStub stub(isolate(), | 5512 StringAddStub stub(isolate(), |
5491 instr->hydrogen()->flags(), | 5513 instr->hydrogen()->flags(), |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6092 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6114 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6093 __ Push(scope_info); | 6115 __ Push(scope_info); |
6094 __ Push(ToRegister(instr->function())); | 6116 __ Push(ToRegister(instr->function())); |
6095 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6117 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6096 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6118 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6097 } | 6119 } |
6098 | 6120 |
6099 | 6121 |
6100 } // namespace internal | 6122 } // namespace internal |
6101 } // namespace v8 | 6123 } // namespace v8 |
OLD | NEW |