Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index 96edf2d3b92478545674cb920dc2e4dde18ee9da..bd6466b3f6de89e8b81c9a4ec21d7b6ab13b573a 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -123,9 +123,6 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub, |
| deferred_handles_(nullptr), |
| bailout_reason_(kNoReason), |
| prologue_offset_(Code::kPrologueOffsetNotSet), |
| - no_frame_ranges_(isolate->cpu_profiler()->is_profiling() |
| - ? new List<OffsetRange>(2) |
| - : nullptr), |
| track_positions_(FLAG_hydrogen_track_positions), |
| opt_count_(has_shared_info() ? shared_info()->opt_count() : 0), |
| parameter_count_(0), |
| @@ -133,13 +130,19 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub, |
| aborted_due_to_dependency_change_(false), |
| osr_expr_stack_height_(0) { |
| std::fill_n(dependencies_, DependentCode::kGroupCount, nullptr); |
| + if (isolate->cpu_profiler()->is_profiling()) { |
| + no_frame_ranges_.Reset(new List<OffsetRange>(2)); |
|
Sven Panne
2015/03/23 10:13:26
No need for this, see comment in the header.
|
| + track_positions_ = true; |
|
Sven Panne
2015/03/23 10:13:26
Instead of doing this assignment to track_position
|
| + } |
| + if (track_positions_) { |
| + inlined_function_infos_.Reset(new std::vector<InlinedFunctionInfo>()); |
|
Sven Panne
2015/03/23 10:13:26
No need for this, see comment in the header.
|
| + } |
| } |
| CompilationInfo::~CompilationInfo() { |
| DisableFutureOptimization(); |
| delete deferred_handles_; |
| - delete no_frame_ranges_; |
| #ifdef DEBUG |
| // Check that no dependent maps have been added or added dependent maps have |
| // been rolled back or committed. |
| @@ -245,7 +248,7 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared, |
| int parent_id) { |
| DCHECK(track_positions_); |
| - int inline_id = static_cast<int>(inlined_function_infos_.size()); |
| + int inline_id = static_cast<int>(inlined_function_infos_->size()); |
| InlinedFunctionInfo info(parent_id, position, UnboundScript::kNoScriptId, |
| shared->start_position()); |
| if (!shared->script()->IsUndefined()) { |
| @@ -267,12 +270,11 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared, |
| os << AsReversiblyEscapedUC16(c); |
| } |
| } |
| - |
| os << "\n--- END ---\n"; |
| } |
| } |
| - inlined_function_infos_.push_back(info); |
| + inlined_function_infos_->push_back(info); |
| if (FLAG_hydrogen_track_positions && inline_id != 0) { |
| CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer()); |
| @@ -288,8 +290,9 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared, |
| void CompilationInfo::LogDeoptCallPosition(int pc_offset, int inlining_id) { |
| if (!track_positions_ || IsStub()) return; |
| - DCHECK_LT(static_cast<size_t>(inlining_id), inlined_function_infos_.size()); |
| - inlined_function_infos_.at(inlining_id).deopt_pc_offsets.push_back(pc_offset); |
| + DCHECK_LT(static_cast<size_t>(inlining_id), inlined_function_infos_->size()); |
| + inlined_function_infos_->at(inlining_id) |
| + .deopt_pc_offsets.push_back(pc_offset); |
| } |