| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); | 61 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 | 64 |
| 65 void DeoptimizationStub::GenerateCode(FlowGraphCompiler* compiler) { | 65 void DeoptimizationStub::GenerateCode(FlowGraphCompiler* compiler) { |
| 66 Assembler* assem = compiler->assembler(); | 66 Assembler* assem = compiler->assembler(); |
| 67 #define __ assem-> | 67 #define __ assem-> |
| 68 __ Comment("Deopt stub for id %d", deopt_id_); | 68 __ Comment("Deopt stub for id %d", deopt_id_); |
| 69 __ Bind(entry_label()); | 69 __ Bind(entry_label()); |
| 70 for (intptr_t i = 0; i < registers_.length(); i++) { | 70 for (intptr_t i = 0; i < registers_.length(); i++) { |
| 71 __ pushq(registers_[i]); | 71 if (registers_[i] != kNoRegister) { |
| 72 __ pushq(registers_[i]); |
| 73 } |
| 72 } | 74 } |
| 73 __ movq(RAX, Immediate(Smi::RawValue(reason_))); | 75 __ movq(RAX, Immediate(Smi::RawValue(reason_))); |
| 74 __ call(&StubCode::DeoptimizeLabel()); | 76 __ call(&StubCode::DeoptimizeLabel()); |
| 75 compiler->AddCurrentDescriptor(PcDescriptors::kOther, | 77 compiler->AddCurrentDescriptor(PcDescriptors::kOther, |
| 76 deopt_id_, | 78 deopt_id_, |
| 77 deopt_token_index_, | 79 deopt_token_index_, |
| 78 try_index_); | 80 try_index_); |
| 79 #undef __ | 81 #undef __ |
| 80 } | 82 } |
| 81 | 83 |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 // Moved to intermediate_language_x64.cc. | 1004 // Moved to intermediate_language_x64.cc. |
| 1003 UNREACHABLE(); | 1005 UNREACHABLE(); |
| 1004 } | 1006 } |
| 1005 | 1007 |
| 1006 | 1008 |
| 1007 void FlowGraphCompiler::VisitBinaryOp(BinaryOpComp* comp) { | 1009 void FlowGraphCompiler::VisitBinaryOp(BinaryOpComp* comp) { |
| 1008 UNIMPLEMENTED(); | 1010 UNIMPLEMENTED(); |
| 1009 } | 1011 } |
| 1010 | 1012 |
| 1011 | 1013 |
| 1014 void FlowGraphCompiler::VisitUnaryOp(UnaryOpComp* comp) { |
| 1015 UNIMPLEMENTED(); |
| 1016 } |
| 1017 |
| 1018 |
| 1012 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { | 1019 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { |
| 1013 LocationSummary* locs = instr->locs(); | 1020 LocationSummary* locs = instr->locs(); |
| 1014 ASSERT(locs != NULL); | 1021 ASSERT(locs != NULL); |
| 1015 | 1022 |
| 1016 locs->AllocateRegisters(); | 1023 locs->AllocateRegisters(); |
| 1017 | 1024 |
| 1018 // Load instruction inputs into allocated registers. | 1025 // Load instruction inputs into allocated registers. |
| 1019 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { | 1026 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { |
| 1020 Location loc = locs->in(i); | 1027 Location loc = locs->in(i); |
| 1021 ASSERT(loc.kind() == Location::kRegister); | 1028 ASSERT(loc.kind() == Location::kRegister); |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 | 1658 |
| 1652 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1659 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1653 code.set_comments(assembler_->GetCodeComments()); | 1660 code.set_comments(assembler_->GetCodeComments()); |
| 1654 } | 1661 } |
| 1655 | 1662 |
| 1656 #undef __ | 1663 #undef __ |
| 1657 | 1664 |
| 1658 } // namespace dart | 1665 } // namespace dart |
| 1659 | 1666 |
| 1660 #endif // defined TARGET_ARCH_X64 | 1667 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |