| 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 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 __ bne(T4, T0, &update); | 1313 __ bne(T4, T0, &update); |
| 1314 | 1314 |
| 1315 __ Bind(&call_target_function); | 1315 __ Bind(&call_target_function); |
| 1316 // Call the target found in the cache. For a class id match, this is a | 1316 // Call the target found in the cache. For a class id match, this is a |
| 1317 // proper target for the given name and arguments descriptor. If the | 1317 // proper target for the given name and arguments descriptor. If the |
| 1318 // illegal class id was found, the target is a cache miss handler that can | 1318 // illegal class id was found, the target is a cache miss handler that can |
| 1319 // be invoked as a normal Dart function. | 1319 // be invoked as a normal Dart function. |
| 1320 __ sll(T1, T3, 2); | 1320 __ sll(T1, T3, 2); |
| 1321 __ addu(T1, T2, T1); | 1321 __ addu(T1, T2, T1); |
| 1322 __ lw(T0, FieldAddress(T1, base + kWordSize)); | 1322 __ lw(T0, FieldAddress(T1, base + kWordSize)); |
| 1323 |
| 1323 __ lw(T1, FieldAddress(T0, Function::code_offset())); | 1324 __ lw(T1, FieldAddress(T0, Function::code_offset())); |
| 1324 if (FLAG_collect_code) { | 1325 __ lw(T1, FieldAddress(T1, Code::instructions_offset())); |
| 1325 // If we are collecting code, the code object may be null. | |
| 1326 Label is_compiled; | |
| 1327 __ BranchNotEqual(T1, reinterpret_cast<int32_t>(Object::null()), | |
| 1328 &is_compiled); | |
| 1329 __ BranchLink(&StubCode::CompileFunctionRuntimeCallLabel()); | |
| 1330 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | |
| 1331 Isolate::kNoDeoptId, | |
| 1332 token_pos); | |
| 1333 RecordSafepoint(locs); | |
| 1334 __ lw(T1, FieldAddress(T0, Function::code_offset())); | |
| 1335 __ Bind(&is_compiled); | |
| 1336 } | |
| 1337 __ lw(T0, FieldAddress(T1, Code::instructions_offset())); | |
| 1338 __ LoadObject(S5, ic_data); | 1326 __ LoadObject(S5, ic_data); |
| 1339 __ LoadObject(S4, arguments_descriptor); | 1327 __ LoadObject(S4, arguments_descriptor); |
| 1340 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); | 1328 __ AddImmediate(T1, Instructions::HeaderSize() - kHeapObjectTag); |
| 1341 __ jalr(T0); | 1329 __ jalr(T1); |
| 1342 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); | 1330 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); |
| 1343 RecordSafepoint(locs); | 1331 RecordSafepoint(locs); |
| 1344 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); | 1332 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); |
| 1345 __ Drop(argument_count); | 1333 __ Drop(argument_count); |
| 1346 } | 1334 } |
| 1347 | 1335 |
| 1348 | 1336 |
| 1349 void FlowGraphCompiler::EmitUnoptimizedStaticCall( | 1337 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
| 1350 const Function& target_function, | 1338 const Function& target_function, |
| 1351 const Array& arguments_descriptor, | 1339 const Array& arguments_descriptor, |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 __ AddImmediate(SP, kDoubleSize); | 1845 __ AddImmediate(SP, kDoubleSize); |
| 1858 } | 1846 } |
| 1859 | 1847 |
| 1860 | 1848 |
| 1861 #undef __ | 1849 #undef __ |
| 1862 | 1850 |
| 1863 | 1851 |
| 1864 } // namespace dart | 1852 } // namespace dart |
| 1865 | 1853 |
| 1866 #endif // defined TARGET_ARCH_MIPS | 1854 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |