| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/base/adapters.h" | 5 #include "src/base/adapters.h" |
| 6 #include "src/compiler/frame-elider.h" | 6 #include "src/compiler/frame-elider.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 namespace compiler { | 10 namespace compiler { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 for (auto block : instruction_blocks()) { | 41 for (auto block : instruction_blocks()) { |
| 42 if (block->needs_frame()) { | 42 if (block->needs_frame()) { |
| 43 // Special case: The start block needs a frame. | 43 // Special case: The start block needs a frame. |
| 44 if (block->predecessors().empty()) { | 44 if (block->predecessors().empty()) { |
| 45 block->mark_must_construct_frame(); | 45 block->mark_must_construct_frame(); |
| 46 } | 46 } |
| 47 // Find "frame -> no frame" transitions, inserting frame | 47 // Find "frame -> no frame" transitions, inserting frame |
| 48 // deconstructions. | 48 // deconstructions. |
| 49 for (auto succ : block->successors()) { | 49 for (auto succ : block->successors()) { |
| 50 if (!InstructionBlockAt(succ)->needs_frame()) { | 50 if (!InstructionBlockAt(succ)->needs_frame()) { |
| 51 DCHECK_EQ(1, block->SuccessorCount()); | 51 DCHECK_EQ(1U, block->SuccessorCount()); |
| 52 block->mark_must_deconstruct_frame(); | 52 block->mark_must_deconstruct_frame(); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 } else { | 55 } else { |
| 56 // Find "no frame -> frame" transitions, inserting frame constructions. | 56 // Find "no frame -> frame" transitions, inserting frame constructions. |
| 57 for (auto succ : block->successors()) { | 57 for (auto succ : block->successors()) { |
| 58 if (InstructionBlockAt(succ)->needs_frame()) { | 58 if (InstructionBlockAt(succ)->needs_frame()) { |
| 59 DCHECK_NE(1, block->SuccessorCount()); | 59 DCHECK_NE(1U, block->SuccessorCount()); |
| 60 InstructionBlockAt(succ)->mark_must_construct_frame(); | 60 InstructionBlockAt(succ)->mark_must_construct_frame(); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 bool FrameElider::PropagateInOrder() { | 68 bool FrameElider::PropagateInOrder() { |
| 69 bool changed = false; | 69 bool changed = false; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 | 123 |
| 124 Instruction* FrameElider::InstructionAt(int index) const { | 124 Instruction* FrameElider::InstructionAt(int index) const { |
| 125 return code_->InstructionAt(index); | 125 return code_->InstructionAt(index); |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace compiler | 128 } // namespace compiler |
| 129 } // namespace internal | 129 } // namespace internal |
| 130 } // namespace v8 | 130 } // namespace v8 |
| OLD | NEW |