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

Side by Side 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, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 // Add deoptimization continuation point after the call and before the 1191 // Add deoptimization continuation point after the call and before the
1192 // arguments are removed. 1192 // arguments are removed.
1193 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 1193 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1194 deopt_id_after, 1194 deopt_id_after,
1195 token_pos); 1195 token_pos);
1196 } 1196 }
1197 } 1197 }
1198 } 1198 }
1199 1199
1200 1200
1201 void FlowGraphCompiler::EmitEdgeCounter() { 1201 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
1202 // We do not check for overflow when incrementing the edge counter. The 1202 // We do not check for overflow when incrementing the edge counter. The
1203 // function should normally be optimized long before the counter can 1203 // function should normally be optimized long before the counter can
1204 // overflow; and though we do not reset the counters when we optimize or 1204 // overflow; and though we do not reset the counters when we optimize or
1205 // deoptimize, there is a bound on the number of 1205 // deoptimize, there is a bound on the number of
1206 // optimization/deoptimization cycles we will attempt. 1206 // optimization/deoptimization cycles we will attempt.
1207 const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld)); 1207 ASSERT(!edge_counters_array_.IsNull());
1208 counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
1209 __ Comment("Edge counter"); 1208 __ Comment("Edge counter");
1210 __ LoadUniqueObject(T0, counter); 1209 __ LoadObject(T0, edge_counters_array_);
1211 __ lw(T1, FieldAddress(T0, Array::element_offset(0))); 1210 __ lw(T1, FieldAddress(T0, Array::element_offset(edge_id)));
1212 __ AddImmediate(T1, T1, Smi::RawValue(1)); 1211 __ AddImmediate(T1, T1, Smi::RawValue(1));
1213 __ sw(T1, FieldAddress(T0, Array::element_offset(0))); 1212 __ sw(T1, FieldAddress(T0, Array::element_offset(edge_id)));
1214 } 1213 }
1215 1214
1216 1215
1217 void FlowGraphCompiler::EmitOptimizedInstanceCall( 1216 void FlowGraphCompiler::EmitOptimizedInstanceCall(
1218 const StubEntry& stub_entry, 1217 const StubEntry& stub_entry,
1219 const ICData& ic_data, 1218 const ICData& ic_data,
1220 intptr_t argument_count, 1219 intptr_t argument_count,
1221 intptr_t deopt_id, 1220 intptr_t deopt_id,
1222 intptr_t token_pos, 1221 intptr_t token_pos,
1223 LocationSummary* locs) { 1222 LocationSummary* locs) {
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 __ AddImmediate(SP, kDoubleSize); 1840 __ AddImmediate(SP, kDoubleSize);
1842 } 1841 }
1843 1842
1844 1843
1845 #undef __ 1844 #undef __
1846 1845
1847 1846
1848 } // namespace dart 1847 } // namespace dart
1849 1848
1850 #endif // defined TARGET_ARCH_MIPS 1849 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« 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