Revision: 22485
Author:   [email protected]
Date:     Sat Jul 19 12:00:20 2014 UTC
Log:      Migrate to current map if deprecated in SetProperty

BUG=
[email protected]

Review URL: https://codereview.chromium.org/404963002
http://code.google.com/p/v8/source/detail?r=22485

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

=======================================
--- /branches/bleeding_edge/src/objects.cc      Fri Jul 18 13:50:21 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Sat Jul 19 12:00:20 2014 UTC
@@ -7324,6 +7324,13 @@
                                         Handle<Object> value) {
   // Dictionaries can store any property value.
   if (map->is_dictionary_map()) return map;
+
+  // Migrate to the newest map before storing the property.
+  if (map->is_deprecated()) {
+    map = GeneralizeRepresentation(map, 0, Representation::None(),
+                                   HeapType::None(map->GetIsolate()),
+                                   ALLOW_AS_CONSTANT);
+  }

   Handle<DescriptorArray> descriptors(map->instance_descriptors());

@@ -7342,10 +7349,15 @@
                                           Handle<Object> value,
                                           PropertyAttributes attributes,
                                           StoreFromKeyed store_mode) {
-  // Cannot currently handle deprecated maps.
-  ASSERT(!map->is_deprecated());
   // Dictionary maps can always have additional data properties.
   if (map->is_dictionary_map()) return map;
+
+  // Migrate to the newest map before transitioning to the new property.
+  if (map->is_deprecated()) {
+    map = GeneralizeRepresentation(map, 0, Representation::None(),
+                                   HeapType::None(map->GetIsolate()),
+                                   ALLOW_AS_CONSTANT);
+  }

   int index = map->SearchTransition(*name);
   if (index != TransitionArray::kNotFound) {

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