Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: runtime/vm/kernel.h

Issue 2790073004: Restructure the Kernel string table. (Closed)
Patch Set: Incorporate review comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | runtime/vm/kernel_binary.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | runtime/vm/kernel_binary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698