Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/isolate.h

Issue 2752043002: [promises] Add %WaitForPromise runtime call to allow tests to reliably wait for promises to be fini… (Closed)
Patch Set: Strip it down to %IncrementWaitCount and %DecrementWaitCount Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/d8.cc ('K') | « src/d8.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Can be used by tests to force d8 to wait for certain things to run.
1247 inline void IncrementWaitCount() { wait_count_++; }
1248 inline void DecrementWaitCount() { wait_count_--; }
1249 inline int GetWaitCount() { 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 #ifdef USE_SIMULATOR 1526 #ifdef USE_SIMULATOR
1522 base::Mutex simulator_i_cache_mutex_; 1527 base::Mutex simulator_i_cache_mutex_;
1523 #endif 1528 #endif
1524 1529
1525 bool allow_atomics_wait_; 1530 bool allow_atomics_wait_;
1526 1531
1527 ManagedObjectFinalizer managed_object_finalizers_list_; 1532 ManagedObjectFinalizer managed_object_finalizers_list_;
1528 1533
1529 size_t total_regexp_code_generated_; 1534 size_t total_regexp_code_generated_;
1530 1535
1536 int wait_count_ = 0;
1537
1531 friend class ExecutionAccess; 1538 friend class ExecutionAccess;
1532 friend class HandleScopeImplementer; 1539 friend class HandleScopeImplementer;
1533 friend class HeapTester; 1540 friend class HeapTester;
1534 friend class OptimizingCompileDispatcher; 1541 friend class OptimizingCompileDispatcher;
1535 friend class SweeperThread; 1542 friend class SweeperThread;
1536 friend class ThreadManager; 1543 friend class ThreadManager;
1537 friend class Simulator; 1544 friend class Simulator;
1538 friend class StackGuard; 1545 friend class StackGuard;
1539 friend class ThreadId; 1546 friend class ThreadId;
1540 friend class v8::Isolate; 1547 friend class v8::Isolate;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 1764
1758 EmbeddedVector<char, 128> filename_; 1765 EmbeddedVector<char, 128> filename_;
1759 FILE* file_; 1766 FILE* file_;
1760 int scope_depth_; 1767 int scope_depth_;
1761 }; 1768 };
1762 1769
1763 } // namespace internal 1770 } // namespace internal
1764 } // namespace v8 1771 } // namespace v8
1765 1772
1766 #endif // V8_ISOLATE_H_ 1773 #endif // V8_ISOLATE_H_
OLDNEW
« src/d8.cc ('K') | « src/d8.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698