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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); | 1125 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); |
1126 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); | 1126 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); |
1127 if (hint == IfExceptionHint::kLocallyCaught) { | 1127 if (hint == IfExceptionHint::kLocallyCaught) { |
1128 flags |= CallDescriptor::kHasLocalCatchHandler; | 1128 flags |= CallDescriptor::kHasLocalCatchHandler; |
1129 } | 1129 } |
1130 flags |= CallDescriptor::kHasExceptionHandler; | 1130 flags |= CallDescriptor::kHasExceptionHandler; |
1131 buffer.instruction_args.push_back(g.Label(handler)); | 1131 buffer.instruction_args.push_back(g.Label(handler)); |
1132 } | 1132 } |
1133 | 1133 |
1134 // Select the appropriate opcode based on the call type. | 1134 // Select the appropriate opcode based on the call type. |
1135 InstructionCode opcode; | 1135 InstructionCode opcode = kArchNop; |
1136 switch (descriptor->kind()) { | 1136 switch (descriptor->kind()) { |
1137 case CallDescriptor::kCallAddress: | 1137 case CallDescriptor::kCallAddress: |
1138 opcode = | 1138 opcode = |
1139 kArchCallCFunction | | 1139 kArchCallCFunction | |
1140 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); | 1140 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
1141 break; | 1141 break; |
1142 case CallDescriptor::kCallCodeObject: | 1142 case CallDescriptor::kCallCodeObject: |
1143 opcode = kArchCallCodeObject | MiscField::encode(flags); | 1143 opcode = kArchCallCodeObject | MiscField::encode(flags); |
1144 break; | 1144 break; |
1145 case CallDescriptor::kCallJSFunction: | 1145 case CallDescriptor::kCallJSFunction: |
1146 opcode = kArchCallJSFunction | MiscField::encode(flags); | 1146 opcode = kArchCallJSFunction | MiscField::encode(flags); |
1147 break; | 1147 break; |
1148 default: | 1148 case CallDescriptor::kLazyBailout: |
1149 UNREACHABLE(); | 1149 opcode = kArchLazyBailout | MiscField::encode(flags); |
1150 return; | 1150 break; |
1151 } | 1151 } |
1152 | 1152 |
1153 // Emit the call instruction. | 1153 // Emit the call instruction. |
1154 size_t const output_count = buffer.outputs.size(); | 1154 size_t const output_count = buffer.outputs.size(); |
1155 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; | 1155 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
1156 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), | 1156 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
1157 &buffer.instruction_args.front())->MarkAsCall(); | 1157 &buffer.instruction_args.front())->MarkAsCall(); |
1158 } | 1158 } |
1159 | 1159 |
1160 | 1160 |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 if (CpuFeatures::IsSupported(SSE4_1)) { | 1724 if (CpuFeatures::IsSupported(SSE4_1)) { |
1725 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1725 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1726 MachineOperatorBuilder::kFloat64RoundTruncate; | 1726 MachineOperatorBuilder::kFloat64RoundTruncate; |
1727 } | 1727 } |
1728 return flags; | 1728 return flags; |
1729 } | 1729 } |
1730 | 1730 |
1731 } // namespace compiler | 1731 } // namespace compiler |
1732 } // namespace internal | 1732 } // namespace internal |
1733 } // namespace v8 | 1733 } // namespace v8 |
OLD | NEW |