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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 top_ = value; | 370 top_ = value; |
371 } | 371 } |
372 void set_end(uword value) { | 372 void set_end(uword value) { |
373 ASSERT(heap_ != NULL); | 373 ASSERT(heap_ != NULL); |
374 end_ = value; | 374 end_ = value; |
375 } | 375 } |
376 | 376 |
377 uword top() { return top_; } | 377 uword top() { return top_; } |
378 uword end() { return end_; } | 378 uword end() { return end_; } |
379 | 379 |
| 380 bool HasActiveTLAB() { return end_ > 0; } |
| 381 |
380 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); } | 382 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); } |
381 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); } | 383 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); } |
382 | 384 |
383 int32_t no_handle_scope_depth() const { | 385 int32_t no_handle_scope_depth() const { |
384 #if defined(DEBUG) | 386 #if defined(DEBUG) |
385 return no_handle_scope_depth_; | 387 return no_handle_scope_depth_; |
386 #else | 388 #else |
387 return 0; | 389 return 0; |
388 #endif | 390 #endif |
389 } | 391 } |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // Disable thread interrupts. | 834 // Disable thread interrupts. |
833 class DisableThreadInterruptsScope : public StackResource { | 835 class DisableThreadInterruptsScope : public StackResource { |
834 public: | 836 public: |
835 explicit DisableThreadInterruptsScope(Thread* thread); | 837 explicit DisableThreadInterruptsScope(Thread* thread); |
836 ~DisableThreadInterruptsScope(); | 838 ~DisableThreadInterruptsScope(); |
837 }; | 839 }; |
838 | 840 |
839 } // namespace dart | 841 } // namespace dart |
840 | 842 |
841 #endif // RUNTIME_VM_THREAD_H_ | 843 #endif // RUNTIME_VM_THREAD_H_ |
OLD | NEW |