| 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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1171 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 1172 } else { | 1172 } else { |
| 1173 // Add deoptimization continuation point after the call and before the | 1173 // Add deoptimization continuation point after the call and before the |
| 1174 // arguments are removed. | 1174 // arguments are removed. |
| 1175 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1175 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
| 1176 } | 1176 } |
| 1177 } | 1177 } |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 | 1180 |
| 1181 void FlowGraphCompiler::EmitEdgeCounter() { | 1181 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) { |
| 1182 // We do not check for overflow when incrementing the edge counter. The | 1182 // We do not check for overflow when incrementing the edge counter. The |
| 1183 // function should normally be optimized long before the counter can | 1183 // function should normally be optimized long before the counter can |
| 1184 // overflow; and though we do not reset the counters when we optimize or | 1184 // overflow; and though we do not reset the counters when we optimize or |
| 1185 // deoptimize, there is a bound on the number of | 1185 // deoptimize, there is a bound on the number of |
| 1186 // optimization/deoptimization cycles we will attempt. | 1186 // optimization/deoptimization cycles we will attempt. |
| 1187 ASSERT(!edge_counters_array_.IsNull()); |
| 1187 ASSERT(assembler_->constant_pool_allowed()); | 1188 ASSERT(assembler_->constant_pool_allowed()); |
| 1188 const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld)); | |
| 1189 counter.SetAt(0, Smi::Handle(zone(), Smi::New(0))); | |
| 1190 __ Comment("Edge counter"); | 1189 __ Comment("Edge counter"); |
| 1191 __ LoadUniqueObject(R0, counter); | 1190 __ LoadObject(R0, edge_counters_array_); |
| 1192 __ LoadFieldFromOffset(TMP, R0, Array::element_offset(0)); | 1191 __ LoadFieldFromOffset(TMP, R0, Array::element_offset(edge_id)); |
| 1193 __ add(TMP, TMP, Operand(Smi::RawValue(1))); | 1192 __ add(TMP, TMP, Operand(Smi::RawValue(1))); |
| 1194 __ StoreFieldToOffset(TMP, R0, Array::element_offset(0)); | 1193 __ StoreFieldToOffset(TMP, R0, Array::element_offset(edge_id)); |
| 1195 } | 1194 } |
| 1196 | 1195 |
| 1197 | 1196 |
| 1198 void FlowGraphCompiler::EmitOptimizedInstanceCall( | 1197 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
| 1199 const StubEntry& stub_entry, | 1198 const StubEntry& stub_entry, |
| 1200 const ICData& ic_data, | 1199 const ICData& ic_data, |
| 1201 intptr_t argument_count, | 1200 intptr_t argument_count, |
| 1202 intptr_t deopt_id, | 1201 intptr_t deopt_id, |
| 1203 intptr_t token_pos, | 1202 intptr_t token_pos, |
| 1204 LocationSummary* locs) { | 1203 LocationSummary* locs) { |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1818 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1820 __ PopDouble(reg); | 1819 __ PopDouble(reg); |
| 1821 } | 1820 } |
| 1822 | 1821 |
| 1823 | 1822 |
| 1824 #undef __ | 1823 #undef __ |
| 1825 | 1824 |
| 1826 } // namespace dart | 1825 } // namespace dart |
| 1827 | 1826 |
| 1828 #endif // defined TARGET_ARCH_ARM64 | 1827 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |