Revision: 14735
Author:   [email protected]
Date:     Tue May 21 10:21:27 2013
Log:      Don't track representations in context extensions.
This also enables verification of representations.

BUG=
[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/objects-debug.cc        Wed May  8 01:08:23 2013
+++ /branches/bleeding_edge/src/objects-debug.cc        Tue May 21 10:21:27 2013
@@ -306,6 +306,17 @@
     CHECK_EQ(map()->unused_property_fields(),
              (map()->inobject_properties() + properties()->length() -
               map()->NextFreePropertyIndex()));
+    DescriptorArray* descriptors = map()->instance_descriptors();
+    for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
+      if (descriptors->GetDetails(i).type() == FIELD) {
+        Representation r = descriptors->GetDetails(i).representation();
+        int field = descriptors->GetFieldIndex(i);
+        Object* value = RawFastPropertyAt(field);
+        if (r.IsSmi()) ASSERT(value->IsSmi());
+        if (r.IsDouble()) ASSERT(value->IsHeapNumber());
+        if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
+      }
+    }
   }
   CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
              (elements() == GetHeap()->empty_fixed_array())),
=======================================
--- /branches/bleeding_edge/src/objects.cc      Tue May 21 04:20:24 2013
+++ /branches/bleeding_edge/src/objects.cc      Tue May 21 10:21:27 2013
@@ -1801,7 +1801,9 @@
   int index = map()->NextFreePropertyIndex();

   // Allocate new instance descriptors with (name, index) added
-  Representation representation = value->OptimalRepresentation();
+  Representation representation = IsJSContextExtensionObject()
+      ? Representation::Tagged() : value->OptimalRepresentation();
+
   FieldDescriptor new_field(name, index, attributes, representation);

   ASSERT(index < map()->inobject_properties() ||
@@ -2105,7 +2107,8 @@
     return ReplaceSlowProperty(name, new_value, attributes);
   }

-  Representation representation = new_value->OptimalRepresentation();
+  Representation representation = IsJSContextExtensionObject()
+      ? Representation::Tagged() : new_value->OptimalRepresentation();
   int index = map()->NextFreePropertyIndex();
   FieldDescriptor new_field(name, index, attributes, representation);

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