OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_THREAD_H_ | 5 #ifndef RUNTIME_VM_THREAD_H_ |
6 #define RUNTIME_VM_THREAD_H_ | 6 #define RUNTIME_VM_THREAD_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 } | 357 } |
358 | 358 |
359 StackResource* top_resource() const { return top_resource_; } | 359 StackResource* top_resource() const { return top_resource_; } |
360 void set_top_resource(StackResource* value) { top_resource_ = value; } | 360 void set_top_resource(StackResource* value) { top_resource_ = value; } |
361 static intptr_t top_resource_offset() { | 361 static intptr_t top_resource_offset() { |
362 return OFFSET_OF(Thread, top_resource_); | 362 return OFFSET_OF(Thread, top_resource_); |
363 } | 363 } |
364 | 364 |
365 // Heap of the isolate that this thread is operating on. | 365 // Heap of the isolate that this thread is operating on. |
366 Heap* heap() const { return heap_; } | 366 Heap* heap() const { return heap_; } |
367 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } | 367 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } |
rmacnak
2017/07/05 17:39:53
It should be possible to remove this now, right?
danunez
2017/07/05 18:12:56
Looks like it, according to a grep. Consider it go
| |
368 | 368 |
369 void set_top_offset(uword value) { | |
rmacnak
2017/07/05 17:39:53
set_top
danunez
2017/07/05 18:12:56
Done.
| |
370 ASSERT(heap_ != NULL); | |
371 top_ = value; | |
372 } | |
373 void set_end_offset(uword value) { | |
rmacnak
2017/07/05 17:39:53
set_end
danunez
2017/07/05 18:12:56
Done.
| |
374 ASSERT(heap_ != NULL); | |
375 end_ = value; | |
376 } | |
377 | |
378 uword top() { return top_; } | |
379 uword end() { return end_; } | |
380 | |
381 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); } | |
382 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); } | |
383 | |
369 int32_t no_handle_scope_depth() const { | 384 int32_t no_handle_scope_depth() const { |
370 #if defined(DEBUG) | 385 #if defined(DEBUG) |
371 return no_handle_scope_depth_; | 386 return no_handle_scope_depth_; |
372 #else | 387 #else |
373 return 0; | 388 return 0; |
374 #endif | 389 #endif |
375 } | 390 } |
376 | 391 |
377 void IncrementNoHandleScopeDepth() { | 392 void IncrementNoHandleScopeDepth() { |
378 #if defined(DEBUG) | 393 #if defined(DEBUG) |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
745 | 760 |
746 // JumpToExceptionHandler state: | 761 // JumpToExceptionHandler state: |
747 RawObject* active_exception_; | 762 RawObject* active_exception_; |
748 RawObject* active_stacktrace_; | 763 RawObject* active_stacktrace_; |
749 uword resume_pc_; | 764 uword resume_pc_; |
750 | 765 |
751 RawError* sticky_error_; | 766 RawError* sticky_error_; |
752 | 767 |
753 CompilerStats* compiler_stats_; | 768 CompilerStats* compiler_stats_; |
754 | 769 |
770 uword top_; | |
rmacnak
2017/07/05 17:39:53
These should move up to where heap_ is. See commen
danunez
2017/07/05 18:12:56
I placed these down here after I encountered an er
| |
771 uword end_; | |
772 | |
755 // Reusable handles support. | 773 // Reusable handles support. |
756 #define REUSABLE_HANDLE_FIELDS(object) object* object##_handle_; | 774 #define REUSABLE_HANDLE_FIELDS(object) object* object##_handle_; |
757 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) | 775 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) |
758 #undef REUSABLE_HANDLE_FIELDS | 776 #undef REUSABLE_HANDLE_FIELDS |
759 | 777 |
760 #if defined(DEBUG) | 778 #if defined(DEBUG) |
761 #define REUSABLE_HANDLE_SCOPE_VARIABLE(object) \ | 779 #define REUSABLE_HANDLE_SCOPE_VARIABLE(object) \ |
762 bool reusable_##object##_handle_scope_active_; | 780 bool reusable_##object##_handle_scope_active_; |
763 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE); | 781 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE); |
764 #undef REUSABLE_HANDLE_SCOPE_VARIABLE | 782 #undef REUSABLE_HANDLE_SCOPE_VARIABLE |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
818 // Disable thread interrupts. | 836 // Disable thread interrupts. |
819 class DisableThreadInterruptsScope : public StackResource { | 837 class DisableThreadInterruptsScope : public StackResource { |
820 public: | 838 public: |
821 explicit DisableThreadInterruptsScope(Thread* thread); | 839 explicit DisableThreadInterruptsScope(Thread* thread); |
822 ~DisableThreadInterruptsScope(); | 840 ~DisableThreadInterruptsScope(); |
823 }; | 841 }; |
824 | 842 |
825 } // namespace dart | 843 } // namespace dart |
826 | 844 |
827 #endif // RUNTIME_VM_THREAD_H_ | 845 #endif // RUNTIME_VM_THREAD_H_ |
OLD | NEW |