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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 const StubEntry& stub_entry, | 1170 const StubEntry& stub_entry, |
1171 RawPcDescriptors::Kind kind, | 1171 RawPcDescriptors::Kind kind, |
1172 LocationSummary* locs) { | 1172 LocationSummary* locs) { |
1173 __ BranchLinkPatchable(stub_entry); | 1173 __ BranchLinkPatchable(stub_entry); |
1174 AddCurrentDescriptor(kind, deopt_id, token_pos); | 1174 AddCurrentDescriptor(kind, deopt_id, token_pos); |
1175 RecordSafepoint(locs); | 1175 RecordSafepoint(locs); |
1176 // Marks either the continuation point in unoptimized code or the | 1176 // Marks either the continuation point in unoptimized code or the |
1177 // deoptimization point in optimized code, after call. | 1177 // deoptimization point in optimized code, after call. |
1178 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1178 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1179 if (is_optimizing()) { | 1179 if (is_optimizing()) { |
1180 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1180 AddDeoptIndexAtCall(deopt_id_after); |
1181 } else { | 1181 } else { |
1182 // Add deoptimization continuation point after the call and before the | 1182 // Add deoptimization continuation point after the call and before the |
1183 // arguments are removed. | 1183 // arguments are removed. |
1184 AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 1184 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
1185 deopt_id_after, | 1185 deopt_id_after, |
1186 token_pos); | 1186 token_pos); |
1187 } | 1187 } |
1188 } | 1188 } |
1189 | 1189 |
1190 | 1190 |
1191 void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id, | 1191 void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id, |
1192 TokenPosition token_pos, | 1192 TokenPosition token_pos, |
1193 const StubEntry& stub_entry, | 1193 const StubEntry& stub_entry, |
1194 RawPcDescriptors::Kind kind, | 1194 RawPcDescriptors::Kind kind, |
1195 LocationSummary* locs, | 1195 LocationSummary* locs, |
1196 const Function& target) { | 1196 const Function& target) { |
1197 // Call sites to the same target can share object pool entries. These | 1197 // Call sites to the same target can share object pool entries. These |
1198 // call sites are never patched for breakpoints: the function is deoptimized | 1198 // call sites are never patched for breakpoints: the function is deoptimized |
1199 // and the unoptimized code with IC calls for static calls is patched instead. | 1199 // and the unoptimized code with IC calls for static calls is patched instead. |
1200 ASSERT(is_optimizing()); | 1200 ASSERT(is_optimizing()); |
1201 __ BranchLinkWithEquivalence(stub_entry, target); | 1201 __ BranchLinkWithEquivalence(stub_entry, target); |
1202 | 1202 |
1203 AddCurrentDescriptor(kind, deopt_id, token_pos); | 1203 AddCurrentDescriptor(kind, deopt_id, token_pos); |
1204 RecordSafepoint(locs); | 1204 RecordSafepoint(locs); |
1205 // Marks either the continuation point in unoptimized code or the | 1205 // Marks either the continuation point in unoptimized code or the |
1206 // deoptimization point in optimized code, after call. | 1206 // deoptimization point in optimized code, after call. |
1207 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1207 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1208 if (is_optimizing()) { | 1208 if (is_optimizing()) { |
1209 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1209 AddDeoptIndexAtCall(deopt_id_after); |
1210 } else { | 1210 } else { |
1211 // Add deoptimization continuation point after the call and before the | 1211 // Add deoptimization continuation point after the call and before the |
1212 // arguments are removed. | 1212 // arguments are removed. |
1213 AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 1213 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
1214 deopt_id_after, | 1214 deopt_id_after, |
1215 token_pos); | 1215 token_pos); |
1216 } | 1216 } |
1217 AddStaticCallTarget(target); | 1217 AddStaticCallTarget(target); |
1218 } | 1218 } |
1219 | 1219 |
1220 | 1220 |
1221 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos, | 1221 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos, |
1222 intptr_t deopt_id, | 1222 intptr_t deopt_id, |
1223 const RuntimeEntry& entry, | 1223 const RuntimeEntry& entry, |
1224 intptr_t argument_count, | 1224 intptr_t argument_count, |
1225 LocationSummary* locs) { | 1225 LocationSummary* locs) { |
1226 __ CallRuntime(entry, argument_count); | 1226 __ CallRuntime(entry, argument_count); |
1227 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); | 1227 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); |
1228 RecordSafepoint(locs); | 1228 RecordSafepoint(locs); |
1229 if (deopt_id != Thread::kNoDeoptId) { | 1229 if (deopt_id != Thread::kNoDeoptId) { |
1230 // Marks either the continuation point in unoptimized code or the | 1230 // Marks either the continuation point in unoptimized code or the |
1231 // deoptimization point in optimized code, after call. | 1231 // deoptimization point in optimized code, after call. |
1232 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1232 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1233 if (is_optimizing()) { | 1233 if (is_optimizing()) { |
1234 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1234 AddDeoptIndexAtCall(deopt_id_after); |
1235 } else { | 1235 } else { |
1236 // Add deoptimization continuation point after the call and before the | 1236 // Add deoptimization continuation point after the call and before the |
1237 // arguments are removed. | 1237 // arguments are removed. |
1238 AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 1238 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
1239 deopt_id_after, | 1239 deopt_id_after, |
1240 token_pos); | 1240 token_pos); |
1241 } | 1241 } |
1242 } | 1242 } |
1243 } | 1243 } |
1244 | 1244 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 try_index = CurrentTryIndex(); | 1353 try_index = CurrentTryIndex(); |
1354 } | 1354 } |
1355 pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther, | 1355 pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther, |
1356 assembler()->CodeSize(), | 1356 assembler()->CodeSize(), |
1357 Thread::kNoDeoptId, | 1357 Thread::kNoDeoptId, |
1358 token_pos, | 1358 token_pos, |
1359 try_index); | 1359 try_index); |
1360 } else if (is_optimizing()) { | 1360 } else if (is_optimizing()) { |
1361 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1361 AddCurrentDescriptor(RawPcDescriptors::kOther, |
1362 Thread::kNoDeoptId, token_pos); | 1362 Thread::kNoDeoptId, token_pos); |
1363 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1363 AddDeoptIndexAtCall(deopt_id_after); |
1364 } else { | 1364 } else { |
1365 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1365 AddCurrentDescriptor(RawPcDescriptors::kOther, |
1366 Thread::kNoDeoptId, token_pos); | 1366 Thread::kNoDeoptId, token_pos); |
1367 // Add deoptimization continuation point after the call and before the | 1367 // Add deoptimization continuation point after the call and before the |
1368 // arguments are removed. | 1368 // arguments are removed. |
1369 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1369 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
1370 } | 1370 } |
1371 __ Drop(argument_count); | 1371 __ Drop(argument_count); |
1372 } | 1372 } |
1373 | 1373 |
(...skipping 13 matching lines...) Expand all Loading... |
1387 __ LoadUniqueObject(S5, ic_data); | 1387 __ LoadUniqueObject(S5, ic_data); |
1388 __ LoadUniqueObject(CODE_REG, initial_stub); | 1388 __ LoadUniqueObject(CODE_REG, initial_stub); |
1389 __ lw(T9, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); | 1389 __ lw(T9, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
1390 __ jalr(T9); | 1390 __ jalr(T9); |
1391 | 1391 |
1392 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1392 AddCurrentDescriptor(RawPcDescriptors::kOther, |
1393 Thread::kNoDeoptId, token_pos); | 1393 Thread::kNoDeoptId, token_pos); |
1394 RecordSafepoint(locs); | 1394 RecordSafepoint(locs); |
1395 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1395 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1396 if (is_optimizing()) { | 1396 if (is_optimizing()) { |
1397 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1397 AddDeoptIndexAtCall(deopt_id_after); |
1398 } else { | 1398 } else { |
1399 // Add deoptimization continuation point after the call and before the | 1399 // Add deoptimization continuation point after the call and before the |
1400 // arguments are removed. | 1400 // arguments are removed. |
1401 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1401 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
1402 } | 1402 } |
1403 __ Drop(argument_count); | 1403 __ Drop(argument_count); |
1404 } | 1404 } |
1405 | 1405 |
1406 | 1406 |
1407 void FlowGraphCompiler::EmitUnoptimizedStaticCall( | 1407 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 __ AddImmediate(SP, kDoubleSize); | 1957 __ AddImmediate(SP, kDoubleSize); |
1958 } | 1958 } |
1959 | 1959 |
1960 | 1960 |
1961 #undef __ | 1961 #undef __ |
1962 | 1962 |
1963 | 1963 |
1964 } // namespace dart | 1964 } // namespace dart |
1965 | 1965 |
1966 #endif // defined TARGET_ARCH_MIPS | 1966 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |