| 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 VM_THREAD_H_ | 5 #ifndef VM_THREAD_H_ |
| 6 #define VM_THREAD_H_ | 6 #define VM_THREAD_H_ |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/handles.h" | 9 #include "vm/handles.h" |
| 10 #include "vm/os_thread.h" | 10 #include "vm/os_thread.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 #define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \ | 341 #define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \ |
| 342 void set_reusable_##object##_handle_scope_active(bool value) { \ | 342 void set_reusable_##object##_handle_scope_active(bool value) { \ |
| 343 reusable_##object##_handle_scope_active_ = value; \ | 343 reusable_##object##_handle_scope_active_ = value; \ |
| 344 } \ | 344 } \ |
| 345 bool reusable_##object##_handle_scope_active() const { \ | 345 bool reusable_##object##_handle_scope_active() const { \ |
| 346 return reusable_##object##_handle_scope_active_; \ | 346 return reusable_##object##_handle_scope_active_; \ |
| 347 } | 347 } |
| 348 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS) | 348 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS) |
| 349 #undef REUSABLE_HANDLE_SCOPE_ACCESSORS | 349 #undef REUSABLE_HANDLE_SCOPE_ACCESSORS |
| 350 | 350 |
| 351 bool IsAnyReusableHandleScopeActive() const { | 351 bool IsAnyReusableHandleScopeActive() const { |
| 352 #define IS_REUSABLE_HANDLE_SCOPE_ACTIVE(object) \ | 352 #define IS_REUSABLE_HANDLE_SCOPE_ACTIVE(object) \ |
| 353 if (reusable_##object##_handle_scope_active_) return true; | 353 if (reusable_##object##_handle_scope_active_) return true; |
| 354 REUSABLE_HANDLE_LIST(IS_REUSABLE_HANDLE_SCOPE_ACTIVE) | 354 REUSABLE_HANDLE_LIST(IS_REUSABLE_HANDLE_SCOPE_ACTIVE) |
| 355 return false; | 355 return false; |
| 356 #undef IS_REUSABLE_HANDLE_SCOPE_ACTIVE | 356 #undef IS_REUSABLE_HANDLE_SCOPE_ACTIVE |
| 357 } | 357 } |
| 358 #endif // defined(DEBUG) | 358 #endif // defined(DEBUG) |
| 359 | 359 |
| 360 void ClearReusableHandles(); |
| 361 |
| 360 #define REUSABLE_HANDLE(object) \ | 362 #define REUSABLE_HANDLE(object) \ |
| 361 object& object##Handle() const { \ | 363 object& object##Handle() const { \ |
| 362 return *object##_handle_; \ | 364 return *object##_handle_; \ |
| 363 } | 365 } |
| 364 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE) | 366 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE) |
| 365 #undef REUSABLE_HANDLE | 367 #undef REUSABLE_HANDLE |
| 366 | 368 |
| 367 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 369 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 368 | 370 |
| 369 private: | 371 private: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 friend class ApiZone; | 446 friend class ApiZone; |
| 445 friend class Isolate; | 447 friend class Isolate; |
| 446 friend class StackZone; | 448 friend class StackZone; |
| 447 friend class ThreadRegistry; | 449 friend class ThreadRegistry; |
| 448 DISALLOW_COPY_AND_ASSIGN(Thread); | 450 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 449 }; | 451 }; |
| 450 | 452 |
| 451 } // namespace dart | 453 } // namespace dart |
| 452 | 454 |
| 453 #endif // VM_THREAD_H_ | 455 #endif // VM_THREAD_H_ |
| OLD | NEW |