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_SNAPSHOT_SERIALIZE_H_ | 5 #ifndef V8_SNAPSHOT_SERIALIZE_H_ |
6 #define V8_SNAPSHOT_SERIALIZE_H_ | 6 #define V8_SNAPSHOT_SERIALIZE_H_ |
7 | 7 |
8 #include "src/hashmap.h" | 8 #include "src/hashmap.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/snapshot/snapshot-source-sink.h" | 10 #include "src/snapshot/snapshot-source-sink.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 static const int kSkip = 0x1d; | 376 static const int kSkip = 0x1d; |
377 // Internal reference encoded as offsets of pc and target from code entry. | 377 // Internal reference encoded as offsets of pc and target from code entry. |
378 static const int kInternalReference = 0x1e; | 378 static const int kInternalReference = 0x1e; |
379 static const int kInternalReferenceEncoded = 0x1f; | 379 static const int kInternalReferenceEncoded = 0x1f; |
380 // Do nothing, used for padding. | 380 // Do nothing, used for padding. |
381 static const int kNop = 0x3d; | 381 static const int kNop = 0x3d; |
382 // Move to next reserved chunk. | 382 // Move to next reserved chunk. |
383 static const int kNextChunk = 0x3e; | 383 static const int kNextChunk = 0x3e; |
384 // Deferring object content. | 384 // Deferring object content. |
385 static const int kDeferred = 0x3f; | 385 static const int kDeferred = 0x3f; |
386 // Used for the source code of the natives, which is in the executable, but | |
387 // is referred to from external strings in the snapshot. | |
388 static const int kNativesStringResource = 0x5d; | |
389 // Used for the source code for compiled stubs, which is in the executable, | |
390 // but is referred to from external strings in the snapshot. | |
391 static const int kCodeStubNativesStringResource = 0x5e; | |
392 // Used for the source code for V8 extras, which is in the executable, | |
393 // but is referred to from external strings in the snapshot. | |
394 static const int kExtraNativesStringResource = 0x5f; | |
386 // A tag emitted at strategic points in the snapshot to delineate sections. | 395 // A tag emitted at strategic points in the snapshot to delineate sections. |
387 // If the deserializer does not find these at the expected moments then it | 396 // If the deserializer does not find these at the expected moments then it |
388 // is an indication that the snapshot and the VM do not fit together. | 397 // is an indication that the snapshot and the VM do not fit together. |
389 // Examine the build process for architecture, version or configuration | 398 // Examine the build process for architecture, version or configuration |
390 // mismatches. | 399 // mismatches. |
391 static const int kSynchronize = 0x17; | 400 static const int kSynchronize = 0x17; |
392 // Used for the source code of the natives, which is in the executable, but | |
393 // is referred to from external strings in the snapshot. | |
394 static const int kNativesStringResource = 0x37; | |
395 // Raw data of variable length. | 401 // Raw data of variable length. |
396 static const int kVariableRawData = 0x57; | 402 static const int kVariableRawData = 0x57; |
397 // Repeats of variable length. | 403 // Repeats of variable length. |
398 static const int kVariableRepeat = 0x77; | 404 static const int kVariableRepeat = 0x37; |
Yang
2015/08/14 07:52:37
small nit: order it before kVariableRawData please
| |
399 // Alignment prefixes 0x7d..0x7f | 405 // Alignment prefixes 0x7d..0x7f |
400 static const int kAlignmentPrefix = 0x7d; | 406 static const int kAlignmentPrefix = 0x7d; |
401 // Used for the source code for compiled stubs, which is in the executable, | |
402 // but is referred to from external strings in the snapshot. | |
403 static const int kCodeStubNativesStringResource = 0x5d; | |
404 | 407 |
405 // 0x5e..0x5f unused | 408 // 0x77 unused |
406 | 409 |
407 // ---------- byte code range 0x80..0xff ---------- | 410 // ---------- byte code range 0x80..0xff ---------- |
408 // First 32 root array items. | 411 // First 32 root array items. |
409 static const int kNumberOfRootArrayConstants = 0x20; | 412 static const int kNumberOfRootArrayConstants = 0x20; |
410 // 0x80..0x9f | 413 // 0x80..0x9f |
411 static const int kRootArrayConstants = 0x80; | 414 static const int kRootArrayConstants = 0x80; |
412 // 0xa0..0xbf | 415 // 0xa0..0xbf |
413 static const int kRootArrayConstantsWithSkip = 0xa0; | 416 static const int kRootArrayConstantsWithSkip = 0xa0; |
414 static const int kRootArrayConstantsMask = 0x1f; | 417 static const int kRootArrayConstantsMask = 0x1f; |
415 | 418 |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1049 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; | 1052 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; |
1050 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 1053 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
1051 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 1054 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
1052 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 1055 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
1053 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 1056 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
1054 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 1057 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
1055 }; | 1058 }; |
1056 } } // namespace v8::internal | 1059 } } // namespace v8::internal |
1057 | 1060 |
1058 #endif // V8_SNAPSHOT_SERIALIZE_H_ | 1061 #endif // V8_SNAPSHOT_SERIALIZE_H_ |
OLD | NEW |