Reviewers: danno,

Message:
What could possibly go wrong? :-)

Description:
Use hydrogenized KeyedLoadGeneric stub for generic named loads too (with
--compiled-keyed-generic-loads).

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

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+13, -1 lines):
  M src/ic.h
  M src/ic.cc


Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 39b94162285291ebafd899f5fc2446127e404a42..e6c831c4178749aa2250a5230c2d27b162350197 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -598,9 +598,11 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) {
       } else if (state() == PREMONOMORPHIC) {
         FunctionPrototypeStub function_prototype_stub(isolate(), kind());
         stub = function_prototype_stub.GetCode();
-      } else if (state() != MEGAMORPHIC) {
+ } else if (!FLAG_compiled_keyed_generic_loads && state() != MEGAMORPHIC) {
         ASSERT(state() != GENERIC);
         stub = megamorphic_stub();
+      } else if (FLAG_compiled_keyed_generic_loads && state() != GENERIC) {
+        stub = generic_stub();
       }
       if (!stub.is_null()) {
         set_target(*stub);
@@ -821,6 +823,10 @@ void IC::PatchCache(Handle<HeapType> type,
         if (UpdatePolymorphicIC(type, name, code)) break;
         CopyICToMegamorphicCache(name);
       }
+      if (FLAG_compiled_keyed_generic_loads && (kind() == Code::LOAD_IC)) {
+        set_target(*generic_stub());
+        break;
+      }
       set_target(*megamorphic_stub());
       // Fall through.
     case MEGAMORPHIC:
@@ -852,6 +858,11 @@ Handle<Code> LoadIC::megamorphic_stub() {
 }


+Handle<Code> LoadIC::generic_stub() const {
+  return KeyedLoadGenericElementStub(isolate()).GetCode();
+}
+
+
 Handle<Code> LoadIC::SimpleFieldLoad(FieldIndex index) {
   if (kind() == Code::LOAD_IC) {
     LoadFieldStub stub(isolate(), index);
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index 19146acc7ca5217076ed9d9620dbaf53749420a2..38515b39bfc9a71c193364eb99f3fe11139c85b6 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -467,6 +467,7 @@ class LoadIC: public IC {
   }

   virtual Handle<Code> megamorphic_stub();
+  virtual Handle<Code> generic_stub() const;

   // Update the inline cache and the global stub cache based on the
   // lookup result.


--
--
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