Reviewers: Weiliang,

Message:
PTAL.

thanks

Description:
X87: Megamorphic KeyedLoadIC needs special handling for vector ics

port 16843e239d95f5e8eaaa06d2a0a6e371298fe11f (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=

Please review this at https://codereview.chromium.org/910623002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+19, -2 lines):
  M src/ic/x87/ic-x87.cc


Index: src/ic/x87/ic-x87.cc
diff --git a/src/ic/x87/ic-x87.cc b/src/ic/x87/ic-x87.cc
index 77c9c916daaaafb9c2d11c7f8d63bb8e48f56675..67cc7142e8bf57ad4f647131f10e2ef9cd39acdc 100644
--- a/src/ic/x87/ic-x87.cc
+++ b/src/ic/x87/ic-x87.cc
@@ -399,10 +399,27 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
          Immediate(isolate->factory()->hash_table_map()));
   __ 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::ComputeHandlerFlags(Code::LOAD_IC));
-  masm->isolate()->stub_cache()->GenerateProbe(
-      masm, Code::LOAD_IC, flags, false, receiver, key, ebx, no_reg);
+ masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, + false, receiver, key, ebx, edi);
+
+  if (FLAG_vector_ics) {
+    __ pop(VectorLoadICDescriptor::VectorRegister());
+    __ pop(VectorLoadICDescriptor::SlotRegister());
+  }
+
   // Cache miss.
   GenerateMiss(masm);



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to