Commit 994a34f0 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] --trace-turbo in CreatePipelineStatistics needs a parse_info

A recent CL enabled pipeline statistics for WebAssembly. This caused a
problem with the --trace-turbo flag because in the pipeline statistics
code --trace-turbo wanted to access the parse_info, which is not
available for WebAssembly. With this CL I guard the trace-turbo code
behind a parse_info check to avoid this problem.

R=clemensh@chromium.org

Change-Id: I9d628c7dec5b456e0ff9178ad989c41ac1e0237e
Reviewed-on: https://chromium-review.googlesource.com/461902Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44229}
parent f8deca1c
......@@ -520,14 +520,14 @@ PipelineStatistics* CreatePipelineStatistics(CompilationInfo* info,
if (FLAG_trace_turbo) {
TurboJsonFile json_of(info, std::ios_base::trunc);
Handle<Script> script = info->script();
std::unique_ptr<char[]> function_name = info->GetDebugName();
int pos = info->shared_info()->start_position();
int pos = info->parse_info() ? info->shared_info()->start_position() : 0;
json_of << "{\"function\":\"" << function_name.get()
<< "\", \"sourcePosition\":" << pos << ", \"source\":\"";
Isolate* isolate = info->isolate();
if (!script->IsUndefined(isolate) &&
!script->source()->IsUndefined(isolate)) {
Handle<Script> script =
info->parse_info() ? info->script() : Handle<Script>::null();
if (!script.is_null() && !script->source()->IsUndefined(isolate)) {
DisallowHeapAllocation no_allocation;
int start = info->shared_info()->start_position();
int len = info->shared_info()->end_position() - start;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment