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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 | 389 |
390 class TreeNode : public Node { | 390 class TreeNode : public Node { |
391 public: | 391 public: |
392 virtual ~TreeNode(); | 392 virtual ~TreeNode(); |
393 | 393 |
394 DEFINE_CASTING_OPERATIONS(TreeNode); | 394 DEFINE_CASTING_OPERATIONS(TreeNode); |
395 | 395 |
396 virtual void AcceptVisitor(Visitor* visitor); | 396 virtual void AcceptVisitor(Visitor* visitor); |
397 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; | 397 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; |
398 intptr_t kernel_offset() const { return kernel_offset_; } | 398 intptr_t kernel_offset() const { |
| 399 ASSERT(kernel_offset_ > 0); |
| 400 return kernel_offset_; |
| 401 } |
399 bool can_stream() { return can_stream_; } | 402 bool can_stream() { return can_stream_; } |
400 | 403 |
401 protected: | 404 protected: |
402 TreeNode() : kernel_offset_(-1), can_stream_(true) {} | 405 TreeNode() : kernel_offset_(-1), can_stream_(true) {} |
403 | 406 |
404 // Offset for this node in the kernel-binary. If this node has a tag the | 407 // Offset for this node in the kernel-binary. If this node has a tag the |
405 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset. | 408 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset. |
406 intptr_t kernel_offset_; | 409 intptr_t kernel_offset_; |
407 | 410 |
408 bool can_stream_; | 411 bool can_stream_; |
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3361 } // namespace kernel | 3364 } // namespace kernel |
3362 | 3365 |
3363 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3366 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3364 intptr_t buffer_length); | 3367 intptr_t buffer_length); |
3365 | 3368 |
3366 | 3369 |
3367 } // namespace dart | 3370 } // namespace dart |
3368 | 3371 |
3369 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3372 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3370 #endif // RUNTIME_VM_KERNEL_H_ | 3373 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |