OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_SERIALIZE_H_ | 5 #ifndef V8_SERIALIZE_H_ |
6 #define V8_SERIALIZE_H_ | 6 #define V8_SERIALIZE_H_ |
7 | 7 |
8 #include "src/hashmap.h" | 8 #include "src/hashmap.h" |
9 #include "src/heap-profiler.h" | 9 #include "src/heap-profiler.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 static int nop() { return kNop; } | 299 static int nop() { return kNop; } |
300 | 300 |
301 // No reservation for large object space necessary. | 301 // No reservation for large object space necessary. |
302 static const int kNumberOfPreallocatedSpaces = LO_SPACE; | 302 static const int kNumberOfPreallocatedSpaces = LO_SPACE; |
303 static const int kNumberOfSpaces = LAST_SPACE + 1; | 303 static const int kNumberOfSpaces = LAST_SPACE + 1; |
304 | 304 |
305 protected: | 305 protected: |
306 // Where the pointed-to object can be found: | 306 // Where the pointed-to object can be found: |
307 enum Where { | 307 enum Where { |
308 kNewObject = 0, // Object is next in snapshot. | 308 kNewObject = 0, // Object is next in snapshot. |
309 // 1-7 One per space. | 309 // 1-6 One per space. |
310 // 0x8 Unused. | 310 // 0x7, 0x8 Unused. |
311 kRootArray = 0x9, // Object is found in root array. | 311 kRootArray = 0x9, // Object is found in root array. |
312 kPartialSnapshotCache = 0xa, // Object is in the cache. | 312 kPartialSnapshotCache = 0xa, // Object is in the cache. |
313 kExternalReference = 0xb, // Pointer to an external reference. | 313 kExternalReference = 0xb, // Pointer to an external reference. |
314 kSkip = 0xc, // Skip n bytes. | 314 kSkip = 0xc, // Skip n bytes. |
315 kBuiltin = 0xd, // Builtin code object. | 315 kBuiltin = 0xd, // Builtin code object. |
316 kAttachedReference = 0xe, // Object is described in an attached list. | 316 kAttachedReference = 0xe, // Object is described in an attached list. |
317 // 0xf Used by misc. See below. | 317 // 0xf Used by misc. See below. |
318 kBackref = 0x10, // Object is described relative to end. | 318 kBackref = 0x10, // Object is described relative to end. |
319 // 0x11-0x17 One per space. | 319 // 0x11-0x16 One per space. |
| 320 // 0x17 Unused. |
320 kBackrefWithSkip = 0x18, // Object is described relative to end. | 321 kBackrefWithSkip = 0x18, // Object is described relative to end. |
321 // 0x19-0x1f One per space. | 322 // 0x19-0x1e One per space. |
| 323 // 0x1f Unused. |
322 // 0x20-0x3f Used by misc. See below. | 324 // 0x20-0x3f Used by misc. See below. |
323 kPointedToMask = 0x3f | 325 kPointedToMask = 0x3f |
324 }; | 326 }; |
325 | 327 |
326 // How to code the pointer to the object. | 328 // How to code the pointer to the object. |
327 enum HowToCode { | 329 enum HowToCode { |
328 kPlain = 0, // Straight pointer. | 330 kPlain = 0, // Straight pointer. |
329 // What this means depends on the architecture: | 331 // What this means depends on the architecture: |
330 kFromCode = 0x40, // A pointer inlined in code. | 332 kFromCode = 0x40, // A pointer inlined in code. |
331 kHowToCodeMask = 0x40 | 333 kHowToCodeMask = 0x40 |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 kNumInternalizedStringsOffset + kInt32Size; | 971 kNumInternalizedStringsOffset + kInt32Size; |
970 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 972 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
971 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 973 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
972 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 974 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
973 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 975 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
974 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 976 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
975 }; | 977 }; |
976 } } // namespace v8::internal | 978 } } // namespace v8::internal |
977 | 979 |
978 #endif // V8_SERIALIZE_H_ | 980 #endif // V8_SERIALIZE_H_ |
OLD | NEW |