OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1184 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
1185 } else { | 1185 } else { |
1186 // Add deoptimization continuation point after the call and before the | 1186 // Add deoptimization continuation point after the call and before the |
1187 // arguments are removed. | 1187 // arguments are removed. |
1188 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1188 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
1189 } | 1189 } |
1190 } | 1190 } |
1191 } | 1191 } |
1192 | 1192 |
1193 | 1193 |
1194 void FlowGraphCompiler::EmitEdgeCounter() { | 1194 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) { |
1195 // We do not check for overflow when incrementing the edge counter. The | 1195 // We do not check for overflow when incrementing the edge counter. The |
1196 // function should normally be optimized long before the counter can | 1196 // function should normally be optimized long before the counter can |
1197 // overflow; and though we do not reset the counters when we optimize or | 1197 // overflow; and though we do not reset the counters when we optimize or |
1198 // deoptimize, there is a bound on the number of | 1198 // deoptimize, there is a bound on the number of |
1199 // optimization/deoptimization cycles we will attempt. | 1199 // optimization/deoptimization cycles we will attempt. |
| 1200 ASSERT(!edge_counters_array_.IsNull()); |
1200 ASSERT(assembler_->constant_pool_allowed()); | 1201 ASSERT(assembler_->constant_pool_allowed()); |
1201 const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld)); | |
1202 counter.SetAt(0, Smi::Handle(zone(), Smi::New(0))); | |
1203 __ Comment("Edge counter"); | 1202 __ Comment("Edge counter"); |
1204 __ LoadUniqueObject(R0, counter); | 1203 __ LoadObject(R0, edge_counters_array_); |
1205 __ LoadFieldFromOffset(TMP, R0, Array::element_offset(0)); | 1204 __ LoadFieldFromOffset(TMP, R0, Array::element_offset(edge_id)); |
1206 __ add(TMP, TMP, Operand(Smi::RawValue(1))); | 1205 __ add(TMP, TMP, Operand(Smi::RawValue(1))); |
1207 __ StoreFieldToOffset(TMP, R0, Array::element_offset(0)); | 1206 __ StoreFieldToOffset(TMP, R0, Array::element_offset(edge_id)); |
1208 } | 1207 } |
1209 | 1208 |
1210 | 1209 |
1211 void FlowGraphCompiler::EmitOptimizedInstanceCall( | 1210 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
1212 const StubEntry& stub_entry, | 1211 const StubEntry& stub_entry, |
1213 const ICData& ic_data, | 1212 const ICData& ic_data, |
1214 intptr_t argument_count, | 1213 intptr_t argument_count, |
1215 intptr_t deopt_id, | 1214 intptr_t deopt_id, |
1216 intptr_t token_pos, | 1215 intptr_t token_pos, |
1217 LocationSummary* locs) { | 1216 LocationSummary* locs) { |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1831 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1833 __ PopDouble(reg); | 1832 __ PopDouble(reg); |
1834 } | 1833 } |
1835 | 1834 |
1836 | 1835 |
1837 #undef __ | 1836 #undef __ |
1838 | 1837 |
1839 } // namespace dart | 1838 } // namespace dart |
1840 | 1839 |
1841 #endif // defined TARGET_ARCH_ARM64 | 1840 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |