Skip to content

Commit 00fec20

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: patch V8 to 15.6.75.60
Refs: v8/v8@15.6.75.50...15.6.75.60 PR-URL: #67479 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent e6eb318 commit 00fec20

53 files changed

Lines changed: 1247 additions & 258 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎deps/v8/include/v8-version.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 15
1212
#define V8_MINOR_VERSION 6
1313
#define V8_BUILD_NUMBER 75
14-
#define V8_PATCH_LEVEL 50
14+
#define V8_PATCH_LEVEL 60
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

‎deps/v8/src/baseline/baseline-compiler.cc‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,27 +1882,25 @@ void BaselineCompiler::VisitIntrinsicAsyncFunctionResolve(
18821882

18831883
void BaselineCompiler::VisitIntrinsicGeneratorYieldResult(
18841884
interpreter::RegisterList args) {
1885-
Register value = WriteBarrierDescriptor::ValueRegister();
18861885
Register generator = WriteBarrierDescriptor::ObjectRegister();
1887-
DCHECK(!AreAliased(value, generator, kInterpreterAccumulatorRegister));
1886+
DCHECK(!AreAliased(generator, kInterpreterAccumulatorRegister));
18881887

18891888
Label allocate, done;
18901889

18911890
__ LoadRegister(generator, args[1]); // generator
18921891

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).
18951894
__ 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
19061904
__ Jump(&done);
19071905

19081906
__ Bind(&allocate);

‎deps/v8/src/builtins/builtins-generator-gen.cc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ void GeneratorBuiltinsAssembler::InnerResume(
122122
case JSGeneratorObject::kRethrow:
123123
// Currently only async generators use this mode.
124124
UNREACHABLE();
125+
case JSGeneratorObject::kNextTrySkipAlloc:
126+
case JSGeneratorObject::kNextAllocSkipped:
127+
// Handshake states only set by optimized callers or the generator body.
128+
UNREACHABLE();
125129
}
126130
args->PopAndReturn(builtin_result);
127131
}

‎deps/v8/src/builtins/generator.tq‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ transitioning javascript builtin GeneratorPrototypeNextLazyDeoptContinuation(
1919
js-implicit context: NativeContext, receiver: JSAny)(generator: JSAny,
2020
exception: JSAny|TheHole, result: JSAny): JSAny {
2121
const gen = UnsafeCast<JSGeneratorObject>(generator);
22-
const yieldedValue = gen.yielded_value;
23-
gen.yielded_value = Undefined;
2422

2523
// Exception path: close the generator and rethrow.
2624
typeswitch (exception) {
@@ -36,15 +34,13 @@ transitioning javascript builtin GeneratorPrototypeNextLazyDeoptContinuation(
3634
// continuation is now kGeneratorExecuting; close it and wrap the result.
3735
// Otherwise (yielded), return the result as-is.
3836
if (gen.continuation == SmiConstant(kGeneratorExecuting)) {
39-
dcheck(result != TheHole);
4037
gen.continuation = SmiConstant(kGeneratorClosed);
4138
return AllocateJSIteratorResult(result, True);
4239
}
4340

4441
// 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);
4844
}
4945

5046
return result;

‎deps/v8/src/codegen/compiler.cc‎

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,11 @@ class ConstantPoolPointerForwarder {
21772177
}
21782178
}
21792179

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+
21802185
void UpdateStandaloneScopeInfo(Tagged<ScopeInfo> scope_info) {
21812186
if (!scope_info->HasOuterScopeInfo()) return;
21822187

@@ -2354,6 +2359,23 @@ void VerifyCodeMerge(Isolate* isolate, DirectHandle<Script> script) {
23542359
// * All constant pool SFI entries point to an SFI referring to the old
23552360
// script (i.e. references were updated correctly).
23562361
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+
};
23572379
uint32_t script_infos_len = script->infos()->ulength().value();
23582380
for (uint32_t info_idx = 0; info_idx < script_infos_len; info_idx++) {
23592381
Tagged<ScopeInfo> scope_info;
@@ -2377,6 +2399,8 @@ void VerifyCodeMerge(Isolate* isolate, DirectHandle<Script> script) {
23772399
int id = inner_sfi->function_literal_id(kRelaxedLoad);
23782400
CHECK_EQ(MakeWeak(inner_sfi), script->infos()->get(id));
23792401
CHECK_EQ(inner_sfi->script(), *script);
2402+
} else if (Is<ScopeInfo>(entry)) {
2403+
verify_scope_info(Cast<ScopeInfo>(entry));
23802404
}
23812405
}
23822406
}
@@ -2391,21 +2415,7 @@ void VerifyCodeMerge(Isolate* isolate, DirectHandle<Script> script) {
23912415
} else {
23922416
scope_info = Cast<ScopeInfo>(info);
23932417
}
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);
24092419
}
24102420
}
24112421
} // namespace
@@ -2553,6 +2563,9 @@ void BackgroundMergeTask::BeginMergeInBackground(
25532563
for (DirectHandle<SharedFunctionInfo> new_sfi : used_new_sfis_) {
25542564
forwarder.UpdateScopeInfo(*new_sfi);
25552565
}
2566+
for (DirectHandle<ScopeInfo> new_scope : used_new_scope_infos_) {
2567+
forwarder.UpdateStandaloneScopeInfo(*new_scope);
2568+
}
25562569
for (const auto& new_compiled_data : new_compiled_data_for_cached_sfis_) {
25572570
// It's possible that new_compiled_data.cached_sfi had
25582571
// scope_info()->IsEmpty() while an inner function has scope info if the
@@ -2659,6 +2672,14 @@ Handle<SharedFunctionInfo> BackgroundMergeTask::CompleteMergeInForeground(
26592672
compiled_data_it++;
26602673
}
26612674
} 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())));
26622683
old_script->infos()->set(i, maybe_new_info, kReleaseStore);
26632684
}
26642685
}

‎deps/v8/src/common/assert-scope.h‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,25 @@ class V8_NODISCARD PerThreadAssertScope
7575

7676
// Per-isolate assert scopes.
7777

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)
9397

9498
#define PER_ISOLATE_CHECK_TYPE(V, enable) \
9599
/* Scope in which javascript execution leads to exception being thrown. */ \

‎deps/v8/src/compiler/backend/register-allocator.cc‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4406,8 +4406,9 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current,
44064406
InstructionBlock* deferred_block =
44074407
code()->GetInstructionBlock(current->Start().ToInstructionIndex());
44084408
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());
44114412
}
44124413

44134414
// We couldn't spill until the next register use. Split before the register

‎deps/v8/src/compiler/escape-analysis-reducer.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ void EscapeAnalysisReducer::Finalize() {
309309
NodeProperties::SetType(load, Type::None());
310310
NodeProperties::SetType(dead_value, Type::None());
311311
NodeProperties::ReplaceUses(load, dead_value, load);
312+
NodeProperties::ReplaceValueInput(dead_value, load, 0);
312313
continue;
313314
}
314315

‎deps/v8/src/compiler/simplified-operator.cc‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,9 +1167,12 @@ struct SimplifiedOperatorGlobalCache final {
11671167
DEOPTIMIZE_REASON_LIST(CHECK_IF)
11681168
#undef CHECK_IF
11691169

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.
11701172
struct FindOrderedHashMapEntryOperator final : public Operator {
11711173
FindOrderedHashMapEntryOperator()
1172-
: Operator(IrOpcode::kFindOrderedHashMapEntry, Operator::kEliminatable,
1174+
: Operator(IrOpcode::kFindOrderedHashMapEntry,
1175+
Operator::kNoThrow | Operator::kNoDeopt,
11731176
"FindOrderedHashMapEntry", 2, 1, 1, 1, 1, 0) {}
11741177
};
11751178
FindOrderedHashMapEntryOperator kFindOrderedHashMapEntry;
@@ -1183,9 +1186,12 @@ struct SimplifiedOperatorGlobalCache final {
11831186
FindOrderedHashMapEntryForInt32KeyOperator
11841187
kFindOrderedHashMapEntryForInt32Key;
11851188

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.
11861191
struct FindOrderedHashSetEntryOperator final : public Operator {
11871192
FindOrderedHashSetEntryOperator()
1188-
: Operator(IrOpcode::kFindOrderedHashSetEntry, Operator::kEliminatable,
1193+
: Operator(IrOpcode::kFindOrderedHashSetEntry,
1194+
Operator::kNoThrow | Operator::kNoDeopt,
11891195
"FindOrderedHashSetEntry", 2, 1, 1, 1, 1, 0) {}
11901196
};
11911197
FindOrderedHashSetEntryOperator kFindOrderedHashSetEntry;

‎deps/v8/src/compiler/turboshaft/builtin-call-descriptors.h‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,19 @@ struct builtin : CallDescriptorBuilder {
300300
static constexpr auto kFunction = B;
301301
struct Arguments : ArgumentsBase {
302302
ARG(V<Object>, table)
303-
ARG(V<Smi>, key)
303+
ARG(V<Object>, key)
304304
};
305305
using returns_t = std::tuple<V<Smi>>;
306306

307307
static constexpr bool kCanTriggerLazyDeopt = false;
308308
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();
312316
};
313317
using FindOrderedHashMapEntry =
314318
FindOrderedHashEntry<Builtin::kFindOrderedHashMapEntry>;

0 commit comments

Comments
 (0)