[gcmole] Handlify script in code-serializer.cc

R=mslekova@chromium.org

Bug: v8:9992
Change-Id: I970b919e456257f5776454edceb0bcc1c40eff7d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1930556
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65115}
This commit is contained in:
Dan Elphick 2019-11-22 11:17:23 +00:00 committed by Commit Bot
parent 8e8fe47505
commit 1269498fa7

View File

@ -228,13 +228,12 @@ void CodeSerializer::SerializeGeneric(HeapObject heap_object) {
void CreateInterpreterDataForDeserializedCode(Isolate* isolate, void CreateInterpreterDataForDeserializedCode(Isolate* isolate,
Handle<SharedFunctionInfo> sfi, Handle<SharedFunctionInfo> sfi,
bool log_code_creation) { bool log_code_creation) {
Script script = Script::cast(sfi->script()); Handle<Script> script(Script::cast(sfi->script()), isolate);
Handle<Script> script_handle(script, isolate);
String name = ReadOnlyRoots(isolate).empty_string(); String name = ReadOnlyRoots(isolate).empty_string();
if (script.name().IsString()) name = String::cast(script.name()); if (script->name().IsString()) name = String::cast(script->name());
Handle<String> name_handle(name, isolate); Handle<String> name_handle(name, isolate);
SharedFunctionInfo::ScriptIterator iter(isolate, script); SharedFunctionInfo::ScriptIterator iter(isolate, *script);
for (SharedFunctionInfo shared_info = iter.Next(); !shared_info.is_null(); for (SharedFunctionInfo shared_info = iter.Next(); !shared_info.is_null();
shared_info = iter.Next()) { shared_info = iter.Next()) {
if (!shared_info.HasBytecodeArray()) continue; if (!shared_info.HasBytecodeArray()) continue;
@ -253,8 +252,8 @@ void CreateInterpreterDataForDeserializedCode(Isolate* isolate,
if (!log_code_creation) continue; if (!log_code_creation) continue;
Handle<AbstractCode> abstract_code = Handle<AbstractCode>::cast(code); Handle<AbstractCode> abstract_code = Handle<AbstractCode>::cast(code);
int line_num = script.GetLineNumber(info->StartPosition()) + 1; int line_num = script->GetLineNumber(info->StartPosition()) + 1;
int column_num = script.GetColumnNumber(info->StartPosition()) + 1; int column_num = script->GetColumnNumber(info->StartPosition()) + 1;
PROFILE(isolate, PROFILE(isolate,
CodeCreateEvent(CodeEventListener::INTERPRETED_FUNCTION_TAG, CodeCreateEvent(CodeEventListener::INTERPRETED_FUNCTION_TAG,
*abstract_code, *info, *name_handle, line_num, *abstract_code, *info, *name_handle, line_num,