OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3238 static const int kMaxPreAllocatedPropertyFields = 255; | 3238 static const int kMaxPreAllocatedPropertyFields = 255; |
3239 | 3239 |
3240 // Layout description. | 3240 // Layout description. |
3241 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; | 3241 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; |
3242 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; | 3242 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; |
3243 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; | 3243 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; |
3244 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; | 3244 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; |
3245 static const int kInstanceDescriptorsOffset = | 3245 static const int kInstanceDescriptorsOffset = |
3246 kConstructorOffset + kPointerSize; | 3246 kConstructorOffset + kPointerSize; |
3247 static const int kCodeCacheOffset = kInstanceDescriptorsOffset + kPointerSize; | 3247 static const int kCodeCacheOffset = kInstanceDescriptorsOffset + kPointerSize; |
3248 static const int kScavengerCallbackOffset = kCodeCacheOffset + kPointerSize; | 3248 static const int kPadStart = kCodeCacheOffset + kPointerSize; |
3249 static const int kPadStart = kScavengerCallbackOffset + kPointerSize; | |
3250 static const int kSize = MAP_POINTER_ALIGN(kPadStart); | 3249 static const int kSize = MAP_POINTER_ALIGN(kPadStart); |
3251 | 3250 |
3252 // Layout of pointer fields. Heap iteration code relies on them | 3251 // Layout of pointer fields. Heap iteration code relies on them |
3253 // being continiously allocated. | 3252 // being continiously allocated. |
3254 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; | 3253 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; |
3255 static const int kPointerFieldsEndOffset = | 3254 static const int kPointerFieldsEndOffset = |
3256 Map::kCodeCacheOffset + kPointerSize; | 3255 Map::kCodeCacheOffset + kPointerSize; |
3257 | 3256 |
3258 // Byte offsets within kInstanceSizesOffset. | 3257 // Byte offsets within kInstanceSizesOffset. |
3259 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; | 3258 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; |
3260 static const int kInObjectPropertiesByte = 1; | 3259 static const int kInObjectPropertiesByte = 1; |
3261 static const int kInObjectPropertiesOffset = | 3260 static const int kInObjectPropertiesOffset = |
3262 kInstanceSizesOffset + kInObjectPropertiesByte; | 3261 kInstanceSizesOffset + kInObjectPropertiesByte; |
3263 static const int kPreAllocatedPropertyFieldsByte = 2; | 3262 static const int kPreAllocatedPropertyFieldsByte = 2; |
3264 static const int kPreAllocatedPropertyFieldsOffset = | 3263 static const int kPreAllocatedPropertyFieldsOffset = |
3265 kInstanceSizesOffset + kPreAllocatedPropertyFieldsByte; | 3264 kInstanceSizesOffset + kPreAllocatedPropertyFieldsByte; |
3266 // The byte at position 3 is not in use at the moment. | 3265 static const int kVisitorIdByte = 3; |
3267 static const int kUnusedByte = 3; | 3266 static const int kVisitorIdOffset = kInstanceSizesOffset + kVisitorIdByte; |
3268 static const int kUnusedOffset = kInstanceSizesOffset + kUnusedByte; | |
3269 | 3267 |
3270 // Byte offsets within kInstanceAttributesOffset attributes. | 3268 // Byte offsets within kInstanceAttributesOffset attributes. |
3271 static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0; | 3269 static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0; |
3272 static const int kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 1; | 3270 static const int kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 1; |
3273 static const int kBitFieldOffset = kInstanceAttributesOffset + 2; | 3271 static const int kBitFieldOffset = kInstanceAttributesOffset + 2; |
3274 static const int kBitField2Offset = kInstanceAttributesOffset + 3; | 3272 static const int kBitField2Offset = kInstanceAttributesOffset + 3; |
3275 | 3273 |
3276 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset); | 3274 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset); |
3277 | 3275 |
3278 // Bit positions for bit field. | 3276 // Bit positions for bit field. |
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5563 } else { | 5561 } else { |
5564 value &= ~(1 << bit_position); | 5562 value &= ~(1 << bit_position); |
5565 } | 5563 } |
5566 return value; | 5564 return value; |
5567 } | 5565 } |
5568 }; | 5566 }; |
5569 | 5567 |
5570 } } // namespace v8::internal | 5568 } } // namespace v8::internal |
5571 | 5569 |
5572 #endif // V8_OBJECTS_H_ | 5570 #endif // V8_OBJECTS_H_ |
OLD | NEW |