Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1272)

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 1343383003: VM: Store edge counters in one per-function array. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 7bc12680092c29a55d7604765cebf378f1fa24ca..05cbcc0a9a09295f54d76494fdd96403b0c31e9b 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -1198,19 +1198,18 @@ void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos,
}
-void FlowGraphCompiler::EmitEdgeCounter() {
+void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
// We do not check for overflow when incrementing the edge counter. The
// function should normally be optimized long before the counter can
// overflow; and though we do not reset the counters when we optimize or
// deoptimize, there is a bound on the number of
// optimization/deoptimization cycles we will attempt.
- const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
- counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
+ ASSERT(!edge_counters_array_.IsNull());
__ Comment("Edge counter");
- __ LoadUniqueObject(T0, counter);
- __ lw(T1, FieldAddress(T0, Array::element_offset(0)));
+ __ LoadObject(T0, edge_counters_array_);
+ __ lw(T1, FieldAddress(T0, Array::element_offset(edge_id)));
__ AddImmediate(T1, T1, Smi::RawValue(1));
- __ sw(T1, FieldAddress(T0, Array::element_offset(0)));
+ __ sw(T1, FieldAddress(T0, Array::element_offset(edge_id)));
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698