GeezerVison is showing github.com — deps: patch V8 to 15.6.75.60 · nodejs/node@02a3007
File treeExpand file treeCollapse file tree Open diff view settings interpreter/bytecode_expectations
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/v8/include/v8-version.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 | #define V8_MAJOR_VERSION 15 | 12 | 12 | #define V8_MINOR_VERSION 6 | 13 | 13 | #define V8_BUILD_NUMBER 75 | 14 | | -#define V8_PATCH_LEVEL 50 | | 14 | +#define V8_PATCH_LEVEL 60 | 15 | 15 |
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/baseline/baseline-compiler.cc +12-14Lines changed: 12 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1882,27 +1882,25 @@ void BaselineCompiler::VisitIntrinsicAsyncFunctionResolve( | 1882 | 1882 |
| 1883 | 1883 | void BaselineCompiler::VisitIntrinsicGeneratorYieldResult( | 1884 | 1884 | interpreter::RegisterList args) { | 1885 | | - Register value = WriteBarrierDescriptor::ValueRegister(); | 1886 | 1885 | Register generator = WriteBarrierDescriptor::ObjectRegister(); | 1887 | | - DCHECK(!AreAliased(value, generator, kInterpreterAccumulatorRegister)); | | 1886 | + DCHECK(!AreAliased(generator, kInterpreterAccumulatorRegister)); | 1888 | 1887 |
| 1889 | 1888 | Label allocate, done; | 1890 | 1889 |
| 1891 | 1890 | __ LoadRegister(generator, args[1]); // generator | 1892 | 1891 |
| 1893 | | - // Check whether the generator user asked to skip result allocation | 1894 | | - // (yielded_value_ == TheHole). | | 1892 | + // Check whether the caller asked to skip result allocation | | 1893 | + // (resume_mode_ == kNextTrySkipAlloc). | 1895 | 1894 | __ LoadTaggedField(kInterpreterAccumulatorRegister, generator, | 1896 | | - offsetof(JSGeneratorObject, yielded_value_)); | 1897 | | - __ JumpIfNotRoot(kInterpreterAccumulatorRegister, RootIndex::kTheHoleValue, | 1898 | | - &allocate); | 1899 | | - | 1900 | | - // Skip allocation: store value into yielded_value_. | 1901 | | - __ LoadRegister(value, args[0]); // value | 1902 | | - __ StoreTaggedFieldWithWriteBarrier( | 1903 | | - generator, offsetof(JSGeneratorObject, yielded_value_), value); | 1904 | | - | 1905 | | - __ LoadRoot(kInterpreterAccumulatorRegister, RootIndex::kTheHoleValue); | | 1895 | + offsetof(JSGeneratorObject, resume_mode_)); | | 1896 | + __ JumpIfSmi(kNotEqual, kInterpreterAccumulatorRegister, | | 1897 | + Smi::FromInt(JSGeneratorObject::kNextTrySkipAlloc), &allocate); | | 1898 | + | | 1899 | + // Skip allocation: ack handshake and return bare value. | | 1900 | + __ StoreTaggedSignedField(generator, | | 1901 | + offsetof(JSGeneratorObject, resume_mode_), | | 1902 | + Smi::FromInt(JSGeneratorObject::kNextAllocSkipped)); | | 1903 | + __ LoadRegister(kInterpreterAccumulatorRegister, args[0]); // value | 1906 | 1904 | __ Jump(&done); | 1907 | 1905 |
| 1908 | 1906 | __ Bind(&allocate); | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-generator-gen.cc +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -122,6 +122,10 @@ void GeneratorBuiltinsAssembler::InnerResume( | 122 | 122 | case JSGeneratorObject::kRethrow: | 123 | 123 | // Currently only async generators use this mode. | 124 | 124 | UNREACHABLE(); | | 125 | + case JSGeneratorObject::kNextTrySkipAlloc: | | 126 | + case JSGeneratorObject::kNextAllocSkipped: | | 127 | + // Handshake states only set by optimized callers or the generator body. | | 128 | + UNREACHABLE(); | 125 | 129 | } | 126 | 130 | args->PopAndReturn(builtin_result); | 127 | 131 | } | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/builtins/generator.tq +2-6Lines changed: 2 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,8 +19,6 @@ transitioning javascript builtin GeneratorPrototypeNextLazyDeoptContinuation( | 19 | 19 | js-implicit context: NativeContext, receiver: JSAny)(generator: JSAny, | 20 | 20 | exception: JSAny|TheHole, result: JSAny): JSAny { | 21 | 21 | const gen = UnsafeCast<JSGeneratorObject>(generator); | 22 | | - const yieldedValue = gen.yielded_value; | 23 | | - gen.yielded_value = Undefined; | 24 | 22 |
| 25 | 23 | // Exception path: close the generator and rethrow. | 26 | 24 | typeswitch (exception) { | @@ -36,15 +34,13 @@ transitioning javascript builtin GeneratorPrototypeNextLazyDeoptContinuation( | 36 | 34 | // continuation is now kGeneratorExecuting; close it and wrap the result. | 37 | 35 | // Otherwise (yielded), return the result as-is. | 38 | 36 | if (gen.continuation == SmiConstant(kGeneratorExecuting)) { | 39 | | - dcheck(result != TheHole); | 40 | 37 | gen.continuation = SmiConstant(kGeneratorClosed); | 41 | 38 | return AllocateJSIteratorResult(result, True); | 42 | 39 | } | 43 | 40 |
| 44 | 41 | // Allocating the iterator result object was skipped; allocate it here. | 45 | | - if (result == TheHole) { | 46 | | - const val = (yieldedValue == TheHole) ? Undefined : yieldedValue; | 47 | | - return AllocateJSIteratorResult(val, False); | | 42 | + if (gen.resume_mode == SmiConstant(kGeneratorResumeModeNextAllocSkipped)) { | | 43 | + return AllocateJSIteratorResult(result, False); | 48 | 44 | } | 49 | 45 |
| 50 | 46 | return result; | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/codegen/compiler.cc +36-15Lines changed: 36 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2177,6 +2177,11 @@ class ConstantPoolPointerForwarder { | 2177 | 2177 | } | 2178 | 2178 | } | 2179 | 2179 |
| | 2180 | + bool HasScopeInfoToUpdate(Tagged<ScopeInfo> scope_info) const { | | 2181 | + return scope_infos_to_update_.find(scope_info->UniqueIdInScript()) != | | 2182 | + scope_infos_to_update_.end(); | | 2183 | + } | | 2184 | + | 2180 | 2185 | void UpdateStandaloneScopeInfo(Tagged<ScopeInfo> scope_info) { | 2181 | 2186 | if (!scope_info->HasOuterScopeInfo()) return; | 2182 | 2187 |
| @@ -2354,6 +2359,23 @@ void VerifyCodeMerge(Isolate* isolate, DirectHandle<Script> script) { | 2354 | 2359 | // * All constant pool SFI entries point to an SFI referring to the old | 2355 | 2360 | // script (i.e. references were updated correctly). | 2356 | 2361 | std::unordered_map<int, Tagged<ScopeInfo>> scope_infos; | | 2362 | + auto verify_scope_info = [&](Tagged<ScopeInfo> scope_info) { | | 2363 | + while (true) { | | 2364 | + auto it = scope_infos.find(scope_info->UniqueIdInScript()); | | 2365 | + if (it != scope_infos.end()) { | | 2366 | + if (it->second != scope_info) { | | 2367 | + isolate->PushParamsAndDie("duplicate scope info unique id", | | 2368 | + reinterpret_cast<void*>(it->second.ptr()), | | 2369 | + reinterpret_cast<void*>(scope_info.ptr())); | | 2370 | + UNREACHABLE(); | | 2371 | + } | | 2372 | + break; | | 2373 | + } | | 2374 | + scope_infos[scope_info->UniqueIdInScript()] = scope_info; | | 2375 | + if (!scope_info->HasOuterScopeInfo()) break; | | 2376 | + scope_info = scope_info->OuterScopeInfo(); | | 2377 | + } | | 2378 | + }; | 2357 | 2379 | uint32_t script_infos_len = script->infos()->ulength().value(); | 2358 | 2380 | for (uint32_t info_idx = 0; info_idx < script_infos_len; info_idx++) { | 2359 | 2381 | Tagged<ScopeInfo> scope_info; | @@ -2377,6 +2399,8 @@ void VerifyCodeMerge(Isolate* isolate, DirectHandle<Script> script) { | 2377 | 2399 | int id = inner_sfi->function_literal_id(kRelaxedLoad); | 2378 | 2400 | CHECK_EQ(MakeWeak(inner_sfi), script->infos()->get(id)); | 2379 | 2401 | CHECK_EQ(inner_sfi->script(), *script); | | 2402 | + } else if (Is<ScopeInfo>(entry)) { | | 2403 | + verify_scope_info(Cast<ScopeInfo>(entry)); | 2380 | 2404 | } | 2381 | 2405 | } | 2382 | 2406 | } | @@ -2391,21 +2415,7 @@ void VerifyCodeMerge(Isolate* isolate, DirectHandle<Script> script) { | 2391 | 2415 | } else { | 2392 | 2416 | scope_info = Cast<ScopeInfo>(info); | 2393 | 2417 | } | 2394 | | - while (true) { | 2395 | | - auto it = scope_infos.find(scope_info->UniqueIdInScript()); | 2396 | | - if (it != scope_infos.end()) { | 2397 | | - if (it->second != scope_info) { | 2398 | | - isolate->PushParamsAndDie("duplicate scope info unique id", | 2399 | | - reinterpret_cast<void*>(it->second.ptr()), | 2400 | | - reinterpret_cast<void*>(scope_info.ptr())); | 2401 | | - UNREACHABLE(); | 2402 | | - } | 2403 | | - break; | 2404 | | - } | 2405 | | - scope_infos[scope_info->UniqueIdInScript()] = scope_info; | 2406 | | - if (!scope_info->HasOuterScopeInfo()) break; | 2407 | | - scope_info = scope_info->OuterScopeInfo(); | 2408 | | - } | | 2418 | + verify_scope_info(scope_info); | 2409 | 2419 | } | 2410 | 2420 | } | 2411 | 2421 | } // namespace | @@ -2553,6 +2563,9 @@ void BackgroundMergeTask::BeginMergeInBackground( | 2553 | 2563 | for (DirectHandle<SharedFunctionInfo> new_sfi : used_new_sfis_) { | 2554 | 2564 | forwarder.UpdateScopeInfo(*new_sfi); | 2555 | 2565 | } | | 2566 | + for (DirectHandle<ScopeInfo> new_scope : used_new_scope_infos_) { | | 2567 | + forwarder.UpdateStandaloneScopeInfo(*new_scope); | | 2568 | + } | 2556 | 2569 | for (const auto& new_compiled_data : new_compiled_data_for_cached_sfis_) { | 2557 | 2570 | // It's possible that new_compiled_data.cached_sfi had | 2558 | 2571 | // scope_info()->IsEmpty() while an inner function has scope info if the | @@ -2659,6 +2672,14 @@ Handle<SharedFunctionInfo> BackgroundMergeTask::CompleteMergeInForeground( | 2659 | 2672 | compiled_data_it++; | 2660 | 2673 | } | 2661 | 2674 | } else if (!maybe_old_info.IsWeak()) { | | 2675 | + // Standalone eval ScopeInfos are only recorded for scopes within their | | 2676 | + // owning closure, so if the slot in old_script was cleared, the ScopeInfo | | 2677 | + // itself cannot still be alive in old_script. | | 2678 | + DCHECK_IMPLIES( | | 2679 | + maybe_new_info.IsWeak() && | | 2680 | + Is<ScopeInfo>(maybe_new_info.GetHeapObjectAssumeWeak()), | | 2681 | + !forwarder.HasScopeInfoToUpdate( | | 2682 | + Cast<ScopeInfo>(maybe_new_info.GetHeapObjectAssumeWeak()))); | 2662 | 2683 | old_script->infos()->set(i, maybe_new_info, kReleaseStore); | 2663 | 2684 | } | 2664 | 2685 | } | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/common/assert-scope.h +19-15Lines changed: 19 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -75,21 +75,25 @@ class V8_NODISCARD PerThreadAssertScope | 75 | 75 |
| 76 | 76 | // Per-isolate assert scopes. | 77 | 77 |
| 78 | | -#define PER_ISOLATE_DCHECK_TYPE(V, enable) \ | 79 | | - /* Scope to document where we do not expect javascript execution. */ \ | 80 | | - /* Scope to introduce an exception to DisallowJavascriptExecution. */ \ | 81 | | - V(AllowJavascriptExecution, DisallowJavascriptExecution, \ | 82 | | - javascript_execution_assert, enable) \ | 83 | | - /* Scope to document where we do not expect deoptimization. */ \ | 84 | | - /* Scope to introduce an exception to DisallowDeoptimization. */ \ | 85 | | - V(AllowDeoptimization, DisallowDeoptimization, deoptimization_assert, \ | 86 | | - enable) \ | 87 | | - /* Scope to document where we do not expect deoptimization. */ \ | 88 | | - /* Scope to introduce an exception to DisallowDeoptimization. */ \ | 89 | | - V(AllowCompilation, DisallowCompilation, compilation_assert, enable) \ | 90 | | - /* Scope to document where we do not expect exceptions. */ \ | 91 | | - /* Scope to introduce an exception to DisallowExceptions. */ \ | 92 | | - V(AllowExceptions, DisallowExceptions, no_exception_assert, enable) | | 78 | +#define PER_ISOLATE_DCHECK_TYPE(V, enable) \ | | 79 | + /* Scope to document where we do not expect javascript execution. */ \ | | 80 | + /* Scope to introduce an exception to DisallowJavascriptExecution. */ \ | | 81 | + V(AllowJavascriptExecution, DisallowJavascriptExecution, \ | | 82 | + javascript_execution_assert, enable) \ | | 83 | + /* Scope to document where we do not expect deoptimization. */ \ | | 84 | + /* Scope to introduce an exception to DisallowDeoptimization. */ \ | | 85 | + V(AllowDeoptimization, DisallowDeoptimization, deoptimization_assert, \ | | 86 | + enable) \ | | 87 | + /* Scope to document where we do not expect deoptimization. */ \ | | 88 | + /* Scope to introduce an exception to DisallowDeoptimization. */ \ | | 89 | + V(AllowCompilation, DisallowCompilation, compilation_assert, enable) \ | | 90 | + /* Scope to document where we do not expect exceptions. */ \ | | 91 | + /* Scope to introduce an exception to DisallowExceptions. */ \ | | 92 | + V(AllowExceptions, DisallowExceptions, no_exception_assert, enable) \ | | 93 | + /* Scope to document where we do not expect JS object modifications. */ \ | | 94 | + /* Scope to introduce an exception to DisallowJSObjectModification. */ \ | | 95 | + V(AllowJSObjectModification, DisallowJSObjectModification, \ | | 96 | + js_object_modification_assert, enable) | 93 | 97 |
| 94 | 98 | #define PER_ISOLATE_CHECK_TYPE(V, enable) \ | 95 | 99 | /* Scope in which javascript execution leads to exception being thrown. */ \ | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/backend/register-allocator.cc +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4406,8 +4406,9 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current, | 4406 | 4406 | InstructionBlock* deferred_block = | 4407 | 4407 | code()->GetInstructionBlock(current->Start().ToInstructionIndex()); | 4408 | 4408 | new_end = | 4409 | | - std::min(new_end, LifetimePosition::GapFromInstructionIndex( | 4410 | | - LastDeferredInstructionIndex(deferred_block))); | | 4409 | + std::min(new_end, LifetimePosition::InstructionFromInstructionIndex( | | 4410 | + LastDeferredInstructionIndex(deferred_block)) | | 4411 | + .NextFullStart()); | 4411 | 4412 | } | 4412 | 4413 |
| 4413 | 4414 | // We couldn't spill until the next register use. Split before the register | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/escape-analysis-reducer.cc +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -309,6 +309,7 @@ void EscapeAnalysisReducer::Finalize() { | 309 | 309 | NodeProperties::SetType(load, Type::None()); | 310 | 310 | NodeProperties::SetType(dead_value, Type::None()); | 311 | 311 | NodeProperties::ReplaceUses(load, dead_value, load); | | 312 | + NodeProperties::ReplaceValueInput(dead_value, load, 0); | 312 | 313 | continue; | 313 | 314 | } | 314 | 315 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/simplified-operator.cc +8-2Lines changed: 8 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1167,9 +1167,12 @@ struct SimplifiedOperatorGlobalCache final { | 1167 | 1167 | DEOPTIMIZE_REASON_LIST(CHECK_IF) | 1168 | 1168 | #undef CHECK_IF | 1169 | 1169 |
| | 1170 | + // Looking up a string key can internalize it in place into a ThinString, | | 1171 | + // so Operator::kNoWrite (and thus Operator::kEliminatable) does not hold. | 1170 | 1172 | struct FindOrderedHashMapEntryOperator final : public Operator { | 1171 | 1173 | FindOrderedHashMapEntryOperator() | 1172 | | - : Operator(IrOpcode::kFindOrderedHashMapEntry, Operator::kEliminatable, | | 1174 | + : Operator(IrOpcode::kFindOrderedHashMapEntry, | | 1175 | + Operator::kNoThrow | Operator::kNoDeopt, | 1173 | 1176 | "FindOrderedHashMapEntry", 2, 1, 1, 1, 1, 0) {} | 1174 | 1177 | }; | 1175 | 1178 | FindOrderedHashMapEntryOperator kFindOrderedHashMapEntry; | @@ -1183,9 +1186,12 @@ struct SimplifiedOperatorGlobalCache final { | 1183 | 1186 | FindOrderedHashMapEntryForInt32KeyOperator | 1184 | 1187 | kFindOrderedHashMapEntryForInt32Key; | 1185 | 1188 |
| | 1189 | + // Looking up a string key can internalize it in place into a ThinString, | | 1190 | + // so Operator::kNoWrite (and thus Operator::kEliminatable) does not hold. | 1186 | 1191 | struct FindOrderedHashSetEntryOperator final : public Operator { | 1187 | 1192 | FindOrderedHashSetEntryOperator() | 1188 | | - : Operator(IrOpcode::kFindOrderedHashSetEntry, Operator::kEliminatable, | | 1193 | + : Operator(IrOpcode::kFindOrderedHashSetEntry, | | 1194 | + Operator::kNoThrow | Operator::kNoDeopt, | 1189 | 1195 | "FindOrderedHashSetEntry", 2, 1, 1, 1, 1, 0) {} | 1190 | 1196 | }; | 1191 | 1197 | FindOrderedHashSetEntryOperator kFindOrderedHashSetEntry; | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/turboshaft/builtin-call-descriptors.h +8-4Lines changed: 8 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -300,15 +300,19 @@ struct builtin : CallDescriptorBuilder { | 300 | 300 | static constexpr auto kFunction = B; | 301 | 301 | struct Arguments : ArgumentsBase { | 302 | 302 | ARG(V<Object>, table) | 303 | | - ARG(V<Smi>, key) | | 303 | + ARG(V<Object>, key) | 304 | 304 | }; | 305 | 305 | using returns_t = std::tuple<V<Smi>>; | 306 | 306 |
| 307 | 307 | static constexpr bool kCanTriggerLazyDeopt = false; | 308 | 308 | static constexpr bool kNeedsContext = true; | 309 | | - static constexpr Operator::Properties kProperties = Operator::kEliminatable; | 310 | | - static constexpr OpEffects kEffects = | 311 | | - base_effects.AssumesConsistentHeap().CanReadMemory().CanAllocate(); | | 309 | + static constexpr Operator::Properties kProperties = | | 310 | + Operator::kNoThrow | Operator::kNoDeopt; | | 311 | + // Looking up a string key can internalize it in place into a ThinString. | | 312 | + static constexpr OpEffects kEffects = base_effects.AssumesConsistentHeap() | | 313 | + .CanReadMemory() | | 314 | + .CanWriteHeapMemory() | | 315 | + .CanAllocate(); | 312 | 316 | }; | 313 | 317 | using FindOrderedHashMapEntry = | 314 | 318 | FindOrderedHashEntry<Builtin::kFindOrderedHashMapEntry>; | |
|