Commit 7e163d25 authored by iposva@chromium.org's avatar iposva@chromium.org

- Rearrange fields in SharedFunctionInfo.

Review URL: http://codereview.chromium.org/669051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4014 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f4190f98
...@@ -4958,11 +4958,9 @@ void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator, ...@@ -4958,11 +4958,9 @@ void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator,
void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) { void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) {
IteratePointers(v, kNameOffset, kConstructStubOffset + kPointerSize); IteratePointers(v,
IteratePointers(v, kInstanceClassNameOffset, kScriptOffset + kPointerSize); kNameOffset,
IteratePointers(v, kDebugInfoOffset, kInferredNameOffset + kPointerSize); kThisPropertyAssignmentsOffset + kPointerSize);
IteratePointers(v, kThisPropertyAssignmentsOffset,
kThisPropertyAssignmentsOffset + kPointerSize);
} }
......
...@@ -3280,11 +3280,22 @@ class SharedFunctionInfo: public HeapObject { ...@@ -3280,11 +3280,22 @@ class SharedFunctionInfo: public HeapObject {
static const int kDontAdaptArgumentsSentinel = -1; static const int kDontAdaptArgumentsSentinel = -1;
// Layout description. // 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 kNameOffset = HeapObject::kHeaderSize;
static const int kCodeOffset = kNameOffset + kPointerSize; static const int kCodeOffset = kNameOffset + kPointerSize;
static const int kConstructStubOffset = kCodeOffset + kPointerSize; static const int kConstructStubOffset = kCodeOffset + kPointerSize;
static const int kLengthOffset = kConstructStubOffset + kPointerSize; static const int kInstanceClassNameOffset =
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 kThisPropertyAssignmentsOffset =
kInferredNameOffset + kPointerSize;
// Integer fields.
static const int kLengthOffset =
kThisPropertyAssignmentsOffset + kPointerSize;
static const int kFormalParameterCountOffset = kLengthOffset + kIntSize; static const int kFormalParameterCountOffset = kLengthOffset + kIntSize;
static const int kExpectedNofPropertiesOffset = static const int kExpectedNofPropertiesOffset =
kFormalParameterCountOffset + kIntSize; kFormalParameterCountOffset + kIntSize;
...@@ -3292,27 +3303,14 @@ class SharedFunctionInfo: public HeapObject { ...@@ -3292,27 +3303,14 @@ class SharedFunctionInfo: public HeapObject {
kExpectedNofPropertiesOffset + kIntSize; kExpectedNofPropertiesOffset + kIntSize;
static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize; static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize;
static const int kFunctionTokenPositionOffset = kEndPositionOffset + kIntSize; static const int kFunctionTokenPositionOffset = kEndPositionOffset + kIntSize;
static const int kInstanceClassNameOffset = static const int kCompilerHintsOffset =
kFunctionTokenPositionOffset + kIntSize; kFunctionTokenPositionOffset + kIntSize;
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;
static const int kThisPropertyAssignmentsCountOffset = static const int kThisPropertyAssignmentsCountOffset =
kThisPropertyAssignmentsOffset + kPointerSize; kCompilerHintsOffset + kIntSize;
static const int kSize = kThisPropertyAssignmentsCountOffset + kPointerSize; // Total size.
static const int kSize = kThisPropertyAssignmentsCountOffset + kIntSize;
private: 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. // Bit positions in start_position_and_type.
// The source code start position is in the 30 most significant bits of // The source code start position is in the 30 most significant bits of
// the start_position_and_type field. // the start_position_and_type field.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment