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 #ifndef V8_COMPILER_FRAME_ELIDER_H_ | 5 #ifndef V8_COMPILER_FRAME_ELIDER_H_ |
6 #define V8_COMPILER_FRAME_ELIDER_H_ | 6 #define V8_COMPILER_FRAME_ELIDER_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 | 14 |
15 // Determine which instruction blocks need a frame and where frames must be | 15 // Determine which instruction blocks need a frame and where frames must be |
16 // constructed/deconstructed. | 16 // constructed/deconstructed. |
17 class FrameElider { | 17 class FrameElider { |
18 public: | 18 public: |
19 explicit FrameElider(InstructionSequence* code); | 19 explicit FrameElider(InstructionSequence* code); |
20 void Run(); | 20 void Run(const CallDescriptor* descriptor); |
21 | |
22 | 21 |
23 private: | 22 private: |
24 void MarkBlocks(); | 23 void MarkBlocks(); |
25 void PropagateMarks(); | 24 void PropagateMarks(); |
26 void MarkDeConstruction(); | 25 void MarkDeConstruction(); |
27 bool PropagateInOrder(); | 26 bool PropagateInOrder(); |
28 bool PropagateReversed(); | 27 bool PropagateReversed(); |
29 bool PropagateIntoBlock(InstructionBlock* block); | 28 bool PropagateIntoBlock(InstructionBlock* block); |
30 const InstructionBlocks& instruction_blocks() const; | 29 const InstructionBlocks& instruction_blocks() const; |
31 InstructionBlock* InstructionBlockAt(RpoNumber rpo_number) const; | 30 InstructionBlock* InstructionBlockAt(RpoNumber rpo_number) const; |
32 Instruction* InstructionAt(int index) const; | 31 Instruction* InstructionAt(int index) const; |
33 | 32 |
34 InstructionSequence* const code_; | 33 InstructionSequence* const code_; |
35 }; | 34 }; |
36 | 35 |
37 } // namespace compiler | 36 } // namespace compiler |
38 } // namespace internal | 37 } // namespace internal |
39 } // namespace v8 | 38 } // namespace v8 |
40 | 39 |
41 #endif // V8_COMPILER_FRAME_ELIDER_H_ | 40 #endif // V8_COMPILER_FRAME_ELIDER_H_ |
OLD | NEW |