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

Unified Diff: src/ic/x87/ic-x87.cc

Issue 642843004: X87: Add MEGAMORPHIC state support for KeyedStoreIC (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/x87/ic-x87.cc
diff --git a/src/ic/x87/ic-x87.cc b/src/ic/x87/ic-x87.cc
index 9c090c56a536a4f6488353b64dc2bab6a009f4ca..05d240968652c9d277aa1c932d5dcd9eca79e49e 100644
--- a/src/ic/x87/ic-x87.cc
+++ b/src/ic/x87/ic-x87.cc
@@ -674,12 +674,13 @@ static void KeyedStoreGenerateGenericHelper(
}
-void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
- StrictMode strict_mode) {
+void KeyedStoreIC::GenerateGeneric(
+ MacroAssembler* masm, StrictMode strict_mode,
+ KeyedStoreStubCacheRequirement handler_requirement) {
// Return address is on the stack.
Label slow, fast_object, fast_object_grow;
Label fast_double, fast_double_grow;
- Label array, extra, check_if_double_array;
+ Label array, extra, check_if_double_array, maybe_name_key, miss;
Register receiver = StoreDescriptor::ReceiverRegister();
Register key = StoreDescriptor::NameRegister();
DCHECK(receiver.is(edx));
@@ -695,7 +696,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
1 << Map::kIsAccessCheckNeeded | 1 << Map::kIsObserved);
__ j(not_zero, &slow);
// Check that the key is a smi.
- __ JumpIfNotSmi(key, &slow);
+ __ JumpIfNotSmi(key, &maybe_name_key);
__ CmpInstanceType(edi, JS_ARRAY_TYPE);
__ j(equal, &array);
// Check that the object is some kind of JSObject.
@@ -713,6 +714,23 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
// Slow case: call runtime.
__ bind(&slow);
PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
+ // Never returns to here.
+
+ __ bind(&maybe_name_key);
+ __ mov(ebx, FieldOperand(key, HeapObject::kMapOffset));
+ __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset));
+ __ JumpIfNotUniqueNameInstanceType(ebx, &slow);
+ Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
+ Code::ComputeHandlerFlags(Code::STORE_IC));
+ masm->isolate()->stub_cache()->GenerateProbe(masm, flags, false, receiver,
+ key, ebx, no_reg);
+ // Cache miss.
+ if (handler_requirement == kCallRuntimeOnMissingHandler) {
+ __ jmp(&slow);
+ } else {
+ DCHECK(handler_requirement == kMissOnMissingHandler);
+ __ jmp(&miss);
+ }
// Extra capacity case: Check if there is extra capacity to
// perform the store and update the length. Used for adding one
@@ -755,6 +773,11 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
kCheckMap, kDontIncrementLength);
KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow,
&slow, kDontCheckMap, kIncrementLength);
+
+ if (handler_requirement == kMissOnMissingHandler) {
+ __ bind(&miss);
+ GenerateMiss(masm);
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698