OLD | NEW |
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 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 // Add deoptimization continuation point after the call and before the | 1208 // Add deoptimization continuation point after the call and before the |
1209 // arguments are removed. | 1209 // arguments are removed. |
1210 AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 1210 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
1211 deopt_id_after, | 1211 deopt_id_after, |
1212 token_pos); | 1212 token_pos); |
1213 } | 1213 } |
1214 } | 1214 } |
1215 } | 1215 } |
1216 | 1216 |
1217 | 1217 |
1218 void FlowGraphCompiler::EmitEdgeCounter() { | 1218 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) { |
1219 // We do not check for overflow when incrementing the edge counter. The | 1219 // We do not check for overflow when incrementing the edge counter. The |
1220 // function should normally be optimized long before the counter can | 1220 // function should normally be optimized long before the counter can |
1221 // overflow; and though we do not reset the counters when we optimize or | 1221 // overflow; and though we do not reset the counters when we optimize or |
1222 // deoptimize, there is a bound on the number of | 1222 // deoptimize, there is a bound on the number of |
1223 // optimization/deoptimization cycles we will attempt. | 1223 // optimization/deoptimization cycles we will attempt. |
1224 const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld)); | 1224 ASSERT(!edge_counters_array_.IsNull()); |
1225 counter.SetAt(0, Smi::Handle(zone(), Smi::New(0))); | |
1226 __ Comment("Edge counter"); | 1225 __ Comment("Edge counter"); |
1227 __ LoadUniqueObject(T0, counter); | 1226 __ LoadObject(T0, edge_counters_array_); |
1228 __ lw(T1, FieldAddress(T0, Array::element_offset(0))); | 1227 __ lw(T1, FieldAddress(T0, Array::element_offset(edge_id))); |
1229 __ AddImmediate(T1, T1, Smi::RawValue(1)); | 1228 __ AddImmediate(T1, T1, Smi::RawValue(1)); |
1230 __ sw(T1, FieldAddress(T0, Array::element_offset(0))); | 1229 __ sw(T1, FieldAddress(T0, Array::element_offset(edge_id))); |
1231 } | 1230 } |
1232 | 1231 |
1233 | 1232 |
1234 void FlowGraphCompiler::EmitOptimizedInstanceCall( | 1233 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
1235 const StubEntry& stub_entry, | 1234 const StubEntry& stub_entry, |
1236 const ICData& ic_data, | 1235 const ICData& ic_data, |
1237 intptr_t argument_count, | 1236 intptr_t argument_count, |
1238 intptr_t deopt_id, | 1237 intptr_t deopt_id, |
1239 intptr_t token_pos, | 1238 intptr_t token_pos, |
1240 LocationSummary* locs) { | 1239 LocationSummary* locs) { |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 __ AddImmediate(SP, kDoubleSize); | 1857 __ AddImmediate(SP, kDoubleSize); |
1859 } | 1858 } |
1860 | 1859 |
1861 | 1860 |
1862 #undef __ | 1861 #undef __ |
1863 | 1862 |
1864 | 1863 |
1865 } // namespace dart | 1864 } // namespace dart |
1866 | 1865 |
1867 #endif // defined TARGET_ARCH_MIPS | 1866 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |