OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_SERIALIZER_COMMON_H_ | 5 #ifndef V8_SNAPSHOT_SERIALIZER_COMMON_H_ |
6 #define V8_SNAPSHOT_SERIALIZER_COMMON_H_ | 6 #define V8_SNAPSHOT_SERIALIZER_COMMON_H_ |
7 | 7 |
8 #include "src/address-map.h" | 8 #include "src/address-map.h" |
9 #include "src/external-reference-table.h" | 9 #include "src/external-reference-table.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 static const int kVariableRawData = 0x1a; | 165 static const int kVariableRawData = 0x1a; |
166 // Internal reference encoded as offsets of pc and target from code entry. | 166 // Internal reference encoded as offsets of pc and target from code entry. |
167 static const int kInternalReference = 0x1b; | 167 static const int kInternalReference = 0x1b; |
168 static const int kInternalReferenceEncoded = 0x1c; | 168 static const int kInternalReferenceEncoded = 0x1c; |
169 // Used for the source code of the natives, which is in the executable, but | 169 // Used for the source code of the natives, which is in the executable, but |
170 // is referred to from external strings in the snapshot. | 170 // is referred to from external strings in the snapshot. |
171 static const int kNativesStringResource = 0x1d; | 171 static const int kNativesStringResource = 0x1d; |
172 // Used for the source code for compiled stubs, which is in the executable, | 172 // Used for the source code for compiled stubs, which is in the executable, |
173 // but is referred to from external strings in the snapshot. | 173 // but is referred to from external strings in the snapshot. |
174 static const int kExtraNativesStringResource = 0x1e; | 174 static const int kExtraNativesStringResource = 0x1e; |
| 175 // Used for embedder-provided serialization data for internal fields. |
| 176 static const int kInternalFieldsData = 0x1f; |
175 | 177 |
176 // 8 hot (recently seen or back-referenced) objects with optional skip. | 178 // 8 hot (recently seen or back-referenced) objects with optional skip. |
177 static const int kNumberOfHotObjects = 8; | 179 static const int kNumberOfHotObjects = 8; |
178 STATIC_ASSERT(kNumberOfHotObjects == HotObjectsList::kSize); | 180 STATIC_ASSERT(kNumberOfHotObjects == HotObjectsList::kSize); |
179 // 0x38..0x3f | 181 // 0x38..0x3f |
180 static const int kHotObject = 0x38; | 182 static const int kHotObject = 0x38; |
181 // 0x58..0x5f | 183 // 0x58..0x5f |
182 static const int kHotObjectWithSkip = 0x58; | 184 static const int kHotObjectWithSkip = 0x58; |
183 static const int kHotObjectMask = 0x07; | 185 static const int kHotObjectMask = 0x07; |
184 | 186 |
185 // 0x1f, 0x35..0x37, 0x55..0x57, 0x75..0x7f unused. | 187 // 0x35..0x37, 0x55..0x57, 0x75..0x7f unused. |
186 | 188 |
187 // ---------- byte code range 0x80..0xff ---------- | 189 // ---------- byte code range 0x80..0xff ---------- |
188 // First 32 root array items. | 190 // First 32 root array items. |
189 static const int kNumberOfRootArrayConstants = 0x20; | 191 static const int kNumberOfRootArrayConstants = 0x20; |
190 // 0x80..0x9f | 192 // 0x80..0x9f |
191 static const int kRootArrayConstants = 0x80; | 193 static const int kRootArrayConstants = 0x80; |
192 // 0xa0..0xbf | 194 // 0xa0..0xbf |
193 static const int kRootArrayConstantsWithSkip = 0xa0; | 195 static const int kRootArrayConstantsWithSkip = 0xa0; |
194 static const int kRootArrayConstantsMask = 0x1f; | 196 static const int kRootArrayConstantsMask = 0x1f; |
195 | 197 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 280 |
279 byte* data_; | 281 byte* data_; |
280 int size_; | 282 int size_; |
281 bool owns_data_; | 283 bool owns_data_; |
282 }; | 284 }; |
283 | 285 |
284 } // namespace internal | 286 } // namespace internal |
285 } // namespace v8 | 287 } // namespace v8 |
286 | 288 |
287 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ | 289 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ |
OLD | NEW |