Commit 3e29f36b authored by loislo's avatar loislo Committed by Commit bot

CpuProfiler: convert List<InlinedFunctionInfo> into std::vector<InlinedFunctionInfo>

this is the first part of https://codereview.chromium.org/1012633002.
mechanical change.

The motivation: the original patch needs to use List of List but list is not copiable.

BUG=chromium:452067
LOG=n

Review URL: https://codereview.chromium.org/1011733002

Cr-Commit-Position: refs/heads/master@{#27221}
parent 567e45a1
...@@ -117,7 +117,7 @@ void CompilationInfo::Initialize(Isolate* isolate, ...@@ -117,7 +117,7 @@ void CompilationInfo::Initialize(Isolate* isolate,
no_frame_ranges_ = isolate->cpu_profiler()->is_profiling() no_frame_ranges_ = isolate->cpu_profiler()->is_profiling()
? new List<OffsetRange>(2) : NULL; ? new List<OffsetRange>(2) : NULL;
if (FLAG_hydrogen_track_positions) { if (FLAG_hydrogen_track_positions) {
inlined_function_infos_ = new List<InlinedFunctionInfo>(5); inlined_function_infos_ = new std::vector<InlinedFunctionInfo>();
} else { } else {
inlined_function_infos_ = NULL; inlined_function_infos_ = NULL;
} }
...@@ -279,7 +279,7 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared, ...@@ -279,7 +279,7 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
DCHECK(FLAG_hydrogen_track_positions); DCHECK(FLAG_hydrogen_track_positions);
DCHECK(inlined_function_infos_); DCHECK(inlined_function_infos_);
int inline_id = inlined_function_infos_->length(); int inline_id = static_cast<int>(inlined_function_infos_->size());
InlinedFunctionInfo info(parent_id, position, UnboundScript::kNoScriptId, InlinedFunctionInfo info(parent_id, position, UnboundScript::kNoScriptId,
shared->start_position()); shared->start_position());
if (!shared->script()->IsUndefined()) { if (!shared->script()->IsUndefined()) {
...@@ -306,7 +306,7 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared, ...@@ -306,7 +306,7 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
} }
} }
inlined_function_infos_->Add(info); inlined_function_infos_->push_back(info);
if (inline_id != 0) { if (inline_id != 0) {
CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer()); CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer());
......
...@@ -337,7 +337,7 @@ class CompilationInfo { ...@@ -337,7 +337,7 @@ class CompilationInfo {
return result; return result;
} }
List<InlinedFunctionInfo>* inlined_function_infos() { std::vector<InlinedFunctionInfo>* inlined_function_infos() {
return inlined_function_infos_; return inlined_function_infos_;
} }
int TraceInlinedFunction(Handle<SharedFunctionInfo> shared, int TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
...@@ -448,7 +448,7 @@ class CompilationInfo { ...@@ -448,7 +448,7 @@ class CompilationInfo {
int prologue_offset_; int prologue_offset_;
List<OffsetRange>* no_frame_ranges_; List<OffsetRange>* no_frame_ranges_;
List<InlinedFunctionInfo>* inlined_function_infos_; std::vector<InlinedFunctionInfo>* inlined_function_infos_;
// A copy of shared_info()->opt_count() to avoid handle deref // A copy of shared_info()->opt_count() to avoid handle deref
// during graph optimization. // during graph optimization.
......
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