Reviewers: Mads Ager,

Description:
- Rearrange fields in SharedFunctionInfo.


Please review this at http://codereview.chromium.org/669051

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/objects.h
  M     src/objects.cc


Index: src/objects.cc
===================================================================
--- src/objects.cc      (revision 4013)
+++ src/objects.cc      (working copy)
@@ -4958,11 +4958,7 @@


 void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) {
-  IteratePointers(v, kNameOffset, kConstructStubOffset + kPointerSize);
- IteratePointers(v, kInstanceClassNameOffset, kScriptOffset + kPointerSize);
-  IteratePointers(v, kDebugInfoOffset, kInferredNameOffset + kPointerSize);
-  IteratePointers(v, kThisPropertyAssignmentsOffset,
-      kThisPropertyAssignmentsOffset + kPointerSize);
+ IteratePointers(v, kNameOffset, kThisPropertyAssignmentsOffset + kPointerSize);
 }


Index: src/objects.h
===================================================================
--- src/objects.h       (revision 4013)
+++ src/objects.h       (working copy)
@@ -3280,39 +3280,35 @@
   static const int kDontAdaptArgumentsSentinel = -1;

   // Layout description.
- // (An even number of integers has a size that is a multiple of a pointer.)
+  // Pointer fields.
   static const int kNameOffset = HeapObject::kHeaderSize;
   static const int kCodeOffset = kNameOffset + kPointerSize;
   static const int kConstructStubOffset = kCodeOffset + kPointerSize;
-  static const int kLengthOffset = kConstructStubOffset + kPointerSize;
-  static const int kFormalParameterCountOffset = kLengthOffset + kIntSize;
-  static const int kExpectedNofPropertiesOffset =
-      kFormalParameterCountOffset + kIntSize;
-  static const int kStartPositionAndTypeOffset =
-      kExpectedNofPropertiesOffset + kIntSize;
- static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize; - static const int kFunctionTokenPositionOffset = kEndPositionOffset + kIntSize;
   static const int kInstanceClassNameOffset =
-      kFunctionTokenPositionOffset + kIntSize;
+      kConstructStubOffset + kPointerSize;
   static const int kExternalReferenceDataOffset =
       kInstanceClassNameOffset + kPointerSize;
static const int kScriptOffset = kExternalReferenceDataOffset + kPointerSize;
   static const int kDebugInfoOffset = kScriptOffset + kPointerSize;
   static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
- static const int kCompilerHintsOffset = kInferredNameOffset + kPointerSize;
   static const int kThisPropertyAssignmentsOffset =
-      kCompilerHintsOffset + kPointerSize;
+      kInferredNameOffset + kPointerSize;
+  // Integer fields.
+ static const int kLengthOffset = kThisPropertyAssignmentsOffset + kPointerSize;
+  static const int kFormalParameterCountOffset = kLengthOffset + kIntSize;
+  static const int kExpectedNofPropertiesOffset =
+      kFormalParameterCountOffset + kIntSize;
+  static const int kStartPositionAndTypeOffset =
+      kExpectedNofPropertiesOffset + kIntSize;
+ static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize; + static const int kFunctionTokenPositionOffset = kEndPositionOffset + kIntSize; + static const int kCompilerHintsOffset = kFunctionTokenPositionOffset + kIntSize;
   static const int kThisPropertyAssignmentsCountOffset =
-      kThisPropertyAssignmentsOffset + kPointerSize;
- static const int kSize = kThisPropertyAssignmentsCountOffset + kPointerSize;
+      kCompilerHintsOffset + kIntSize;
+  // Total size.
+  static const int kSize = kThisPropertyAssignmentsCountOffset + kIntSize;

  private:
-  // Bit positions in length_and_flg.
-  // The least significant bit is used as the flag.
-  static const int kFlagBit         = 0;
-  static const int kLengthShift     = 1;
-  static const int kLengthMask      = ~((1 << kLengthShift) - 1);
-
   // Bit positions in start_position_and_type.
   // The source code start position is in the 30 most significant bits of
   // the start_position_and_type field.


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

Reply via email to