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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 26 matching lines...) Expand all Loading... |
37 return os << "(S)"; | 37 return os << "(S)"; |
38 case UnallocatedOperand::SAME_AS_FIRST_INPUT: | 38 case UnallocatedOperand::SAME_AS_FIRST_INPUT: |
39 return os << "(1)"; | 39 return os << "(1)"; |
40 case UnallocatedOperand::ANY: | 40 case UnallocatedOperand::ANY: |
41 return os << "(-)"; | 41 return os << "(-)"; |
42 } | 42 } |
43 } | 43 } |
44 case InstructionOperand::CONSTANT: | 44 case InstructionOperand::CONSTANT: |
45 return os << "[constant:" << ConstantOperand::cast(op).virtual_register() | 45 return os << "[constant:" << ConstantOperand::cast(op).virtual_register() |
46 << "]"; | 46 << "]"; |
47 case InstructionOperand::IMMEDIATE: | 47 case InstructionOperand::IMMEDIATE: { |
48 return os << "[immediate:" << ImmediateOperand::cast(op).index() << "]"; | 48 auto imm = ImmediateOperand::cast(op); |
| 49 switch (imm.type()) { |
| 50 case ImmediateOperand::INLINE: |
| 51 return os << "#" << imm.inline_value(); |
| 52 case ImmediateOperand::INDEXED: |
| 53 return os << "[immediate:" << imm.indexed_value() << "]"; |
| 54 } |
| 55 } |
49 case InstructionOperand::ALLOCATED: | 56 case InstructionOperand::ALLOCATED: |
50 switch (AllocatedOperand::cast(op).allocated_kind()) { | 57 switch (AllocatedOperand::cast(op).allocated_kind()) { |
51 case AllocatedOperand::STACK_SLOT: | 58 case AllocatedOperand::STACK_SLOT: |
52 return os << "[stack:" << StackSlotOperand::cast(op).index() << "]"; | 59 return os << "[stack:" << StackSlotOperand::cast(op).index() << "]"; |
53 case AllocatedOperand::DOUBLE_STACK_SLOT: | 60 case AllocatedOperand::DOUBLE_STACK_SLOT: |
54 return os << "[double_stack:" | 61 return os << "[double_stack:" |
55 << DoubleStackSlotOperand::cast(op).index() << "]"; | 62 << DoubleStackSlotOperand::cast(op).index() << "]"; |
56 case AllocatedOperand::REGISTER: | 63 case AllocatedOperand::REGISTER: |
57 return os << "[" | 64 return os << "[" |
58 << conf->general_register_name( | 65 << conf->general_register_name( |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 | 606 |
600 int InstructionSequence::GetFrameStateDescriptorCount() { | 607 int InstructionSequence::GetFrameStateDescriptorCount() { |
601 return static_cast<int>(deoptimization_entries_.size()); | 608 return static_cast<int>(deoptimization_entries_.size()); |
602 } | 609 } |
603 | 610 |
604 | 611 |
605 RpoNumber InstructionSequence::InputRpo(Instruction* instr, size_t index) { | 612 RpoNumber InstructionSequence::InputRpo(Instruction* instr, size_t index) { |
606 InstructionOperand* operand = instr->InputAt(index); | 613 InstructionOperand* operand = instr->InputAt(index); |
607 Constant constant = | 614 Constant constant = |
608 operand->IsImmediate() | 615 operand->IsImmediate() |
609 ? GetImmediate(ImmediateOperand::cast(operand)->index()) | 616 ? GetImmediate(ImmediateOperand::cast(operand)) |
610 : GetConstant(ConstantOperand::cast(operand)->virtual_register()); | 617 : GetConstant(ConstantOperand::cast(operand)->virtual_register()); |
611 return constant.ToRpoNumber(); | 618 return constant.ToRpoNumber(); |
612 } | 619 } |
613 | 620 |
614 | 621 |
615 FrameStateDescriptor::FrameStateDescriptor( | 622 FrameStateDescriptor::FrameStateDescriptor( |
616 Zone* zone, const FrameStateCallInfo& state_info, size_t parameters_count, | 623 Zone* zone, const FrameStateCallInfo& state_info, size_t parameters_count, |
617 size_t locals_count, size_t stack_count, FrameStateDescriptor* outer_state) | 624 size_t locals_count, size_t stack_count, FrameStateDescriptor* outer_state) |
618 : type_(state_info.type()), | 625 : type_(state_info.type()), |
619 bailout_id_(state_info.bailout_id()), | 626 bailout_id_(state_info.bailout_id()), |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 os << " B" << succ.ToInt(); | 754 os << " B" << succ.ToInt(); |
748 } | 755 } |
749 os << "\n"; | 756 os << "\n"; |
750 } | 757 } |
751 return os; | 758 return os; |
752 } | 759 } |
753 | 760 |
754 } // namespace compiler | 761 } // namespace compiler |
755 } // namespace internal | 762 } // namespace internal |
756 } // namespace v8 | 763 } // namespace v8 |
OLD | NEW |