OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 Register megamorphic_scratch = rdi; | 340 Register megamorphic_scratch = rdi; |
341 // The handlers in the stub cache expect a vector and slot. Since we won't | 341 // The handlers in the stub cache expect a vector and slot. Since we won't |
342 // change the IC from any downstream misses, a dummy vector can be used. | 342 // change the IC from any downstream misses, a dummy vector can be used. |
343 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 343 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
344 Register slot = LoadDescriptor::SlotRegister(); | 344 Register slot = LoadDescriptor::SlotRegister(); |
345 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); | 345 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); |
346 Handle<TypeFeedbackVector> dummy_vector = | 346 Handle<TypeFeedbackVector> dummy_vector = |
347 TypeFeedbackVector::DummyVector(masm->isolate()); | 347 TypeFeedbackVector::DummyVector(masm->isolate()); |
348 int slot_index = dummy_vector->GetIndex( | 348 int slot_index = dummy_vector->GetIndex( |
349 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 349 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
350 __ Move(vector, dummy_vector); | 350 __ Move(vector, dummy_vector); |
351 __ Move(slot, Smi::FromInt(slot_index)); | 351 __ Move(slot, Smi::FromInt(slot_index)); |
352 | 352 |
353 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 353 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
354 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 354 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
355 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 355 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
356 receiver, key, | 356 receiver, key, |
357 megamorphic_scratch, no_reg); | 357 megamorphic_scratch, no_reg); |
358 // Cache miss. | 358 // Cache miss. |
359 GenerateMiss(masm); | 359 GenerateMiss(masm); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); | 567 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); |
568 | 568 |
569 if (FLAG_vector_stores) { | 569 if (FLAG_vector_stores) { |
570 Register vector = VectorStoreICDescriptor::VectorRegister(); | 570 Register vector = VectorStoreICDescriptor::VectorRegister(); |
571 Register slot = VectorStoreICDescriptor::SlotRegister(); | 571 Register slot = VectorStoreICDescriptor::SlotRegister(); |
572 // The handlers in the stub cache expect a vector and slot. Since we won't | 572 // The handlers in the stub cache expect a vector and slot. Since we won't |
573 // change the IC from any downstream misses, a dummy vector can be used. | 573 // change the IC from any downstream misses, a dummy vector can be used. |
574 Handle<TypeFeedbackVector> dummy_vector = | 574 Handle<TypeFeedbackVector> dummy_vector = |
575 TypeFeedbackVector::DummyVector(masm->isolate()); | 575 TypeFeedbackVector::DummyVector(masm->isolate()); |
576 int slot_index = dummy_vector->GetIndex( | 576 int slot_index = dummy_vector->GetIndex( |
577 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 577 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
578 __ Move(vector, dummy_vector); | 578 __ Move(vector, dummy_vector); |
579 __ Move(slot, Smi::FromInt(slot_index)); | 579 __ Move(slot, Smi::FromInt(slot_index)); |
580 } | 580 } |
581 | 581 |
582 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 582 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
583 Code::ComputeHandlerFlags(Code::STORE_IC)); | 583 Code::ComputeHandlerFlags(Code::STORE_IC)); |
584 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 584 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
585 receiver, key, r9, no_reg); | 585 receiver, key, r9, no_reg); |
586 // Cache miss. | 586 // Cache miss. |
587 __ jmp(&miss); | 587 __ jmp(&miss); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 Condition cc = | 886 Condition cc = |
887 (check == ENABLE_INLINED_SMI_CHECK) | 887 (check == ENABLE_INLINED_SMI_CHECK) |
888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
891 } | 891 } |
892 } // namespace internal | 892 } // namespace internal |
893 } // namespace v8 | 893 } // namespace v8 |
894 | 894 |
895 #endif // V8_TARGET_ARCH_X64 | 895 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |