X87: Add MEGAMORPHIC state support for KeyedStoreIC
port r24500. original commit message: Add MEGAMORPHIC state support for KeyedStoreIC BUG= R=weiliang.lin@intel.com Review URL: https://codereview.chromium.org/642843004 Patch from Chunyang Dai <chunyang.dai@intel.com>. git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
980cc41238
commit
e0e844b490
@ -674,12 +674,13 @@ static void KeyedStoreGenerateGenericHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
|
void KeyedStoreIC::GenerateGeneric(
|
||||||
StrictMode strict_mode) {
|
MacroAssembler* masm, StrictMode strict_mode,
|
||||||
|
KeyedStoreStubCacheRequirement handler_requirement) {
|
||||||
// Return address is on the stack.
|
// Return address is on the stack.
|
||||||
Label slow, fast_object, fast_object_grow;
|
Label slow, fast_object, fast_object_grow;
|
||||||
Label fast_double, fast_double_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 receiver = StoreDescriptor::ReceiverRegister();
|
||||||
Register key = StoreDescriptor::NameRegister();
|
Register key = StoreDescriptor::NameRegister();
|
||||||
DCHECK(receiver.is(edx));
|
DCHECK(receiver.is(edx));
|
||||||
@ -695,7 +696,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
|
|||||||
1 << Map::kIsAccessCheckNeeded | 1 << Map::kIsObserved);
|
1 << Map::kIsAccessCheckNeeded | 1 << Map::kIsObserved);
|
||||||
__ j(not_zero, &slow);
|
__ j(not_zero, &slow);
|
||||||
// Check that the key is a smi.
|
// Check that the key is a smi.
|
||||||
__ JumpIfNotSmi(key, &slow);
|
__ JumpIfNotSmi(key, &maybe_name_key);
|
||||||
__ CmpInstanceType(edi, JS_ARRAY_TYPE);
|
__ CmpInstanceType(edi, JS_ARRAY_TYPE);
|
||||||
__ j(equal, &array);
|
__ j(equal, &array);
|
||||||
// Check that the object is some kind of JSObject.
|
// Check that the object is some kind of JSObject.
|
||||||
@ -713,6 +714,23 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
|
|||||||
// Slow case: call runtime.
|
// Slow case: call runtime.
|
||||||
__ bind(&slow);
|
__ bind(&slow);
|
||||||
PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
|
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
|
// Extra capacity case: Check if there is extra capacity to
|
||||||
// perform the store and update the length. Used for adding one
|
// perform the store and update the length. Used for adding one
|
||||||
@ -755,6 +773,11 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
|
|||||||
kCheckMap, kDontIncrementLength);
|
kCheckMap, kDontIncrementLength);
|
||||||
KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow,
|
KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow,
|
||||||
&slow, kDontCheckMap, kIncrementLength);
|
&slow, kDontCheckMap, kIncrementLength);
|
||||||
|
|
||||||
|
if (handler_requirement == kMissOnMissingHandler) {
|
||||||
|
__ bind(&miss);
|
||||||
|
GenerateMiss(masm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user