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-pipeline.h" | 10 #include "src/interpreter/bytecode-pipeline.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 size_t GetRegisterInfoTableIndex(Register reg) const { | 130 size_t GetRegisterInfoTableIndex(Register reg) const { |
131 return static_cast<size_t>(reg.index() + register_info_table_offset_); | 131 return static_cast<size_t>(reg.index() + register_info_table_offset_); |
132 } | 132 } |
133 | 133 |
134 Register RegisterFromRegisterInfoTableIndex(size_t index) const { | 134 Register RegisterFromRegisterInfoTableIndex(size_t index) const { |
135 return Register(static_cast<int>(index) - register_info_table_offset_); | 135 return Register(static_cast<int>(index) - register_info_table_offset_); |
136 } | 136 } |
137 | 137 |
138 uint32_t NextEquivalenceId() { | 138 uint32_t NextEquivalenceId() { |
139 equivalence_id_++; | 139 equivalence_id_++; |
140 CHECK_NE(equivalence_id_, kInvalidEquivalenceId); | 140 // TODO(rmcilroy): use the same type for these and remove static_cast. |
| 141 CHECK_NE(static_cast<size_t>(equivalence_id_), kInvalidEquivalenceId); |
141 return equivalence_id_; | 142 return equivalence_id_; |
142 } | 143 } |
143 | 144 |
144 Zone* zone() { return zone_; } | 145 Zone* zone() { return zone_; } |
145 | 146 |
146 const Register accumulator_; | 147 const Register accumulator_; |
147 RegisterInfo* accumulator_info_; | 148 RegisterInfo* accumulator_info_; |
148 const Register temporary_base_; | 149 const Register temporary_base_; |
149 int max_register_index_; | 150 int max_register_index_; |
150 | 151 |
151 // Direct mapping to register info. | 152 // Direct mapping to register info. |
152 ZoneVector<RegisterInfo*> register_info_table_; | 153 ZoneVector<RegisterInfo*> register_info_table_; |
153 int register_info_table_offset_; | 154 int register_info_table_offset_; |
154 | 155 |
155 // Counter for equivalence sets identifiers. | 156 // Counter for equivalence sets identifiers. |
156 int equivalence_id_; | 157 int equivalence_id_; |
157 | 158 |
158 BytecodePipelineStage* next_stage_; | 159 BytecodePipelineStage* next_stage_; |
159 bool flush_required_; | 160 bool flush_required_; |
160 Zone* zone_; | 161 Zone* zone_; |
161 | 162 |
162 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); | 163 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); |
163 }; | 164 }; |
164 | 165 |
165 } // namespace interpreter | 166 } // namespace interpreter |
166 } // namespace internal | 167 } // namespace internal |
167 } // namespace v8 | 168 } // namespace v8 |
168 | 169 |
169 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ | 170 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ |
OLD | NEW |