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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 | 60 |
61 // Materialize all live registers and flush equivalence sets. | 61 // Materialize all live registers and flush equivalence sets. |
62 void Flush(); | 62 void Flush(); |
63 | 63 |
64 // Prepares for |bytecode|. | 64 // Prepares for |bytecode|. |
65 template <Bytecode bytecode, AccumulatorUse accumulator_use> | 65 template <Bytecode bytecode, AccumulatorUse accumulator_use> |
66 INLINE(void PrepareForBytecode()) { | 66 INLINE(void PrepareForBytecode()) { |
67 if (Bytecodes::IsJump(bytecode) || Bytecodes::IsSwitch(bytecode) || | 67 if (Bytecodes::IsJump(bytecode) || Bytecodes::IsSwitch(bytecode) || |
68 bytecode == Bytecode::kDebugger || | 68 bytecode == Bytecode::kDebugger || |
69 bytecode == Bytecode::kSuspendGenerator || | 69 bytecode == Bytecode::kSuspendGenerator || |
70 bytecode == Bytecode::kResumeGenerator) { | 70 bytecode == Bytecode::kResumeGenerator || |
rmcilroy
2017/06/01 10:44:44
Remove ResumeGenerator from here now.
Jarin
2017/06/01 12:48:22
Done.
| |
71 bytecode == Bytecode::kRestoreGeneratorRegisters) { | |
71 // All state must be flushed before emitting | 72 // All state must be flushed before emitting |
72 // - a jump bytecode (as the register equivalents at the jump target | 73 // - a jump bytecode (as the register equivalents at the jump target |
73 // aren't known) | 74 // aren't known) |
74 // - a switch bytecode (as the register equivalents at the switch targets | 75 // - a switch bytecode (as the register equivalents at the switch targets |
75 // aren't known) | 76 // aren't known) |
76 // - a call to the debugger (as it can manipulate locals and parameters), | 77 // - a call to the debugger (as it can manipulate locals and parameters), |
77 // - a generator suspend (as this involves saving all registers). | 78 // - a generator suspend (as this involves saving all registers). |
78 // - a generator resume (as this involves restoring all registers). | 79 // - a generator resume (as this involves restoring all registers). |
rmcilroy
2017/06/01 10:44:44
update comment please
Jarin
2017/06/01 12:48:22
Done.
| |
79 Flush(); | 80 Flush(); |
80 } | 81 } |
81 | 82 |
82 // Materialize the accumulator if it is read by the bytecode. The | 83 // Materialize the accumulator if it is read by the bytecode. The |
83 // accumulator is special and no other register can be materialized | 84 // accumulator is special and no other register can be materialized |
84 // in it's place. | 85 // in it's place. |
85 if (BytecodeOperands::ReadsAccumulator(accumulator_use)) { | 86 if (BytecodeOperands::ReadsAccumulator(accumulator_use)) { |
86 Materialize(accumulator_info_); | 87 Materialize(accumulator_info_); |
87 } | 88 } |
88 | 89 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 Zone* zone_; | 198 Zone* zone_; |
198 | 199 |
199 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); | 200 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); |
200 }; | 201 }; |
201 | 202 |
202 } // namespace interpreter | 203 } // namespace interpreter |
203 } // namespace internal | 204 } // namespace internal |
204 } // namespace v8 | 205 } // namespace v8 |
205 | 206 |
206 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ | 207 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ |
OLD | NEW |