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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 void set_top_resource(StackResource* value) { top_resource_ = value; } | 359 void set_top_resource(StackResource* value) { top_resource_ = value; } |
360 static intptr_t top_resource_offset() { | 360 static intptr_t top_resource_offset() { |
361 return OFFSET_OF(Thread, top_resource_); | 361 return OFFSET_OF(Thread, top_resource_); |
362 } | 362 } |
363 | 363 |
364 // Heap of the isolate that this thread is operating on. | 364 // Heap of the isolate that this thread is operating on. |
365 Heap* heap() const { return heap_; } | 365 Heap* heap() const { return heap_; } |
366 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } | 366 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } |
367 | 367 |
368 void set_top(uword value) { | 368 void set_top(uword value) { |
| 369 ASSERT(heap_ != NULL); |
369 top_ = value; | 370 top_ = value; |
370 } | 371 } |
371 void set_end(uword value) { | 372 void set_end(uword value) { |
| 373 ASSERT(heap_ != NULL); |
372 end_ = value; | 374 end_ = value; |
373 } | 375 } |
374 | 376 |
375 uword top() { return top_; } | 377 uword top() { return top_; } |
376 uword end() { return end_; } | 378 uword end() { return end_; } |
377 | 379 |
378 bool HasActiveTLAB() { return end_ > 0; } | |
379 | |
380 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); } | 380 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); } |
381 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); } | 381 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); } |
382 | 382 |
383 int32_t no_handle_scope_depth() const { | 383 int32_t no_handle_scope_depth() const { |
384 #if defined(DEBUG) | 384 #if defined(DEBUG) |
385 return no_handle_scope_depth_; | 385 return no_handle_scope_depth_; |
386 #else | 386 #else |
387 return 0; | 387 return 0; |
388 #endif | 388 #endif |
389 } | 389 } |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // Disable thread interrupts. | 832 // Disable thread interrupts. |
833 class DisableThreadInterruptsScope : public StackResource { | 833 class DisableThreadInterruptsScope : public StackResource { |
834 public: | 834 public: |
835 explicit DisableThreadInterruptsScope(Thread* thread); | 835 explicit DisableThreadInterruptsScope(Thread* thread); |
836 ~DisableThreadInterruptsScope(); | 836 ~DisableThreadInterruptsScope(); |
837 }; | 837 }; |
838 | 838 |
839 } // namespace dart | 839 } // namespace dart |
840 | 840 |
841 #endif // RUNTIME_VM_THREAD_H_ | 841 #endif // RUNTIME_VM_THREAD_H_ |
OLD | NEW |