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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); | 1157 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); |
1158 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); | 1158 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); |
1159 if (hint == IfExceptionHint::kLocallyCaught) { | 1159 if (hint == IfExceptionHint::kLocallyCaught) { |
1160 flags |= CallDescriptor::kHasLocalCatchHandler; | 1160 flags |= CallDescriptor::kHasLocalCatchHandler; |
1161 } | 1161 } |
1162 flags |= CallDescriptor::kHasExceptionHandler; | 1162 flags |= CallDescriptor::kHasExceptionHandler; |
1163 buffer.instruction_args.push_back(g.Label(handler)); | 1163 buffer.instruction_args.push_back(g.Label(handler)); |
1164 } | 1164 } |
1165 | 1165 |
1166 // Select the appropriate opcode based on the call type. | 1166 // Select the appropriate opcode based on the call type. |
1167 InstructionCode opcode; | 1167 InstructionCode opcode = kArchNop; |
1168 switch (descriptor->kind()) { | 1168 switch (descriptor->kind()) { |
1169 case CallDescriptor::kCallAddress: | 1169 case CallDescriptor::kCallAddress: |
1170 opcode = | 1170 opcode = |
1171 kArchCallCFunction | | 1171 kArchCallCFunction | |
1172 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); | 1172 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
1173 break; | 1173 break; |
1174 case CallDescriptor::kCallCodeObject: | 1174 case CallDescriptor::kCallCodeObject: |
1175 opcode = kArchCallCodeObject | MiscField::encode(flags); | 1175 opcode = kArchCallCodeObject | MiscField::encode(flags); |
1176 break; | 1176 break; |
1177 case CallDescriptor::kCallJSFunction: | 1177 case CallDescriptor::kCallJSFunction: |
1178 opcode = kArchCallJSFunction | MiscField::encode(flags); | 1178 opcode = kArchCallJSFunction | MiscField::encode(flags); |
1179 break; | 1179 break; |
1180 default: | 1180 case CallDescriptor::kLazyBailout: |
1181 UNREACHABLE(); | 1181 opcode = kArchLazyBailout | MiscField::encode(flags); |
1182 return; | 1182 break; |
1183 } | 1183 } |
1184 | 1184 |
1185 // Emit the call instruction. | 1185 // Emit the call instruction. |
1186 size_t const output_count = buffer.outputs.size(); | 1186 size_t const output_count = buffer.outputs.size(); |
1187 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; | 1187 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
1188 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), | 1188 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
1189 &buffer.instruction_args.front())->MarkAsCall(); | 1189 &buffer.instruction_args.front())->MarkAsCall(); |
1190 } | 1190 } |
1191 | 1191 |
1192 | 1192 |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1666 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1667 MachineOperatorBuilder::kFloat64RoundTruncate | | 1667 MachineOperatorBuilder::kFloat64RoundTruncate | |
1668 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1668 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1669 } | 1669 } |
1670 return flags; | 1670 return flags; |
1671 } | 1671 } |
1672 | 1672 |
1673 } // namespace compiler | 1673 } // namespace compiler |
1674 } // namespace internal | 1674 } // namespace internal |
1675 } // namespace v8 | 1675 } // namespace v8 |
OLD | NEW |