OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 ManagedObjectFinalizer* RegisterForReleaseAtTeardown( | 1236 ManagedObjectFinalizer* RegisterForReleaseAtTeardown( |
1237 void* value, ManagedObjectFinalizer::Deleter deleter); | 1237 void* value, ManagedObjectFinalizer::Deleter deleter); |
1238 | 1238 |
1239 // Unregister a previously registered value from release at | 1239 // Unregister a previously registered value from release at |
1240 // isolate teardown, deleting the ManagedObjectFinalizer. | 1240 // isolate teardown, deleting the ManagedObjectFinalizer. |
1241 // This transfers the responsibility of the previously managed value's | 1241 // This transfers the responsibility of the previously managed value's |
1242 // deletion to the caller. Pass by pointer, because *finalizer_ptr gets | 1242 // deletion to the caller. Pass by pointer, because *finalizer_ptr gets |
1243 // reset to nullptr. | 1243 // reset to nullptr. |
1244 void UnregisterFromReleaseAtTeardown(ManagedObjectFinalizer** finalizer_ptr); | 1244 void UnregisterFromReleaseAtTeardown(ManagedObjectFinalizer** finalizer_ptr); |
1245 | 1245 |
| 1246 // Used by mjsunit tests to force d8 to wait for certain things to run. |
| 1247 inline void IncrementWaitCountForTesting() { wait_count_++; } |
| 1248 inline void DecrementWaitCountForTesting() { wait_count_--; } |
| 1249 inline int GetWaitCountForTesting() { return wait_count_; } |
| 1250 |
1246 protected: | 1251 protected: |
1247 explicit Isolate(bool enable_serializer); | 1252 explicit Isolate(bool enable_serializer); |
1248 bool IsArrayOrObjectPrototype(Object* object); | 1253 bool IsArrayOrObjectPrototype(Object* object); |
1249 | 1254 |
1250 private: | 1255 private: |
1251 friend struct GlobalState; | 1256 friend struct GlobalState; |
1252 friend struct InitializeGlobalState; | 1257 friend struct InitializeGlobalState; |
1253 | 1258 |
1254 // These fields are accessed through the API, offsets must be kept in sync | 1259 // These fields are accessed through the API, offsets must be kept in sync |
1255 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1260 // with v8::internal::Internals (in include/v8.h) constants. This is also |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 #ifdef USE_SIMULATOR | 1522 #ifdef USE_SIMULATOR |
1518 base::Mutex simulator_i_cache_mutex_; | 1523 base::Mutex simulator_i_cache_mutex_; |
1519 #endif | 1524 #endif |
1520 | 1525 |
1521 bool allow_atomics_wait_; | 1526 bool allow_atomics_wait_; |
1522 | 1527 |
1523 ManagedObjectFinalizer managed_object_finalizers_list_; | 1528 ManagedObjectFinalizer managed_object_finalizers_list_; |
1524 | 1529 |
1525 size_t total_regexp_code_generated_; | 1530 size_t total_regexp_code_generated_; |
1526 | 1531 |
| 1532 int wait_count_ = 0; |
| 1533 |
1527 friend class ExecutionAccess; | 1534 friend class ExecutionAccess; |
1528 friend class HandleScopeImplementer; | 1535 friend class HandleScopeImplementer; |
1529 friend class HeapTester; | 1536 friend class HeapTester; |
1530 friend class OptimizingCompileDispatcher; | 1537 friend class OptimizingCompileDispatcher; |
1531 friend class SweeperThread; | 1538 friend class SweeperThread; |
1532 friend class ThreadManager; | 1539 friend class ThreadManager; |
1533 friend class Simulator; | 1540 friend class Simulator; |
1534 friend class StackGuard; | 1541 friend class StackGuard; |
1535 friend class ThreadId; | 1542 friend class ThreadId; |
1536 friend class v8::Isolate; | 1543 friend class v8::Isolate; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 | 1760 |
1754 EmbeddedVector<char, 128> filename_; | 1761 EmbeddedVector<char, 128> filename_; |
1755 FILE* file_; | 1762 FILE* file_; |
1756 int scope_depth_; | 1763 int scope_depth_; |
1757 }; | 1764 }; |
1758 | 1765 |
1759 } // namespace internal | 1766 } // namespace internal |
1760 } // namespace v8 | 1767 } // namespace v8 |
1761 | 1768 |
1762 #endif // V8_ISOLATE_H_ | 1769 #endif // V8_ISOLATE_H_ |
OLD | NEW |