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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); | 764 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); |
765 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); | 765 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); |
766 if (hint == IfExceptionHint::kLocallyCaught) { | 766 if (hint == IfExceptionHint::kLocallyCaught) { |
767 flags |= CallDescriptor::kHasLocalCatchHandler; | 767 flags |= CallDescriptor::kHasLocalCatchHandler; |
768 } | 768 } |
769 flags |= CallDescriptor::kHasExceptionHandler; | 769 flags |= CallDescriptor::kHasExceptionHandler; |
770 buffer.instruction_args.push_back(g.Label(handler)); | 770 buffer.instruction_args.push_back(g.Label(handler)); |
771 } | 771 } |
772 | 772 |
773 // Select the appropriate opcode based on the call type. | 773 // Select the appropriate opcode based on the call type. |
774 InstructionCode opcode; | 774 InstructionCode opcode = kArchNop; |
775 switch (descriptor->kind()) { | 775 switch (descriptor->kind()) { |
776 case CallDescriptor::kCallAddress: | 776 case CallDescriptor::kCallAddress: |
777 opcode = | 777 opcode = |
778 kArchCallCFunction | | 778 kArchCallCFunction | |
779 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); | 779 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
780 break; | 780 break; |
781 case CallDescriptor::kCallCodeObject: | 781 case CallDescriptor::kCallCodeObject: |
782 opcode = kArchCallCodeObject | MiscField::encode(flags); | 782 opcode = kArchCallCodeObject | MiscField::encode(flags); |
783 break; | 783 break; |
784 case CallDescriptor::kCallJSFunction: | 784 case CallDescriptor::kCallJSFunction: |
785 opcode = kArchCallJSFunction | MiscField::encode(flags); | 785 opcode = kArchCallJSFunction | MiscField::encode(flags); |
786 break; | 786 break; |
787 default: | 787 case CallDescriptor::kLazyBailout: |
788 UNREACHABLE(); | 788 opcode = kArchLazyBailout | MiscField::encode(flags); |
789 return; | 789 break; |
790 } | 790 } |
791 opcode |= MiscField::encode(flags); | 791 opcode |= MiscField::encode(flags); |
792 | 792 |
793 // Emit the call instruction. | 793 // Emit the call instruction. |
794 size_t const output_count = buffer.outputs.size(); | 794 size_t const output_count = buffer.outputs.size(); |
795 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; | 795 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
796 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), | 796 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
797 &buffer.instruction_args.front())->MarkAsCall(); | 797 &buffer.instruction_args.front())->MarkAsCall(); |
798 } | 798 } |
799 | 799 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 // static | 1410 // static |
1411 MachineOperatorBuilder::Flags | 1411 MachineOperatorBuilder::Flags |
1412 InstructionSelector::SupportedMachineOperatorFlags() { | 1412 InstructionSelector::SupportedMachineOperatorFlags() { |
1413 return MachineOperatorBuilder::kFloat64RoundDown | | 1413 return MachineOperatorBuilder::kFloat64RoundDown | |
1414 MachineOperatorBuilder::kFloat64RoundTruncate; | 1414 MachineOperatorBuilder::kFloat64RoundTruncate; |
1415 } | 1415 } |
1416 | 1416 |
1417 } // namespace compiler | 1417 } // namespace compiler |
1418 } // namespace internal | 1418 } // namespace internal |
1419 } // namespace v8 | 1419 } // namespace v8 |
OLD | NEW |