Revision: 15606
Author:   [email protected]
Date:     Wed Jul 10 09:06:30 2013
Log: Flag rewriting an IC while writing to a global constant property as a failure caused by the constant property turning mutable.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/19006002
http://code.google.com/p/v8/source/detail?r=15606

Modified:
 /branches/bleeding_edge/src/ic.cc

=======================================
--- /branches/bleeding_edge/src/ic.cc   Wed Jul 10 09:00:48 2013
+++ /branches/bleeding_edge/src/ic.cc   Wed Jul 10 09:06:30 2013
@@ -190,6 +190,17 @@
     Name* stub_name = target->FindFirstName();
     if (Name::cast(name) != stub_name) return false;
   }
+
+  if (receiver->IsGlobalObject()) {
+    if (!name->IsName()) return false;
+    Isolate* isolate = target->GetIsolate();
+    LookupResult lookup(isolate);
+    GlobalObject* global = GlobalObject::cast(receiver);
+    global->LocalLookupRealNamedProperty(Name::cast(name), &lookup);
+    if (!lookup.IsFound()) return false;
+    PropertyCell* cell = global->GetPropertyCell(&lookup);
+    return cell->type()->IsConstant();
+  }

   InlineCacheHolderFlag cache_holder =
       Code::ExtractCacheHolderFromFlags(target->flags());

--
--
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/groups/opt_out.


Reply via email to