| 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/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/hashmap.h" | 9 #include "src/hashmap.h" |
| 10 #include "src/heap-profiler.h" | 10 #include "src/heap-profiler.h" |
| 11 #include "src/isolate.h" | 11 #include "src/isolate.h" |
| 12 #include "src/snapshot-source-sink.h" | 12 #include "src/snapshot-source-sink.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 // A TypeCode is used to distinguish different kinds of external reference. | 17 // A TypeCode is used to distinguish different kinds of external reference. |
| 18 // It is a single bit to make testing for types easy. | 18 // It is a single bit to make testing for types easy. |
| 19 enum TypeCode { | 19 enum TypeCode { |
| 20 UNCLASSIFIED, // One-of-a-kind references. | 20 UNCLASSIFIED, // One-of-a-kind references. |
| 21 C_BUILTIN, | 21 C_BUILTIN, |
| 22 BUILTIN, | 22 BUILTIN, |
| 23 RUNTIME_FUNCTION, | 23 RUNTIME_FUNCTION, |
| 24 IC_UTILITY, | 24 IC_UTILITY, |
| 25 STATS_COUNTER, | 25 STATS_COUNTER, |
| 26 TOP_ADDRESS, | 26 TOP_ADDRESS, |
| 27 ACCESSOR, | 27 ACCESSOR_CODE, |
| 28 STUB_CACHE_TABLE, | 28 STUB_CACHE_TABLE, |
| 29 RUNTIME_ENTRY, | 29 RUNTIME_ENTRY, |
| 30 LAZY_DEOPTIMIZATION | 30 LAZY_DEOPTIMIZATION |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 const int kTypeCodeCount = LAZY_DEOPTIMIZATION + 1; | 33 const int kTypeCodeCount = LAZY_DEOPTIMIZATION + 1; |
| 34 const int kFirstTypeCode = UNCLASSIFIED; | 34 const int kFirstTypeCode = UNCLASSIFIED; |
| 35 | 35 |
| 36 const int kReferenceIdBits = 16; | 36 const int kReferenceIdBits = 16; |
| 37 const int kReferenceIdMask = (1 << kReferenceIdBits) - 1; | 37 const int kReferenceIdMask = (1 << kReferenceIdBits) - 1; |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 static const int kCheckSumOffset = 0; | 933 static const int kCheckSumOffset = 0; |
| 934 static const int kNumInternalizedStringsOffset = 1; | 934 static const int kNumInternalizedStringsOffset = 1; |
| 935 static const int kReservationsOffset = 2; | 935 static const int kReservationsOffset = 2; |
| 936 static const int kNumCodeStubKeysOffset = 3; | 936 static const int kNumCodeStubKeysOffset = 3; |
| 937 static const int kPayloadLengthOffset = 4; | 937 static const int kPayloadLengthOffset = 4; |
| 938 static const int kHeaderSize = (kPayloadLengthOffset + 1) * kIntSize; | 938 static const int kHeaderSize = (kPayloadLengthOffset + 1) * kIntSize; |
| 939 }; | 939 }; |
| 940 } } // namespace v8::internal | 940 } } // namespace v8::internal |
| 941 | 941 |
| 942 #endif // V8_SERIALIZE_H_ | 942 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |