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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 | 423 |
424 class TreeNode : public Node { | 424 class TreeNode : public Node { |
425 public: | 425 public: |
426 virtual ~TreeNode(); | 426 virtual ~TreeNode(); |
427 | 427 |
428 DEFINE_CASTING_OPERATIONS(TreeNode); | 428 DEFINE_CASTING_OPERATIONS(TreeNode); |
429 | 429 |
430 virtual void AcceptVisitor(Visitor* visitor); | 430 virtual void AcceptVisitor(Visitor* visitor); |
431 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; | 431 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; |
432 intptr_t kernel_offset() const { return kernel_offset_; } | 432 intptr_t kernel_offset() const { |
| 433 ASSERT(kernel_offset_ > 0); |
| 434 return kernel_offset_; |
| 435 } |
433 bool can_stream() { return can_stream_; } | 436 bool can_stream() { return can_stream_; } |
434 | 437 |
435 protected: | 438 protected: |
436 TreeNode() : kernel_offset_(-1), can_stream_(true) {} | 439 TreeNode() : kernel_offset_(-1), can_stream_(true) {} |
437 | 440 |
438 // Offset for this node in the kernel-binary. If this node has a tag the | 441 // Offset for this node in the kernel-binary. If this node has a tag the |
439 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset. | 442 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset. |
440 intptr_t kernel_offset_; | 443 intptr_t kernel_offset_; |
441 | 444 |
442 bool can_stream_; | 445 bool can_stream_; |
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3451 } // namespace kernel | 3454 } // namespace kernel |
3452 | 3455 |
3453 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3456 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3454 intptr_t buffer_length); | 3457 intptr_t buffer_length); |
3455 | 3458 |
3456 | 3459 |
3457 } // namespace dart | 3460 } // namespace dart |
3458 | 3461 |
3459 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3462 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3460 #endif // RUNTIME_VM_KERNEL_H_ | 3463 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |