| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 (call_address_immediate && | 561 (call_address_immediate && |
| 562 callee->opcode() == IrOpcode::kExternalConstant) | 562 callee->opcode() == IrOpcode::kExternalConstant) |
| 563 ? g.UseImmediate(callee) | 563 ? g.UseImmediate(callee) |
| 564 : g.UseRegister(callee)); | 564 : g.UseRegister(callee)); |
| 565 break; | 565 break; |
| 566 case CallDescriptor::kCallJSFunction: | 566 case CallDescriptor::kCallJSFunction: |
| 567 buffer->instruction_args.push_back( | 567 buffer->instruction_args.push_back( |
| 568 g.UseLocation(callee, buffer->descriptor->GetInputLocation(0), | 568 g.UseLocation(callee, buffer->descriptor->GetInputLocation(0), |
| 569 buffer->descriptor->GetInputType(0).representation())); | 569 buffer->descriptor->GetInputType(0).representation())); |
| 570 break; | 570 break; |
| 571 case CallDescriptor::kLazyBailout: | |
| 572 // The target is ignored, but we still need to pass a value here. | |
| 573 buffer->instruction_args.push_back(g.UseImmediate(callee)); | |
| 574 break; | |
| 575 } | 571 } |
| 576 DCHECK_EQ(1u, buffer->instruction_args.size()); | 572 DCHECK_EQ(1u, buffer->instruction_args.size()); |
| 577 | 573 |
| 578 // If the call needs a frame state, we insert the state information as | 574 // If the call needs a frame state, we insert the state information as |
| 579 // follows (n is the number of value inputs to the frame state): | 575 // follows (n is the number of value inputs to the frame state): |
| 580 // arg 1 : deoptimization id. | 576 // arg 1 : deoptimization id. |
| 581 // arg 2 - arg (n + 1) : value inputs to the frame state. | 577 // arg 2 - arg (n + 1) : value inputs to the frame state. |
| 582 size_t frame_state_entries = 0; | 578 size_t frame_state_entries = 0; |
| 583 USE(frame_state_entries); // frame_state_entries is only used for debug. | 579 USE(frame_state_entries); // frame_state_entries is only used for debug. |
| 584 if (buffer->frame_state_descriptor != nullptr) { | 580 if (buffer->frame_state_descriptor != nullptr) { |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 opcode = | 1448 opcode = |
| 1453 kArchCallCFunction | | 1449 kArchCallCFunction | |
| 1454 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); | 1450 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
| 1455 break; | 1451 break; |
| 1456 case CallDescriptor::kCallCodeObject: | 1452 case CallDescriptor::kCallCodeObject: |
| 1457 opcode = kArchCallCodeObject | MiscField::encode(flags); | 1453 opcode = kArchCallCodeObject | MiscField::encode(flags); |
| 1458 break; | 1454 break; |
| 1459 case CallDescriptor::kCallJSFunction: | 1455 case CallDescriptor::kCallJSFunction: |
| 1460 opcode = kArchCallJSFunction | MiscField::encode(flags); | 1456 opcode = kArchCallJSFunction | MiscField::encode(flags); |
| 1461 break; | 1457 break; |
| 1462 case CallDescriptor::kLazyBailout: | |
| 1463 opcode = kArchLazyBailout | MiscField::encode(flags); | |
| 1464 break; | |
| 1465 } | 1458 } |
| 1466 | 1459 |
| 1467 // Emit the call instruction. | 1460 // Emit the call instruction. |
| 1468 size_t const output_count = buffer.outputs.size(); | 1461 size_t const output_count = buffer.outputs.size(); |
| 1469 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; | 1462 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
| 1470 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), | 1463 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
| 1471 &buffer.instruction_args.front()) | 1464 &buffer.instruction_args.front()) |
| 1472 ->MarkAsCall(); | 1465 ->MarkAsCall(); |
| 1473 } | 1466 } |
| 1474 | 1467 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 return new (instruction_zone()) FrameStateDescriptor( | 1640 return new (instruction_zone()) FrameStateDescriptor( |
| 1648 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1641 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 1649 state_info.state_combine(), parameters, locals, stack, | 1642 state_info.state_combine(), parameters, locals, stack, |
| 1650 state_info.shared_info(), outer_state); | 1643 state_info.shared_info(), outer_state); |
| 1651 } | 1644 } |
| 1652 | 1645 |
| 1653 | 1646 |
| 1654 } // namespace compiler | 1647 } // namespace compiler |
| 1655 } // namespace internal | 1648 } // namespace internal |
| 1656 } // namespace v8 | 1649 } // namespace v8 |
| OLD | NEW |