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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 deserialize_internal_fields_callback, nullptr) \ | 408 deserialize_internal_fields_callback, nullptr) \ |
409 V(int, pending_microtask_count, 0) \ | 409 V(int, pending_microtask_count, 0) \ |
410 V(int, debug_microtask_count, 0) \ | 410 V(int, debug_microtask_count, 0) \ |
411 V(HStatistics*, hstatistics, nullptr) \ | 411 V(HStatistics*, hstatistics, nullptr) \ |
412 V(CompilationStatistics*, turbo_statistics, nullptr) \ | 412 V(CompilationStatistics*, turbo_statistics, nullptr) \ |
413 V(HTracer*, htracer, nullptr) \ | 413 V(HTracer*, htracer, nullptr) \ |
414 V(CodeTracer*, code_tracer, nullptr) \ | 414 V(CodeTracer*, code_tracer, nullptr) \ |
415 V(bool, fp_stubs_generated, false) \ | 415 V(bool, fp_stubs_generated, false) \ |
416 V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \ | 416 V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \ |
417 V(PromiseRejectCallback, promise_reject_callback, nullptr) \ | 417 V(PromiseRejectCallback, promise_reject_callback, nullptr) \ |
| 418 V(PromiseHook, promise_hook, nullptr) \ |
418 V(const v8::StartupData*, snapshot_blob, nullptr) \ | 419 V(const v8::StartupData*, snapshot_blob, nullptr) \ |
419 V(int, code_and_metadata_size, 0) \ | 420 V(int, code_and_metadata_size, 0) \ |
420 V(int, bytecode_and_metadata_size, 0) \ | 421 V(int, bytecode_and_metadata_size, 0) \ |
421 /* true if being profiled. Causes collection of extra compile info. */ \ | 422 /* true if being profiled. Causes collection of extra compile info. */ \ |
422 V(bool, is_profiling, false) \ | 423 V(bool, is_profiling, false) \ |
423 /* true if a trace is being formatted through Error.prepareStackTrace. */ \ | 424 /* true if a trace is being formatted through Error.prepareStackTrace. */ \ |
424 V(bool, formatting_stack_trace, false) \ | 425 V(bool, formatting_stack_trace, false) \ |
425 ISOLATE_INIT_SIMULATOR_LIST(V) | 426 ISOLATE_INIT_SIMULATOR_LIST(V) |
426 | 427 |
427 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ | 428 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 | 1119 |
1119 BasicBlockProfiler* GetOrCreateBasicBlockProfiler(); | 1120 BasicBlockProfiler* GetOrCreateBasicBlockProfiler(); |
1120 BasicBlockProfiler* basic_block_profiler() { return basic_block_profiler_; } | 1121 BasicBlockProfiler* basic_block_profiler() { return basic_block_profiler_; } |
1121 | 1122 |
1122 std::string GetTurboCfgFileName(); | 1123 std::string GetTurboCfgFileName(); |
1123 | 1124 |
1124 #if TRACE_MAPS | 1125 #if TRACE_MAPS |
1125 int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; } | 1126 int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; } |
1126 #endif | 1127 #endif |
1127 | 1128 |
1128 Address is_promisehook_enabled_address() { | 1129 Address is_promise_hook_enabled_address() { |
1129 return reinterpret_cast<Address>(&is_promisehook_enabled_); | 1130 return reinterpret_cast<Address>(&is_promise_hook_enabled_); |
1130 } | 1131 } |
1131 bool IsPromiseHookEnabled() { return is_promisehook_enabled_; } | 1132 bool IsPromiseHookEnabled() { return is_promise_hook_enabled_; } |
1132 void EnablePromiseHook(); | 1133 void SetPromiseHook(PromiseHook hook); |
1133 void DisablePromiseHook(); | 1134 void RunPromiseHook(PromiseHookType type, Handle<JSObject> promise, |
| 1135 Handle<Object> parent); |
1134 | 1136 |
1135 // Support for dynamically disabling tail call elimination. | 1137 // Support for dynamically disabling tail call elimination. |
1136 Address is_tail_call_elimination_enabled_address() { | 1138 Address is_tail_call_elimination_enabled_address() { |
1137 return reinterpret_cast<Address>(&is_tail_call_elimination_enabled_); | 1139 return reinterpret_cast<Address>(&is_tail_call_elimination_enabled_); |
1138 } | 1140 } |
1139 bool is_tail_call_elimination_enabled() const { | 1141 bool is_tail_call_elimination_enabled() const { |
1140 return is_tail_call_elimination_enabled_; | 1142 return is_tail_call_elimination_enabled_; |
1141 } | 1143 } |
1142 void SetTailCallEliminationEnabled(bool enabled); | 1144 void SetTailCallEliminationEnabled(bool enabled); |
1143 | 1145 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 // Whether the isolate has been created for snapshotting. | 1368 // Whether the isolate has been created for snapshotting. |
1367 bool serializer_enabled_; | 1369 bool serializer_enabled_; |
1368 | 1370 |
1369 // True if fatal error has been signaled for this isolate. | 1371 // True if fatal error has been signaled for this isolate. |
1370 bool has_fatal_error_; | 1372 bool has_fatal_error_; |
1371 | 1373 |
1372 // True if this isolate was initialized from a snapshot. | 1374 // True if this isolate was initialized from a snapshot. |
1373 bool initialized_from_snapshot_; | 1375 bool initialized_from_snapshot_; |
1374 | 1376 |
1375 // True if PromiseHook feature is enabled. | 1377 // True if PromiseHook feature is enabled. |
1376 bool is_promisehook_enabled_; | 1378 bool is_promise_hook_enabled_; |
1377 | 1379 |
1378 // True if ES2015 tail call elimination feature is enabled. | 1380 // True if ES2015 tail call elimination feature is enabled. |
1379 bool is_tail_call_elimination_enabled_; | 1381 bool is_tail_call_elimination_enabled_; |
1380 | 1382 |
1381 // True if the isolate is in background. This flag is used | 1383 // True if the isolate is in background. This flag is used |
1382 // to prioritize between memory usage and latency. | 1384 // to prioritize between memory usage and latency. |
1383 bool is_isolate_in_background_; | 1385 bool is_isolate_in_background_; |
1384 | 1386 |
1385 // Time stamp at initialization. | 1387 // Time stamp at initialization. |
1386 double time_millis_at_init_; | 1388 double time_millis_at_init_; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 | 1695 |
1694 EmbeddedVector<char, 128> filename_; | 1696 EmbeddedVector<char, 128> filename_; |
1695 FILE* file_; | 1697 FILE* file_; |
1696 int scope_depth_; | 1698 int scope_depth_; |
1697 }; | 1699 }; |
1698 | 1700 |
1699 } // namespace internal | 1701 } // namespace internal |
1700 } // namespace v8 | 1702 } // namespace v8 |
1701 | 1703 |
1702 #endif // V8_ISOLATE_H_ | 1704 #endif // V8_ISOLATE_H_ |
OLD | NEW |