OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ |
6 #define V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ | 6 #define V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ |
7 | 7 |
8 #include "src/interpreter/bytecode-pipeline.h" | 8 #include "src/interpreter/bytecode-pipeline.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const uint32_t* operands, | 86 const uint32_t* operands, |
87 int operand_count); | 87 int operand_count); |
88 static Register GetRegisterOutputOperand(int index, Bytecode bytecode, | 88 static Register GetRegisterOutputOperand(int index, Bytecode bytecode, |
89 const uint32_t* operands, | 89 const uint32_t* operands, |
90 int operand_count); | 90 int operand_count); |
91 | 91 |
92 void CreateMaterializedEquivalent(RegisterInfo* info); | 92 void CreateMaterializedEquivalent(RegisterInfo* info); |
93 RegisterInfo* GetMaterializedEquivalent(RegisterInfo* info); | 93 RegisterInfo* GetMaterializedEquivalent(RegisterInfo* info); |
94 RegisterInfo* GetMaterializedEquivalentNotAccumulator(RegisterInfo* info); | 94 RegisterInfo* GetMaterializedEquivalentNotAccumulator(RegisterInfo* info); |
95 void Materialize(RegisterInfo* info); | 95 void Materialize(RegisterInfo* info); |
| 96 void AddToEquivalenceSet(RegisterInfo* set_member, |
| 97 RegisterInfo* non_set_member); |
96 | 98 |
97 // Methods for finding and creating metadata for each register. | 99 // Methods for finding and creating metadata for each register. |
98 RegisterInfo* GetOrCreateRegisterInfo(Register reg); | 100 RegisterInfo* GetOrCreateRegisterInfo(Register reg); |
99 RegisterInfo* GetRegisterInfo(Register reg); | 101 RegisterInfo* GetRegisterInfo(Register reg); |
100 RegisterInfo* NewRegisterInfo(Register reg); | 102 RegisterInfo* NewRegisterInfo(Register reg); |
101 void GrowRegisterMap(Register reg); | 103 void GrowRegisterMap(Register reg); |
102 | 104 |
103 bool RegisterIsTemporary(Register reg) const { | 105 bool RegisterIsTemporary(Register reg) const { |
104 return reg >= temporary_base_; | 106 return reg >= temporary_base_; |
105 } | 107 } |
(...skipping 27 matching lines...) Expand all Loading... |
133 const Register temporary_base_; | 135 const Register temporary_base_; |
134 | 136 |
135 // Direct mapping to register info. | 137 // Direct mapping to register info. |
136 ZoneVector<RegisterInfo*> register_info_table_; | 138 ZoneVector<RegisterInfo*> register_info_table_; |
137 int register_info_table_offset_; | 139 int register_info_table_offset_; |
138 | 140 |
139 // Counter for equivalence sets identifiers. | 141 // Counter for equivalence sets identifiers. |
140 int equivalence_id_; | 142 int equivalence_id_; |
141 | 143 |
142 BytecodePipelineStage* next_stage_; | 144 BytecodePipelineStage* next_stage_; |
143 bool flushed_; | 145 bool flush_required_; |
144 Zone* zone_; | 146 Zone* zone_; |
145 | 147 |
146 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); | 148 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); |
147 }; | 149 }; |
148 | 150 |
149 } // namespace interpreter | 151 } // namespace interpreter |
150 } // namespace internal | 152 } // namespace internal |
151 } // namespace v8 | 153 } // namespace v8 |
152 | 154 |
153 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ | 155 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ |
OLD | NEW |