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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 | 428 |
429 class TreeNode : public Node { | 429 class TreeNode : public Node { |
430 public: | 430 public: |
431 virtual ~TreeNode(); | 431 virtual ~TreeNode(); |
432 | 432 |
433 DEFINE_CASTING_OPERATIONS(TreeNode); | 433 DEFINE_CASTING_OPERATIONS(TreeNode); |
434 | 434 |
435 virtual void AcceptVisitor(Visitor* visitor); | 435 virtual void AcceptVisitor(Visitor* visitor); |
436 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; | 436 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; |
437 intptr_t kernel_offset() { return kernel_offset_; } | |
438 | 437 |
439 protected: | 438 protected: |
440 TreeNode() : kernel_offset_(-1) {} | 439 TreeNode() {} |
441 | |
442 // Offset for this node in the kernel-binary. If this node has a tag the | |
443 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset. | |
444 intptr_t kernel_offset_; | |
445 | 440 |
446 private: | 441 private: |
447 DISALLOW_COPY_AND_ASSIGN(TreeNode); | 442 DISALLOW_COPY_AND_ASSIGN(TreeNode); |
448 }; | 443 }; |
449 | 444 |
450 | 445 |
451 class LinkedNode : public TreeNode { | 446 class LinkedNode : public TreeNode { |
452 public: | 447 public: |
453 virtual ~LinkedNode(); | 448 virtual ~LinkedNode(); |
454 | 449 |
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2448 | 2443 |
2449 | 2444 |
2450 class VariableDeclaration : public Statement { | 2445 class VariableDeclaration : public Statement { |
2451 public: | 2446 public: |
2452 enum Flags { | 2447 enum Flags { |
2453 kFlagFinal = 1 << 0, | 2448 kFlagFinal = 1 << 0, |
2454 kFlagConst = 1 << 1, | 2449 kFlagConst = 1 << 1, |
2455 }; | 2450 }; |
2456 | 2451 |
2457 static VariableDeclaration* ReadFrom(Reader* reader); | 2452 static VariableDeclaration* ReadFrom(Reader* reader); |
2458 static VariableDeclaration* ReadFromImpl(Reader* reader, bool read_tag); | 2453 static VariableDeclaration* ReadFromImpl(Reader* reader); |
2459 | 2454 |
2460 virtual ~VariableDeclaration(); | 2455 virtual ~VariableDeclaration(); |
2461 | 2456 |
2462 DEFINE_CASTING_OPERATIONS(VariableDeclaration); | 2457 DEFINE_CASTING_OPERATIONS(VariableDeclaration); |
2463 | 2458 |
2464 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2459 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
2465 virtual void VisitChildren(Visitor* visitor); | 2460 virtual void VisitChildren(Visitor* visitor); |
2466 | 2461 |
2467 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } | 2462 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
2468 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } | 2463 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3187 | 3182 |
3188 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3183 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3189 intptr_t buffer_length); | 3184 intptr_t buffer_length); |
3190 | 3185 |
3191 | 3186 |
3192 | 3187 |
3193 } // namespace dart | 3188 } // namespace dart |
3194 | 3189 |
3195 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3190 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3196 #endif // RUNTIME_VM_KERNEL_H_ | 3191 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |