Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 2e07a671d892ecdfca81564f3686906da3e7ef29..2aceedbd95de7822011d2444e3f9af6b9c995c24 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -118,10 +118,8 @@ void CompilationInfo::Initialize(Isolate* isolate, |
? new List<OffsetRange>(2) : NULL; |
if (FLAG_hydrogen_track_positions) { |
inlined_function_infos_ = new List<InlinedFunctionInfo>(5); |
- inlining_id_to_function_id_ = new List<int>(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<SharedFunctionInfo> 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<Script> script(Script::cast(shared->script())); |
- if (!script->source()->IsUndefined()) { |
- CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer()); |
- OFStream os(tracing_scope.file()); |
- os << "--- FUNCTION SOURCE (" << shared->DebugName()->ToCString().get() |
- << ") id{" << optimization_id() << "," << id << "} ---\n"; |
- { |
- DisallowHeapAllocation no_allocation; |
- int start = shared->start_position(); |
- int len = shared->end_position() - start; |
- String::SubStringRange source(String::cast(script->source()), start, |
- len); |
- for (const auto& c : source) { |
- os << AsReversiblyEscapedUC16(c); |
- } |
- } |
- os << "\n--- END ---\n"; |
+ int inline_id = inlined_function_infos_->length(); |
+ InlinedFunctionInfo info(parent_id, position, UnboundScript::kNoScriptId, |
+ shared->start_position()); |
+ if (!shared->script()->IsUndefined()) { |
+ Handle<Script> script(Script::cast(shared->script())); |
+ info.script_id = script->id()->value(); |
+ |
+ if (!script->source()->IsUndefined()) { |
+ CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer()); |
+ OFStream os(tracing_scope.file()); |
+ os << "--- FUNCTION SOURCE (" << shared->DebugName()->ToCString().get() |
+ << ") id{" << optimization_id() << "," << inline_id << "} ---\n"; |
+ { |
+ DisallowHeapAllocation no_allocation; |
+ int start = shared->start_position(); |
+ int len = shared->end_position() - start; |
+ String::SubStringRange source(String::cast(script->source()), start, |
+ len); |
+ for (const auto& c : source) { |
+ os << AsReversiblyEscapedUC16(c); |
+ } |
} |
+ |
+ os << "\n--- END ---\n"; |
} |
} |
- int inline_id = inlining_id_to_function_id_->length(); |
- inlining_id_to_function_id_->Add(id); |
+ inlined_function_infos_->Add(info); |
if (inline_id != 0) { |
CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer()); |
OFStream os(tracing_scope.file()); |
os << "INLINE (" << shared->DebugName()->ToCString().get() << ") id{" |
- << optimization_id() << "," << id << "} AS " << inline_id << " AT " |
- << position << std::endl; |
+ << optimization_id() << "," << inline_id << "} AS " << inline_id |
+ << " AT " << position << std::endl; |
} |
return inline_id; |