Skip to content

Commit 7c25dce

Browse files
joyeecheungtargos
authored andcommitted
deps: V8: cherry-pick 5d0cf6b
Original commit message: [snapshot] Use Handle to track name in `CodeSerializer::Deserialize` The `Script::InitLineEnds(Handle<Script>(script, isolate));` line may lead to objects being moved around on the heap, so it’s necessary to use a `Handle` to track that. This was causing crashes in Node.js in Debug mode when using the code cache in combination with the CPU profiler. Refs: #27307 Change-Id: I392b4c00c6ebad44753f87fcbf2e3278ea7799a6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1575698 Reviewed-by: Jakob Gruber <[email protected]> Reviewed-by: Peter Marshall <[email protected]> Commit-Queue: Peter Marshall <[email protected]> Cr-Commit-Position: refs/heads/master@{#61036} Refs: v8/v8@5d0cf6b PR-URL: #27423 Fixes: #27307 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 7d80999 commit 7c25dce

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.16',
41+
'v8_embedder_string': '-node.17',
4242

4343
##### V8 defaults for Node.js #####
4444

deps/v8/src/snapshot/code-serializer.cc

+7-6
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,12 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
258258
Script script = Script::cast(result->script());
259259
Handle<Script> script_handle(script, isolate);
260260
if (script->name()->IsString()) name = String::cast(script->name());
261+
Handle<String> name_handle(name, isolate);
261262
if (FLAG_log_function_events) {
262-
LOG(isolate,
263-
FunctionEvent("deserialize", script->id(),
264-
timer.Elapsed().InMillisecondsF(),
265-
result->StartPosition(), result->EndPosition(), name));
263+
LOG(isolate, FunctionEvent("deserialize", script->id(),
264+
timer.Elapsed().InMillisecondsF(),
265+
result->StartPosition(), result->EndPosition(),
266+
*name_handle));
266267
}
267268
if (log_code_creation) {
268269
Script::InitLineEnds(Handle<Script>(script, isolate));
@@ -274,8 +275,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
274275
int line_num = script->GetLineNumber(info->StartPosition()) + 1;
275276
int column_num = script->GetColumnNumber(info->StartPosition()) + 1;
276277
PROFILE(isolate, CodeCreateEvent(CodeEventListener::SCRIPT_TAG,
277-
info->abstract_code(), info, name,
278-
line_num, column_num));
278+
info->abstract_code(), info,
279+
*name_handle, line_num, column_num));
279280
}
280281
}
281282
}

0 commit comments

Comments
 (0)