X87: Megamorphic KeyedLoadIC needs special handling for vector ics

port 16843e239d (r26381)

original commit message:

  Megamorphic KeyedLoadIC needs special handling for vector ics.

  When --vector-ics is true, we still tail-call to the hand-written
  megamorphic KeyedLoadIC (formerly "generic"). Now that this code uses
  the megamorphic cache, it needs to deal properly with the vector and
  slot registers. Achieve this with a sentinel vectors/slot combo.

BUG=
R=weiliang.lin@intel.com

Review URL: https://codereview.chromium.org/910623002

Cr-Commit-Position: refs/heads/master@{#26508}
This commit is contained in:
cdai2 2015-02-09 14:33:40 +08:00
parent 13d6a96a8f
commit b2e15510a8

View File

@ -399,10 +399,27 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
Immediate(isolate->factory()->hash_table_map())); Immediate(isolate->factory()->hash_table_map()));
__ j(equal, &probe_dictionary); __ j(equal, &probe_dictionary);
if (FLAG_vector_ics) {
// When vector ics are in use, the handlers in the stub cache expect a
// vector and slot. Since we won't change the IC from any downstream
// misses, a dummy vector can be used.
Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast(
isolate->factory()->keyed_load_dummy_vector());
int slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0));
__ push(Immediate(Smi::FromInt(slot)));
__ push(Immediate(dummy_vector));
}
Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
Code::ComputeHandlerFlags(Code::LOAD_IC)); Code::ComputeHandlerFlags(Code::LOAD_IC));
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags,
masm, Code::LOAD_IC, flags, false, receiver, key, ebx, no_reg); false, receiver, key, ebx, edi);
if (FLAG_vector_ics) {
__ pop(VectorLoadICDescriptor::VectorRegister());
__ pop(VectorLoadICDescriptor::SlotRegister());
}
// Cache miss. // Cache miss.
GenerateMiss(masm); GenerateMiss(masm);