| 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 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 case Bytecode::kMov: { | 240 case Bytecode::kMov: { |
| 241 DoMov(node); | 241 DoMov(node); |
| 242 return; | 242 return; |
| 243 } | 243 } |
| 244 default: | 244 default: |
| 245 break; | 245 break; |
| 246 } | 246 } |
| 247 | 247 |
| 248 if (Bytecodes::IsJump(node->bytecode()) || | 248 if (Bytecodes::IsJump(node->bytecode()) || |
| 249 node->bytecode() == Bytecode::kDebugger) { | 249 node->bytecode() == Bytecode::kDebugger || |
| 250 // The debugger can manipulate locals and parameters, flush | 250 node->bytecode() == Bytecode::kSuspendGenerator) { |
| 251 // everything before handing over to it. Similarly, all state must | 251 // All state must be flushed before emitting |
| 252 // be flushed before emitting a jump due to how bytecode offsets | 252 // - a jump (due to how bytecode offsets for jumps are evaluated), |
| 253 // for jumps are evaluated. | 253 // - a call to the debugger (as it can manipulate locals and parameters), |
| 254 // - a generator suspend (as this involves saving all registers). |
| 254 FlushState(); | 255 FlushState(); |
| 255 } | 256 } |
| 256 | 257 |
| 257 PrepareOperands(node); | 258 PrepareOperands(node); |
| 258 WriteToNextStage(node); | 259 WriteToNextStage(node); |
| 259 } | 260 } |
| 260 | 261 |
| 261 // override | 262 // override |
| 262 void BytecodeRegisterOptimizer::WriteJump(BytecodeNode* node, | 263 void BytecodeRegisterOptimizer::WriteJump(BytecodeNode* node, |
| 263 BytecodeLabel* label) { | 264 BytecodeLabel* label) { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 if (info->materialized()) { | 618 if (info->materialized()) { |
| 618 CreateMaterializedEquivalent(info); | 619 CreateMaterializedEquivalent(info); |
| 619 } | 620 } |
| 620 info->MoveToNewEquivalenceSet(kInvalidEquivalenceId, false); | 621 info->MoveToNewEquivalenceSet(kInvalidEquivalenceId, false); |
| 621 } | 622 } |
| 622 } | 623 } |
| 623 | 624 |
| 624 } // namespace interpreter | 625 } // namespace interpreter |
| 625 } // namespace internal | 626 } // namespace internal |
| 626 } // namespace v8 | 627 } // namespace v8 |
| OLD | NEW |