Follow-on to hydrogen fix keyed loads with string keys for vector ics.
authormvstanton <mvstanton@chromium.org>
Fri, 19 Dec 2014 13:40:59 +0000 (05:40 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 19 Dec 2014 13:41:07 +0000 (13:41 +0000)
r25817 optimized hydrogen keyed loads with string keys.
(https://codereview.chromium.org/755513003).
This CL adapts that work for the vector-ic keyed load.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#25903}

src/type-info.cc
src/type-info.h
src/typing.cc

index a18c65b12a76b680fdb86bf0b4f3f796b9e2aae6..611373f86547dbcdbc7a6dea9fd12b1baae4fb8d 100644 (file)
@@ -342,11 +342,13 @@ void TypeFeedbackOracle::PropertyReceiverTypes(FeedbackVectorICSlot slot,
 
 
 void TypeFeedbackOracle::KeyedPropertyReceiverTypes(
-    FeedbackVectorICSlot slot, SmallMapList* receiver_types, bool* is_string) {
+    FeedbackVectorICSlot slot, SmallMapList* receiver_types, bool* is_string,
+    IcCheckType* key_type) {
   receiver_types->Clear();
   KeyedLoadICNexus nexus(feedback_vector_, slot);
   CollectReceiverTypes<FeedbackNexus>(&nexus, receiver_types);
   *is_string = HasOnlyStringMaps(receiver_types);
+  *key_type = nexus.FindFirstName() != NULL ? PROPERTY : ELEMENT;
 }
 
 
index 9753ff06d9a519c44e912cb116864d92a5f40e6b..60f156f5f3da7dc980c28c7fd8dad3c4b6212c15 100644 (file)
@@ -51,8 +51,8 @@ class TypeFeedbackOracle: public ZoneObject {
                                   bool* is_string,
                                   IcCheckType* key_type);
   void KeyedPropertyReceiverTypes(FeedbackVectorICSlot slot,
-                                  SmallMapList* receiver_types,
-                                  bool* is_string);
+                                  SmallMapList* receiver_types, bool* is_string,
+                                  IcCheckType* key_type);
   void AssignmentReceiverTypes(TypeFeedbackId id,
                                Handle<String> name,
                                SmallMapList* receiver_types);
index 88c530eeee7bca2a38d78c187b8384fb1f5ed5f9..17deb6db42d1ca085cf121cca55c0e6e0e257996 100644 (file)
@@ -510,8 +510,7 @@ void AstTyper::VisitProperty(Property* expr) {
       IcCheckType key_type;
       if (FLAG_vector_ics) {
         oracle()->KeyedPropertyReceiverTypes(slot, expr->GetReceiverTypes(),
-                                             &is_string);
-        key_type = ELEMENT;
+                                             &is_string, &key_type);
       } else {
         oracle()->KeyedPropertyReceiverTypes(id, expr->GetReceiverTypes(),
                                              &is_string, &key_type);