| 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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); | 1470 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); |
| 1471 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); | 1471 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); |
| 1472 if (hint == IfExceptionHint::kLocallyCaught) { | 1472 if (hint == IfExceptionHint::kLocallyCaught) { |
| 1473 flags |= CallDescriptor::kHasLocalCatchHandler; | 1473 flags |= CallDescriptor::kHasLocalCatchHandler; |
| 1474 } | 1474 } |
| 1475 flags |= CallDescriptor::kHasExceptionHandler; | 1475 flags |= CallDescriptor::kHasExceptionHandler; |
| 1476 buffer.instruction_args.push_back(g.Label(handler)); | 1476 buffer.instruction_args.push_back(g.Label(handler)); |
| 1477 } | 1477 } |
| 1478 | 1478 |
| 1479 // Select the appropriate opcode based on the call type. | 1479 // Select the appropriate opcode based on the call type. |
| 1480 InstructionCode opcode; | 1480 InstructionCode opcode = kArchNop; |
| 1481 switch (descriptor->kind()) { | 1481 switch (descriptor->kind()) { |
| 1482 case CallDescriptor::kCallAddress: | 1482 case CallDescriptor::kCallAddress: |
| 1483 opcode = | 1483 opcode = |
| 1484 kArchCallCFunction | | 1484 kArchCallCFunction | |
| 1485 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); | 1485 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
| 1486 break; | 1486 break; |
| 1487 case CallDescriptor::kCallCodeObject: | 1487 case CallDescriptor::kCallCodeObject: |
| 1488 opcode = kArchCallCodeObject | MiscField::encode(flags); | 1488 opcode = kArchCallCodeObject | MiscField::encode(flags); |
| 1489 break; | 1489 break; |
| 1490 case CallDescriptor::kCallJSFunction: | 1490 case CallDescriptor::kCallJSFunction: |
| 1491 opcode = kArchCallJSFunction | MiscField::encode(flags); | 1491 opcode = kArchCallJSFunction | MiscField::encode(flags); |
| 1492 break; | 1492 break; |
| 1493 default: | 1493 case CallDescriptor::kLazyBailout: |
| 1494 UNREACHABLE(); | 1494 opcode = kArchLazyBailout | MiscField::encode(flags); |
| 1495 return; | 1495 break; |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 // Emit the call instruction. | 1498 // Emit the call instruction. |
| 1499 size_t const output_count = buffer.outputs.size(); | 1499 size_t const output_count = buffer.outputs.size(); |
| 1500 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; | 1500 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
| 1501 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), | 1501 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
| 1502 &buffer.instruction_args.front())->MarkAsCall(); | 1502 &buffer.instruction_args.front())->MarkAsCall(); |
| 1503 } | 1503 } |
| 1504 | 1504 |
| 1505 | 1505 |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 MachineOperatorBuilder::kFloat64RoundTruncate | | 2117 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 2118 MachineOperatorBuilder::kFloat64RoundTiesAway | | 2118 MachineOperatorBuilder::kFloat64RoundTiesAway | |
| 2119 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2119 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 2120 MachineOperatorBuilder::kInt32DivIsSafe | | 2120 MachineOperatorBuilder::kInt32DivIsSafe | |
| 2121 MachineOperatorBuilder::kUint32DivIsSafe; | 2121 MachineOperatorBuilder::kUint32DivIsSafe; |
| 2122 } | 2122 } |
| 2123 | 2123 |
| 2124 } // namespace compiler | 2124 } // namespace compiler |
| 2125 } // namespace internal | 2125 } // namespace internal |
| 2126 } // namespace v8 | 2126 } // namespace v8 |
| OLD | NEW |