diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-03-21 10:16:54 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-03-25 09:44:10 +0100 |
commit | c459d8ea5d402c702948c860d9497b2230ff7e8a (patch) | |
tree | 56c282fc4d40e5cb613b47cf7be3ea0526ed5b6f /deps/v8/src/isolate.h | |
parent | e0bc5a7361b1d29c3ed034155fd779ce6f44fb13 (diff) | |
download | node-new-c459d8ea5d402c702948c860d9497b2230ff7e8a.tar.gz |
deps: update V8 to 5.7.492.69
PR-URL: https://github.com/nodejs/node/pull/11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'deps/v8/src/isolate.h')
-rw-r--r-- | deps/v8/src/isolate.h | 93 |
1 files changed, 59 insertions, 34 deletions
diff --git a/deps/v8/src/isolate.h b/deps/v8/src/isolate.h index 87bc45bb51..6bbc0fc343 100644 --- a/deps/v8/src/isolate.h +++ b/deps/v8/src/isolate.h @@ -35,6 +35,7 @@ namespace internal { class AccessCompilerData; class AddressToIndexHashMap; +class AstStringConstants; class BasicBlockProfiler; class Bootstrapper; class CancelableTaskManager; @@ -46,7 +47,7 @@ class CodeRange; class CodeStubDescriptor; class CodeTracer; class CompilationCache; -class CompilerDispatcherTracer; +class CompilerDispatcher; class CompilationStatistics; class ContextSlotCache; class Counters; @@ -250,7 +251,7 @@ class ThreadId { static int AllocateThreadId(); - static int GetCurrentThreadId(); + V8_EXPORT_PRIVATE static int GetCurrentThreadId(); base::Atomic32 id_; @@ -383,7 +384,6 @@ class ThreadLocalTop BASE_EMBEDDED { V(int, bad_char_shift_table, kUC16AlphabetSize) \ V(int, good_suffix_shift_table, (kBMMaxShift + 1)) \ V(int, suffix_table, (kBMMaxShift + 1)) \ - V(uint32_t, private_random_seed, 2) \ ISOLATE_INIT_DEBUG_ARRAY_LIST(V) typedef List<HeapObject*> DebugObjectCache; @@ -394,6 +394,8 @@ typedef List<HeapObject*> DebugObjectCache; V(OOMErrorCallback, oom_behavior, nullptr) \ V(LogEventCallback, event_logger, nullptr) \ V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, nullptr) \ + V(AllowWasmCompileCallback, allow_wasm_compile_callback, nullptr) \ + V(AllowWasmInstantiateCallback, allow_wasm_instantiate_callback, nullptr) \ V(ExternalReferenceRedirectorPointer*, external_reference_redirector, \ nullptr) \ /* State for Relocatable. */ \ @@ -404,15 +406,11 @@ typedef List<HeapObject*> DebugObjectCache; V(intptr_t*, api_external_references, nullptr) \ V(AddressToIndexHashMap*, external_reference_map, nullptr) \ V(HeapObjectToIndexHashMap*, root_index_map, nullptr) \ - V(v8::DeserializeInternalFieldsCallback, \ - deserialize_internal_fields_callback, nullptr) \ V(int, pending_microtask_count, 0) \ - V(int, debug_microtask_count, 0) \ V(HStatistics*, hstatistics, nullptr) \ V(CompilationStatistics*, turbo_statistics, nullptr) \ V(HTracer*, htracer, nullptr) \ V(CodeTracer*, code_tracer, nullptr) \ - V(bool, fp_stubs_generated, false) \ V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \ V(PromiseRejectCallback, promise_reject_callback, nullptr) \ V(const v8::StartupData*, snapshot_blob, nullptr) \ @@ -422,6 +420,8 @@ typedef List<HeapObject*> DebugObjectCache; V(bool, is_profiling, false) \ /* true if a trace is being formatted through Error.prepareStackTrace. */ \ V(bool, formatting_stack_trace, false) \ + /* Perform side effect checks on function call and API callbacks. */ \ + V(bool, needs_side_effect_check, false) \ ISOLATE_INIT_SIMULATOR_LIST(V) #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ @@ -765,7 +765,9 @@ class Isolate { Object* PromoteScheduledException(); // Attempts to compute the current source location, storing the - // result in the target out parameter. + // result in the target out parameter. The source location is attached to a + // Message object as the location which should be shown to the user. It's + // typically the top-most meaningful location on the stack. bool ComputeLocation(MessageLocation* target); bool ComputeLocationFromException(MessageLocation* target, Handle<Object> exception); @@ -905,12 +907,6 @@ class Isolate { Builtins* builtins() { return &builtins_; } - void NotifyExtensionInstalled() { - has_installed_extensions_ = true; - } - - bool has_installed_extensions() { return has_installed_extensions_; } - unibrow::Mapping<unibrow::Ecma262Canonicalize>* regexp_macro_assembler_canonicalize() { return ®exp_macro_assembler_canonicalize_; @@ -970,6 +966,8 @@ class Isolate { bool initialized_from_snapshot() { return initialized_from_snapshot_; } + bool NeedsSourcePositionsForProfiling() const; + double time_millis_since_init() { return heap_.MonotonicallyIncreasingTimeInMs() - time_millis_at_init_; } @@ -1001,6 +999,9 @@ class Isolate { // Avoid deopt loops if fast Array Iterators migrate to slow Array Iterators. inline bool IsFastArrayIterationIntact(); + // Make sure we do check for neutered array buffers. + inline bool IsArrayBufferNeuteringIntact(); + // On intent to set an element in object, make sure that appropriate // notifications occur if the set is on the elements of the array or // object prototype. Also ensure that changes to prototype chain between @@ -1020,11 +1021,13 @@ class Isolate { void InvalidateIsConcatSpreadableProtector(); void InvalidateStringLengthOverflowProtector(); void InvalidateArrayIteratorProtector(); + void InvalidateArrayBufferNeuteringProtector(); // Returns true if array is the initial array prototype in any native context. bool IsAnyInitialArrayPrototype(Handle<JSArray> array); - CallInterfaceDescriptorData* call_descriptor_data(int index); + V8_EXPORT_PRIVATE CallInterfaceDescriptorData* call_descriptor_data( + int index); AccessCompilerData* access_compiler_data() { return access_compiler_data_; } @@ -1070,7 +1073,7 @@ class Isolate { int GenerateIdentityHash(uint32_t mask); // Given an address occupied by a live code object, return that object. - Object* FindCodeObject(Address a); + Code* FindCodeObject(Address a); int NextOptimizationId() { int id = next_optimization_id_++; @@ -1080,9 +1083,6 @@ class Isolate { return id; } - // Get (and lazily initialize) the registry for per-isolate symbols. - Handle<JSObject> GetSymbolRegistry(); - void AddCallCompletedCallback(CallCompletedCallback callback); void RemoveCallCompletedCallback(CallCompletedCallback callback); void FireCallCompletedCallback(); @@ -1108,7 +1108,9 @@ class Isolate { void EnqueueMicrotask(Handle<Object> microtask); void RunMicrotasks(); bool IsRunningMicrotasks() const { return is_running_microtasks_; } - int GetNextDebugMicrotaskId() { return debug_microtask_count_++; } + + Handle<Symbol> SymbolFor(Heap::RootListIndex dictionary_index, + Handle<String> name, bool private_symbol); void SetUseCounterCallback(v8::Isolate::UseCounterCallback callback); void CountUsage(v8::Isolate::UseCounterFeature feature); @@ -1122,6 +1124,13 @@ class Isolate { int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; } #endif + Address promise_hook_address() { + return reinterpret_cast<Address>(&promise_hook_); + } + void SetPromiseHook(PromiseHook hook); + void RunPromiseHook(PromiseHookType type, Handle<JSPromise> promise, + Handle<Object> parent); + // Support for dynamically disabling tail call elimination. Address is_tail_call_elimination_enabled_address() { return reinterpret_cast<Address>(&is_tail_call_elimination_enabled_); @@ -1149,18 +1158,32 @@ class Isolate { return cancelable_task_manager_; } + AstStringConstants* ast_string_constants() const { + return ast_string_constants_; + } + interpreter::Interpreter* interpreter() const { return interpreter_; } AccountingAllocator* allocator() { return allocator_; } - CompilerDispatcherTracer* compiler_dispatcher_tracer() const { - return compiler_dispatcher_tracer_; + CompilerDispatcher* compiler_dispatcher() const { + return compiler_dispatcher_; } + // Clear all optimized code stored in native contexts. + void ClearOSROptimizedCode(); + + // Ensure that a particular optimized code is evicted. + void EvictOSROptimizedCode(Code* code, const char* reason); + bool IsInAnyContext(Object* object, uint32_t index); void SetRAILMode(RAILMode rail_mode); + RAILMode rail_mode() { return rail_mode_.Value(); } + + double LoadStartTimeMs(); + void IsolateInForegroundNotification(); void IsolateInBackgroundNotification(); @@ -1180,8 +1203,6 @@ class Isolate { private: friend struct GlobalState; friend struct InitializeGlobalState; - Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, - const char* name); // These fields are accessed through the API, offsets must be kept in sync // with v8::internal::Internals (in include/v8.h) constants. This is also @@ -1337,7 +1358,6 @@ class Isolate { ThreadManager* thread_manager_; RuntimeState runtime_state_; Builtins builtins_; - bool has_installed_extensions_; unibrow::Mapping<unibrow::Ecma262UnCanonicalize> jsregexp_uncanonicalize_; unibrow::Mapping<unibrow::CanonicalizationRange> jsregexp_canonrange_; unibrow::Mapping<unibrow::Ecma262Canonicalize> @@ -1349,6 +1369,9 @@ class Isolate { AccessCompilerData* access_compiler_data_; base::RandomNumberGenerator* random_number_generator_; base::AtomicValue<RAILMode> rail_mode_; + PromiseHook promise_hook_; + base::Mutex rail_mutex_; + double load_start_time_ms_; // Whether the isolate has been created for snapshotting. bool serializer_enabled_; @@ -1381,9 +1404,11 @@ class Isolate { std::unique_ptr<CodeEventDispatcher> code_event_dispatcher_; FunctionEntryHook function_entry_hook_; + AstStringConstants* ast_string_constants_; + interpreter::Interpreter* interpreter_; - CompilerDispatcherTracer* compiler_dispatcher_tracer_; + CompilerDispatcher* compiler_dispatcher_; typedef std::pair<InterruptCallback, void*> InterruptEntry; std::queue<InterruptEntry> api_interrupts_queue_; @@ -1451,6 +1476,7 @@ class Isolate { friend class ExecutionAccess; friend class HandleScopeImplementer; + friend class HeapTester; friend class OptimizingCompileDispatcher; friend class SweeperThread; friend class ThreadManager; @@ -1571,14 +1597,13 @@ class StackLimitCheck BASE_EMBEDDED { Isolate* isolate_; }; -#define STACK_CHECK(isolate, result_value) \ - do { \ - StackLimitCheck stack_check(isolate); \ - if (stack_check.HasOverflowed()) { \ - isolate->Throw(*isolate->factory()->NewRangeError( \ - MessageTemplate::kStackOverflow)); \ - return result_value; \ - } \ +#define STACK_CHECK(isolate, result_value) \ + do { \ + StackLimitCheck stack_check(isolate); \ + if (stack_check.HasOverflowed()) { \ + isolate->StackOverflow(); \ + return result_value; \ + } \ } while (false) // Support for temporarily postponing interrupts. When the outermost |