Revision: 12285
Author:   [email protected]
Date:     Thu Aug  9 05:25:03 2012
Log:      Remove obsolete SLOT_ADDR macro usages.

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Mon Aug  6 06:23:52 2012
+++ /branches/bleeding_edge/src/mark-compact.cc Thu Aug  9 05:25:03 2012
@@ -1428,10 +1428,6 @@
                           reinterpret_cast<JSFunction*>(object),
                           false);
   }
-
-
-#define SLOT_ADDR(obj, offset) \
-  reinterpret_cast<Object**>((obj)->address() + offset)


   static inline void VisitJSFunctionFields(Map* map,
@@ -1469,26 +1465,28 @@
         heap,
         HeapObject::RawField(object,
                              JSFunction::kCodeEntryOffset + kPointerSize),
-        HeapObject::RawField(object,
-                             JSFunction::kNonWeakFieldsEndOffset));
+        HeapObject::RawField(object, JSFunction::kNonWeakFieldsEndOffset));
   }


   static void VisitSharedFunctionInfoFields(Heap* heap,
                                             HeapObject* object,
                                             bool flush_code_candidate) {
-    VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset));
+    VisitPointer(heap,
+ HeapObject::RawField(object, SharedFunctionInfo::kNameOffset));

     if (!flush_code_candidate) {
- VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset));
+      VisitPointer(heap,
+                   HeapObject::RawField(object,
+                                        SharedFunctionInfo::kCodeOffset));
     }

-    VisitPointers(heap,
-        SLOT_ADDR(object, SharedFunctionInfo::kOptimizedCodeMapOffset),
-        SLOT_ADDR(object, SharedFunctionInfo::kSize));
+    VisitPointers(
+        heap,
+        HeapObject::RawField(object,
+                             SharedFunctionInfo::kOptimizedCodeMapOffset),
+        HeapObject::RawField(object, SharedFunctionInfo::kSize));
   }
-
-  #undef SLOT_ADDR

   static VisitorDispatchTable<Callback> non_count_table_;
 };
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Mon Aug  6 07:25:19 2012
+++ /branches/bleeding_edge/src/objects-inl.h   Thu Aug  9 05:25:03 2012
@@ -5359,14 +5359,13 @@
       reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset)));
 }

-#define SLOT_ADDR(obj, offset) \
-  reinterpret_cast<Object**>((obj)->address() + offset)

 template<int start_offset, int end_offset, int size>
 void FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(
     HeapObject* obj,
     ObjectVisitor* v) {
- v->VisitPointers(SLOT_ADDR(obj, start_offset), SLOT_ADDR(obj, end_offset));
+    v->VisitPointers(HeapObject::RawField(obj, start_offset),
+                     HeapObject::RawField(obj, end_offset));
 }


@@ -5374,10 +5373,10 @@
 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj,
                                                        int object_size,
                                                        ObjectVisitor* v) {
- v->VisitPointers(SLOT_ADDR(obj, start_offset), SLOT_ADDR(obj, object_size));
+  v->VisitPointers(HeapObject::RawField(obj, start_offset),
+                   HeapObject::RawField(obj, object_size));
 }

-#undef SLOT_ADDR

 #undef TYPE_CHECKER
 #undef CAST_ACCESSOR
=======================================
--- /branches/bleeding_edge/src/objects.h       Mon Aug  6 07:25:19 2012
+++ /branches/bleeding_edge/src/objects.h       Thu Aug  9 05:25:03 2012
@@ -1254,9 +1254,6 @@
 };


-#define SLOT_ADDR(obj, offset) \
-  reinterpret_cast<Object**>((obj)->address() + offset)
-
 // This class describes a body of an object of a fixed size
// in which all pointer fields are located in the [start_offset, end_offset)
 // interval.
@@ -1271,8 +1268,8 @@

   template<typename StaticVisitor>
   static inline void IterateBody(HeapObject* obj) {
-    StaticVisitor::VisitPointers(SLOT_ADDR(obj, start_offset),
-                                 SLOT_ADDR(obj, end_offset));
+    StaticVisitor::VisitPointers(HeapObject::RawField(obj, start_offset),
+                                 HeapObject::RawField(obj, end_offset));
   }
 };

@@ -1291,13 +1288,11 @@

   template<typename StaticVisitor>
   static inline void IterateBody(HeapObject* obj, int object_size) {
-    StaticVisitor::VisitPointers(SLOT_ADDR(obj, start_offset),
-                                 SLOT_ADDR(obj, object_size));
+    StaticVisitor::VisitPointers(HeapObject::RawField(obj, start_offset),
+                                 HeapObject::RawField(obj, object_size));
   }
 };

-#undef SLOT_ADDR
-

 // The HeapNumber class describes heap allocated numbers that cannot be
 // represented in a Smi (small integer)

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

Reply via email to