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

Side by Side Diff: src/ic/x87/ic-x87.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_X87 5 #if V8_TARGET_ARCH_X87
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 // The handlers in the stub cache expect a vector and slot. Since we won't 330 // The handlers in the stub cache expect a vector and slot. Since we won't
331 // change the IC from any downstream misses, a dummy vector can be used. 331 // change the IC from any downstream misses, a dummy vector can be used.
332 Handle<TypeFeedbackVector> dummy_vector = 332 Handle<TypeFeedbackVector> dummy_vector =
333 TypeFeedbackVector::DummyVector(isolate); 333 TypeFeedbackVector::DummyVector(isolate);
334 int slot = dummy_vector->GetIndex( 334 int slot = dummy_vector->GetIndex(
335 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); 335 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
336 __ push(Immediate(Smi::FromInt(slot))); 336 __ push(Immediate(Smi::FromInt(slot)));
337 __ push(Immediate(dummy_vector)); 337 __ push(Immediate(dummy_vector));
338 338
339 Code::Flags flags = 339 masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, key, ebx,
340 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); 340 edi);
341 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags,
342 receiver, key, ebx, edi);
343 341
344 __ pop(LoadWithVectorDescriptor::VectorRegister()); 342 __ pop(LoadWithVectorDescriptor::VectorRegister());
345 __ pop(LoadDescriptor::SlotRegister()); 343 __ pop(LoadDescriptor::SlotRegister());
346 344
347 // Cache miss. 345 // Cache miss.
348 GenerateMiss(masm); 346 GenerateMiss(masm);
349 347
350 // Do a quick inline probe of the receiver's dictionary, if it 348 // Do a quick inline probe of the receiver's dictionary, if it
351 // exists. 349 // exists.
352 __ bind(&probe_dictionary); 350 __ bind(&probe_dictionary);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 554
557 // The handlers in the stub cache expect a vector and slot. Since we won't 555 // The handlers in the stub cache expect a vector and slot. Since we won't
558 // change the IC from any downstream misses, a dummy vector can be used. 556 // change the IC from any downstream misses, a dummy vector can be used.
559 Handle<TypeFeedbackVector> dummy_vector = 557 Handle<TypeFeedbackVector> dummy_vector =
560 TypeFeedbackVector::DummyVector(masm->isolate()); 558 TypeFeedbackVector::DummyVector(masm->isolate());
561 int slot = dummy_vector->GetIndex( 559 int slot = dummy_vector->GetIndex(
562 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); 560 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot));
563 __ push(Immediate(Smi::FromInt(slot))); 561 __ push(Immediate(Smi::FromInt(slot)));
564 __ push(Immediate(dummy_vector)); 562 __ push(Immediate(dummy_vector));
565 563
566 Code::Flags flags = 564 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, edi,
567 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); 565 no_reg);
568 masm->isolate()->stub_cache()->GenerateProbe(
569 masm, Code::KEYED_STORE_IC, flags, receiver, key, edi, no_reg);
570 566
571 __ pop(VectorStoreICDescriptor::VectorRegister()); 567 __ pop(VectorStoreICDescriptor::VectorRegister());
572 __ pop(VectorStoreICDescriptor::SlotRegister()); 568 __ pop(VectorStoreICDescriptor::SlotRegister());
573 569
574 // Cache miss. 570 // Cache miss.
575 __ jmp(&miss); 571 __ jmp(&miss);
576 572
577 // Extra capacity case: Check if there is extra capacity to 573 // Extra capacity case: Check if there is extra capacity to
578 // perform the store and update the length. Used for adding one 574 // perform the store and update the length. Used for adding one
579 // element to the array by writing to array[array.length]. 575 // element to the array by writing to array[array.length].
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 Condition cc = 840 Condition cc =
845 (check == ENABLE_INLINED_SMI_CHECK) 841 (check == ENABLE_INLINED_SMI_CHECK)
846 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 842 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
847 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 843 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
848 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 844 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
849 } 845 }
850 } // namespace internal 846 } // namespace internal
851 } // namespace v8 847 } // namespace v8
852 848
853 #endif // V8_TARGET_ARCH_X87 849 #endif // V8_TARGET_ARCH_X87
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698