| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 __ Branch(&stub_code->DeoptimizeLazyLabel()); | 1096 __ Branch(&stub_code->DeoptimizeLazyLabel()); |
| 1097 } | 1097 } |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 | 1100 |
| 1101 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, | 1101 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, |
| 1102 const ExternalLabel* label, | 1102 const ExternalLabel* label, |
| 1103 RawPcDescriptors::Kind kind, | 1103 RawPcDescriptors::Kind kind, |
| 1104 LocationSummary* locs) { | 1104 LocationSummary* locs) { |
| 1105 __ BranchLinkPatchable(label); | 1105 __ BranchLinkPatchable(label); |
| 1106 RecordCallInfo(token_pos, kind, Isolate::kNoDeoptId, locs, 0); | 1106 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos); |
| 1107 RecordSafepoint(locs); |
| 1107 } | 1108 } |
| 1108 | 1109 |
| 1109 | 1110 |
| 1110 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, | 1111 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, |
| 1111 intptr_t token_pos, | 1112 intptr_t token_pos, |
| 1112 const ExternalLabel* label, | 1113 const ExternalLabel* label, |
| 1113 RawPcDescriptors::Kind kind, | 1114 RawPcDescriptors::Kind kind, |
| 1114 LocationSummary* locs) { | 1115 LocationSummary* locs) { |
| 1115 __ BranchLinkPatchable(label); | 1116 __ BranchLinkPatchable(label); |
| 1116 RecordCallInfo(token_pos, kind, deopt_id, locs, locs->input_count()); | 1117 AddCurrentDescriptor(kind, deopt_id, token_pos); |
| 1118 RecordSafepoint(locs); |
| 1119 // Marks either the continuation point in unoptimized code or the |
| 1120 // deoptimization point in optimized code, after call. |
| 1121 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
| 1122 if (is_optimizing()) { |
| 1123 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 1124 } else { |
| 1125 // Add deoptimization continuation point after the call and before the |
| 1126 // arguments are removed. |
| 1127 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 1128 deopt_id_after, token_pos); |
| 1129 } |
| 1117 } | 1130 } |
| 1118 | 1131 |
| 1119 | 1132 |
| 1120 void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos, | 1133 void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos, |
| 1121 intptr_t deopt_id, | 1134 intptr_t deopt_id, |
| 1122 const RuntimeEntry& entry, | 1135 const RuntimeEntry& entry, |
| 1123 intptr_t argument_count, | 1136 intptr_t argument_count, |
| 1124 LocationSummary* locs) { | 1137 LocationSummary* locs) { |
| 1125 __ CallRuntime(entry, argument_count); | 1138 __ CallRuntime(entry, argument_count); |
| 1126 RecordCallInfo(token_pos, RawPcDescriptors::kOther, deopt_id, locs, 0); | 1139 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); |
| 1140 RecordSafepoint(locs); |
| 1141 if (deopt_id != Isolate::kNoDeoptId) { |
| 1142 // Marks either the continuation point in unoptimized code or the |
| 1143 // deoptimization point in optimized code, after call. |
| 1144 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
| 1145 if (is_optimizing()) { |
| 1146 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 1147 } else { |
| 1148 // Add deoptimization continuation point after the call and before the |
| 1149 // arguments are removed. |
| 1150 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 1151 deopt_id_after, |
| 1152 token_pos); |
| 1153 } |
| 1154 } |
| 1127 } | 1155 } |
| 1128 | 1156 |
| 1129 | 1157 |
| 1130 void FlowGraphCompiler::EmitEdgeCounter() { | 1158 void FlowGraphCompiler::EmitEdgeCounter() { |
| 1131 // We do not check for overflow when incrementing the edge counter. The | 1159 // We do not check for overflow when incrementing the edge counter. The |
| 1132 // function should normally be optimized long before the counter can | 1160 // function should normally be optimized long before the counter can |
| 1133 // overflow; and though we do not reset the counters when we optimize or | 1161 // overflow; and though we do not reset the counters when we optimize or |
| 1134 // deoptimize, there is a bound on the number of | 1162 // deoptimize, there is a bound on the number of |
| 1135 // optimization/deoptimization cycles we will attempt. | 1163 // optimization/deoptimization cycles we will attempt. |
| 1136 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); | 1164 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 // proper target for the given name and arguments descriptor. If the | 1264 // proper target for the given name and arguments descriptor. If the |
| 1237 // illegal class id was found, the target is a cache miss handler that can | 1265 // illegal class id was found, the target is a cache miss handler that can |
| 1238 // be invoked as a normal Dart function. | 1266 // be invoked as a normal Dart function. |
| 1239 __ add(IP, R2, Operand(R3, LSL, 2)); | 1267 __ add(IP, R2, Operand(R3, LSL, 2)); |
| 1240 __ ldr(R0, FieldAddress(IP, base + kWordSize)); | 1268 __ ldr(R0, FieldAddress(IP, base + kWordSize)); |
| 1241 __ ldr(R1, FieldAddress(R0, Function::instructions_offset())); | 1269 __ ldr(R1, FieldAddress(R0, Function::instructions_offset())); |
| 1242 __ LoadObject(R5, ic_data); | 1270 __ LoadObject(R5, ic_data); |
| 1243 __ LoadObject(R4, arguments_descriptor); | 1271 __ LoadObject(R4, arguments_descriptor); |
| 1244 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag); | 1272 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag); |
| 1245 __ blx(R1); | 1273 __ blx(R1); |
| 1246 RecordCallInfo( | 1274 AddCurrentDescriptor(RawPcDescriptors::kOther, |
| 1247 token_pos, RawPcDescriptors::kOther, deopt_id, locs, locs->input_count()); | 1275 Isolate::kNoDeoptId, token_pos); |
| 1276 RecordSafepoint(locs); |
| 1277 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); |
| 1248 __ Drop(argument_count); | 1278 __ Drop(argument_count); |
| 1249 } | 1279 } |
| 1250 | 1280 |
| 1251 | 1281 |
| 1252 void FlowGraphCompiler::EmitUnoptimizedStaticCall( | 1282 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
| 1253 intptr_t argument_count, | 1283 intptr_t argument_count, |
| 1254 intptr_t deopt_id, | 1284 intptr_t deopt_id, |
| 1255 intptr_t token_pos, | 1285 intptr_t token_pos, |
| 1256 LocationSummary* locs, | 1286 LocationSummary* locs, |
| 1257 const ICData& ic_data) { | 1287 const ICData& ic_data) { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 DRegister dreg = EvenDRegisterOf(reg); | 1802 DRegister dreg = EvenDRegisterOf(reg); |
| 1773 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1803 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1774 } | 1804 } |
| 1775 | 1805 |
| 1776 | 1806 |
| 1777 #undef __ | 1807 #undef __ |
| 1778 | 1808 |
| 1779 } // namespace dart | 1809 } // namespace dart |
| 1780 | 1810 |
| 1781 #endif // defined TARGET_ARCH_ARM | 1811 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |