OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 InstructionOperand op = | 1700 InstructionOperand op = |
1701 linkage()->ParameterHasSecondaryLocation(index) | 1701 linkage()->ParameterHasSecondaryLocation(index) |
1702 ? g.DefineAsDualLocation( | 1702 ? g.DefineAsDualLocation( |
1703 node, linkage()->GetParameterLocation(index), | 1703 node, linkage()->GetParameterLocation(index), |
1704 linkage()->GetParameterSecondaryLocation(index)) | 1704 linkage()->GetParameterSecondaryLocation(index)) |
1705 : g.DefineAsLocation(node, linkage()->GetParameterLocation(index)); | 1705 : g.DefineAsLocation(node, linkage()->GetParameterLocation(index)); |
1706 | 1706 |
1707 Emit(kArchNop, op); | 1707 Emit(kArchNop, op); |
1708 } | 1708 } |
1709 | 1709 |
1710 namespace { | |
1711 LinkageLocation ExceptionLocation() { | |
1712 return LinkageLocation::ForRegister(kReturnRegister0.code(), | |
1713 MachineType::IntPtr()); | |
1714 } | |
1715 } | |
1716 | 1710 |
1717 void InstructionSelector::VisitIfException(Node* node) { | 1711 void InstructionSelector::VisitIfException(Node* node) { |
1718 OperandGenerator g(this); | 1712 OperandGenerator g(this); |
1719 DCHECK_EQ(IrOpcode::kCall, node->InputAt(1)->opcode()); | 1713 Node* call = node->InputAt(1); |
1720 Emit(kArchNop, g.DefineAsLocation(node, ExceptionLocation())); | 1714 DCHECK_EQ(IrOpcode::kCall, call->opcode()); |
| 1715 const CallDescriptor* descriptor = CallDescriptorOf(call->op()); |
| 1716 Emit(kArchNop, g.DefineAsLocation(node, descriptor->GetReturnLocation(0))); |
1721 } | 1717 } |
1722 | 1718 |
1723 | 1719 |
1724 void InstructionSelector::VisitOsrValue(Node* node) { | 1720 void InstructionSelector::VisitOsrValue(Node* node) { |
1725 OperandGenerator g(this); | 1721 OperandGenerator g(this); |
1726 int index = OpParameter<int>(node); | 1722 int index = OpParameter<int>(node); |
1727 Emit(kArchNop, | 1723 Emit(kArchNop, |
1728 g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index))); | 1724 g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index))); |
1729 } | 1725 } |
1730 | 1726 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2099 return new (instruction_zone()) FrameStateDescriptor( | 2095 return new (instruction_zone()) FrameStateDescriptor( |
2100 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2096 instruction_zone(), state_info.type(), state_info.bailout_id(), |
2101 state_info.state_combine(), parameters, locals, stack, | 2097 state_info.state_combine(), parameters, locals, stack, |
2102 state_info.shared_info(), outer_state); | 2098 state_info.shared_info(), outer_state); |
2103 } | 2099 } |
2104 | 2100 |
2105 | 2101 |
2106 } // namespace compiler | 2102 } // namespace compiler |
2107 } // namespace internal | 2103 } // namespace internal |
2108 } // namespace v8 | 2104 } // namespace v8 |
OLD | NEW |