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-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 void InstructionSelector::VisitFloat64RoundTruncate(Node* node) { | 1073 void InstructionSelector::VisitFloat64RoundTruncate(Node* node) { |
1074 VisitRRFloat64(this, kArm64Float64RoundTruncate, node); | 1074 VisitRRFloat64(this, kArm64Float64RoundTruncate, node); |
1075 } | 1075 } |
1076 | 1076 |
1077 | 1077 |
1078 void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) { | 1078 void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) { |
1079 VisitRRFloat64(this, kArm64Float64RoundTiesAway, node); | 1079 VisitRRFloat64(this, kArm64Float64RoundTiesAway, node); |
1080 } | 1080 } |
1081 | 1081 |
1082 | 1082 |
1083 void InstructionSelector::VisitCall(Node* node) { | 1083 void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
1084 Arm64OperandGenerator g(this); | 1084 Arm64OperandGenerator g(this); |
1085 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); | 1085 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); |
1086 | 1086 |
1087 FrameStateDescriptor* frame_state_descriptor = NULL; | 1087 FrameStateDescriptor* frame_state_descriptor = NULL; |
1088 if (descriptor->NeedsFrameState()) { | 1088 if (descriptor->NeedsFrameState()) { |
1089 frame_state_descriptor = | 1089 frame_state_descriptor = |
1090 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); | 1090 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); |
1091 } | 1091 } |
1092 | 1092 |
1093 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); | 1093 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); |
(...skipping 26 matching lines...) Expand all Loading... |
1120 slot--; | 1120 slot--; |
1121 } | 1121 } |
1122 // Now all pushes can be done in pairs. | 1122 // Now all pushes can be done in pairs. |
1123 for (; slot >= 0; slot -= 2) { | 1123 for (; slot >= 0; slot -= 2) { |
1124 Emit(kArm64PokePair | MiscField::encode(slot), g.NoOutput(), | 1124 Emit(kArm64PokePair | MiscField::encode(slot), g.NoOutput(), |
1125 g.UseRegister(buffer.pushed_nodes[slot]), | 1125 g.UseRegister(buffer.pushed_nodes[slot]), |
1126 g.UseRegister(buffer.pushed_nodes[slot - 1])); | 1126 g.UseRegister(buffer.pushed_nodes[slot - 1])); |
1127 } | 1127 } |
1128 } | 1128 } |
1129 | 1129 |
| 1130 // Pass label of exception handler block. |
| 1131 CallDescriptor::Flags flags = descriptor->flags(); |
| 1132 if (handler != nullptr) { |
| 1133 flags |= CallDescriptor::kHasExceptionHandler; |
| 1134 buffer.instruction_args.push_back(g.Label(handler)); |
| 1135 } |
| 1136 |
1130 // Select the appropriate opcode based on the call type. | 1137 // Select the appropriate opcode based on the call type. |
1131 InstructionCode opcode; | 1138 InstructionCode opcode; |
1132 switch (descriptor->kind()) { | 1139 switch (descriptor->kind()) { |
1133 case CallDescriptor::kCallCodeObject: { | 1140 case CallDescriptor::kCallCodeObject: { |
1134 opcode = kArchCallCodeObject; | 1141 opcode = kArchCallCodeObject; |
1135 break; | 1142 break; |
1136 } | 1143 } |
1137 case CallDescriptor::kCallJSFunction: | 1144 case CallDescriptor::kCallJSFunction: |
1138 opcode = kArchCallJSFunction; | 1145 opcode = kArchCallJSFunction; |
1139 break; | 1146 break; |
1140 default: | 1147 default: |
1141 UNREACHABLE(); | 1148 UNREACHABLE(); |
1142 return; | 1149 return; |
1143 } | 1150 } |
1144 opcode |= MiscField::encode(descriptor->flags()); | 1151 opcode |= MiscField::encode(flags); |
1145 | 1152 |
1146 // Emit the call instruction. | 1153 // Emit the call instruction. |
1147 InstructionOperand* first_output = | 1154 InstructionOperand* first_output = |
1148 buffer.outputs.size() > 0 ? &buffer.outputs.front() : NULL; | 1155 buffer.outputs.size() > 0 ? &buffer.outputs.front() : NULL; |
1149 Instruction* call_instr = | 1156 Instruction* call_instr = |
1150 Emit(opcode, buffer.outputs.size(), first_output, | 1157 Emit(opcode, buffer.outputs.size(), first_output, |
1151 buffer.instruction_args.size(), &buffer.instruction_args.front()); | 1158 buffer.instruction_args.size(), &buffer.instruction_args.front()); |
1152 call_instr->MarkAsCall(); | 1159 call_instr->MarkAsCall(); |
1153 } | 1160 } |
1154 | 1161 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 MachineOperatorBuilder::kFloat64RoundTruncate | | 1597 MachineOperatorBuilder::kFloat64RoundTruncate | |
1591 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1598 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1592 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1599 MachineOperatorBuilder::kWord32ShiftIsSafe | |
1593 MachineOperatorBuilder::kInt32DivIsSafe | | 1600 MachineOperatorBuilder::kInt32DivIsSafe | |
1594 MachineOperatorBuilder::kUint32DivIsSafe; | 1601 MachineOperatorBuilder::kUint32DivIsSafe; |
1595 } | 1602 } |
1596 | 1603 |
1597 } // namespace compiler | 1604 } // namespace compiler |
1598 } // namespace internal | 1605 } // namespace internal |
1599 } // namespace v8 | 1606 } // namespace v8 |
OLD | NEW |