| 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/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 return Register(static_cast<int>(index) - register_info_table_offset_); | 171 return Register(static_cast<int>(index) - register_info_table_offset_); |
| 172 } | 172 } |
| 173 | 173 |
| 174 uint32_t NextEquivalenceId() { | 174 uint32_t NextEquivalenceId() { |
| 175 equivalence_id_++; | 175 equivalence_id_++; |
| 176 // TODO(rmcilroy): use the same type for these and remove static_cast. | 176 // TODO(rmcilroy): use the same type for these and remove static_cast. |
| 177 CHECK_NE(static_cast<size_t>(equivalence_id_), kInvalidEquivalenceId); | 177 CHECK_NE(static_cast<size_t>(equivalence_id_), kInvalidEquivalenceId); |
| 178 return equivalence_id_; | 178 return equivalence_id_; |
| 179 } | 179 } |
| 180 | 180 |
| 181 void AllocateRegister(RegisterInfo* info); |
| 182 |
| 181 Zone* zone() { return zone_; } | 183 Zone* zone() { return zone_; } |
| 182 | 184 |
| 183 const Register accumulator_; | 185 const Register accumulator_; |
| 184 RegisterInfo* accumulator_info_; | 186 RegisterInfo* accumulator_info_; |
| 185 const Register temporary_base_; | 187 const Register temporary_base_; |
| 186 int max_register_index_; | 188 int max_register_index_; |
| 187 | 189 |
| 188 // Direct mapping to register info. | 190 // Direct mapping to register info. |
| 189 ZoneVector<RegisterInfo*> register_info_table_; | 191 ZoneVector<RegisterInfo*> register_info_table_; |
| 190 int register_info_table_offset_; | 192 int register_info_table_offset_; |
| 191 | 193 |
| 192 // Counter for equivalence sets identifiers. | 194 // Counter for equivalence sets identifiers. |
| 193 int equivalence_id_; | 195 int equivalence_id_; |
| 194 | 196 |
| 195 BytecodeWriter* bytecode_writer_; | 197 BytecodeWriter* bytecode_writer_; |
| 196 bool flush_required_; | 198 bool flush_required_; |
| 197 Zone* zone_; | 199 Zone* zone_; |
| 198 | 200 |
| 199 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); | 201 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); |
| 200 }; | 202 }; |
| 201 | 203 |
| 202 } // namespace interpreter | 204 } // namespace interpreter |
| 203 } // namespace internal | 205 } // namespace internal |
| 204 } // namespace v8 | 206 } // namespace v8 |
| 205 | 207 |
| 206 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ | 208 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ |
| OLD | NEW |