Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: src/ic/arm64/ic-arm64.cc

Issue 2123983004: [ic] Split megamorphic stub cache in two caches (for loads and for stores). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@flags-fix
Patch Set: Rebasing Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 Register vector = LoadWithVectorDescriptor::VectorRegister(); 387 Register vector = LoadWithVectorDescriptor::VectorRegister();
388 Register slot = LoadWithVectorDescriptor::SlotRegister(); 388 Register slot = LoadWithVectorDescriptor::SlotRegister();
389 DCHECK(!AreAliased(vector, slot, scratch1, scratch2, scratch3, scratch4)); 389 DCHECK(!AreAliased(vector, slot, scratch1, scratch2, scratch3, scratch4));
390 Handle<TypeFeedbackVector> dummy_vector = 390 Handle<TypeFeedbackVector> dummy_vector =
391 TypeFeedbackVector::DummyVector(masm->isolate()); 391 TypeFeedbackVector::DummyVector(masm->isolate());
392 int slot_index = dummy_vector->GetIndex( 392 int slot_index = dummy_vector->GetIndex(
393 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); 393 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
394 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); 394 __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
395 __ Mov(slot, Operand(Smi::FromInt(slot_index))); 395 __ Mov(slot, Operand(Smi::FromInt(slot_index)));
396 396
397 Code::Flags flags = 397 masm->isolate()->load_stub_cache()->GenerateProbe(
398 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); 398 masm, receiver, key, scratch1, scratch2, scratch3, scratch4);
399 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags,
400 receiver, key, scratch1,
401 scratch2, scratch3, scratch4);
402 // Cache miss. 399 // Cache miss.
403 KeyedLoadIC::GenerateMiss(masm); 400 KeyedLoadIC::GenerateMiss(masm);
404 401
405 // Do a quick inline probe of the receiver's dictionary, if it exists. 402 // Do a quick inline probe of the receiver's dictionary, if it exists.
406 __ Bind(&probe_dictionary); 403 __ Bind(&probe_dictionary);
407 __ Ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset)); 404 __ Ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset));
408 __ Ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); 405 __ Ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
409 GenerateGlobalInstanceTypeCheck(masm, scratch1, slow); 406 GenerateGlobalInstanceTypeCheck(masm, scratch1, slow);
410 // Load the property. 407 // Load the property.
411 GenerateDictionaryLoad(masm, slow, scratch2, key, result, scratch1, scratch3); 408 GenerateDictionaryLoad(masm, slow, scratch2, key, result, scratch1, scratch3);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 Register vector = VectorStoreICDescriptor::VectorRegister(); 662 Register vector = VectorStoreICDescriptor::VectorRegister();
666 Register slot = VectorStoreICDescriptor::SlotRegister(); 663 Register slot = VectorStoreICDescriptor::SlotRegister();
667 DCHECK(!AreAliased(vector, slot, x5, x6, x7, x8)); 664 DCHECK(!AreAliased(vector, slot, x5, x6, x7, x8));
668 Handle<TypeFeedbackVector> dummy_vector = 665 Handle<TypeFeedbackVector> dummy_vector =
669 TypeFeedbackVector::DummyVector(masm->isolate()); 666 TypeFeedbackVector::DummyVector(masm->isolate());
670 int slot_index = dummy_vector->GetIndex( 667 int slot_index = dummy_vector->GetIndex(
671 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); 668 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot));
672 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); 669 __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
673 __ Mov(slot, Operand(Smi::FromInt(slot_index))); 670 __ Mov(slot, Operand(Smi::FromInt(slot_index)));
674 671
675 Code::Flags flags = 672 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, x5,
676 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); 673 x6, x7, x8);
677 masm->isolate()->stub_cache()->GenerateProbe(
678 masm, Code::KEYED_STORE_IC, flags, receiver, key, x5, x6, x7, x8);
679 // Cache miss. 674 // Cache miss.
680 __ B(&miss); 675 __ B(&miss);
681 676
682 __ Bind(&extra); 677 __ Bind(&extra);
683 // Extra capacity case: Check if there is extra capacity to 678 // Extra capacity case: Check if there is extra capacity to
684 // perform the store and update the length. Used for adding one 679 // perform the store and update the length. Used for adding one
685 // element to the array by writing to array[array.length]. 680 // element to the array by writing to array[array.length].
686 681
687 // Check for room in the elements backing store. 682 // Check for room in the elements backing store.
688 // Both the key and the length of FixedArray are smis. 683 // Both the key and the length of FixedArray are smis.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } else { 835 } else {
841 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); 836 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ);
842 // This is JumpIfSmi(smi_reg, branch_imm). 837 // This is JumpIfSmi(smi_reg, branch_imm).
843 patcher.tbz(smi_reg, 0, branch_imm); 838 patcher.tbz(smi_reg, 0, branch_imm);
844 } 839 }
845 } 840 }
846 } // namespace internal 841 } // namespace internal
847 } // namespace v8 842 } // namespace v8
848 843
849 #endif // V8_TARGET_ARCH_ARM64 844 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698