OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_H_ | 5 #ifndef RUNTIME_VM_KERNEL_H_ |
6 #define RUNTIME_VM_KERNEL_H_ | 6 #define RUNTIME_VM_KERNEL_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 Ref<A> first_; | 251 Ref<A> first_; |
252 Child<B> second_; | 252 Child<B> second_; |
253 | 253 |
254 DISALLOW_COPY_AND_ASSIGN(Tuple); | 254 DISALLOW_COPY_AND_ASSIGN(Tuple); |
255 }; | 255 }; |
256 | 256 |
257 | 257 |
258 class String { | 258 class String { |
259 public: | 259 public: |
| 260 // Read a string reference, which is an index into the string table. |
260 static String* ReadFrom(Reader* reader); | 261 static String* ReadFrom(Reader* reader); |
| 262 |
| 263 // Read a string implementation, which is a size followed by a UTF-8 |
| 264 // encoded string. |
261 static String* ReadFromImpl(Reader* reader); | 265 static String* ReadFromImpl(Reader* reader); |
262 | 266 |
| 267 // Read a string implementation given its size. |
| 268 static String* ReadRaw(Reader* reader, intptr_t size); |
| 269 |
263 String(const uint8_t* utf8, int length) { | 270 String(const uint8_t* utf8, int length) { |
264 buffer_ = new uint8_t[length]; | 271 buffer_ = new uint8_t[length]; |
265 size_ = length; | 272 size_ = length; |
266 memmove(buffer_, utf8, length); | 273 memmove(buffer_, utf8, length); |
267 } | 274 } |
268 ~String() { delete[] buffer_; } | 275 ~String() { delete[] buffer_; } |
269 | 276 |
270 uint8_t* buffer() { return buffer_; } | 277 uint8_t* buffer() { return buffer_; } |
271 int size() { return size_; } | 278 int size() { return size_; } |
272 | 279 |
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3151 | 3158 |
3152 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3159 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3153 intptr_t buffer_length); | 3160 intptr_t buffer_length); |
3154 | 3161 |
3155 | 3162 |
3156 | 3163 |
3157 } // namespace dart | 3164 } // namespace dart |
3158 | 3165 |
3159 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3166 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3160 #endif // RUNTIME_VM_KERNEL_H_ | 3167 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |