| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 return NULL; | 1521 return NULL; |
| 1522 } | 1522 } |
| 1523 | 1523 |
| 1524 | 1524 |
| 1525 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1525 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1526 UNIMPLEMENTED(); | 1526 UNIMPLEMENTED(); |
| 1527 } | 1527 } |
| 1528 | 1528 |
| 1529 | 1529 |
| 1530 LocationSummary* CatchEntryInstr::MakeLocationSummary() const { | 1530 LocationSummary* CatchEntryInstr::MakeLocationSummary() const { |
| 1531 UNIMPLEMENTED(); | 1531 return LocationSummary::Make(0, |
| 1532 return NULL; | 1532 Location::NoLocation(), |
| 1533 LocationSummary::kNoCall); |
| 1533 } | 1534 } |
| 1534 | 1535 |
| 1535 | 1536 |
| 1537 // Restore stack and initialize the two exception variables: |
| 1538 // exception and stack trace variables. |
| 1536 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1539 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1537 UNIMPLEMENTED(); | 1540 // Restore SP from FP as we are coming from a throw and the code for |
| 1541 // popping arguments has not been run. |
| 1542 const intptr_t fp_sp_dist = |
| 1543 (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize; |
| 1544 ASSERT(fp_sp_dist <= 0); |
| 1545 __ AddImmediate(SP, FP, fp_sp_dist); |
| 1546 |
| 1547 ASSERT(!exception_var().is_captured()); |
| 1548 ASSERT(!stacktrace_var().is_captured()); |
| 1549 |
| 1550 __ sw(kExceptionObjectReg, |
| 1551 Address(FP, exception_var().index() * kWordSize)); |
| 1552 __ sw(kStackTraceObjectReg, |
| 1553 Address(FP, stacktrace_var().index() * kWordSize)); |
| 1554 |
| 1555 Label next; |
| 1556 __ mov(TMP1, RA); // Save return adress. |
| 1557 // Restore the pool pointer. |
| 1558 __ bal(&next); // Branch and link to next instruction to get PC in RA. |
| 1559 __ delay_slot()->mov(TMP2, RA); // Save PC of the following mov. |
| 1560 |
| 1561 // Calculate offset of pool pointer from the PC. |
| 1562 const intptr_t object_pool_pc_dist = |
| 1563 Instructions::HeaderSize() - Instructions::object_pool_offset() + |
| 1564 compiler->assembler()->CodeSize(); |
| 1565 |
| 1566 __ Bind(&next); |
| 1567 __ mov(RA, TMP1); // Restore return address. |
| 1568 __ lw(PP, Address(TMP2, -object_pool_pc_dist)); |
| 1538 } | 1569 } |
| 1539 | 1570 |
| 1540 | 1571 |
| 1541 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const { | 1572 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const { |
| 1542 const intptr_t kNumInputs = 0; | 1573 const intptr_t kNumInputs = 0; |
| 1543 const intptr_t kNumTemps = 0; | 1574 const intptr_t kNumTemps = 0; |
| 1544 LocationSummary* summary = | 1575 LocationSummary* summary = |
| 1545 new LocationSummary(kNumInputs, | 1576 new LocationSummary(kNumInputs, |
| 1546 kNumTemps, | 1577 kNumTemps, |
| 1547 LocationSummary::kCallOnSlowPath); | 1578 LocationSummary::kCallOnSlowPath); |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2101 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2132 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2102 compiler->GenerateCallRuntime(token_pos(), | 2133 compiler->GenerateCallRuntime(token_pos(), |
| 2103 deopt_id(), | 2134 deopt_id(), |
| 2104 kThrowRuntimeEntry, | 2135 kThrowRuntimeEntry, |
| 2105 locs()); | 2136 locs()); |
| 2106 __ break_(0); | 2137 __ break_(0); |
| 2107 } | 2138 } |
| 2108 | 2139 |
| 2109 | 2140 |
| 2110 LocationSummary* ReThrowInstr::MakeLocationSummary() const { | 2141 LocationSummary* ReThrowInstr::MakeLocationSummary() const { |
| 2111 UNIMPLEMENTED(); | 2142 return new LocationSummary(0, 0, LocationSummary::kCall); |
| 2112 return NULL; | |
| 2113 } | 2143 } |
| 2114 | 2144 |
| 2115 | 2145 |
| 2116 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2146 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2117 UNIMPLEMENTED(); | 2147 compiler->GenerateCallRuntime(token_pos(), |
| 2148 deopt_id(), |
| 2149 kReThrowRuntimeEntry, |
| 2150 locs()); |
| 2151 __ break_(0); |
| 2118 } | 2152 } |
| 2119 | 2153 |
| 2120 | 2154 |
| 2121 LocationSummary* GotoInstr::MakeLocationSummary() const { | 2155 LocationSummary* GotoInstr::MakeLocationSummary() const { |
| 2122 return new LocationSummary(0, 0, LocationSummary::kNoCall); | 2156 return new LocationSummary(0, 0, LocationSummary::kNoCall); |
| 2123 } | 2157 } |
| 2124 | 2158 |
| 2125 | 2159 |
| 2126 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2160 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2127 __ TraceSimMsg("GotoInstr"); | 2161 __ TraceSimMsg("GotoInstr"); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 &label, | 2422 &label, |
| 2389 PcDescriptors::kOther, | 2423 PcDescriptors::kOther, |
| 2390 locs()); | 2424 locs()); |
| 2391 __ Drop(2); // Discard type arguments and receiver. | 2425 __ Drop(2); // Discard type arguments and receiver. |
| 2392 } | 2426 } |
| 2393 | 2427 |
| 2394 } // namespace dart | 2428 } // namespace dart |
| 2395 | 2429 |
| 2396 #endif // defined TARGET_ARCH_MIPS | 2430 #endif // defined TARGET_ARCH_MIPS |
| 2397 | 2431 |
| OLD | NEW |