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 #include "src/interpreter/bytecode-register-optimizer.h" | 5 #include "src/interpreter/bytecode-register-optimizer.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace interpreter { | 9 namespace interpreter { |
10 | 10 |
11 const uint32_t BytecodeRegisterOptimizer::kInvalidEquivalenceId; | 11 const uint32_t BytecodeRegisterOptimizer::kInvalidEquivalenceId = kMaxUInt32; |
12 | 12 |
13 // A class for tracking the state of a register. This class tracks | 13 // A class for tracking the state of a register. This class tracks |
14 // which equivalence set a register is a member of and also whether a | 14 // which equivalence set a register is a member of and also whether a |
15 // register is materialized in the bytecode stream. | 15 // register is materialized in the bytecode stream. |
16 class BytecodeRegisterOptimizer::RegisterInfo final : public ZoneObject { | 16 class BytecodeRegisterOptimizer::RegisterInfo final : public ZoneObject { |
17 public: | 17 public: |
18 RegisterInfo(Register reg, uint32_t equivalence_id, bool materialized, | 18 RegisterInfo(Register reg, uint32_t equivalence_id, bool materialized, |
19 bool allocated) | 19 bool allocated) |
20 : register_(reg), | 20 : register_(reg), |
21 equivalence_id_(equivalence_id), | 21 equivalence_id_(equivalence_id), |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 void BytecodeRegisterOptimizer::RegisterListFreeEvent(RegisterList reg_list) { | 652 void BytecodeRegisterOptimizer::RegisterListFreeEvent(RegisterList reg_list) { |
653 int first_index = reg_list.first_register().index(); | 653 int first_index = reg_list.first_register().index(); |
654 for (int i = 0; i < reg_list.register_count(); i++) { | 654 for (int i = 0; i < reg_list.register_count(); i++) { |
655 GetRegisterInfo(Register(first_index + i))->set_allocated(false); | 655 GetRegisterInfo(Register(first_index + i))->set_allocated(false); |
656 } | 656 } |
657 } | 657 } |
658 | 658 |
659 } // namespace interpreter | 659 } // namespace interpreter |
660 } // namespace internal | 660 } // namespace internal |
661 } // namespace v8 | 661 } // namespace v8 |
OLD | NEW |