diff options
Diffstat (limited to 'deps/v8/src/runtime')
-rw-r--r-- | deps/v8/src/runtime/runtime-atomics.cc | 5 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-classes.cc | 94 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-compiler.cc | 125 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-debug.cc | 42 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-internal.cc | 73 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-literals.cc | 47 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-module.cc | 15 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-object.cc | 39 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-regexp.cc | 89 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-scopes.cc | 10 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-strings.cc | 66 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-test.cc | 134 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-trace.cc (renamed from deps/v8/src/runtime/runtime-interpreter.cc) | 66 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-wasm.cc | 150 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime.h | 113 |
15 files changed, 609 insertions, 459 deletions
diff --git a/deps/v8/src/runtime/runtime-atomics.cc b/deps/v8/src/runtime/runtime-atomics.cc index 2b17ad52b1..6ea4e04d63 100644 --- a/deps/v8/src/runtime/runtime-atomics.cc +++ b/deps/v8/src/runtime/runtime-atomics.cc @@ -19,7 +19,8 @@ namespace internal { // Other platforms have CSA support, see builtins-sharedarraybuffer-gen.h. #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \ - V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X + V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X || \ + V8_TARGET_ARCH_RISCV64 namespace { @@ -568,6 +569,6 @@ RUNTIME_FUNCTION(Runtime_AtomicsXor) { UNREACHABLE(); } #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 // || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X - + // || V8_TARGET_ARCH_RISCV64 } // namespace internal } // namespace v8 diff --git a/deps/v8/src/runtime/runtime-classes.cc b/deps/v8/src/runtime/runtime-classes.cc index 3e9b9bfd09..87456ad3a5 100644 --- a/deps/v8/src/runtime/runtime-classes.cc +++ b/deps/v8/src/runtime/runtime-classes.cc @@ -113,11 +113,6 @@ RUNTIME_FUNCTION(Runtime_ThrowNotSuperConstructor) { return ThrowNotSuperConstructor(isolate, constructor, function); } -RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { - DCHECK_EQ(0, args.length()); - return ReadOnlyRoots(isolate).home_object_symbol(); -} - namespace { template <typename Dictionary> @@ -134,35 +129,17 @@ Handle<Name> KeyToName<NumberDictionary>(Isolate* isolate, Handle<Object> key) { return isolate->factory()->NumberToString(key); } -inline void SetHomeObject(Isolate* isolate, JSFunction method, - JSObject home_object) { - if (method.shared().needs_home_object()) { - const InternalIndex kPropertyIndex( - JSFunction::kMaybeHomeObjectDescriptorIndex); - CHECK_EQ( - method.map().instance_descriptors(kRelaxedLoad).GetKey(kPropertyIndex), - ReadOnlyRoots(isolate).home_object_symbol()); - - FieldIndex field_index = - FieldIndex::ForDescriptor(method.map(), kPropertyIndex); - method.RawFastPropertyAtPut(field_index, home_object); - } -} - // Gets |index|'th argument which may be a class constructor object, a class // prototype object or a class method. In the latter case the following // post-processing may be required: -// 1) set [[HomeObject]] slot to given |home_object| value if the method's -// shared function info indicates that the method requires that; -// 2) set method's name to a concatenation of |name_prefix| and |key| if the +// 1) set method's name to a concatenation of |name_prefix| and |key| if the // method's shared function info indicates that method does not have a // shared name. template <typename Dictionary> -MaybeHandle<Object> GetMethodAndSetHomeObjectAndName( +MaybeHandle<Object> GetMethodAndSetName( Isolate* isolate, RuntimeArguments& args, // NOLINT(runtime/references) - Smi index, Handle<JSObject> home_object, Handle<String> name_prefix, - Handle<Object> key) { + Smi index, Handle<String> name_prefix, Handle<Object> key) { int int_index = index.value(); // Class constructor and prototype values do not require post processing. @@ -172,8 +149,6 @@ MaybeHandle<Object> GetMethodAndSetHomeObjectAndName( Handle<JSFunction> method = args.at<JSFunction>(int_index); - SetHomeObject(isolate, *method, *home_object); - if (!method->shared().HasSharedName()) { // TODO(ishell): method does not have a shared name at this point only if // the key is a computed property name. However, the bytecode generator @@ -189,17 +164,14 @@ MaybeHandle<Object> GetMethodAndSetHomeObjectAndName( } // Gets |index|'th argument which may be a class constructor object, a class -// prototype object or a class method. In the latter case the following -// post-processing may be required: -// 1) set [[HomeObject]] slot to given |home_object| value if the method's -// shared function info indicates that the method requires that; -// This is a simplified version of GetMethodWithSharedNameAndSetHomeObject() +// prototype object or a class method. +// This is a simplified version of GetMethodAndSetName() // function above that is used when it's guaranteed that the method has // shared name. -Object GetMethodWithSharedNameAndSetHomeObject( +Object GetMethodWithSharedName( Isolate* isolate, RuntimeArguments& args, // NOLINT(runtime/references) - Object index, JSObject home_object) { + Object index) { DisallowGarbageCollection no_gc; int int_index = Smi::ToInt(index); @@ -209,9 +181,6 @@ Object GetMethodWithSharedNameAndSetHomeObject( } Handle<JSFunction> method = args.at<JSFunction>(int_index); - - SetHomeObject(isolate, *method, home_object); - DCHECK(method->shared().HasSharedName()); return *method; } @@ -237,7 +206,6 @@ Handle<Dictionary> ShallowCopyDictionaryTemplate( template <typename Dictionary> bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary, - Handle<JSObject> receiver, RuntimeArguments& args, // NOLINT(runtime/references) bool* install_name_accessor = nullptr) { Handle<Name> name_string = isolate->factory()->name_string(); @@ -260,9 +228,9 @@ bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary, Handle<Object> result; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, result, - GetMethodAndSetHomeObjectAndName<Dictionary>( - isolate, args, Smi::cast(tmp), receiver, - isolate->factory()->get_string(), key), + GetMethodAndSetName<Dictionary>(isolate, args, Smi::cast(tmp), + isolate->factory()->get_string(), + key), false); pair->set_getter(*result); } @@ -271,9 +239,9 @@ bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary, Handle<Object> result; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, result, - GetMethodAndSetHomeObjectAndName<Dictionary>( - isolate, args, Smi::cast(tmp), receiver, - isolate->factory()->set_string(), key), + GetMethodAndSetName<Dictionary>(isolate, args, Smi::cast(tmp), + isolate->factory()->set_string(), + key), false); pair->set_setter(*result); } @@ -281,9 +249,9 @@ bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary, Handle<Object> result; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, result, - GetMethodAndSetHomeObjectAndName<Dictionary>( - isolate, args, Smi::cast(*value), receiver, - isolate->factory()->empty_string(), key), + GetMethodAndSetName<Dictionary>(isolate, args, Smi::cast(*value), + isolate->factory()->empty_string(), + key), false); dictionary->ValueAtPut(i, *result); } @@ -359,8 +327,7 @@ bool AddDescriptorsByTemplate( if (details.location() == kDescriptor) { if (details.kind() == kData) { if (value.IsSmi()) { - value = GetMethodWithSharedNameAndSetHomeObject(isolate, args, value, - *receiver); + value = GetMethodWithSharedName(isolate, args, value); } details = details.CopyWithRepresentation( value.OptimalRepresentation(isolate)); @@ -370,13 +337,11 @@ bool AddDescriptorsByTemplate( AccessorPair pair = AccessorPair::cast(value); Object tmp = pair.getter(); if (tmp.IsSmi()) { - pair.set_getter(GetMethodWithSharedNameAndSetHomeObject( - isolate, args, tmp, *receiver)); + pair.set_getter(GetMethodWithSharedName(isolate, args, tmp)); } tmp = pair.setter(); if (tmp.IsSmi()) { - pair.set_setter(GetMethodWithSharedNameAndSetHomeObject( - isolate, args, tmp, *receiver)); + pair.set_setter(GetMethodWithSharedName(isolate, args, tmp)); } } } @@ -401,11 +366,10 @@ bool AddDescriptorsByTemplate( UpdateProtectors(isolate, receiver, descriptors_template); - map->InitializeDescriptors(isolate, *descriptors, - LayoutDescriptor::FastPointerLayout()); + map->InitializeDescriptors(isolate, *descriptors); if (elements_dictionary->NumberOfElements() > 0) { if (!SubstituteValues<NumberDictionary>(isolate, elements_dictionary, - receiver, args)) { + args)) { return false; } map->set_elements_kind(DICTIONARY_ELEMENTS); @@ -480,14 +444,15 @@ bool AddDescriptorsByTemplate( } // Replace all indices with proper methods. - if (!SubstituteValues<Dictionary>(isolate, properties_dictionary, receiver, - args, &install_name_accessor)) { + if (!SubstituteValues<Dictionary>(isolate, properties_dictionary, args, + &install_name_accessor)) { return false; } if (install_name_accessor) { PropertyAttributes attribs = static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); - PropertyDetails details(kAccessor, attribs, PropertyCellType::kNoCell); + PropertyDetails details(kAccessor, attribs, + PropertyDetails::kConstIfDictConstnessTracking); Handle<Dictionary> dict = ToHandle(Dictionary::Add( isolate, properties_dictionary, isolate->factory()->name_string(), isolate->factory()->function_name_accessor(), details)); @@ -498,7 +463,7 @@ bool AddDescriptorsByTemplate( if (elements_dictionary->NumberOfElements() > 0) { if (!SubstituteValues<NumberDictionary>(isolate, elements_dictionary, - receiver, args)) { + args)) { return false; } map->set_elements_kind(DICTIONARY_ELEMENTS); @@ -594,6 +559,8 @@ bool InitClassConstructor( // Set map's prototype without enabling prototype setup mode for superclass // because it does not make sense. Map::SetPrototype(isolate, map, constructor_parent, false); + // Ensure that setup mode will never be enabled for superclass. + JSObject::MakePrototypesFast(constructor_parent, kStartAtReceiver, isolate); } Handle<NumberDictionary> elements_dictionary_template( @@ -615,8 +582,7 @@ bool InitClassConstructor( } else { map->set_is_dictionary_map(true); map->InitializeDescriptors(isolate, - ReadOnlyRoots(isolate).empty_descriptor_array(), - LayoutDescriptor::FastPointerLayout()); + ReadOnlyRoots(isolate).empty_descriptor_array()); map->set_is_migration_target(false); map->set_may_have_interesting_symbols(true); map->set_construction_counter(Map::kNoSlackTracking); @@ -695,7 +661,7 @@ MaybeHandle<Object> DefineClass( DCHECK(isolate->has_pending_exception()); return MaybeHandle<Object>(); } - if (FLAG_trace_maps) { + if (FLAG_log_maps) { Handle<Map> empty_map; LOG(isolate, MapEvent("InitialMap", empty_map, handle(constructor->map(), isolate), diff --git a/deps/v8/src/runtime/runtime-compiler.cc b/deps/v8/src/runtime/runtime-compiler.cc index 5377e80548..0897f685fc 100644 --- a/deps/v8/src/runtime/runtime-compiler.cc +++ b/deps/v8/src/runtime/runtime-compiler.cc @@ -3,19 +3,25 @@ // found in the LICENSE file. #include "src/asmjs/asm-js.h" +#include "src/baseline/baseline.h" #include "src/codegen/compilation-cache.h" #include "src/codegen/compiler.h" +#include "src/codegen/optimized-compilation-info.h" #include "src/common/assert-scope.h" +#include "src/common/globals.h" #include "src/common/message-template.h" #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" +#include "src/compiler/pipeline.h" #include "src/deoptimizer/deoptimizer.h" #include "src/execution/arguments-inl.h" #include "src/execution/frames-inl.h" #include "src/execution/isolate-inl.h" #include "src/execution/v8threads.h" #include "src/execution/vm-state-inl.h" +#include "src/heap/parked-scope.h" #include "src/objects/js-array-buffer-inl.h" #include "src/objects/js-array-inl.h" +#include "src/objects/shared-function-info.h" #include "src/runtime/runtime-utils.h" namespace v8 { @@ -25,27 +31,10 @@ namespace { // Returns false iff an exception was thrown. bool MaybeSpawnNativeContextIndependentCompilationJob( - Handle<JSFunction> function, ConcurrencyMode mode) { - if (!FLAG_turbo_nci || FLAG_turbo_nci_as_midtier) { - return true; // Nothing to do. - } - - // If delayed codegen is enabled, the first optimization request does not - // trigger NCI compilation, since we try to avoid compiling Code that - // remains unused in the future. Repeated optimization (possibly in - // different native contexts) is taken as a signal that this SFI will - // continue to be used in the future, thus we trigger NCI compilation. - if (!FLAG_turbo_nci_delayed_codegen || - function->shared().has_optimized_at_least_once()) { - if (!Compiler::CompileOptimized(function, mode, - CodeKind::NATIVE_CONTEXT_INDEPENDENT)) { - return false; - } - } else { - function->shared().set_has_optimized_at_least_once(true); - } - - return true; + Isolate* isolate, Handle<JSFunction> function, ConcurrencyMode mode) { + if (!FLAG_turbo_nci) return true; // Nothing to do. + return Compiler::CompileOptimized(isolate, function, mode, + CodeKind::NATIVE_CONTEXT_INDEPENDENT); } Object CompileOptimized(Isolate* isolate, Handle<JSFunction> function, @@ -56,12 +45,14 @@ Object CompileOptimized(Isolate* isolate, Handle<JSFunction> function, } // Compile for the next tier. - if (!Compiler::CompileOptimized(function, mode, function->NextTier())) { + if (!Compiler::CompileOptimized(isolate, function, mode, + function->NextTier())) { return ReadOnlyRoots(isolate).exception(); } // Possibly compile for NCI caching. - if (!MaybeSpawnNativeContextIndependentCompilationJob(function, mode)) { + if (!MaybeSpawnNativeContextIndependentCompilationJob(isolate, function, + mode)) { return ReadOnlyRoots(isolate).exception(); } @@ -81,7 +72,7 @@ void TryInstallNCICode(Isolate* isolate, Handle<JSFunction> function, Handle<Code> code; if (sfi->TryGetCachedCode(isolate).ToHandle(&code)) { - function->set_code(*code); + function->set_code(*code, kReleaseStore); JSFunction::EnsureFeedbackVector(function, is_compiled_scope); if (FLAG_trace_turbo_nci) CompilationCacheCode::TraceHit(sfi, code); } @@ -109,7 +100,7 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) { return isolate->StackOverflow(); } IsCompiledScope is_compiled_scope; - if (!Compiler::Compile(function, Compiler::KEEP_EXCEPTION, + if (!Compiler::Compile(isolate, function, Compiler::KEEP_EXCEPTION, &is_compiled_scope)) { return ReadOnlyRoots(isolate).exception(); } @@ -120,6 +111,22 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) { return function->code(); } +RUNTIME_FUNCTION(Runtime_InstallBaselineCode) { + HandleScope scope(isolate); + DCHECK_EQ(1, args.length()); + CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); + Handle<SharedFunctionInfo> sfi(function->shared(), isolate); + DCHECK(sfi->HasBaselineData()); + IsCompiledScope is_compiled_scope(*sfi, isolate); + DCHECK(!function->HasAvailableOptimizedCode()); + DCHECK(!function->HasOptimizationMarker()); + DCHECK(!function->has_feedback_vector()); + JSFunction::EnsureFeedbackVector(function, &is_compiled_scope); + Code baseline_code = sfi->baseline_data().baseline_code(); + function->set_code(baseline_code); + return baseline_code; +} + RUNTIME_FUNCTION(Runtime_TryInstallNCICode) { HandleScope scope(isolate); DCHECK_EQ(1, args.length()); @@ -174,7 +181,8 @@ RUNTIME_FUNCTION(Runtime_HealOptimizedCodeSlot) { DCHECK(function->shared().is_compiled()); function->feedback_vector().EvictOptimizedCodeMarkedForDeoptimization( - function->shared(), "Runtime_HealOptimizedCodeSlot"); + function->raw_feedback_cell(), function->shared(), + "Runtime_HealOptimizedCodeSlot"); return function->code(); } @@ -197,10 +205,12 @@ RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) { } Handle<SharedFunctionInfo> shared(function->shared(), isolate); if (shared->HasAsmWasmData()) { +#if V8_ENABLE_WEBASSEMBLY Handle<AsmWasmData> data(shared->asm_wasm_data(), isolate); MaybeHandle<Object> result = AsmJs::InstantiateAsmWasm( isolate, shared, data, stdlib, foreign, memory); if (!result.is_null()) return *result.ToHandleChecked(); +#endif // Remove wasm data, mark as broken for asm->wasm, replace function code // with UncompiledData, and return a smi 0 to indicate failure. SharedFunctionInfo::DiscardCompiled(isolate, shared); @@ -257,6 +267,14 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { return ReadOnlyRoots(isolate).undefined_value(); } +RUNTIME_FUNCTION(Runtime_ObserveNode) { + // The %ObserveNode intrinsic only tracks the changes to an observed node in + // code compiled by TurboFan. + HandleScope scope(isolate); + DCHECK_EQ(1, args.length()); + CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); + return *obj; +} static bool IsSuitableForOnStackReplacement(Isolate* isolate, Handle<JSFunction> function) { @@ -283,24 +301,30 @@ static bool IsSuitableForOnStackReplacement(Isolate* isolate, namespace { -BailoutId DetermineEntryAndDisarmOSRForInterpreter(JavaScriptFrame* frame) { - InterpretedFrame* iframe = reinterpret_cast<InterpretedFrame*>(frame); +BytecodeOffset DetermineEntryAndDisarmOSRForUnoptimized( + JavaScriptFrame* js_frame) { + UnoptimizedFrame* frame = reinterpret_cast<UnoptimizedFrame*>(js_frame); // Note that the bytecode array active on the stack might be different from // the one installed on the function (e.g. patched by debugger). This however - // is fine because we guarantee the layout to be in sync, hence any BailoutId - // representing the entry point will be valid for any copy of the bytecode. - Handle<BytecodeArray> bytecode(iframe->GetBytecodeArray(), iframe->isolate()); - - DCHECK(frame->LookupCode().is_interpreter_trampoline_builtin()); + // is fine because we guarantee the layout to be in sync, hence any + // BytecodeOffset representing the entry point will be valid for any copy of + // the bytecode. + Handle<BytecodeArray> bytecode(frame->GetBytecodeArray(), frame->isolate()); + + DCHECK_IMPLIES(frame->is_interpreted(), + frame->LookupCode().is_interpreter_trampoline_builtin()); + DCHECK_IMPLIES(frame->is_baseline(), + frame->LookupCode().kind() == CodeKind::BASELINE); + DCHECK(frame->is_unoptimized()); DCHECK(frame->function().shared().HasBytecodeArray()); - DCHECK(frame->is_interpreted()); // Reset the OSR loop nesting depth to disarm back edges. bytecode->set_osr_loop_nesting_level(0); - // Return a BailoutId representing the bytecode offset of the back branch. - return BailoutId(iframe->GetBytecodeOffset()); + // Return a BytecodeOffset representing the bytecode offset of the back + // branch. + return BytecodeOffset(frame->GetBytecodeOffset()); } } // namespace @@ -315,12 +339,12 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { // Determine frame triggering OSR request. JavaScriptFrameIterator it(isolate); JavaScriptFrame* frame = it.frame(); - DCHECK(frame->is_interpreted()); + DCHECK(frame->is_unoptimized()); // Determine the entry point for which this OSR request has been fired and // also disarm all back edges in the calling code to stop new requests. - BailoutId ast_id = DetermineEntryAndDisarmOSRForInterpreter(frame); - DCHECK(!ast_id.IsNone()); + BytecodeOffset osr_offset = DetermineEntryAndDisarmOSRForUnoptimized(frame); + DCHECK(!osr_offset.IsNone()); MaybeHandle<Code> maybe_result; Handle<JSFunction> function(frame->function(), isolate); @@ -329,15 +353,17 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { CodeTracer::Scope scope(isolate->GetCodeTracer()); PrintF(scope.file(), "[OSR - Compiling: "); function->PrintName(scope.file()); - PrintF(scope.file(), " at AST id %d]\n", ast_id.ToInt()); + PrintF(scope.file(), " at OSR bytecode offset %d]\n", osr_offset.ToInt()); } - maybe_result = Compiler::GetOptimizedCodeForOSR(function, ast_id, frame); + maybe_result = + Compiler::GetOptimizedCodeForOSR(function, osr_offset, frame); // Possibly compile for NCI caching. if (!MaybeSpawnNativeContextIndependentCompilationJob( - function, isolate->concurrent_recompilation_enabled() - ? ConcurrencyMode::kConcurrent - : ConcurrencyMode::kNotConcurrent)) { + isolate, function, + isolate->concurrent_recompilation_enabled() + ? ConcurrencyMode::kConcurrent + : ConcurrencyMode::kNotConcurrent)) { return Object(); } } @@ -350,12 +376,13 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { DeoptimizationData::cast(result->deoptimization_data()); if (data.OsrPcOffset().value() >= 0) { - DCHECK(BailoutId(data.OsrBytecodeOffset().value()) == ast_id); + DCHECK(BytecodeOffset(data.OsrBytecodeOffset().value()) == osr_offset); if (FLAG_trace_osr) { CodeTracer::Scope scope(isolate->GetCodeTracer()); PrintF(scope.file(), - "[OSR - Entry at AST id %d, offset %d in optimized code]\n", - ast_id.ToInt(), data.OsrPcOffset().value()); + "[OSR - Entry at OSR bytecode offset %d, offset %d in optimized " + "code]\n", + osr_offset.ToInt(), data.OsrPcOffset().value()); } DCHECK(result->is_turbofanned()); @@ -399,11 +426,11 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { CodeTracer::Scope scope(isolate->GetCodeTracer()); PrintF(scope.file(), "[OSR - Failed: "); function->PrintName(scope.file()); - PrintF(scope.file(), " at AST id %d]\n", ast_id.ToInt()); + PrintF(scope.file(), " at OSR bytecode offset %d]\n", osr_offset.ToInt()); } if (!function->HasAttachedOptimizedCode()) { - function->set_code(function->shared().GetCode()); + function->set_code(function->shared().GetCode(), kReleaseStore); } return Object(); } diff --git a/deps/v8/src/runtime/runtime-debug.cc b/deps/v8/src/runtime/runtime-debug.cc index ce91550684..e7ebfa2c18 100644 --- a/deps/v8/src/runtime/runtime-debug.cc +++ b/deps/v8/src/runtime/runtime-debug.cc @@ -10,6 +10,7 @@ #include "src/debug/debug-evaluate.h" #include "src/debug/debug-frames.h" #include "src/debug/debug-scopes.h" +#include "src/debug/debug-wasm-objects.h" #include "src/debug/debug.h" #include "src/debug/liveedit.h" #include "src/execution/arguments-inl.h" @@ -325,7 +326,7 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate, kExternalInt32Array, }; Handle<FixedArray> result = - factory->NewFixedArray((2 + arraysize(kTypes)) * 2); + factory->NewFixedArray((3 + arraysize(kTypes)) * 2); int index = 0; for (auto type : kTypes) { switch (type) { @@ -349,36 +350,41 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate, } Handle<String> byte_length_str = factory->NewStringFromAsciiChecked("[[ArrayBufferByteLength]]"); - result->set(index++, *byte_length_str); Handle<Object> byte_length_obj = factory->NewNumberFromSize(byte_length); + result->set(index++, *byte_length_str); result->set(index++, *byte_length_obj); + Handle<String> buffer_data_str = factory->NewStringFromAsciiChecked("[[ArrayBufferData]]"); - result->set(index++, *buffer_data_str); // Use the backing store pointer as a unique ID EmbeddedVector<char, 32> buffer_data_vec; int len = SNPrintF(buffer_data_vec, V8PRIxPTR_FMT, reinterpret_cast<Address>(js_array_buffer->backing_store())); - Handle<String> buffer_id = + Handle<String> buffer_data_obj = factory->InternalizeUtf8String(buffer_data_vec.SubVector(0, len)); - result->set(index++, *buffer_id); + result->set(index++, *buffer_data_str); + result->set(index++, *buffer_data_obj); + + Handle<Symbol> memory_symbol = factory->array_buffer_wasm_memory_symbol(); + Handle<Object> memory_object = + JSObject::GetDataProperty(js_array_buffer, memory_symbol); + if (!memory_object->IsUndefined(isolate)) { + Handle<String> buffer_memory_str = + factory->NewStringFromAsciiChecked("[[WebAssemblyMemory]]"); + Handle<WasmMemoryObject> buffer_memory_obj = + Handle<WasmMemoryObject>::cast(memory_object); + result->set(index++, *buffer_memory_str); + result->set(index++, *buffer_memory_obj); + } return factory->NewJSArrayWithElements(result, PACKED_ELEMENTS, index); + } else if (object->IsWasmInstanceObject()) { + return GetWasmInstanceObjectInternalProperties( + Handle<WasmInstanceObject>::cast(object)); } else if (object->IsWasmModuleObject()) { - auto module_object = Handle<WasmModuleObject>::cast(object); - Handle<FixedArray> result = factory->NewFixedArray(2 * 2); - Handle<String> exports_str = - factory->NewStringFromStaticChars("[[Exports]]"); - Handle<JSArray> exports_obj = wasm::GetExports(isolate, module_object); - result->set(0, *exports_str); - result->set(1, *exports_obj); - Handle<String> imports_str = - factory->NewStringFromStaticChars("[[Imports]]"); - Handle<JSArray> imports_obj = wasm::GetImports(isolate, module_object); - result->set(2, *imports_str); - result->set(3, *imports_obj); - return factory->NewJSArrayWithElements(result, PACKED_ELEMENTS); + return GetWasmModuleObjectInternalProperties( + Handle<WasmModuleObject>::cast(object)); } return factory->NewJSArray(0); } diff --git a/deps/v8/src/runtime/runtime-internal.cc b/deps/v8/src/runtime/runtime-internal.cc index e51085c00e..3eebf507f0 100644 --- a/deps/v8/src/runtime/runtime-internal.cc +++ b/deps/v8/src/runtime/runtime-internal.cc @@ -7,6 +7,7 @@ #include "src/api/api.h" #include "src/ast/ast-traversal-visitor.h" #include "src/ast/prettyprinter.h" +#include "src/baseline/baseline.h" #include "src/builtins/builtins.h" #include "src/common/message-template.h" #include "src/debug/debug.h" @@ -330,11 +331,16 @@ RUNTIME_FUNCTION(Runtime_BytecodeBudgetInterruptFromBytecode) { HandleScope scope(isolate); DCHECK_EQ(1, args.length()); CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); - function->raw_feedback_cell().set_interrupt_budget(FLAG_interrupt_budget); + function->SetInterruptBudget(); if (!function->has_feedback_vector()) { IsCompiledScope is_compiled_scope( function->shared().is_compiled_scope(isolate)); JSFunction::EnsureFeedbackVector(function, &is_compiled_scope); + DCHECK(is_compiled_scope.is_compiled()); + if (FLAG_sparkplug) { + Compiler::CompileBaseline(isolate, function, Compiler::CLEAR_EXCEPTION, + &is_compiled_scope); + } // Also initialize the invocation count here. This is only really needed for // OSR. When we OSR functions with lazy feedback allocation we want to have // a non zero invocation count so we can inline functions. @@ -356,7 +362,7 @@ RUNTIME_FUNCTION(Runtime_BytecodeBudgetInterruptFromCode) { DCHECK(feedback_cell->value().IsFeedbackVector()); - feedback_cell->set_interrupt_budget(FLAG_interrupt_budget); + FeedbackVector::SetInterruptBudget(*feedback_cell); SealHandleScope shs(isolate); isolate->counters()->runtime_profiler_ticks()->Increment(); @@ -505,7 +511,7 @@ RUNTIME_FUNCTION(Runtime_IncrementUseCounter) { RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) { HandleScope scope(isolate); - + DCHECK_LE(args.length(), 2); // Append any worker thread runtime call stats to the main table before // printing. isolate->counters()->worker_thread_runtime_call_stats()->AddToMainTable( @@ -513,47 +519,42 @@ RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) { if (args.length() == 0) { // Without arguments, the result is returned as a string. - DCHECK_EQ(0, args.length()); std::stringstream stats_stream; isolate->counters()->runtime_call_stats()->Print(stats_stream); Handle<String> result = isolate->factory()->NewStringFromAsciiChecked( stats_stream.str().c_str()); isolate->counters()->runtime_call_stats()->Reset(); return *result; + } + + std::FILE* f; + if (args[0].IsString()) { + // With a string argument, the results are appended to that file. + CONVERT_ARG_HANDLE_CHECKED(String, filename, 0); + f = std::fopen(filename->ToCString().get(), "a"); + DCHECK_NOT_NULL(f); } else { - DCHECK_LE(args.length(), 2); - std::FILE* f; - if (args[0].IsString()) { - // With a string argument, the results are appended to that file. - CONVERT_ARG_HANDLE_CHECKED(String, arg0, 0); - DisallowGarbageCollection no_gc; - String::FlatContent flat = arg0->GetFlatContent(no_gc); - const char* filename = - reinterpret_cast<const char*>(&(flat.ToOneByteVector()[0])); - f = std::fopen(filename, "a"); - DCHECK_NOT_NULL(f); - } else { - // With an integer argument, the results are written to stdout/stderr. - CONVERT_SMI_ARG_CHECKED(fd, 0); - DCHECK(fd == 1 || fd == 2); - f = fd == 1 ? stdout : stderr; - } - // The second argument (if any) is a message header to be printed. - if (args.length() >= 2) { - CONVERT_ARG_HANDLE_CHECKED(String, arg1, 1); - arg1->PrintOn(f); - std::fputc('\n', f); - std::fflush(f); - } - OFStream stats_stream(f); - isolate->counters()->runtime_call_stats()->Print(stats_stream); - isolate->counters()->runtime_call_stats()->Reset(); - if (args[0].IsString()) - std::fclose(f); - else - std::fflush(f); - return ReadOnlyRoots(isolate).undefined_value(); + // With an integer argument, the results are written to stdout/stderr. + CONVERT_SMI_ARG_CHECKED(fd, 0); + DCHECK(fd == 1 || fd == 2); + f = fd == 1 ? stdout : stderr; + } + // The second argument (if any) is a message header to be printed. + if (args.length() >= 2) { + CONVERT_ARG_HANDLE_CHECKED(String, message, 1); + message->PrintOn(f); + std::fputc('\n', f); + std::fflush(f); } + OFStream stats_stream(f); + isolate->counters()->runtime_call_stats()->Print(stats_stream); + isolate->counters()->runtime_call_stats()->Reset(); + if (args[0].IsString()) { + std::fclose(f); + } else { + std::fflush(f); + } + return ReadOnlyRoots(isolate).undefined_value(); } RUNTIME_FUNCTION(Runtime_OrdinaryHasInstance) { diff --git a/deps/v8/src/runtime/runtime-literals.cc b/deps/v8/src/runtime/runtime-literals.cc index dfe738cdba..d0ca45d15a 100644 --- a/deps/v8/src/runtime/runtime-literals.cc +++ b/deps/v8/src/runtime/runtime-literals.cc @@ -120,7 +120,6 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk( FieldIndex index = FieldIndex::ForPropertyIndex( copy->map(isolate), details.field_index(), details.representation()); - if (copy->IsUnboxedDoubleField(isolate, index)) continue; Object raw = copy->RawFastPropertyAt(isolate, index); if (raw.IsJSObject(isolate)) { Handle<JSObject> value(JSObject::cast(raw), isolate); @@ -521,7 +520,7 @@ Handle<JSObject> CreateArrayLiteral( inline DeepCopyHints DecodeCopyHints(int flags) { DeepCopyHints copy_hints = (flags & AggregateLiteral::kIsShallow) ? kObjectIsShallow : kNoHints; - if (FLAG_track_double_fields && !FLAG_unbox_double_fields) { + if (FLAG_track_double_fields) { // Make sure we properly clone mutable heap numbers on 32-bit platforms. copy_hints = kNoHints; } @@ -666,36 +665,46 @@ RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) { CONVERT_ARG_HANDLE_CHECKED(String, pattern, 2); CONVERT_SMI_ARG_CHECKED(flags, 3); - Handle<FeedbackVector> vector; - if (maybe_vector->IsFeedbackVector()) { - vector = Handle<FeedbackVector>::cast(maybe_vector); - } else { - DCHECK(maybe_vector->IsUndefined()); - } - if (vector.is_null()) { - Handle<JSRegExp> new_regexp; - ASSIGN_RETURN_FAILURE_ON_EXCEPTION( - isolate, new_regexp, - JSRegExp::New(isolate, pattern, JSRegExp::Flags(flags))); - return *new_regexp; + if (maybe_vector->IsUndefined()) { + // We don't have a vector; don't create a boilerplate, simply construct a + // plain JSRegExp instance and return it. + RETURN_RESULT_OR_FAILURE( + isolate, JSRegExp::New(isolate, pattern, JSRegExp::Flags(flags))); } - // This function assumes that the boilerplate does not yet exist. + Handle<FeedbackVector> vector = Handle<FeedbackVector>::cast(maybe_vector); FeedbackSlot literal_slot(FeedbackVector::ToSlot(index)); Handle<Object> literal_site(vector->Get(literal_slot)->cast<Object>(), isolate); + + // This function must not be called when a boilerplate already exists (if it + // exists, callers should instead copy the boilerplate into a new JSRegExp + // instance). CHECK(!HasBoilerplate(literal_site)); - Handle<JSRegExp> boilerplate; + Handle<JSRegExp> regexp_instance; ASSIGN_RETURN_FAILURE_ON_EXCEPTION( - isolate, boilerplate, + isolate, regexp_instance, JSRegExp::New(isolate, pattern, JSRegExp::Flags(flags))); + + // JSRegExp literal sites are initialized in a two-step process: + // Uninitialized-Preinitialized, and Preinitialized-Initialized. if (IsUninitializedLiteralSite(*literal_site)) { PreInitializeLiteralSite(vector, literal_slot); - return *boilerplate; + return *regexp_instance; } + + Handle<FixedArray> data(FixedArray::cast(regexp_instance->data()), isolate); + Handle<String> source(String::cast(regexp_instance->source()), isolate); + Handle<RegExpBoilerplateDescription> boilerplate = + isolate->factory()->NewRegExpBoilerplateDescription( + data, source, Smi::cast(regexp_instance->flags())); + vector->SynchronizedSet(literal_slot, *boilerplate); - return *JSRegExp::Copy(boilerplate); + DCHECK(HasBoilerplate( + handle(vector->Get(literal_slot)->cast<Object>(), isolate))); + + return *regexp_instance; } } // namespace internal diff --git a/deps/v8/src/runtime/runtime-module.cc b/deps/v8/src/runtime/runtime-module.cc index dd15f64be5..1862b504fe 100644 --- a/deps/v8/src/runtime/runtime-module.cc +++ b/deps/v8/src/runtime/runtime-module.cc @@ -14,19 +14,26 @@ namespace internal { RUNTIME_FUNCTION(Runtime_DynamicImportCall) { HandleScope scope(isolate); - DCHECK_EQ(2, args.length()); + DCHECK_LE(2, args.length()); + DCHECK_GE(3, args.length()); CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); CONVERT_ARG_HANDLE_CHECKED(Object, specifier, 1); + MaybeHandle<Object> import_assertions; + if (args.length() == 3) { + CHECK(args[2].IsObject()); + import_assertions = args.at<Object>(2); + } + Handle<Script> script(Script::cast(function->shared().script()), isolate); while (script->has_eval_from_shared()) { script = handle(Script::cast(script->eval_from_shared().script()), isolate); } - RETURN_RESULT_OR_FAILURE( - isolate, - isolate->RunHostImportModuleDynamicallyCallback(script, specifier)); + RETURN_RESULT_OR_FAILURE(isolate, + isolate->RunHostImportModuleDynamicallyCallback( + script, specifier, import_assertions)); } RUNTIME_FUNCTION(Runtime_GetModuleNamespace) { diff --git a/deps/v8/src/runtime/runtime-object.cc b/deps/v8/src/runtime/runtime-object.cc index 2bb98e674c..af7a26e869 100644 --- a/deps/v8/src/runtime/runtime-object.cc +++ b/deps/v8/src/runtime/runtime-object.cc @@ -164,12 +164,12 @@ bool DeleteObjectPropertyFast(Isolate* isolate, Handle<JSReceiver> receiver, receiver->SetProperties(ReadOnlyRoots(isolate).empty_fixed_array()); } else { Object filler = ReadOnlyRoots(isolate).one_pointer_filler_map(); - JSObject::cast(*receiver).RawFastPropertyAtPut(index, filler); + JSObject::cast(*receiver).FastPropertyAtPut(index, filler); // We must clear any recorded slot for the deleted property, because // subsequent object modifications might put a raw double there. // Slot clearing is the reason why this entire function cannot currently // be implemented in the DeleteProperty stub. - if (index.is_inobject() && !receiver_map->IsUnboxedDoubleField(index)) { + if (index.is_inobject()) { // We need to clear the recorded slot in this case because in-object // slack tracking might not be finished. This ensures that we don't // have recorded slots in free space. @@ -358,6 +358,38 @@ RUNTIME_FUNCTION(Runtime_ObjectHasOwnProperty) { return ReadOnlyRoots(isolate).false_value(); } +RUNTIME_FUNCTION(Runtime_HasOwnConstDataProperty) { + HandleScope scope(isolate); + DCHECK_EQ(2, args.length()); + CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); + CONVERT_ARG_HANDLE_CHECKED(Object, property, 1); + + bool success; + LookupIterator::Key key(isolate, property, &success); + if (!success) return ReadOnlyRoots(isolate).undefined_value(); + + if (object->IsJSObject()) { + Handle<JSObject> js_obj = Handle<JSObject>::cast(object); + LookupIterator it(isolate, js_obj, key, js_obj, LookupIterator::OWN); + + switch (it.state()) { + case LookupIterator::NOT_FOUND: + return isolate->heap()->ToBoolean(false); + case LookupIterator::DATA: + return isolate->heap()->ToBoolean(it.constness() == + PropertyConstness::kConst); + default: + return ReadOnlyRoots(isolate).undefined_value(); + } + } + + return ReadOnlyRoots(isolate).undefined_value(); +} + +RUNTIME_FUNCTION(Runtime_IsDictPropertyConstTrackingEnabled) { + return isolate->heap()->ToBoolean(V8_DICT_PROPERTY_CONST_TRACKING_BOOL); +} + RUNTIME_FUNCTION(Runtime_AddDictionaryProperty) { HandleScope scope(isolate); Handle<JSObject> receiver = args.at<JSObject>(0); @@ -366,7 +398,8 @@ RUNTIME_FUNCTION(Runtime_AddDictionaryProperty) { DCHECK(name->IsUniqueName()); - PropertyDetails property_details(kData, NONE, PropertyCellType::kNoCell); + PropertyDetails property_details( + kData, NONE, PropertyDetails::kConstIfDictConstnessTracking); if (V8_DICT_MODE_PROTOTYPES_BOOL) { Handle<OrderedNameDictionary> dictionary( receiver->property_dictionary_ordered(), isolate); diff --git a/deps/v8/src/runtime/runtime-regexp.cc b/deps/v8/src/runtime/runtime-regexp.cc index ec3a60dcfc..403d83bef9 100644 --- a/deps/v8/src/runtime/runtime-regexp.cc +++ b/deps/v8/src/runtime/runtime-regexp.cc @@ -861,6 +861,36 @@ RUNTIME_FUNCTION(Runtime_StringSplit) { return *result; } +namespace { + +MaybeHandle<Object> RegExpExec(Isolate* isolate, Handle<JSRegExp> regexp, + Handle<String> subject, int32_t index, + Handle<RegExpMatchInfo> last_match_info, + RegExp::ExecQuirks exec_quirks) { + // Due to the way the JS calls are constructed this must be less than the + // length of a string, i.e. it is always a Smi. We check anyway for security. + CHECK_LE(0, index); + CHECK_GE(subject->length(), index); + isolate->counters()->regexp_entry_runtime()->Increment(); + return RegExp::Exec(isolate, regexp, subject, index, last_match_info, + exec_quirks); +} + +MaybeHandle<Object> ExperimentalOneshotExec( + Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject, + int32_t index, Handle<RegExpMatchInfo> last_match_info, + RegExp::ExecQuirks exec_quirks) { + // Due to the way the JS calls are constructed this must be less than the + // length of a string, i.e. it is always a Smi. We check anyway for security. + CHECK_LE(0, index); + CHECK_GE(subject->length(), index); + isolate->counters()->regexp_entry_runtime()->Increment(); + return RegExp::ExperimentalOneshotExec(isolate, regexp, subject, index, + last_match_info, exec_quirks); +} + +} // namespace + RUNTIME_FUNCTION(Runtime_RegExpExec) { HandleScope scope(isolate); DCHECK_EQ(4, args.length()); @@ -868,13 +898,21 @@ RUNTIME_FUNCTION(Runtime_RegExpExec) { CONVERT_ARG_HANDLE_CHECKED(String, subject, 1); CONVERT_INT32_ARG_CHECKED(index, 2); CONVERT_ARG_HANDLE_CHECKED(RegExpMatchInfo, last_match_info, 3); - // Due to the way the JS calls are constructed this must be less than the - // length of a string, i.e. it is always a Smi. We check anyway for security. - CHECK_LE(0, index); - CHECK_GE(subject->length(), index); - isolate->counters()->regexp_entry_runtime()->Increment(); RETURN_RESULT_OR_FAILURE( - isolate, RegExp::Exec(isolate, regexp, subject, index, last_match_info)); + isolate, RegExpExec(isolate, regexp, subject, index, last_match_info, + RegExp::ExecQuirks::kNone)); +} + +RUNTIME_FUNCTION(Runtime_RegExpExecTreatMatchAtEndAsFailure) { + HandleScope scope(isolate); + DCHECK_EQ(4, args.length()); + CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 0); + CONVERT_ARG_HANDLE_CHECKED(String, subject, 1); + CONVERT_INT32_ARG_CHECKED(index, 2); + CONVERT_ARG_HANDLE_CHECKED(RegExpMatchInfo, last_match_info, 3); + RETURN_RESULT_OR_FAILURE( + isolate, RegExpExec(isolate, regexp, subject, index, last_match_info, + RegExp::ExecQuirks::kTreatMatchAtEndAsFailure)); } RUNTIME_FUNCTION(Runtime_RegExpExperimentalOneshotExec) { @@ -884,14 +922,39 @@ RUNTIME_FUNCTION(Runtime_RegExpExperimentalOneshotExec) { CONVERT_ARG_HANDLE_CHECKED(String, subject, 1); CONVERT_INT32_ARG_CHECKED(index, 2); CONVERT_ARG_HANDLE_CHECKED(RegExpMatchInfo, last_match_info, 3); - // Due to the way the JS calls are constructed this must be less than the - // length of a string, i.e. it is always a Smi. We check anyway for security. - CHECK_LE(0, index); - CHECK_GE(subject->length(), index); - isolate->counters()->regexp_entry_runtime()->Increment(); RETURN_RESULT_OR_FAILURE( - isolate, RegExp::ExperimentalOneshotExec(isolate, regexp, subject, index, - last_match_info)); + isolate, + ExperimentalOneshotExec(isolate, regexp, subject, index, last_match_info, + RegExp::ExecQuirks::kNone)); +} + +RUNTIME_FUNCTION( + Runtime_RegExpExperimentalOneshotExecTreatMatchAtEndAsFailure) { + HandleScope scope(isolate); + DCHECK_EQ(4, args.length()); + CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 0); + CONVERT_ARG_HANDLE_CHECKED(String, subject, 1); + CONVERT_INT32_ARG_CHECKED(index, 2); + CONVERT_ARG_HANDLE_CHECKED(RegExpMatchInfo, last_match_info, 3); + RETURN_RESULT_OR_FAILURE( + isolate, + ExperimentalOneshotExec(isolate, regexp, subject, index, last_match_info, + RegExp::ExecQuirks::kTreatMatchAtEndAsFailure)); +} + +RUNTIME_FUNCTION(Runtime_RegExpBuildIndices) { + DCHECK(FLAG_harmony_regexp_match_indices); + + HandleScope scope(isolate); + DCHECK_EQ(3, args.length()); + CONVERT_ARG_HANDLE_CHECKED(RegExpMatchInfo, match_info, 1); + CONVERT_ARG_HANDLE_CHECKED(Object, maybe_names, 2); +#ifdef DEBUG + CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 0); + DCHECK(regexp->GetFlags() & JSRegExp::kHasIndices); +#endif + + return *JSRegExpResultIndices::BuildIndices(isolate, match_info, maybe_names); } namespace { diff --git a/deps/v8/src/runtime/runtime-scopes.cc b/deps/v8/src/runtime/runtime-scopes.cc index 275fd2f529..457f372955 100644 --- a/deps/v8/src/runtime/runtime-scopes.cc +++ b/deps/v8/src/runtime/runtime-scopes.cc @@ -380,17 +380,7 @@ std::unique_ptr<Handle<Object>[]> GetCallerArguments(Isolate* isolate, return param_data; } else { -#ifdef V8_NO_ARGUMENTS_ADAPTOR int args_count = frame->GetActualArgumentCount(); -#else - if (it.frame()->has_adapted_arguments()) { - it.AdvanceOneFrame(); - DCHECK(it.frame()->is_arguments_adaptor()); - } - frame = it.frame(); - int args_count = frame->ComputeParametersCount(); -#endif - *total_argc = args_count; std::unique_ptr<Handle<Object>[]> param_data( NewArray<Handle<Object>>(*total_argc)); diff --git a/deps/v8/src/runtime/runtime-strings.cc b/deps/v8/src/runtime/runtime-strings.cc index 2e761c4bfc..0acf6334d4 100644 --- a/deps/v8/src/runtime/runtime-strings.cc +++ b/deps/v8/src/runtime/runtime-strings.cc @@ -139,72 +139,6 @@ RUNTIME_FUNCTION(Runtime_StringReplaceOneCharWithString) { return isolate->StackOverflow(); } -// ES6 #sec-string.prototype.includes -// String.prototype.includes(searchString [, position]) -RUNTIME_FUNCTION(Runtime_StringIncludes) { - HandleScope scope(isolate); - DCHECK_EQ(3, args.length()); - - Handle<Object> receiver = args.at(0); - if (receiver->IsNullOrUndefined(isolate)) { - THROW_NEW_ERROR_RETURN_FAILURE( - isolate, NewTypeError(MessageTemplate::kCalledOnNullOrUndefined, - isolate->factory()->NewStringFromAsciiChecked( - "String.prototype.includes"))); - } - Handle<String> receiver_string; - ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver_string, - Object::ToString(isolate, receiver)); - - // Check if the search string is a regExp and fail if it is. - Handle<Object> search = args.at(1); - Maybe<bool> is_reg_exp = RegExpUtils::IsRegExp(isolate, search); - if (is_reg_exp.IsNothing()) { - DCHECK(isolate->has_pending_exception()); - return ReadOnlyRoots(isolate).exception(); - } - if (is_reg_exp.FromJust()) { - THROW_NEW_ERROR_RETURN_FAILURE( - isolate, NewTypeError(MessageTemplate::kFirstArgumentNotRegExp, - isolate->factory()->NewStringFromStaticChars( - "String.prototype.includes"))); - } - Handle<String> search_string; - ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, search_string, - Object::ToString(isolate, args.at(1))); - Handle<Object> position; - ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, position, - Object::ToInteger(isolate, args.at(2))); - - uint32_t index = receiver_string->ToValidIndex(*position); - int index_in_str = - String::IndexOf(isolate, receiver_string, search_string, index); - return *isolate->factory()->ToBoolean(index_in_str != -1); -} - -// ES6 #sec-string.prototype.indexof -// String.prototype.indexOf(searchString [, position]) -RUNTIME_FUNCTION(Runtime_StringIndexOf) { - HandleScope scope(isolate); - DCHECK_EQ(3, args.length()); - return String::IndexOf(isolate, args.at(0), args.at(1), args.at(2)); -} - -// ES6 #sec-string.prototype.indexof -// String.prototype.indexOf(searchString, position) -// Fast version that assumes that does not perform conversions of the incoming -// arguments. -RUNTIME_FUNCTION(Runtime_StringIndexOfUnchecked) { - HandleScope scope(isolate); - DCHECK_EQ(3, args.length()); - Handle<String> receiver_string = args.at<String>(0); - Handle<String> search_string = args.at<String>(1); - int index = std::min(std::max(args.smi_at(2), 0), receiver_string->length()); - - return Smi::FromInt(String::IndexOf(isolate, receiver_string, search_string, - static_cast<uint32_t>(index))); -} - RUNTIME_FUNCTION(Runtime_StringLastIndexOf) { HandleScope handle_scope(isolate); return String::LastIndexOf(isolate, args.at(0), args.at(1), diff --git a/deps/v8/src/runtime/runtime-test.cc b/deps/v8/src/runtime/runtime-test.cc index 202a0a8785..802c7f2997 100644 --- a/deps/v8/src/runtime/runtime-test.cc +++ b/deps/v8/src/runtime/runtime-test.cc @@ -256,9 +256,25 @@ RUNTIME_FUNCTION(Runtime_DynamicCheckMapsEnabled) { return isolate->heap()->ToBoolean(FLAG_turbo_dynamic_map_checks); } -RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { - HandleScope scope(isolate); +RUNTIME_FUNCTION(Runtime_IsTopTierTurboprop) { + SealHandleScope shs(isolate); + DCHECK_EQ(0, args.length()); + return isolate->heap()->ToBoolean(FLAG_turboprop_as_toptier); +} + +RUNTIME_FUNCTION(Runtime_IsMidTierTurboprop) { + SealHandleScope shs(isolate); + DCHECK_EQ(0, args.length()); + return isolate->heap()->ToBoolean(FLAG_turboprop && + !FLAG_turboprop_as_toptier); +} + +namespace { + +enum class TierupKind { kTierupBytecode, kTierupBytecodeOrMidTier }; +Object OptimizeFunctionOnNextCall(RuntimeArguments& args, Isolate* isolate, + TierupKind tierup_kind) { if (args.length() != 1 && args.length() != 2) { return CrashUnlessFuzzing(isolate); } @@ -278,7 +294,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { IsCompiledScope is_compiled_scope( function->shared().is_compiled_scope(isolate)); if (!is_compiled_scope.is_compiled() && - !Compiler::Compile(function, Compiler::CLEAR_EXCEPTION, + !Compiler::Compile(isolate, function, Compiler::CLEAR_EXCEPTION, &is_compiled_scope)) { return CrashUnlessFuzzing(isolate); } @@ -297,7 +313,10 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { PendingOptimizationTable::MarkedForOptimization(isolate, function); } - if (function->HasAvailableOptimizedCode()) { + CodeKind kind = CodeKindForTopTier(); + if ((tierup_kind == TierupKind::kTierupBytecode && + function->HasAvailableOptimizedCode()) || + function->HasAvailableCodeKind(kind)) { DCHECK(function->HasAttachedOptimizedCode() || function->ChecksOptimizationMarker()); if (FLAG_testing_d8_test_runner) { @@ -337,9 +356,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { return ReadOnlyRoots(isolate).undefined_value(); } -namespace { - -bool EnsureFeedbackVector(Handle<JSFunction> function) { +bool EnsureFeedbackVector(Isolate* isolate, Handle<JSFunction> function) { // Check function allows lazy compilation. if (!function->shared().allows_lazy_compilation()) return false; @@ -355,7 +372,7 @@ bool EnsureFeedbackVector(Handle<JSFunction> function) { bool needs_compilation = !function->is_compiled() && !function->has_closure_feedback_cell_array(); if (needs_compilation && - !Compiler::Compile(function, Compiler::CLEAR_EXCEPTION, + !Compiler::Compile(isolate, function, Compiler::CLEAR_EXCEPTION, &is_compiled_scope)) { return false; } @@ -368,11 +385,49 @@ bool EnsureFeedbackVector(Handle<JSFunction> function) { } // namespace +RUNTIME_FUNCTION(Runtime_CompileBaseline) { + HandleScope scope(isolate); + DCHECK_EQ(1, args.length()); + CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); + + IsCompiledScope is_compiled_scope = + function->shared(isolate).is_compiled_scope(isolate); + + if (!function->shared(isolate).IsUserJavaScript()) { + return CrashUnlessFuzzing(isolate); + } + + // First compile the bytecode, if we have to. + if (!is_compiled_scope.is_compiled() && + !Compiler::Compile(isolate, function, Compiler::KEEP_EXCEPTION, + &is_compiled_scope)) { + return CrashUnlessFuzzing(isolate); + } + + if (!Compiler::CompileBaseline(isolate, function, Compiler::KEEP_EXCEPTION, + &is_compiled_scope)) { + return CrashUnlessFuzzing(isolate); + } + + return *function; +} + +RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { + HandleScope scope(isolate); + return OptimizeFunctionOnNextCall(args, isolate, TierupKind::kTierupBytecode); +} + +RUNTIME_FUNCTION(Runtime_TierupFunctionOnNextCall) { + HandleScope scope(isolate); + return OptimizeFunctionOnNextCall(args, isolate, + TierupKind::kTierupBytecodeOrMidTier); +} + RUNTIME_FUNCTION(Runtime_EnsureFeedbackVectorForFunction) { HandleScope scope(isolate); DCHECK_EQ(1, args.length()); CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); - EnsureFeedbackVector(function); + EnsureFeedbackVector(isolate, function); return ReadOnlyRoots(isolate).undefined_value(); } @@ -394,7 +449,7 @@ RUNTIME_FUNCTION(Runtime_PrepareFunctionForOptimization) { } } - if (!EnsureFeedbackVector(function)) { + if (!EnsureFeedbackVector(isolate, function)) { return CrashUnlessFuzzing(isolate); } @@ -474,16 +529,15 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) { function->MarkForOptimization(ConcurrencyMode::kNotConcurrent); // Make the profiler arm all back edges in unoptimized code. - if (it.frame()->type() == StackFrame::INTERPRETED) { + if (it.frame()->is_unoptimized()) { isolate->runtime_profiler()->AttemptOnStackReplacement( - InterpretedFrame::cast(it.frame()), + UnoptimizedFrame::cast(it.frame()), AbstractCode::kMaxLoopNestingMarker); } return ReadOnlyRoots(isolate).undefined_value(); } - RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) { HandleScope scope(isolate); DCHECK_EQ(1, args.length()); @@ -567,6 +621,9 @@ RUNTIME_FUNCTION(Runtime_GetOptimizationStatus) { status |= static_cast<int>(OptimizationStatus::kTurboFanned); } } + if (function->HasAttachedCodeKind(CodeKind::BASELINE)) { + status |= static_cast<int>(OptimizationStatus::kBaseline); + } if (function->ActiveTierIsIgnition()) { status |= static_cast<int>(OptimizationStatus::kInterpreted); } @@ -680,7 +737,6 @@ RUNTIME_FUNCTION(Runtime_NotifyContextDisposed) { return ReadOnlyRoots(isolate).undefined_value(); } - RUNTIME_FUNCTION(Runtime_SetAllocationTimeout) { SealHandleScope shs(isolate); DCHECK(args.length() == 2 || args.length() == 3); @@ -875,7 +931,6 @@ RUNTIME_FUNCTION(Runtime_GlobalPrint) { return string; } - RUNTIME_FUNCTION(Runtime_SystemBreak) { // The code below doesn't create handles, but when breaking here in GDB // having a handle scope might be useful. @@ -885,7 +940,6 @@ RUNTIME_FUNCTION(Runtime_SystemBreak) { return ReadOnlyRoots(isolate).undefined_value(); } - RUNTIME_FUNCTION(Runtime_SetForceSlowPath) { SealHandleScope shs(isolate); DCHECK_EQ(1, args.length()); @@ -943,7 +997,8 @@ RUNTIME_FUNCTION(Runtime_DisassembleFunction) { CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0); IsCompiledScope is_compiled_scope; CHECK(func->is_compiled() || - Compiler::Compile(func, Compiler::KEEP_EXCEPTION, &is_compiled_scope)); + Compiler::Compile(isolate, func, Compiler::KEEP_EXCEPTION, + &is_compiled_scope)); StdoutStream os; func->code().Print(os); os << std::endl; @@ -1061,22 +1116,22 @@ RUNTIME_FUNCTION(Runtime_WasmTraceExit) { if (num_returns == 1) { wasm::ValueType return_type = sig->GetReturn(0); switch (return_type.kind()) { - case wasm::ValueType::kI32: { + case wasm::kI32: { int32_t value = ReadUnalignedValue<int32_t>(value_addr_smi.ptr()); PrintF(" -> %d\n", value); break; } - case wasm::ValueType::kI64: { + case wasm::kI64: { int64_t value = ReadUnalignedValue<int64_t>(value_addr_smi.ptr()); PrintF(" -> %" PRId64 "\n", value); break; } - case wasm::ValueType::kF32: { + case wasm::kF32: { float_t value = ReadUnalignedValue<float_t>(value_addr_smi.ptr()); PrintF(" -> %f\n", value); break; } - case wasm::ValueType::kF64: { + case wasm::kF64: { double_t value = ReadUnalignedValue<double_t>(value_addr_smi.ptr()); PrintF(" -> %f\n", value); break; @@ -1234,22 +1289,6 @@ RUNTIME_FUNCTION(Runtime_GetWasmExceptionValues) { return *isolate->factory()->NewJSArrayWithElements(values); } -namespace { -bool EnableWasmThreads(v8::Local<v8::Context> context) { return true; } -bool DisableWasmThreads(v8::Local<v8::Context> context) { return false; } -} // namespace - -// This runtime function enables WebAssembly threads through an embedder -// callback and thereby bypasses the value in FLAG_experimental_wasm_threads. -RUNTIME_FUNCTION(Runtime_SetWasmThreadsEnabled) { - DCHECK_EQ(1, args.length()); - CONVERT_BOOLEAN_ARG_CHECKED(flag, 0); - v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); - v8_isolate->SetWasmThreadsEnabledCallback(flag ? EnableWasmThreads - : DisableWasmThreads); - return ReadOnlyRoots(isolate).undefined_value(); -} - RUNTIME_FUNCTION(Runtime_RegexpHasBytecode) { SealHandleScope shs(isolate); DCHECK_EQ(2, args.length()); @@ -1571,25 +1610,17 @@ RUNTIME_FUNCTION(Runtime_WasmTierUpFunction) { return ReadOnlyRoots(isolate).undefined_value(); } -RUNTIME_FUNCTION(Runtime_WasmTierDownModule) { +RUNTIME_FUNCTION(Runtime_WasmTierDown) { HandleScope scope(isolate); - DCHECK_EQ(1, args.length()); - CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); - auto* native_module = instance->module_object().native_module(); - native_module->SetTieringState(wasm::kTieredDown); - native_module->RecompileForTiering(); - CHECK(!native_module->compilation_state()->failed()); + DCHECK_EQ(0, args.length()); + isolate->wasm_engine()->TierDownAllModulesPerIsolate(isolate); return ReadOnlyRoots(isolate).undefined_value(); } -RUNTIME_FUNCTION(Runtime_WasmTierUpModule) { +RUNTIME_FUNCTION(Runtime_WasmTierUp) { HandleScope scope(isolate); - DCHECK_EQ(1, args.length()); - CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); - auto* native_module = instance->module_object().native_module(); - native_module->SetTieringState(wasm::kTieredUp); - native_module->RecompileForTiering(); - CHECK(!native_module->compilation_state()->failed()); + DCHECK_EQ(0, args.length()); + isolate->wasm_engine()->TierUpAllModulesPerIsolate(isolate); return ReadOnlyRoots(isolate).undefined_value(); } @@ -1675,6 +1706,7 @@ RUNTIME_FUNCTION(Runtime_EnableCodeLoggingForTesting) { void CodeDependencyChangeEvent(Handle<Code> code, Handle<SharedFunctionInfo> shared, const char* reason) final {} + void BytecodeFlushEvent(Address compiled_data_start) final {} bool is_listening_to_code_events() final { return true; } }; diff --git a/deps/v8/src/runtime/runtime-interpreter.cc b/deps/v8/src/runtime/runtime-trace.cc index 7cb9b067cf..8cd141d33e 100644 --- a/deps/v8/src/runtime/runtime-interpreter.cc +++ b/deps/v8/src/runtime/runtime-trace.cc @@ -21,7 +21,7 @@ namespace v8 { namespace internal { -#ifdef V8_TRACE_IGNITION +#ifdef V8_TRACE_UNOPTIMIZED namespace { @@ -40,9 +40,9 @@ void AdvanceToOffsetForTracing( interpreter::OperandScale::kSingle)); } -void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input, - interpreter::BytecodeArrayIterator& - bytecode_iterator, // NOLINT(runtime/references) +void PrintRegisters(UnoptimizedFrame* frame, std::ostream& os, bool is_input, + interpreter::BytecodeArrayAccessor& + bytecode_accessor, // NOLINT(runtime/references) Handle<Object> accumulator) { static const char kAccumulator[] = "accumulator"; static const int kRegFieldWidth = static_cast<int>(sizeof(kAccumulator) - 1); @@ -54,7 +54,7 @@ void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input, os << (is_input ? kInputColourCode : kOutputColourCode); } - interpreter::Bytecode bytecode = bytecode_iterator.current_bytecode(); + interpreter::Bytecode bytecode = bytecode_accessor.current_bytecode(); // Print accumulator. if ((is_input && interpreter::Bytecodes::ReadsAccumulator(bytecode)) || @@ -65,9 +65,6 @@ void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input, } // Print the registers. - JavaScriptFrameIterator frame_iterator(isolate); - InterpretedFrame* frame = - reinterpret_cast<InterpretedFrame*>(frame_iterator.frame()); int operand_count = interpreter::Bytecodes::NumberOfOperands(bytecode); for (int operand_index = 0; operand_index < operand_count; operand_index++) { interpreter::OperandType operand_type = @@ -78,14 +75,14 @@ void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input, : interpreter::Bytecodes::IsRegisterOutputOperandType(operand_type); if (should_print) { interpreter::Register first_reg = - bytecode_iterator.GetRegisterOperand(operand_index); - int range = bytecode_iterator.GetRegisterOperandRange(operand_index); + bytecode_accessor.GetRegisterOperand(operand_index); + int range = bytecode_accessor.GetRegisterOperandRange(operand_index); for (int reg_index = first_reg.index(); reg_index < first_reg.index() + range; reg_index++) { Object reg_object = frame->ReadInterpreterRegister(reg_index); os << " [ " << std::setw(kRegFieldWidth) << interpreter::Register(reg_index).ToString( - bytecode_iterator.bytecode_array()->parameter_count()) + bytecode_accessor.bytecode_array()->parameter_count()) << kArrowDirection; reg_object.ShortPrint(os); os << " ]" << std::endl; @@ -99,8 +96,19 @@ void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input, } // namespace -RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) { - if (!FLAG_trace_ignition) { +RUNTIME_FUNCTION(Runtime_TraceUnoptimizedBytecodeEntry) { + if (!FLAG_trace_ignition && !FLAG_trace_baseline_exec) { + return ReadOnlyRoots(isolate).undefined_value(); + } + + JavaScriptFrameIterator frame_iterator(isolate); + UnoptimizedFrame* frame = + reinterpret_cast<UnoptimizedFrame*>(frame_iterator.frame()); + + if (frame->is_interpreted() && !FLAG_trace_ignition) { + return ReadOnlyRoots(isolate).undefined_value(); + } + if (frame->is_baseline() && !FLAG_trace_baseline_exec) { return ReadOnlyRoots(isolate).undefined_value(); } @@ -120,21 +128,38 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) { const uint8_t* base_address = reinterpret_cast<const uint8_t*>( bytecode_array->GetFirstBytecodeAddress()); const uint8_t* bytecode_address = base_address + offset; - os << " -> " << static_cast<const void*>(bytecode_address) << " @ " - << std::setw(4) << offset << " : "; + + if (frame->is_baseline()) { + os << "B-> "; + } else { + os << " -> "; + } + os << static_cast<const void*>(bytecode_address) << " @ " << std::setw(4) + << offset << " : "; interpreter::BytecodeDecoder::Decode(os, bytecode_address, bytecode_array->parameter_count()); os << std::endl; // Print all input registers and accumulator. - PrintRegisters(isolate, os, true, bytecode_iterator, accumulator); + PrintRegisters(frame, os, true, bytecode_iterator, accumulator); os << std::flush; } return ReadOnlyRoots(isolate).undefined_value(); } -RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) { - if (!FLAG_trace_ignition) { +RUNTIME_FUNCTION(Runtime_TraceUnoptimizedBytecodeExit) { + if (!FLAG_trace_ignition && !FLAG_trace_baseline_exec) { + return ReadOnlyRoots(isolate).undefined_value(); + } + + JavaScriptFrameIterator frame_iterator(isolate); + UnoptimizedFrame* frame = + reinterpret_cast<UnoptimizedFrame*>(frame_iterator.frame()); + + if (frame->is_interpreted() && !FLAG_trace_ignition) { + return ReadOnlyRoots(isolate).undefined_value(); + } + if (frame->is_baseline() && !FLAG_trace_baseline_exec) { return ReadOnlyRoots(isolate).undefined_value(); } @@ -154,8 +179,9 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) { interpreter::OperandScale::kSingle || offset > bytecode_iterator.current_offset()) { StdoutStream os; + // Print all output registers and accumulator. - PrintRegisters(isolate, os, false, bytecode_iterator, accumulator); + PrintRegisters(frame, os, false, bytecode_iterator, accumulator); os << std::flush; } return ReadOnlyRoots(isolate).undefined_value(); @@ -165,7 +191,7 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) { #ifdef V8_TRACE_FEEDBACK_UPDATES -RUNTIME_FUNCTION(Runtime_InterpreterTraceUpdateFeedback) { +RUNTIME_FUNCTION(Runtime_TraceUpdateFeedback) { if (!FLAG_trace_feedback_updates) { return ReadOnlyRoots(isolate).undefined_value(); } diff --git a/deps/v8/src/runtime/runtime-wasm.cc b/deps/v8/src/runtime/runtime-wasm.cc index db6420f295..9ba26c23ad 100644 --- a/deps/v8/src/runtime/runtime-wasm.cc +++ b/deps/v8/src/runtime/runtime-wasm.cc @@ -12,7 +12,6 @@ #include "src/heap/factory.h" #include "src/logging/counters.h" #include "src/numbers/conversions.h" -#include "src/objects/frame-array-inl.h" #include "src/objects/objects-inl.h" #include "src/runtime/runtime-utils.h" #include "src/trap-handler/trap-handler.h" @@ -66,7 +65,7 @@ Context GetNativeContextFromWasmInstanceOnStackTop(Isolate* isolate) { class V8_NODISCARD ClearThreadInWasmScope { public: - ClearThreadInWasmScope() { + explicit ClearThreadInWasmScope(Isolate* isolate) : isolate_(isolate) { DCHECK_IMPLIES(trap_handler::IsTrapHandlerEnabled(), trap_handler::IsThreadInWasm()); trap_handler::ClearThreadInWasm(); @@ -74,8 +73,15 @@ class V8_NODISCARD ClearThreadInWasmScope { ~ClearThreadInWasmScope() { DCHECK_IMPLIES(trap_handler::IsTrapHandlerEnabled(), !trap_handler::IsThreadInWasm()); - trap_handler::SetThreadInWasm(); + if (!isolate_->has_pending_exception()) { + trap_handler::SetThreadInWasm(); + } + // Otherwise we only want to set the flag if the exception is caught in + // wasm. This is handled by the unwinder. } + + private: + Isolate* isolate_; }; Object ThrowWasmError(Isolate* isolate, MessageTemplate message) { @@ -109,7 +115,7 @@ RUNTIME_FUNCTION(Runtime_WasmIsValidRefValue) { } RUNTIME_FUNCTION(Runtime_WasmMemoryGrow) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(2, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -125,59 +131,68 @@ RUNTIME_FUNCTION(Runtime_WasmMemoryGrow) { } RUNTIME_FUNCTION(Runtime_ThrowWasmError) { - ClearThreadInWasmScope clear_wasm_flag; + ClearThreadInWasmScope flag_scope(isolate); DCHECK_EQ(1, args.length()); CONVERT_SMI_ARG_CHECKED(message_id, 0); return ThrowWasmError(isolate, MessageTemplateFromInt(message_id)); } RUNTIME_FUNCTION(Runtime_ThrowWasmStackOverflow) { - ClearThreadInWasmScope clear_wasm_flag; + ClearThreadInWasmScope clear_wasm_flag(isolate); SealHandleScope shs(isolate); DCHECK_LE(0, args.length()); return isolate->StackOverflow(); } RUNTIME_FUNCTION(Runtime_WasmThrowJSTypeError) { - // This runtime function is called both from wasm and from e.g. js-to-js - // functions. Hence the "thread in wasm" flag can be either set or not. Both - // is OK, since throwing will trigger unwinding anyway, which sets the flag - // correctly depending on the handler. + // The caller may be wasm or JS. Only clear the thread_in_wasm flag if the + // caller is wasm, and let the unwinder set it back depending on the handler. + if (trap_handler::IsTrapHandlerEnabled() && trap_handler::IsThreadInWasm()) { + trap_handler::ClearThreadInWasm(); + } HandleScope scope(isolate); DCHECK_EQ(0, args.length()); THROW_NEW_ERROR_RETURN_FAILURE( isolate, NewTypeError(MessageTemplate::kWasmTrapJSTypeError)); } -RUNTIME_FUNCTION(Runtime_WasmThrowCreate) { - ClearThreadInWasmScope clear_wasm_flag; - // TODO(kschimpf): Can this be replaced with equivalent TurboFan code/calls. +RUNTIME_FUNCTION(Runtime_WasmThrow) { + ClearThreadInWasmScope clear_wasm_flag(isolate); HandleScope scope(isolate); DCHECK_EQ(2, args.length()); - DCHECK(isolate->context().is_null()); isolate->set_context(GetNativeContextFromWasmInstanceOnStackTop(isolate)); + CONVERT_ARG_CHECKED(WasmExceptionTag, tag_raw, 0); - CONVERT_SMI_ARG_CHECKED(size, 1); + CONVERT_ARG_CHECKED(FixedArray, values_raw, 1); // TODO(wasm): Manually box because parameters are not visited yet. - Handle<Object> tag(tag_raw, isolate); + Handle<WasmExceptionTag> tag(tag_raw, isolate); + Handle<FixedArray> values(values_raw, isolate); + Handle<Object> exception = isolate->factory()->NewWasmRuntimeError( MessageTemplate::kWasmExceptionError); - CHECK(!Object::SetProperty(isolate, exception, - isolate->factory()->wasm_exception_tag_symbol(), - tag, StoreOrigin::kMaybeKeyed, - Just(ShouldThrow::kThrowOnError)) - .is_null()); - Handle<FixedArray> values = isolate->factory()->NewFixedArray(size); - CHECK(!Object::SetProperty(isolate, exception, - isolate->factory()->wasm_exception_values_symbol(), - values, StoreOrigin::kMaybeKeyed, - Just(ShouldThrow::kThrowOnError)) - .is_null()); - return *exception; + Object::SetProperty( + isolate, exception, isolate->factory()->wasm_exception_tag_symbol(), tag, + StoreOrigin::kMaybeKeyed, Just(ShouldThrow::kThrowOnError)) + .Check(); + Object::SetProperty( + isolate, exception, isolate->factory()->wasm_exception_values_symbol(), + values, StoreOrigin::kMaybeKeyed, Just(ShouldThrow::kThrowOnError)) + .Check(); + + isolate->wasm_engine()->SampleThrowEvent(isolate); + return isolate->Throw(*exception); +} + +RUNTIME_FUNCTION(Runtime_WasmReThrow) { + ClearThreadInWasmScope clear_wasm_flag(isolate); + HandleScope scope(isolate); + DCHECK_EQ(1, args.length()); + isolate->wasm_engine()->SampleRethrowEvent(isolate); + return isolate->ReThrow(args[0]); } RUNTIME_FUNCTION(Runtime_WasmStackGuard) { - ClearThreadInWasmScope wasm_flag; + ClearThreadInWasmScope wasm_flag(isolate); SealHandleScope shs(isolate); DCHECK_EQ(0, args.length()); @@ -189,7 +204,7 @@ RUNTIME_FUNCTION(Runtime_WasmStackGuard) { } RUNTIME_FUNCTION(Runtime_WasmCompileLazy) { - ClearThreadInWasmScope wasm_flag; + ClearThreadInWasmScope wasm_flag(isolate); HandleScope scope(isolate); DCHECK_EQ(2, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -295,7 +310,7 @@ RUNTIME_FUNCTION(Runtime_WasmTriggerTierUp) { } RUNTIME_FUNCTION(Runtime_WasmAtomicNotify) { - ClearThreadInWasmScope clear_wasm_flag; + ClearThreadInWasmScope clear_wasm_flag(isolate); HandleScope scope(isolate); DCHECK_EQ(3, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -311,7 +326,7 @@ RUNTIME_FUNCTION(Runtime_WasmAtomicNotify) { } RUNTIME_FUNCTION(Runtime_WasmI32AtomicWait) { - ClearThreadInWasmScope clear_wasm_flag; + ClearThreadInWasmScope clear_wasm_flag(isolate); HandleScope scope(isolate); DCHECK_EQ(4, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -334,7 +349,7 @@ RUNTIME_FUNCTION(Runtime_WasmI32AtomicWait) { } RUNTIME_FUNCTION(Runtime_WasmI64AtomicWait) { - ClearThreadInWasmScope clear_wasm_flag; + ClearThreadInWasmScope clear_wasm_flag(isolate); HandleScope scope(isolate); DCHECK_EQ(4, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -372,7 +387,7 @@ Object ThrowTableOutOfBounds(Isolate* isolate, } // namespace RUNTIME_FUNCTION(Runtime_WasmRefFunc) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(2, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -386,7 +401,7 @@ RUNTIME_FUNCTION(Runtime_WasmRefFunc) { } RUNTIME_FUNCTION(Runtime_WasmFunctionTableGet) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(3, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -410,7 +425,7 @@ RUNTIME_FUNCTION(Runtime_WasmFunctionTableGet) { } RUNTIME_FUNCTION(Runtime_WasmFunctionTableSet) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(4, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -437,7 +452,7 @@ RUNTIME_FUNCTION(Runtime_WasmFunctionTableSet) { } RUNTIME_FUNCTION(Runtime_WasmTableInit) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(6, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -459,7 +474,7 @@ RUNTIME_FUNCTION(Runtime_WasmTableInit) { } RUNTIME_FUNCTION(Runtime_WasmTableCopy) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(6, args.length()); CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); @@ -481,7 +496,7 @@ RUNTIME_FUNCTION(Runtime_WasmTableCopy) { } RUNTIME_FUNCTION(Runtime_WasmTableGrow) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(3, args.length()); auto instance = @@ -500,7 +515,7 @@ RUNTIME_FUNCTION(Runtime_WasmTableGrow) { } RUNTIME_FUNCTION(Runtime_WasmTableFill) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(4, args.length()); auto instance = @@ -533,40 +548,73 @@ RUNTIME_FUNCTION(Runtime_WasmTableFill) { } RUNTIME_FUNCTION(Runtime_WasmDebugBreak) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(0, args.length()); FrameFinder<WasmFrame, StackFrame::EXIT, StackFrame::WASM_DEBUG_BREAK> frame_finder(isolate); auto instance = handle(frame_finder.frame()->wasm_instance(), isolate); - int position = frame_finder.frame()->position(); + auto script = handle(instance->module_object().script(), isolate); + WasmFrame* frame = frame_finder.frame(); + int position = frame->position(); + auto frame_id = frame->id(); + auto* debug_info = frame->native_module()->GetDebugInfo(); isolate->set_context(instance->native_context()); + // Stepping can repeatedly create code, and code GC requires stack guards to + // be executed on all involved isolates. Proactively do this here. + StackLimitCheck check(isolate); + if (check.InterruptRequested()) isolate->stack_guard()->HandleInterrupts(); + // Enter the debugger. DebugScope debug_scope(isolate->debug()); - WasmFrame* frame = frame_finder.frame(); - auto* debug_info = frame->native_module()->GetDebugInfo(); + // Check for instrumentation breakpoint. + DCHECK_EQ(script->break_on_entry(), instance->break_on_entry()); + if (script->break_on_entry()) { + MaybeHandle<FixedArray> maybe_on_entry_breakpoints = + WasmScript::CheckBreakPoints( + isolate, script, WasmScript::kOnEntryBreakpointPosition, frame_id); + script->set_break_on_entry(false); + // Update the "break_on_entry" flag on all live instances. + i::WeakArrayList weak_instance_list = script->wasm_weak_instance_list(); + for (int i = 0; i < weak_instance_list.length(); ++i) { + if (weak_instance_list.Get(i)->IsCleared()) continue; + i::WasmInstanceObject instance = i::WasmInstanceObject::cast( + weak_instance_list.Get(i)->GetHeapObject()); + instance.set_break_on_entry(false); + } + DCHECK(!instance->break_on_entry()); + Handle<FixedArray> on_entry_breakpoints; + if (maybe_on_entry_breakpoints.ToHandle(&on_entry_breakpoints)) { + debug_info->ClearStepping(isolate); + StepAction step_action = isolate->debug()->last_step_action(); + isolate->debug()->ClearStepping(); + isolate->debug()->OnDebugBreak(on_entry_breakpoints, step_action); + // Don't process regular breakpoints. + return ReadOnlyRoots(isolate).undefined_value(); + } + } + if (debug_info->IsStepping(frame)) { debug_info->ClearStepping(isolate); - StepAction stepAction = isolate->debug()->last_step_action(); + StepAction step_action = isolate->debug()->last_step_action(); isolate->debug()->ClearStepping(); isolate->debug()->OnDebugBreak(isolate->factory()->empty_fixed_array(), - stepAction); + step_action); return ReadOnlyRoots(isolate).undefined_value(); } // Check whether we hit a breakpoint. - Handle<Script> script(instance->module_object().script(), isolate); Handle<FixedArray> breakpoints; - if (WasmScript::CheckBreakPoints(isolate, script, position) + if (WasmScript::CheckBreakPoints(isolate, script, position, frame_id) .ToHandle(&breakpoints)) { debug_info->ClearStepping(isolate); - StepAction stepAction = isolate->debug()->last_step_action(); + StepAction step_action = isolate->debug()->last_step_action(); isolate->debug()->ClearStepping(); if (isolate->debug()->break_points_active()) { // We hit one or several breakpoints. Notify the debug listeners. - isolate->debug()->OnDebugBreak(breakpoints, stepAction); + isolate->debug()->OnDebugBreak(breakpoints, step_action); } } @@ -574,7 +622,7 @@ RUNTIME_FUNCTION(Runtime_WasmDebugBreak) { } RUNTIME_FUNCTION(Runtime_WasmAllocateRtt) { - ClearThreadInWasmScope flag_scope; + ClearThreadInWasmScope flag_scope(isolate); HandleScope scope(isolate); DCHECK_EQ(2, args.length()); CONVERT_UINT32_ARG_CHECKED(type_index, 0); diff --git a/deps/v8/src/runtime/runtime.h b/deps/v8/src/runtime/runtime.h index 311238c9d5..912808ab3c 100644 --- a/deps/v8/src/runtime/runtime.h +++ b/deps/v8/src/runtime/runtime.h @@ -82,7 +82,6 @@ namespace internal { #define FOR_EACH_INTRINSIC_CLASSES(F, I) \ F(DefineClass, -1 /* >= 3 */, 1) \ - F(HomeObjectSymbol, 0, 1) \ F(LoadFromSuper, 3, 1) \ F(LoadKeyedFromSuper, 3, 1) \ F(StoreKeyedToSuper, 4, 1) \ @@ -106,12 +105,15 @@ namespace internal { #define FOR_EACH_INTRINSIC_COMPILER(F, I) \ F(CompileForOnStackReplacement, 0, 1) \ F(CompileLazy, 1, 1) \ + F(CompileBaseline, 1, 1) \ F(CompileOptimized_Concurrent, 1, 1) \ F(CompileOptimized_NotConcurrent, 1, 1) \ + F(InstallBaselineCode, 1, 1) \ F(HealOptimizedCodeSlot, 1, 1) \ F(FunctionFirstExecution, 1, 1) \ F(InstantiateAsmJs, 4, 1) \ F(NotifyDeoptimized, 0, 1) \ + F(ObserveNode, 1, 1) \ F(ResolvePossiblyDirectEval, 6, 1) \ F(TryInstallNCICode, 1, 1) @@ -150,24 +152,23 @@ namespace internal { F(ForInEnumerate, 1, 1) \ F(ForInHasProperty, 2, 1) -#ifdef V8_TRACE_IGNITION -#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) \ - F(InterpreterTraceBytecodeEntry, 3, 1) \ - F(InterpreterTraceBytecodeExit, 3, 1) +#ifdef V8_TRACE_UNOPTIMIZED +#define FOR_EACH_INTRINSIC_TRACE_UNOPTIMIZED(F, I) \ + F(TraceUnoptimizedBytecodeEntry, 3, 1) \ + F(TraceUnoptimizedBytecodeExit, 3, 1) #else -#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) +#define FOR_EACH_INTRINSIC_TRACE_UNOPTIMIZED(F, I) #endif #ifdef V8_TRACE_FEEDBACK_UPDATES -#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) \ - F(InterpreterTraceUpdateFeedback, 3, 1) +#define FOR_EACH_INTRINSIC_TRACE_FEEDBACK(F, I) F(TraceUpdateFeedback, 3, 1) #else -#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) +#define FOR_EACH_INTRINSIC_TRACE_FEEDBACK(F, I) #endif -#define FOR_EACH_INTRINSIC_INTERPRETER(F, I) \ - FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) \ - FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) +#define FOR_EACH_INTRINSIC_TRACE(F, I) \ + FOR_EACH_INTRINSIC_TRACE_UNOPTIMIZED(F, I) \ + FOR_EACH_INTRINSIC_TRACE_FEEDBACK(F, I) #define FOR_EACH_INTRINSIC_FUNCTION(F, I) \ I(Call, -1 /* >= 2 */, 1) \ @@ -266,9 +267,9 @@ namespace internal { F(CreateObjectLiteralWithoutAllocationSite, 2, 1) \ F(CreateRegExpLiteral, 4, 1) -#define FOR_EACH_INTRINSIC_MODULE(F, I) \ - F(DynamicImportCall, 2, 1) \ - I(GetImportMetaObject, 0, 1) \ +#define FOR_EACH_INTRINSIC_MODULE(F, I) \ + F(DynamicImportCall, -1 /* [2, 3] */, 1) \ + I(GetImportMetaObject, 0, 1) \ F(GetModuleNamespace, 1, 1) #define FOR_EACH_INTRINSIC_NUMBERS(F, I) \ @@ -384,15 +385,18 @@ namespace internal { F(JSProxyGetTarget, 1, 1) \ F(SetPropertyWithReceiver, 4, 1) -#define FOR_EACH_INTRINSIC_REGEXP(F, I) \ - I(IsRegExp, 1, 1) \ - F(RegExpExec, 4, 1) \ - F(RegExpExperimentalOneshotExec, 4, 1) \ - F(RegExpExecMultiple, 4, 1) \ - F(RegExpInitializeAndCompile, 3, 1) \ - F(RegExpReplaceRT, 3, 1) \ - F(RegExpSplit, 3, 1) \ - F(StringReplaceNonGlobalRegExpWithFunction, 3, 1) \ +#define FOR_EACH_INTRINSIC_REGEXP(F, I) \ + I(IsRegExp, 1, 1) \ + F(RegExpBuildIndices, 3, 1) \ + F(RegExpExec, 4, 1) \ + F(RegExpExecTreatMatchAtEndAsFailure, 4, 1) \ + F(RegExpExperimentalOneshotExec, 4, 1) \ + F(RegExpExperimentalOneshotExecTreatMatchAtEndAsFailure, 4, 1) \ + F(RegExpExecMultiple, 4, 1) \ + F(RegExpInitializeAndCompile, 3, 1) \ + F(RegExpReplaceRT, 3, 1) \ + F(RegExpSplit, 3, 1) \ + F(StringReplaceNonGlobalRegExpWithFunction, 3, 1) \ F(StringSplit, 3, 1) #define FOR_EACH_INTRINSIC_SCOPES(F, I) \ @@ -430,9 +434,6 @@ namespace internal { F(StringEscapeQuotes, 1, 1) \ F(StringGreaterThan, 2, 1) \ F(StringGreaterThanOrEqual, 2, 1) \ - F(StringIncludes, 3, 1) \ - F(StringIndexOf, 3, 1) \ - F(StringIndexOfUnchecked, 3, 1) \ F(StringLastIndexOf, 2, 1) \ F(StringLessThan, 2, 1) \ F(StringLessThanOrEqual, 2, 1) \ @@ -469,6 +470,8 @@ namespace internal { F(DisallowWasmCodegen, 1, 1) \ F(DisassembleFunction, 1, 1) \ F(DynamicCheckMapsEnabled, 0, 1) \ + F(IsTopTierTurboprop, 0, 1) \ + F(IsMidTierTurboprop, 0, 1) \ F(EnableCodeLoggingForTesting, 0, 1) \ F(EnsureFeedbackVectorForFunction, 1, 1) \ F(FreezeWasmLazyCompilation, 1, 1) \ @@ -485,6 +488,7 @@ namespace internal { F(HasElementsInALargeObjectSpace, 1, 1) \ F(HasFastElements, 1, 1) \ F(HasFastProperties, 1, 1) \ + F(HasOwnConstDataProperty, 2, 1) \ F(HasFixedBigInt64Elements, 1, 1) \ F(HasFixedBigUint64Elements, 1, 1) \ F(HasFixedFloat32Elements, 1, 1) \ @@ -510,6 +514,7 @@ namespace internal { F(IsAsmWasmCode, 1, 1) \ F(IsBeingInterpreted, 0, 1) \ F(IsConcurrentRecompilationSupported, 0, 1) \ + F(IsDictPropertyConstTrackingEnabled, 0, 1) \ F(IsLiftoffFunction, 1, 1) \ F(IsThreadInWasm, 0, 1) \ F(IsWasmCode, 1, 1) \ @@ -523,6 +528,7 @@ namespace internal { F(NeverOptimizeFunction, 1, 1) \ F(NotifyContextDisposed, 0, 1) \ F(OptimizeFunctionOnNextCall, -1, 1) \ + F(TierupFunctionOnNextCall, -1, 1) \ F(OptimizeOsr, -1, 1) \ F(NewRegExpWithBacktrackLimit, 3, 1) \ F(PrepareFunctionForOptimization, -1, 1) \ @@ -536,7 +542,6 @@ namespace internal { F(SetIteratorProtector, 0, 1) \ F(SetWasmCompileControls, 2, 1) \ F(SetWasmInstantiateControls, 0, 1) \ - F(SetWasmThreadsEnabled, 1, 1) \ F(SimulateNewspaceFull, 0, 1) \ F(ScheduleGCInStackCheck, 0, 1) \ F(StringIteratorProtector, 0, 1) \ @@ -548,9 +553,9 @@ namespace internal { F(UnblockConcurrentRecompilation, 0, 1) \ F(WasmGetNumberOfInstances, 1, 1) \ F(WasmNumCodeSpaces, 1, 1) \ - F(WasmTierDownModule, 1, 1) \ + F(WasmTierDown, 0, 1) \ + F(WasmTierUp, 0, 1) \ F(WasmTierUpFunction, 2, 1) \ - F(WasmTierUpModule, 1, 1) \ F(WasmTraceEnter, 0, 1) \ F(WasmTraceExit, 1, 1) \ F(WasmTraceMemory, 1, 1) \ @@ -566,28 +571,29 @@ namespace internal { F(TypedArraySet, 2, 1) \ F(TypedArraySortFast, 1, 1) -#define FOR_EACH_INTRINSIC_WASM(F, I) \ - F(ThrowWasmError, 1, 1) \ - F(ThrowWasmStackOverflow, 0, 1) \ - F(WasmI32AtomicWait, 4, 1) \ - F(WasmI64AtomicWait, 5, 1) \ - F(WasmAtomicNotify, 3, 1) \ - F(WasmMemoryGrow, 2, 1) \ - F(WasmStackGuard, 0, 1) \ - F(WasmThrowCreate, 2, 1) \ - F(WasmThrowJSTypeError, 0, 1) \ - F(WasmRefFunc, 1, 1) \ - F(WasmFunctionTableGet, 3, 1) \ - F(WasmFunctionTableSet, 4, 1) \ - F(WasmTableInit, 6, 1) \ - F(WasmTableCopy, 6, 1) \ - F(WasmTableGrow, 3, 1) \ - F(WasmTableFill, 4, 1) \ - F(WasmIsValidRefValue, 3, 1) \ - F(WasmCompileLazy, 2, 1) \ - F(WasmCompileWrapper, 2, 1) \ - F(WasmTriggerTierUp, 1, 1) \ - F(WasmDebugBreak, 0, 1) \ +#define FOR_EACH_INTRINSIC_WASM(F, I) \ + F(ThrowWasmError, 1, 1) \ + F(ThrowWasmStackOverflow, 0, 1) \ + F(WasmI32AtomicWait, 4, 1) \ + F(WasmI64AtomicWait, 5, 1) \ + F(WasmAtomicNotify, 3, 1) \ + F(WasmMemoryGrow, 2, 1) \ + F(WasmStackGuard, 0, 1) \ + F(WasmThrow, 2, 1) \ + F(WasmReThrow, 1, 1) \ + F(WasmThrowJSTypeError, 0, 1) \ + F(WasmRefFunc, 1, 1) \ + F(WasmFunctionTableGet, 3, 1) \ + F(WasmFunctionTableSet, 4, 1) \ + F(WasmTableInit, 6, 1) \ + F(WasmTableCopy, 6, 1) \ + F(WasmTableGrow, 3, 1) \ + F(WasmTableFill, 4, 1) \ + F(WasmIsValidRefValue, 3, 1) \ + F(WasmCompileLazy, 2, 1) \ + F(WasmCompileWrapper, 2, 1) \ + F(WasmTriggerTierUp, 1, 1) \ + F(WasmDebugBreak, 0, 1) \ F(WasmAllocateRtt, 2, 1) #define FOR_EACH_INTRINSIC_WEAKREF(F, I) \ @@ -640,7 +646,7 @@ namespace internal { FOR_EACH_INTRINSIC_GENERATOR(F, I) \ FOR_EACH_INTRINSIC_IC(F, I) \ FOR_EACH_INTRINSIC_INTERNAL(F, I) \ - FOR_EACH_INTRINSIC_INTERPRETER(F, I) \ + FOR_EACH_INTRINSIC_TRACE(F, I) \ FOR_EACH_INTRINSIC_INTL(F, I) \ FOR_EACH_INTRINSIC_LITERALS(F, I) \ FOR_EACH_INTRINSIC_MODULE(F, I) \ @@ -841,6 +847,7 @@ enum class OptimizationStatus { kTopmostFrameIsTurboFanned = 1 << 11, kLiteMode = 1 << 12, kMarkedForDeoptimization = 1 << 13, + kBaseline = 1 << 14, }; } // namespace internal |