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

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

Issue 2886873008: [kernel] Streaming ScopeBuilder (Closed)
Patch Set: Created 3 years, 7 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
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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 T** array_; 241 T** array_;
242 int length_; 242 int length_;
243 243
244 DISALLOW_COPY_AND_ASSIGN(List); 244 DISALLOW_COPY_AND_ASSIGN(List);
245 }; 245 };
246 246
247 247
248 class TypeParameterList : public List<TypeParameter> { 248 class TypeParameterList : public List<TypeParameter> {
249 public: 249 public:
250 void ReadFrom(Reader* reader); 250 void ReadFrom(Reader* reader);
251 TypeParameterList() : first_offset(-1) {}
252 intptr_t first_offset;
251 }; 253 };
252 254
253 255
254 class Source { 256 class Source {
255 public: 257 public:
256 ~Source(); 258 ~Source();
257 259
258 private: 260 private:
259 uint8_t* uri_; // UTF-8 encoded. 261 uint8_t* uri_; // UTF-8 encoded.
260 intptr_t uri_size_; // In bytes. 262 intptr_t uri_size_; // In bytes.
(...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 2578
2577 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } 2579 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
2578 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } 2580 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; }
2579 2581
2580 StringIndex name() { return name_index_; } 2582 StringIndex name() { return name_index_; }
2581 DartType* type() { return type_; } 2583 DartType* type() { return type_; }
2582 Expression* initializer() { return initializer_; } 2584 Expression* initializer() { return initializer_; }
2583 TokenPosition equals_position() { return equals_position_; } 2585 TokenPosition equals_position() { return equals_position_; }
2584 TokenPosition end_position() { return end_position_; } 2586 TokenPosition end_position() { return end_position_; }
2585 void set_end_position(TokenPosition position) { end_position_ = position; } 2587 void set_end_position(TokenPosition position) { end_position_ = position; }
2588 intptr_t kernel_offset_no_tag() const { return kernel_offset_no_tag_; }
2586 2589
2587 private: 2590 private:
2588 VariableDeclaration() 2591 VariableDeclaration()
2589 : equals_position_(TokenPosition::kNoSourcePos), 2592 : equals_position_(TokenPosition::kNoSourcePos),
2590 end_position_(TokenPosition::kNoSource) {} 2593 end_position_(TokenPosition::kNoSource),
2594 kernel_offset_no_tag_(-1) {}
2591 2595
2592 template <typename T> 2596 template <typename T>
2593 friend class List; 2597 friend class List;
2594 2598
2595 StringIndex name_index_; 2599 StringIndex name_index_;
2596 word flags_; 2600 word flags_;
2597 Child<DartType> type_; 2601 Child<DartType> type_;
2598 Child<Expression> initializer_; 2602 Child<Expression> initializer_;
2599 TokenPosition equals_position_; 2603 TokenPosition equals_position_;
2600 TokenPosition end_position_; 2604 TokenPosition end_position_;
2601 2605
2606 // Offset for this node in the kernel-binary. Always without the tag.
2607 // Can be -1 to indicate "unknown" or invalid offset.
2608 intptr_t kernel_offset_no_tag_;
2609
2602 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration); 2610 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration);
2603 }; 2611 };
2604 2612
2605 2613
2606 class FunctionDeclaration : public Statement { 2614 class FunctionDeclaration : public Statement {
2607 public: 2615 public:
2608 static FunctionDeclaration* ReadFrom(Reader* reader); 2616 static FunctionDeclaration* ReadFrom(Reader* reader);
2609 2617
2610 virtual ~FunctionDeclaration(); 2618 virtual ~FunctionDeclaration();
2611 2619
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
3353 } // namespace kernel 3361 } // namespace kernel
3354 3362
3355 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 3363 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
3356 intptr_t buffer_length); 3364 intptr_t buffer_length);
3357 3365
3358 3366
3359 } // namespace dart 3367 } // namespace dart
3360 3368
3361 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3369 #endif // !defined(DART_PRECOMPILED_RUNTIME)
3362 #endif // RUNTIME_VM_KERNEL_H_ 3370 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698