| 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 "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 __ Bind(entry_label()); | 1672 __ Bind(entry_label()); |
| 1673 const Class& double_class = compiler->double_class(); | 1673 const Class& double_class = compiler->double_class(); |
| 1674 const Code& stub = | 1674 const Code& stub = |
| 1675 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 1675 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
| 1676 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); | 1676 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); |
| 1677 | 1677 |
| 1678 LocationSummary* locs = instruction_->locs(); | 1678 LocationSummary* locs = instruction_->locs(); |
| 1679 locs->live_registers()->Remove(locs->out()); | 1679 locs->live_registers()->Remove(locs->out()); |
| 1680 | 1680 |
| 1681 compiler->SaveLiveRegisters(locs); | 1681 compiler->SaveLiveRegisters(locs); |
| 1682 compiler->GenerateCall(Scanner::kDummyTokenIndex, // No token position. | 1682 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 1683 &label, | 1683 &label, |
| 1684 PcDescriptors::kOther, | 1684 PcDescriptors::kOther, |
| 1685 locs); | 1685 locs); |
| 1686 __ mov(locs->temp(0).reg(), V0); | 1686 __ mov(locs->temp(0).reg(), V0); |
| 1687 compiler->RestoreLiveRegisters(locs); | 1687 compiler->RestoreLiveRegisters(locs); |
| 1688 | 1688 |
| 1689 __ b(exit_label()); | 1689 __ b(exit_label()); |
| 1690 } | 1690 } |
| 1691 | 1691 |
| 1692 private: | 1692 private: |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 __ Bind(entry_label()); | 1953 __ Bind(entry_label()); |
| 1954 const Class& double_class = compiler->double_class(); | 1954 const Class& double_class = compiler->double_class(); |
| 1955 const Code& stub = | 1955 const Code& stub = |
| 1956 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 1956 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
| 1957 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); | 1957 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); |
| 1958 | 1958 |
| 1959 LocationSummary* locs = instruction_->locs(); | 1959 LocationSummary* locs = instruction_->locs(); |
| 1960 locs->live_registers()->Remove(locs->out()); | 1960 locs->live_registers()->Remove(locs->out()); |
| 1961 | 1961 |
| 1962 compiler->SaveLiveRegisters(locs); | 1962 compiler->SaveLiveRegisters(locs); |
| 1963 compiler->GenerateCall(Scanner::kDummyTokenIndex, // No token position. | 1963 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 1964 &label, | 1964 &label, |
| 1965 PcDescriptors::kOther, | 1965 PcDescriptors::kOther, |
| 1966 locs); | 1966 locs); |
| 1967 if (locs->out().reg() != V0) { | 1967 if (locs->out().reg() != V0) { |
| 1968 __ mov(locs->out().reg(), V0); | 1968 __ mov(locs->out().reg(), V0); |
| 1969 } | 1969 } |
| 1970 compiler->RestoreLiveRegisters(locs); | 1970 compiler->RestoreLiveRegisters(locs); |
| 1971 | 1971 |
| 1972 __ b(exit_label()); | 1972 __ b(exit_label()); |
| 1973 } | 1973 } |
| (...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3986 | 3986 |
| 3987 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3987 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3988 __ Bind(compiler->GetJumpLabel(this)); | 3988 __ Bind(compiler->GetJumpLabel(this)); |
| 3989 if (!compiler->is_optimizing()) { | 3989 if (!compiler->is_optimizing()) { |
| 3990 compiler->EmitEdgeCounter(); | 3990 compiler->EmitEdgeCounter(); |
| 3991 // On MIPS the deoptimization descriptor points after the edge counter | 3991 // On MIPS the deoptimization descriptor points after the edge counter |
| 3992 // code so that we can reuse the same pattern matching code as at call | 3992 // code so that we can reuse the same pattern matching code as at call |
| 3993 // sites, which matches backwards from the end of the pattern. | 3993 // sites, which matches backwards from the end of the pattern. |
| 3994 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 3994 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 3995 deopt_id_, | 3995 deopt_id_, |
| 3996 Scanner::kDummyTokenIndex); | 3996 Scanner::kNoSourcePos); |
| 3997 } | 3997 } |
| 3998 if (HasParallelMove()) { | 3998 if (HasParallelMove()) { |
| 3999 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 3999 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 4000 } | 4000 } |
| 4001 } | 4001 } |
| 4002 | 4002 |
| 4003 | 4003 |
| 4004 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { | 4004 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { |
| 4005 return new LocationSummary(0, 0, LocationSummary::kNoCall); | 4005 return new LocationSummary(0, 0, LocationSummary::kNoCall); |
| 4006 } | 4006 } |
| 4007 | 4007 |
| 4008 | 4008 |
| 4009 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4009 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4010 __ TraceSimMsg("GotoInstr"); | 4010 __ TraceSimMsg("GotoInstr"); |
| 4011 if (!compiler->is_optimizing()) { | 4011 if (!compiler->is_optimizing()) { |
| 4012 compiler->EmitEdgeCounter(); | 4012 compiler->EmitEdgeCounter(); |
| 4013 // Add a deoptimization descriptor for deoptimizing instructions that | 4013 // Add a deoptimization descriptor for deoptimizing instructions that |
| 4014 // may be inserted before this instruction. On MIPS this descriptor | 4014 // may be inserted before this instruction. On MIPS this descriptor |
| 4015 // points after the edge counter code so that we can reuse the same | 4015 // points after the edge counter code so that we can reuse the same |
| 4016 // pattern matching code as at call sites, which matches backwards from | 4016 // pattern matching code as at call sites, which matches backwards from |
| 4017 // the end of the pattern. | 4017 // the end of the pattern. |
| 4018 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 4018 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 4019 GetDeoptId(), | 4019 GetDeoptId(), |
| 4020 Scanner::kDummyTokenIndex); | 4020 Scanner::kNoSourcePos); |
| 4021 } | 4021 } |
| 4022 if (HasParallelMove()) { | 4022 if (HasParallelMove()) { |
| 4023 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 4023 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 4024 } | 4024 } |
| 4025 | 4025 |
| 4026 // We can fall through if the successor is the next block in the list. | 4026 // We can fall through if the successor is the next block in the list. |
| 4027 // Otherwise, we need a jump. | 4027 // Otherwise, we need a jump. |
| 4028 if (!compiler->CanFallThroughTo(successor())) { | 4028 if (!compiler->CanFallThroughTo(successor())) { |
| 4029 __ b(compiler->GetJumpLabel(successor())); | 4029 __ b(compiler->GetJumpLabel(successor())); |
| 4030 } | 4030 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4202 compiler->GenerateCall(token_pos(), | 4202 compiler->GenerateCall(token_pos(), |
| 4203 &label, | 4203 &label, |
| 4204 PcDescriptors::kOther, | 4204 PcDescriptors::kOther, |
| 4205 locs()); | 4205 locs()); |
| 4206 __ Drop(2); // Discard type arguments and receiver. | 4206 __ Drop(2); // Discard type arguments and receiver. |
| 4207 } | 4207 } |
| 4208 | 4208 |
| 4209 } // namespace dart | 4209 } // namespace dart |
| 4210 | 4210 |
| 4211 #endif // defined TARGET_ARCH_MIPS | 4211 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |