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

Side by Side Diff: src/ic/mips64/ic-mips64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 Register vector = LoadWithVectorDescriptor::VectorRegister(); 411 Register vector = LoadWithVectorDescriptor::VectorRegister();
412 Register slot = LoadWithVectorDescriptor::SlotRegister(); 412 Register slot = LoadWithVectorDescriptor::SlotRegister();
413 DCHECK(!AreAliased(vector, slot, a4, a5, a6, t1)); 413 DCHECK(!AreAliased(vector, slot, a4, a5, a6, t1));
414 Handle<TypeFeedbackVector> dummy_vector = 414 Handle<TypeFeedbackVector> dummy_vector =
415 TypeFeedbackVector::DummyVector(masm->isolate()); 415 TypeFeedbackVector::DummyVector(masm->isolate());
416 int slot_index = dummy_vector->GetIndex( 416 int slot_index = dummy_vector->GetIndex(
417 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); 417 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
418 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); 418 __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
419 __ li(slot, Operand(Smi::FromInt(slot_index))); 419 __ li(slot, Operand(Smi::FromInt(slot_index)));
420 420
421 Code::Flags flags = 421 masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, key, a4, a5,
422 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); 422 a6, t1);
423 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags,
424 receiver, key, a4, a5, a6, t1);
425 // Cache miss. 423 // Cache miss.
426 GenerateMiss(masm); 424 GenerateMiss(masm);
427 425
428 // Do a quick inline probe of the receiver's dictionary, if it 426 // Do a quick inline probe of the receiver's dictionary, if it
429 // exists. 427 // exists.
430 __ bind(&probe_dictionary); 428 __ bind(&probe_dictionary);
431 // a3: elements 429 // a3: elements
432 __ ld(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); 430 __ ld(a0, FieldMemOperand(receiver, HeapObject::kMapOffset));
433 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); 431 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset));
434 GenerateGlobalInstanceTypeCheck(masm, a0, &slow); 432 GenerateGlobalInstanceTypeCheck(masm, a0, &slow);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 Register slot = VectorStoreICDescriptor::SlotRegister(); 657 Register slot = VectorStoreICDescriptor::SlotRegister();
660 658
661 DCHECK(!AreAliased(vector, slot, a5, a6, a7, t0)); 659 DCHECK(!AreAliased(vector, slot, a5, a6, a7, t0));
662 Handle<TypeFeedbackVector> dummy_vector = 660 Handle<TypeFeedbackVector> dummy_vector =
663 TypeFeedbackVector::DummyVector(masm->isolate()); 661 TypeFeedbackVector::DummyVector(masm->isolate());
664 int slot_index = dummy_vector->GetIndex( 662 int slot_index = dummy_vector->GetIndex(
665 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); 663 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot));
666 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); 664 __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
667 __ li(slot, Operand(Smi::FromInt(slot_index))); 665 __ li(slot, Operand(Smi::FromInt(slot_index)));
668 666
669 Code::Flags flags = 667 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, a5,
670 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); 668 a6, a7, t0);
671 masm->isolate()->stub_cache()->GenerateProbe(
672 masm, Code::KEYED_STORE_IC, flags, receiver, key, a5, a6, a7, t0);
673 // Cache miss. 669 // Cache miss.
674 __ Branch(&miss); 670 __ Branch(&miss);
675 671
676 // Extra capacity case: Check if there is extra capacity to 672 // Extra capacity case: Check if there is extra capacity to
677 // perform the store and update the length. Used for adding one 673 // perform the store and update the length. Used for adding one
678 // element to the array by writing to array[array.length]. 674 // element to the array by writing to array[array.length].
679 __ bind(&extra); 675 __ bind(&extra);
680 // Condition code from comparing key and array length is still available. 676 // Condition code from comparing key and array length is still available.
681 // Only support writing to array[array.length]. 677 // Only support writing to array[array.length].
682 __ Branch(&slow, ne, key, Operand(a4)); 678 __ Branch(&slow, ne, key, Operand(a4));
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 break; 881 break;
886 default: 882 default:
887 UNIMPLEMENTED(); 883 UNIMPLEMENTED();
888 } 884 }
889 patcher.ChangeBranchCondition(branch_instr, opcode); 885 patcher.ChangeBranchCondition(branch_instr, opcode);
890 } 886 }
891 } // namespace internal 887 } // namespace internal
892 } // namespace v8 888 } // namespace v8
893 889
894 #endif // V8_TARGET_ARCH_MIPS64 890 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698