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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 __ LoadObject(S4, arguments_descriptor); | 1425 __ LoadObject(S4, arguments_descriptor); |
1426 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); | 1426 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); |
1427 __ jalr(T0); | 1427 __ jalr(T0); |
1428 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); | 1428 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); |
1429 RecordSafepoint(locs); | 1429 RecordSafepoint(locs); |
1430 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); | 1430 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); |
1431 __ Drop(argument_count); | 1431 __ Drop(argument_count); |
1432 } | 1432 } |
1433 | 1433 |
1434 | 1434 |
| 1435 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
| 1436 const Function& target_function, |
| 1437 const Array& arguments_descriptor, |
| 1438 intptr_t argument_count, |
| 1439 intptr_t deopt_id, |
| 1440 intptr_t token_pos, |
| 1441 LocationSummary* locs) { |
| 1442 // TODO(srdjan): Improve performance of function recognition. |
| 1443 MethodRecognizer::Kind recognized_kind = |
| 1444 MethodRecognizer::RecognizeKind(target_function); |
| 1445 int num_args_checked = 0; |
| 1446 if ((recognized_kind == MethodRecognizer::kMathMin) || |
| 1447 (recognized_kind == MethodRecognizer::kMathMax)) { |
| 1448 num_args_checked = 2; |
| 1449 } |
| 1450 const ICData& ic_data = ICData::ZoneHandle( |
| 1451 ICData::New(parsed_function().function(), // Caller function. |
| 1452 String::Handle(target_function.name()), |
| 1453 arguments_descriptor, |
| 1454 deopt_id, |
| 1455 num_args_checked)); // No arguments checked. |
| 1456 ic_data.AddTarget(target_function); |
| 1457 uword label_address = 0; |
| 1458 if (ic_data.num_args_tested() == 0) { |
| 1459 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 1460 } else if (ic_data.num_args_tested() == 2) { |
| 1461 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 1462 } else { |
| 1463 UNIMPLEMENTED(); |
| 1464 } |
| 1465 ExternalLabel target_label("StaticCallICStub", label_address); |
| 1466 __ LoadObject(S5, ic_data); |
| 1467 GenerateDartCall(deopt_id, |
| 1468 token_pos, |
| 1469 &target_label, |
| 1470 PcDescriptors::kUnoptStaticCall, |
| 1471 locs); |
| 1472 __ Drop(argument_count); |
| 1473 } |
| 1474 |
| 1475 |
1435 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1476 void FlowGraphCompiler::EmitOptimizedStaticCall( |
1436 const Function& function, | 1477 const Function& function, |
1437 const Array& arguments_descriptor, | 1478 const Array& arguments_descriptor, |
1438 intptr_t argument_count, | 1479 intptr_t argument_count, |
1439 intptr_t deopt_id, | 1480 intptr_t deopt_id, |
1440 intptr_t token_pos, | 1481 intptr_t token_pos, |
1441 LocationSummary* locs) { | 1482 LocationSummary* locs) { |
1442 __ TraceSimMsg("StaticCall"); | 1483 __ TraceSimMsg("StaticCall"); |
1443 __ LoadObject(S4, arguments_descriptor); | 1484 __ LoadObject(S4, arguments_descriptor); |
1444 // Do not use the code from the function, but let the code be patched so that | 1485 // Do not use the code from the function, but let the code be patched so that |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1965 __ AddImmediate(SP, kDoubleSize); | 2006 __ AddImmediate(SP, kDoubleSize); |
1966 } | 2007 } |
1967 | 2008 |
1968 | 2009 |
1969 #undef __ | 2010 #undef __ |
1970 | 2011 |
1971 | 2012 |
1972 } // namespace dart | 2013 } // namespace dart |
1973 | 2014 |
1974 #endif // defined TARGET_ARCH_MIPS | 2015 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |