From f067ed8315d8b2054f6b0e358c625ce93317eb44 Mon Sep 17 00:00:00 2001 From: Dan Elphick Date: Tue, 19 Nov 2019 14:57:03 +0000 Subject: [PATCH] [snapshot] Fix gcmole issues in code-serializer.cc Handlify raw SharedFunctionInfo in CreateInterpreterDataForDeserializedCode. Bug: v8:9992 Change-Id: I58fd2a78723cb3cd4784086c171c58cf2c32aacc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1924362 Auto-Submit: Dan Elphick Commit-Queue: Maya Lekova Reviewed-by: Maya Lekova Cr-Commit-Position: refs/heads/master@{#65044} --- src/snapshot/code-serializer.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc index 774c2f3789..b1fdbb7d0f 100644 --- a/src/snapshot/code-serializer.cc +++ b/src/snapshot/code-serializer.cc @@ -235,9 +235,10 @@ void CreateInterpreterDataForDeserializedCode(Isolate* isolate, Handle name_handle(name, isolate); SharedFunctionInfo::ScriptIterator iter(isolate, script); - for (SharedFunctionInfo info = iter.Next(); !info.is_null(); - info = iter.Next()) { - if (!info.HasBytecodeArray()) continue; + for (SharedFunctionInfo shared_info = iter.Next(); !shared_info.is_null(); + shared_info = iter.Next()) { + if (!shared_info.HasBytecodeArray()) continue; + Handle info = handle(shared_info, isolate); Handle code = isolate->factory()->CopyCode(Handle::cast( isolate->factory()->interpreter_entry_trampoline_for_profiling())); @@ -245,18 +246,18 @@ void CreateInterpreterDataForDeserializedCode(Isolate* isolate, Handle::cast(isolate->factory()->NewStruct( INTERPRETER_DATA_TYPE, AllocationType::kOld)); - interpreter_data->set_bytecode_array(info.GetBytecodeArray()); + interpreter_data->set_bytecode_array(info->GetBytecodeArray()); interpreter_data->set_interpreter_trampoline(*code); - info.set_interpreter_data(*interpreter_data); + info->set_interpreter_data(*interpreter_data); if (!log_code_creation) continue; Handle abstract_code = Handle::cast(code); - int line_num = script.GetLineNumber(info.StartPosition()) + 1; - int column_num = script.GetColumnNumber(info.StartPosition()) + 1; + int line_num = script.GetLineNumber(info->StartPosition()) + 1; + int column_num = script.GetColumnNumber(info->StartPosition()) + 1; PROFILE(isolate, CodeCreateEvent(CodeEventListener::INTERPRETED_FUNCTION_TAG, - *abstract_code, info, *name_handle, line_num, + *abstract_code, *info, *name_handle, line_num, column_num)); } }