Revision: 11693
Author:   [email protected]
Date:     Fri Jun  1 02:12:01 2012
Log:      ClearNonLiveTransitions indepedent of ContentArray

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

Modified:
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Thu May 31 02:27:39 2012
+++ /branches/bleeding_edge/src/objects-inl.h   Fri Jun  1 02:12:01 2012
@@ -1941,6 +1941,12 @@
   ASSERT(descriptor_number < number_of_descriptors());
   return GetContentArray()->get(ToValueIndex(descriptor_number));
 }
+
+
+void DescriptorArray::SetNullValueUnchecked(int descriptor_number, Heap* heap) {
+  ASSERT(descriptor_number < number_of_descriptors());
+ GetContentArray()->set_null_unchecked(heap, ToValueIndex(descriptor_number));
+}


 PropertyDetails DescriptorArray::GetDetails(int descriptor_number) {
@@ -1948,6 +1954,12 @@
Object* details = GetContentArray()->get(ToDetailsIndex(descriptor_number));
   return PropertyDetails(Smi::cast(details));
 }
+
+
+void DescriptorArray::SetDetailsUnchecked(int descriptor_number, Smi* value) {
+  ASSERT(descriptor_number < number_of_descriptors());
+ GetContentArray()->set_unchecked(ToDetailsIndex(descriptor_number), value);
+}


 PropertyType DescriptorArray::GetType(int descriptor_number) {
=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu May 31 02:27:39 2012
+++ /branches/bleeding_edge/src/objects.cc      Fri Jun  1 02:12:01 2012
@@ -7440,23 +7440,20 @@
   if (d->IsEmpty()) return;
   Smi* NullDescriptorDetails =
     PropertyDetails(NONE, NULL_DESCRIPTOR).AsSmi();
-  FixedArray* contents = FixedArray::cast(
-      d->get(DescriptorArray::kContentArrayIndex));
-  ASSERT(contents->length() >= 2);
-  for (int i = 0; i < contents->length(); i += 2) {
+  for (int i = 0; i < d->number_of_descriptors(); ++i) {
// If the pair (value, details) is a map transition, check if the target is // live. If not, null the descriptor. Also drop the back pointer for that // map transition, so that this map is not reached again by following a back
     // pointer from that non-live map.
     bool keep_entry = false;
-    PropertyDetails details(Smi::cast(contents->get(i + 1)));
+    PropertyDetails details(d->GetDetails(i));
     switch (details.type()) {
       case MAP_TRANSITION:
       case CONSTANT_TRANSITION:
-        ClearBackPointer(heap, contents->get(i), &keep_entry);
+        ClearBackPointer(heap, d->GetValue(i), &keep_entry);
         break;
       case ELEMENTS_TRANSITION: {
-        Object* object = contents->get(i);
+        Object* object = d->GetValue(i);
         if (object->IsMap()) {
           ClearBackPointer(heap, object, &keep_entry);
         } else {
@@ -7470,7 +7467,7 @@
         break;
       }
       case CALLBACKS: {
-        Object* object = contents->get(i);
+        Object* object = d->GetValue(i);
         if (object->IsAccessorPair()) {
           AccessorPair* accessors = AccessorPair::cast(object);
           if (ClearBackPointer(heap, accessors->getter(), &keep_entry)) {
@@ -7497,8 +7494,8 @@
// What we *really* want to do here is removing this entry completely, but
     // for technical reasons we can't do this, so we zero it out instead.
     if (!keep_entry) {
-      contents->set_unchecked(i + 1, NullDescriptorDetails);
-      contents->set_null_unchecked(heap, i);
+      d->SetDetailsUnchecked(i, NullDescriptorDetails);
+      d->SetNullValueUnchecked(i, heap);
     }
   }
 }
=======================================
--- /branches/bleeding_edge/src/objects.h       Thu May 31 02:27:39 2012
+++ /branches/bleeding_edge/src/objects.h       Fri Jun  1 02:12:01 2012
@@ -2451,7 +2451,9 @@
   inline String* GetKey(int descriptor_number);
   inline Object* GetValue(int descriptor_number);
   inline Object** GetValueSlot(int descriptor_number);
+  inline void SetNullValueUnchecked(int descriptor_number, Heap* heap);
   inline PropertyDetails GetDetails(int descriptor_number);
+  inline void SetDetailsUnchecked(int descriptor_number, Smi* value);
   inline PropertyType GetType(int descriptor_number);
   inline int GetFieldIndex(int descriptor_number);
   inline JSFunction* GetConstantFunction(int descriptor_number);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to