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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 | 429 |
430 class TreeNode : public Node { | 430 class TreeNode : public Node { |
431 public: | 431 public: |
432 virtual ~TreeNode(); | 432 virtual ~TreeNode(); |
433 | 433 |
434 DEFINE_CASTING_OPERATIONS(TreeNode); | 434 DEFINE_CASTING_OPERATIONS(TreeNode); |
435 | 435 |
436 virtual void AcceptVisitor(Visitor* visitor); | 436 virtual void AcceptVisitor(Visitor* visitor); |
437 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; | 437 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; |
| 438 intptr_t kernel_offset() { return kernel_offset_; } |
438 | 439 |
439 protected: | 440 protected: |
440 TreeNode() {} | 441 TreeNode() : kernel_offset_(-1) {} |
| 442 |
| 443 // Offset for this node in the kernel-binary. If this node has a tag the |
| 444 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset. |
| 445 intptr_t kernel_offset_; |
441 | 446 |
442 private: | 447 private: |
443 DISALLOW_COPY_AND_ASSIGN(TreeNode); | 448 DISALLOW_COPY_AND_ASSIGN(TreeNode); |
444 }; | 449 }; |
445 | 450 |
446 | 451 |
447 class LinkedNode : public TreeNode { | 452 class LinkedNode : public TreeNode { |
448 public: | 453 public: |
449 virtual ~LinkedNode(); | 454 virtual ~LinkedNode(); |
450 | 455 |
(...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2448 | 2453 |
2449 | 2454 |
2450 class VariableDeclaration : public Statement { | 2455 class VariableDeclaration : public Statement { |
2451 public: | 2456 public: |
2452 enum Flags { | 2457 enum Flags { |
2453 kFlagFinal = 1 << 0, | 2458 kFlagFinal = 1 << 0, |
2454 kFlagConst = 1 << 1, | 2459 kFlagConst = 1 << 1, |
2455 }; | 2460 }; |
2456 | 2461 |
2457 static VariableDeclaration* ReadFrom(Reader* reader); | 2462 static VariableDeclaration* ReadFrom(Reader* reader); |
2458 static VariableDeclaration* ReadFromImpl(Reader* reader); | 2463 static VariableDeclaration* ReadFromImpl(Reader* reader, bool read_tag); |
2459 | 2464 |
2460 virtual ~VariableDeclaration(); | 2465 virtual ~VariableDeclaration(); |
2461 | 2466 |
2462 DEFINE_CASTING_OPERATIONS(VariableDeclaration); | 2467 DEFINE_CASTING_OPERATIONS(VariableDeclaration); |
2463 | 2468 |
2464 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2469 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
2465 virtual void VisitChildren(Visitor* visitor); | 2470 virtual void VisitChildren(Visitor* visitor); |
2466 | 2471 |
2467 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } | 2472 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
2468 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } | 2473 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3243 | 3248 |
3244 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3249 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3245 intptr_t buffer_length); | 3250 intptr_t buffer_length); |
3246 | 3251 |
3247 | 3252 |
3248 | 3253 |
3249 } // namespace dart | 3254 } // namespace dart |
3250 | 3255 |
3251 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3256 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3252 #endif // RUNTIME_VM_KERNEL_H_ | 3257 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |