Chromium Code Reviews| Index: src/compiler/bytecode-analysis.h |
| diff --git a/src/compiler/bytecode-analysis.h b/src/compiler/bytecode-analysis.h |
| index f50b00f2c696ecd0acf07ef2d8c7276267555df4..902afdc57bee992d14c48f57adf8afb2439ec81a 100644 |
| --- a/src/compiler/bytecode-analysis.h |
| +++ b/src/compiler/bytecode-analysis.h |
| @@ -5,6 +5,9 @@ |
| #ifndef V8_COMPILER_BYTECODE_ANALYSIS_H_ |
| #define V8_COMPILER_BYTECODE_ANALYSIS_H_ |
| +#include "src/base/hashmap.h" |
| +#include "src/bit-vector.h" |
| +#include "src/compiler/bytecode-liveness-map.h" |
| #include "src/handles.h" |
| #include "src/zone/zone-containers.h" |
| @@ -15,9 +18,10 @@ class BytecodeArray; |
| namespace compiler { |
| -class BytecodeAnalysis BASE_EMBEDDED { |
| +class V8_EXPORT_PRIVATE BytecodeAnalysis BASE_EMBEDDED { |
| public: |
| - BytecodeAnalysis(Handle<BytecodeArray> bytecode_array, Zone* zone); |
| + BytecodeAnalysis(Handle<BytecodeArray> bytecode_array, Zone* zone, |
| + bool do_liveness_analysis); |
| // Analyze the bytecodes to find the loop ranges and nesting. No other |
| // methods in this class return valid information until this has been called. |
| @@ -32,13 +36,25 @@ class BytecodeAnalysis BASE_EMBEDDED { |
| // at {header_offset}, or -1 for outer-most loops. |
| int GetParentLoopFor(int header_offset) const; |
| + const BitVector* GetInLivenessFor(int offset) const; |
|
rmcilroy
2016/11/28 15:16:37
nit - comments for these functions
Leszek Swirski
2016/11/28 16:31:11
Done (also the location of the accumulator comment
|
| + |
| + const BitVector* GetOutLivenessFor(int offset) const; |
| + |
| + std::ostream& PrintLivenessTo(std::ostream& os) const; |
| + |
| private: |
| void PushLoop(int loop_header, int loop_end); |
| +#if DEBUG |
| + bool LivenessIsValid(); |
| +#endif |
| + |
| Zone* zone() const { return zone_; } |
| Handle<BytecodeArray> bytecode_array() const { return bytecode_array_; } |
| + private: |
| Handle<BytecodeArray> bytecode_array_; |
| + bool do_liveness_analysis_; |
| Zone* zone_; |
| ZoneStack<int> loop_stack_; |
| @@ -46,6 +62,8 @@ class BytecodeAnalysis BASE_EMBEDDED { |
| ZoneMap<int, int> end_to_header_; |
| ZoneMap<int, int> header_to_parent_; |
| + BytecodeLivenessMap liveness_map_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(BytecodeAnalysis); |
| }; |