Index: runtime/vm/compiler.cc |
=================================================================== |
--- runtime/vm/compiler.cc (revision 45719) |
+++ runtime/vm/compiler.cc (working copy) |
@@ -375,7 +375,7 @@ |
if (optimized && !function.IsOptimizable()) { |
return false; |
} |
- TimerScope timer(FLAG_compiler_stats, &CompilerStats::codegen_timer); |
+ TimerScope timer(FLAG_compiler_stats, &CSTAT_TIMER(codegen_timer)); |
bool is_compiled = false; |
Thread* const thread = Thread::Current(); |
Zone* const zone = thread->zone(); |
@@ -406,7 +406,7 @@ |
// LongJump. |
{ |
TimerScope timer(FLAG_compiler_stats, |
- &CompilerStats::graphbuilder_timer, |
+ &CSTAT_TIMER(graphbuilder_timer), |
isolate); |
ZoneGrowableArray<const ICData*>* ic_data_array = |
new(zone) ZoneGrowableArray<const ICData*>(); |
@@ -455,7 +455,7 @@ |
if (optimized) { |
TimerScope timer(FLAG_compiler_stats, |
- &CompilerStats::ssa_timer, |
+ &CSTAT_TIMER(ssa_timer), |
isolate); |
// Transform to SSA (virtual register 0 and no inlining arguments). |
flow_graph->ComputeSSA(0, NULL); |
@@ -478,7 +478,7 @@ |
// Top scope function has no caller (-1). |
caller_inline_id.Add(-1); |
TimerScope timer(FLAG_compiler_stats, |
- &CompilerStats::graphoptimizer_timer, |
+ &CSTAT_TIMER(graphoptimizer_timer), |
isolate); |
FlowGraphOptimizer optimizer(flow_graph); |
@@ -495,7 +495,7 @@ |
// Inlining (mutates the flow graph) |
if (FLAG_use_inlining) { |
TimerScope timer(FLAG_compiler_stats, |
- &CompilerStats::graphinliner_timer); |
+ &CSTAT_TIMER(graphinliner_timer)); |
// Propagate types to create more inlining opportunities. |
FlowGraphTypePropagator::Propagate(flow_graph); |
DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
@@ -710,27 +710,39 @@ |
caller_inline_id); |
{ |
TimerScope timer(FLAG_compiler_stats, |
- &CompilerStats::graphcompiler_timer, |
+ &CSTAT_TIMER(graphcompiler_timer), |
isolate); |
graph_compiler.CompileGraph(); |
pipeline->FinalizeCompilation(); |
} |
{ |
TimerScope timer(FLAG_compiler_stats, |
- &CompilerStats::codefinalizer_timer, |
+ &CSTAT_TIMER(codefinalizer_timer), |
isolate); |
// CreateDeoptInfo uses the object pool and needs to be done before |
// FinalizeCode. |
- const Array& deopt_info_array = Array::Handle( |
- graph_compiler.CreateDeoptInfo(&assembler)); |
+ const Array& deopt_info_array = |
+ Array::Handle(isolate, graph_compiler.CreateDeoptInfo(&assembler)); |
+ INC_STAT(isolate, total_code_size, |
+ deopt_info_array.Length() * sizeof(uword)); |
const Code& code = Code::Handle( |
Code::FinalizeCode(function, &assembler, optimized)); |
code.set_is_optimized(optimized); |
- code.set_inlined_intervals(graph_compiler.inlined_code_intervals()); |
- code.set_inlined_id_to_function( |
- Array::Handle(graph_compiler.InliningIdToFunction())); |
+ |
+ const Array& intervals = graph_compiler.inlined_code_intervals(); |
+ INC_STAT(isolate, total_code_size, |
+ intervals.Length() * sizeof(uword)); |
+ code.set_inlined_intervals(intervals); |
+ |
+ const Array& inlined_id_array = |
+ Array::Handle(isolate, graph_compiler.InliningIdToFunction()); |
+ INC_STAT(isolate, total_code_size, |
+ inlined_id_array.Length() * sizeof(uword)); |
+ code.set_inlined_id_to_function(inlined_id_array); |
+ |
graph_compiler.FinalizePcDescriptors(code); |
code.set_deopt_info_array(deopt_info_array); |
+ |
graph_compiler.FinalizeStackmaps(code); |
graph_compiler.FinalizeVarDescriptors(code); |
graph_compiler.FinalizeExceptionHandlers(code); |