| 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 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
| 10 | 10 |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 zone_(instruction_zone), | 806 zone_(instruction_zone), |
| 807 instruction_blocks_(instruction_blocks), | 807 instruction_blocks_(instruction_blocks), |
| 808 source_positions_(zone()), | 808 source_positions_(zone()), |
| 809 constants_(ConstantMap::key_compare(), | 809 constants_(ConstantMap::key_compare(), |
| 810 ConstantMap::allocator_type(zone())), | 810 ConstantMap::allocator_type(zone())), |
| 811 immediates_(zone()), | 811 immediates_(zone()), |
| 812 instructions_(zone()), | 812 instructions_(zone()), |
| 813 next_virtual_register_(0), | 813 next_virtual_register_(0), |
| 814 reference_maps_(zone()), | 814 reference_maps_(zone()), |
| 815 representations_(zone()), | 815 representations_(zone()), |
| 816 representation_mask_(0), |
| 816 deoptimization_entries_(zone()), | 817 deoptimization_entries_(zone()), |
| 817 current_block_(nullptr) {} | 818 current_block_(nullptr) {} |
| 818 | 819 |
| 819 int InstructionSequence::NextVirtualRegister() { | 820 int InstructionSequence::NextVirtualRegister() { |
| 820 int virtual_register = next_virtual_register_++; | 821 int virtual_register = next_virtual_register_++; |
| 821 CHECK_NE(virtual_register, InstructionOperand::kInvalidVirtualRegister); | 822 CHECK_NE(virtual_register, InstructionOperand::kInvalidVirtualRegister); |
| 822 return virtual_register; | 823 return virtual_register; |
| 823 } | 824 } |
| 824 | 825 |
| 825 | 826 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 int virtual_register) { | 912 int virtual_register) { |
| 912 DCHECK_LE(0, virtual_register); | 913 DCHECK_LE(0, virtual_register); |
| 913 DCHECK_LT(virtual_register, VirtualRegisterCount()); | 914 DCHECK_LT(virtual_register, VirtualRegisterCount()); |
| 914 if (virtual_register >= static_cast<int>(representations_.size())) { | 915 if (virtual_register >= static_cast<int>(representations_.size())) { |
| 915 representations_.resize(VirtualRegisterCount(), DefaultRepresentation()); | 916 representations_.resize(VirtualRegisterCount(), DefaultRepresentation()); |
| 916 } | 917 } |
| 917 rep = FilterRepresentation(rep); | 918 rep = FilterRepresentation(rep); |
| 918 DCHECK_IMPLIES(representations_[virtual_register] != rep, | 919 DCHECK_IMPLIES(representations_[virtual_register] != rep, |
| 919 representations_[virtual_register] == DefaultRepresentation()); | 920 representations_[virtual_register] == DefaultRepresentation()); |
| 920 representations_[virtual_register] = rep; | 921 representations_[virtual_register] = rep; |
| 922 representation_mask_ |= 1 << static_cast<int>(rep); |
| 921 } | 923 } |
| 922 | 924 |
| 923 int InstructionSequence::AddDeoptimizationEntry( | 925 int InstructionSequence::AddDeoptimizationEntry( |
| 924 FrameStateDescriptor* descriptor, DeoptimizeReason reason) { | 926 FrameStateDescriptor* descriptor, DeoptimizeReason reason) { |
| 925 int deoptimization_id = static_cast<int>(deoptimization_entries_.size()); | 927 int deoptimization_id = static_cast<int>(deoptimization_entries_.size()); |
| 926 deoptimization_entries_.push_back(DeoptimizationEntry(descriptor, reason)); | 928 deoptimization_entries_.push_back(DeoptimizationEntry(descriptor, reason)); |
| 927 return deoptimization_id; | 929 return deoptimization_id; |
| 928 } | 930 } |
| 929 | 931 |
| 930 DeoptimizationEntry const& InstructionSequence::GetDeoptimizationEntry( | 932 DeoptimizationEntry const& InstructionSequence::GetDeoptimizationEntry( |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 1068 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
| 1067 printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i)); | 1069 printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i)); |
| 1068 os << printable_block; | 1070 os << printable_block; |
| 1069 } | 1071 } |
| 1070 return os; | 1072 return os; |
| 1071 } | 1073 } |
| 1072 | 1074 |
| 1073 } // namespace compiler | 1075 } // namespace compiler |
| 1074 } // namespace internal | 1076 } // namespace internal |
| 1075 } // namespace v8 | 1077 } // namespace v8 |
| OLD | NEW |