OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_VM_KERNEL_BINARY_H_ | 5 #ifndef RUNTIME_VM_KERNEL_BINARY_H_ |
6 #define RUNTIME_VM_KERNEL_BINARY_H_ | 6 #define RUNTIME_VM_KERNEL_BINARY_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 intptr_t ReadListLength() { return ReadUInt(); } | 201 intptr_t ReadListLength() { return ReadUInt(); } |
202 | 202 |
203 uint8_t ReadByte() { return buffer()[offset_++]; } | 203 uint8_t ReadByte() { return buffer()[offset_++]; } |
204 | 204 |
205 uint8_t PeekByte() { return buffer()[offset_]; } | 205 uint8_t PeekByte() { return buffer()[offset_]; } |
206 | 206 |
207 bool ReadBool() { return (ReadByte() & 1) == 1; } | 207 bool ReadBool() { return (ReadByte() & 1) == 1; } |
208 | 208 |
209 word ReadFlags() { return ReadByte(); } | 209 uint8_t ReadFlags() { return ReadByte(); } |
210 | 210 |
211 Tag ReadTag(uint8_t* payload = NULL) { | 211 Tag ReadTag(uint8_t* payload = NULL) { |
212 uint8_t byte = ReadByte(); | 212 uint8_t byte = ReadByte(); |
213 bool has_payload = (byte & kSpecializedTagHighBit) != 0; | 213 bool has_payload = (byte & kSpecializedTagHighBit) != 0; |
214 if (has_payload) { | 214 if (has_payload) { |
215 if (payload != NULL) { | 215 if (payload != NULL) { |
216 *payload = byte & kSpecializedPayloadMask; | 216 *payload = byte & kSpecializedPayloadMask; |
217 } | 217 } |
218 return static_cast<Tag>(byte & kSpecializedTagMask); | 218 return static_cast<Tag>(byte & kSpecializedTagMask); |
219 } else { | 219 } else { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 Reader* reader_; | 338 Reader* reader_; |
339 TokenPosition min_; | 339 TokenPosition min_; |
340 TokenPosition max_; | 340 TokenPosition max_; |
341 }; | 341 }; |
342 | 342 |
343 } // namespace kernel | 343 } // namespace kernel |
344 } // namespace dart | 344 } // namespace dart |
345 | 345 |
346 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 346 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
347 #endif // RUNTIME_VM_KERNEL_BINARY_H_ | 347 #endif // RUNTIME_VM_KERNEL_BINARY_H_ |
OLD | NEW |