Chromium Code Reviews| 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/compiler/frame-elider.h" | |
| 5 #include "src/base/adapters.h" | 6 #include "src/base/adapters.h" |
| 6 #include "src/compiler/frame-elider.h" | 7 #include "src/compiler/linkage.h" |
| 7 | 8 |
| 8 namespace v8 { | 9 namespace v8 { |
| 9 namespace internal { | 10 namespace internal { |
| 10 namespace compiler { | 11 namespace compiler { |
| 11 | 12 |
| 12 FrameElider::FrameElider(InstructionSequence* code) : code_(code) {} | 13 FrameElider::FrameElider(InstructionSequence* code) : code_(code) {} |
| 13 | 14 |
| 14 void FrameElider::Run() { | 15 void FrameElider::Run(const CallDescriptor* descriptor) { |
| 15 MarkBlocks(); | 16 if (descriptor != nullptr && descriptor->RequiresFrameAsIncoming()) { |
|
danno
2016/03/18 18:13:00
Passing in the CallDescriptor here seems weird. I
Mircea Trofin
2016/03/18 18:22:31
Done.
| |
| 17 instruction_blocks()[0]->mark_needs_frame(); | |
| 18 } else { | |
| 19 MarkBlocks(); | |
| 20 } | |
| 16 PropagateMarks(); | 21 PropagateMarks(); |
| 17 MarkDeConstruction(); | 22 MarkDeConstruction(); |
| 18 } | 23 } |
| 19 | 24 |
| 20 | 25 |
| 21 void FrameElider::MarkBlocks() { | 26 void FrameElider::MarkBlocks() { |
| 22 for (InstructionBlock* block : instruction_blocks()) { | 27 for (InstructionBlock* block : instruction_blocks()) { |
| 23 if (block->needs_frame()) continue; | 28 if (block->needs_frame()) continue; |
| 24 for (int i = block->code_start(); i < block->code_end(); ++i) { | 29 for (int i = block->code_start(); i < block->code_end(); ++i) { |
| 25 if (InstructionAt(i)->IsCall() || | 30 if (InstructionAt(i)->IsCall() || |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 } | 127 } |
| 123 | 128 |
| 124 | 129 |
| 125 Instruction* FrameElider::InstructionAt(int index) const { | 130 Instruction* FrameElider::InstructionAt(int index) const { |
| 126 return code_->InstructionAt(index); | 131 return code_->InstructionAt(index); |
| 127 } | 132 } |
| 128 | 133 |
| 129 } // namespace compiler | 134 } // namespace compiler |
| 130 } // namespace internal | 135 } // namespace internal |
| 131 } // namespace v8 | 136 } // namespace v8 |
| OLD | NEW |