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

Side by Side Diff: src/ic/arm/ic-arm.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 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_ARM 5 #if V8_TARGET_ARCH_ARM
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 Register vector = LoadWithVectorDescriptor::VectorRegister(); 408 Register vector = LoadWithVectorDescriptor::VectorRegister();
409 Register slot = LoadWithVectorDescriptor::SlotRegister(); 409 Register slot = LoadWithVectorDescriptor::SlotRegister();
410 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9)); 410 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9));
411 Handle<TypeFeedbackVector> dummy_vector = 411 Handle<TypeFeedbackVector> dummy_vector =
412 TypeFeedbackVector::DummyVector(masm->isolate()); 412 TypeFeedbackVector::DummyVector(masm->isolate());
413 int slot_index = dummy_vector->GetIndex( 413 int slot_index = dummy_vector->GetIndex(
414 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); 414 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
415 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); 415 __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
416 __ mov(slot, Operand(Smi::FromInt(slot_index))); 416 __ mov(slot, Operand(Smi::FromInt(slot_index)));
417 417
418 Code::Flags flags = 418 masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, key, r4, r5,
419 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); 419 r6, r9);
420 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags,
421 receiver, key, r4, r5, r6, r9);
422 // Cache miss. 420 // Cache miss.
423 GenerateMiss(masm); 421 GenerateMiss(masm);
424 422
425 // Do a quick inline probe of the receiver's dictionary, if it 423 // Do a quick inline probe of the receiver's dictionary, if it
426 // exists. 424 // exists.
427 __ bind(&probe_dictionary); 425 __ bind(&probe_dictionary);
428 // r3: elements 426 // r3: elements
429 __ ldr(r0, FieldMemOperand(receiver, HeapObject::kMapOffset)); 427 __ ldr(r0, FieldMemOperand(receiver, HeapObject::kMapOffset));
430 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset)); 428 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset));
431 GenerateGlobalInstanceTypeCheck(masm, r0, &slow); 429 GenerateGlobalInstanceTypeCheck(masm, r0, &slow);
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 Register slot = VectorStoreICDescriptor::SlotRegister(); 673 Register slot = VectorStoreICDescriptor::SlotRegister();
676 674
677 DCHECK(!AreAliased(vector, slot, r5, temporary2, r6, r9)); 675 DCHECK(!AreAliased(vector, slot, r5, temporary2, r6, r9));
678 Handle<TypeFeedbackVector> dummy_vector = 676 Handle<TypeFeedbackVector> dummy_vector =
679 TypeFeedbackVector::DummyVector(masm->isolate()); 677 TypeFeedbackVector::DummyVector(masm->isolate());
680 int slot_index = dummy_vector->GetIndex( 678 int slot_index = dummy_vector->GetIndex(
681 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); 679 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot));
682 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); 680 __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
683 __ mov(slot, Operand(Smi::FromInt(slot_index))); 681 __ mov(slot, Operand(Smi::FromInt(slot_index)));
684 682
685 Code::Flags flags = 683 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, r5,
686 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); 684 temporary2, r6, r9);
687 masm->isolate()->stub_cache()->GenerateProbe(
688 masm, Code::KEYED_STORE_IC, flags, receiver, key, r5, temporary2, r6, r9);
689 // Cache miss. 685 // Cache miss.
690 __ b(&miss); 686 __ b(&miss);
691 687
692 // Extra capacity case: Check if there is extra capacity to 688 // Extra capacity case: Check if there is extra capacity to
693 // perform the store and update the length. Used for adding one 689 // perform the store and update the length. Used for adding one
694 // element to the array by writing to array[array.length]. 690 // element to the array by writing to array[array.length].
695 __ bind(&extra); 691 __ bind(&extra);
696 // Condition code from comparing key and array length is still available. 692 // Condition code from comparing key and array length is still available.
697 __ b(ne, &slow); // Only support writing to writing to array[array.length]. 693 __ b(ne, &slow); // Only support writing to writing to array[array.length].
698 // Check for room in the elements backing store. 694 // Check for room in the elements backing store.
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 patcher.EmitCondition(ne); 856 patcher.EmitCondition(ne);
861 } else { 857 } else {
862 DCHECK(Assembler::GetCondition(branch_instr) == ne); 858 DCHECK(Assembler::GetCondition(branch_instr) == ne);
863 patcher.EmitCondition(eq); 859 patcher.EmitCondition(eq);
864 } 860 }
865 } 861 }
866 } // namespace internal 862 } // namespace internal
867 } // namespace v8 863 } // namespace v8
868 864
869 #endif // V8_TARGET_ARCH_ARM 865 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698