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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // 0x18 Root array item. | 322 // 0x18 Root array item. |
323 kRootArray = 0x18, | 323 kRootArray = 0x18, |
324 // 0x19 Object in the partial snapshot cache. | 324 // 0x19 Object in the partial snapshot cache. |
325 kPartialSnapshotCache = 0x19, | 325 kPartialSnapshotCache = 0x19, |
326 // 0x1a External reference referenced by id. | 326 // 0x1a External reference referenced by id. |
327 kExternalReference = 0x1a, | 327 kExternalReference = 0x1a, |
328 // 0x1b Object provided in the attached list. | 328 // 0x1b Object provided in the attached list. |
329 kAttachedReference = 0x1b, | 329 kAttachedReference = 0x1b, |
330 // 0x1c Builtin code referenced by index. | 330 // 0x1c Builtin code referenced by index. |
331 kBuiltin = 0x1c | 331 kBuiltin = 0x1c |
332 // 0x1d..0x1e Misc (including 0x3d..0x3f, 0x5d..0x5f, 0x7d..0x7f) | 332 // 0x1d..0x1f Misc (including 0x3d..0x3f, 0x5d..0x5f, 0x7d..0x7f) |
333 // 0x1f Unused (including 0x3f, 0x5f, 0x7f). | |
334 }; | 333 }; |
335 | 334 |
336 static const int kWhereMask = 0x1f; | 335 static const int kWhereMask = 0x1f; |
337 static const int kSpaceMask = 7; | 336 static const int kSpaceMask = 7; |
338 STATIC_ASSERT(kNumberOfSpaces <= kSpaceMask + 1); | 337 STATIC_ASSERT(kNumberOfSpaces <= kSpaceMask + 1); |
339 | 338 |
340 // How to code the pointer to the object. | 339 // How to code the pointer to the object. |
341 enum HowToCode { | 340 enum HowToCode { |
342 // Straight pointer. | 341 // Straight pointer. |
343 kPlain = 0, | 342 kPlain = 0, |
(...skipping 11 matching lines...) Expand all Loading... |
355 kInnerPointer = 0x40 | 354 kInnerPointer = 0x40 |
356 }; | 355 }; |
357 | 356 |
358 static const int kWhereToPointMask = 0x40; | 357 static const int kWhereToPointMask = 0x40; |
359 | 358 |
360 // ---------- Misc ---------- | 359 // ---------- Misc ---------- |
361 // Skip. | 360 // Skip. |
362 static const int kSkip = 0x1d; | 361 static const int kSkip = 0x1d; |
363 // Internal reference encoded as offsets of pc and target from code entry. | 362 // Internal reference encoded as offsets of pc and target from code entry. |
364 static const int kInternalReference = 0x1e; | 363 static const int kInternalReference = 0x1e; |
| 364 static const int kInternalReferenceEncoded = 0x1f; |
365 // Do nothing, used for padding. | 365 // Do nothing, used for padding. |
366 static const int kNop = 0x3d; | 366 static const int kNop = 0x3d; |
367 // Move to next reserved chunk. | 367 // Move to next reserved chunk. |
368 static const int kNextChunk = 0x3e; | 368 static const int kNextChunk = 0x3e; |
369 // A tag emitted at strategic points in the snapshot to delineate sections. | 369 // A tag emitted at strategic points in the snapshot to delineate sections. |
370 // If the deserializer does not find these at the expected moments then it | 370 // If the deserializer does not find these at the expected moments then it |
371 // is an indication that the snapshot and the VM do not fit together. | 371 // is an indication that the snapshot and the VM do not fit together. |
372 // Examine the build process for architecture, version or configuration | 372 // Examine the build process for architecture, version or configuration |
373 // mismatches. | 373 // mismatches. |
374 static const int kSynchronize = 0x5d; | 374 static const int kSynchronize = 0x5d; |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 kNumInternalizedStringsOffset + kInt32Size; | 971 kNumInternalizedStringsOffset + kInt32Size; |
972 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 972 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
973 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 973 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
974 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 974 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
975 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 975 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
976 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 976 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
977 }; | 977 }; |
978 } } // namespace v8::internal | 978 } } // namespace v8::internal |
979 | 979 |
980 #endif // V8_SERIALIZE_H_ | 980 #endif // V8_SERIALIZE_H_ |
OLD | NEW |