From df9e6fe329b5655932124a9d871d4eacbf51ce08 Mon Sep 17 00:00:00 2001 From: loislo Date: Wed, 11 Mar 2015 06:51:18 -0700 Subject: [PATCH] CpuProfiler: simplify inlined function info magic. I did some investigation and found that in the most cases the old schema with the separate List for functions and inlines gives us no memory benefits because more frequently we inlines different functions into parent function. So the plain schema wins a tens or even hundreds bytes a few thousand times. The only drawback is that we will print the inlined body the each time when we inline it. But is not a problem because it happens only under FLAG_hydrogen_track_positions. Also I added script_id to the structure, so it could be used later by cpu-profiler. BUG=chromium:452067 LOG=n Review URL: https://codereview.chromium.org/996153003 Cr-Commit-Position: refs/heads/master@{#27134} --- src/compiler.cc | 65 +++++++++++++++++++++---------------------------- src/compiler.h | 30 +++++++++++------------ src/hydrogen.cc | 13 +++++----- 3 files changed, 48 insertions(+), 60 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 2e07a671d..2aceedbd9 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -118,10 +118,8 @@ void CompilationInfo::Initialize(Isolate* isolate, ? new List(2) : NULL; if (FLAG_hydrogen_track_positions) { inlined_function_infos_ = new List(5); - inlining_id_to_function_id_ = new List(5); } else { inlined_function_infos_ = NULL; - inlining_id_to_function_id_ = NULL; } for (int i = 0; i < DependentCode::kGroupCount; i++) { @@ -163,7 +161,6 @@ CompilationInfo::~CompilationInfo() { delete deferred_handles_; delete no_frame_ranges_; delete inlined_function_infos_; - delete inlining_id_to_function_id_; #ifdef DEBUG // Check that no dependent maps have been added or added dependent maps have // been rolled back or committed. @@ -277,52 +274,46 @@ bool CompilationInfo::is_simple_parameter_list() { int CompilationInfo::TraceInlinedFunction(Handle shared, - SourcePosition position) { + SourcePosition position, + int parent_id) { DCHECK(FLAG_hydrogen_track_positions); - DCHECK(inlined_function_infos_); - DCHECK(inlining_id_to_function_id_); - int id = 0; - for (; id < inlined_function_infos_->length(); id++) { - if (inlined_function_infos_->at(id).shared().is_identical_to(shared)) { - break; - } - } - if (id == inlined_function_infos_->length()) { - inlined_function_infos_->Add(InlinedFunctionInfo(shared)); - - if (!shared->script()->IsUndefined()) { - Handle