| 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 #ifndef V8_COMPILER_BYTECODE_ANALYSIS_H_ | 5 #ifndef V8_COMPILER_BYTECODE_ANALYSIS_H_ |
| 6 #define V8_COMPILER_BYTECODE_ANALYSIS_H_ | 6 #define V8_COMPILER_BYTECODE_ANALYSIS_H_ |
| 7 | 7 |
| 8 #include "src/base/hashmap.h" | 8 #include "src/base/hashmap.h" |
| 9 #include "src/bit-vector.h" | 9 #include "src/bit-vector.h" |
| 10 #include "src/compiler/bytecode-liveness-map.h" | 10 #include "src/compiler/bytecode-liveness-map.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Return true if the given offset is a loop header | 30 // Return true if the given offset is a loop header |
| 31 bool IsLoopHeader(int offset) const; | 31 bool IsLoopHeader(int offset) const; |
| 32 // Get the loop header offset of the containing loop for arbitrary | 32 // Get the loop header offset of the containing loop for arbitrary |
| 33 // {offset}, or -1 if the {offset} is not inside any loop. | 33 // {offset}, or -1 if the {offset} is not inside any loop. |
| 34 int GetLoopOffsetFor(int offset) const; | 34 int GetLoopOffsetFor(int offset) const; |
| 35 // Gets the loop header offset of the parent loop of the loop header | 35 // Gets the loop header offset of the parent loop of the loop header |
| 36 // at {header_offset}, or -1 for outer-most loops. | 36 // at {header_offset}, or -1 for outer-most loops. |
| 37 int GetParentLoopFor(int header_offset) const; | 37 int GetParentLoopFor(int header_offset) const; |
| 38 | 38 |
| 39 // Gets the in-liveness for the bytecode at {offset}. The liveness bit vector | 39 // Gets the in-liveness for the bytecode at {offset}. |
| 40 // represents the liveness of the registers and the accumulator, with the last | 40 const BytecodeLivenessState* GetInLivenessFor(int offset) const; |
| 41 // bit being the accumulator liveness bit, and so is (register count + 1) bits | |
| 42 // long. | |
| 43 const BitVector* GetInLivenessFor(int offset) const; | |
| 44 | 41 |
| 45 // Gets the out-liveness for the bytecode at {offset}. The liveness bit vector | 42 // Gets the out-liveness for the bytecode at {offset}. |
| 46 // represents the liveness of the registers and the accumulator, with the last | 43 const BytecodeLivenessState* GetOutLivenessFor(int offset) const; |
| 47 // bit being the accumulator liveness bit, and so is (register count + 1) bits | |
| 48 // long. | |
| 49 const BitVector* GetOutLivenessFor(int offset) const; | |
| 50 | 44 |
| 51 std::ostream& PrintLivenessTo(std::ostream& os) const; | 45 std::ostream& PrintLivenessTo(std::ostream& os) const; |
| 52 | 46 |
| 53 private: | 47 private: |
| 54 void PushLoop(int loop_header, int loop_end); | 48 void PushLoop(int loop_header, int loop_end); |
| 55 | 49 |
| 56 #if DEBUG | 50 #if DEBUG |
| 57 bool LivenessIsValid(); | 51 bool LivenessIsValid(); |
| 58 #endif | 52 #endif |
| 59 | 53 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 74 BytecodeLivenessMap liveness_map_; | 68 BytecodeLivenessMap liveness_map_; |
| 75 | 69 |
| 76 DISALLOW_COPY_AND_ASSIGN(BytecodeAnalysis); | 70 DISALLOW_COPY_AND_ASSIGN(BytecodeAnalysis); |
| 77 }; | 71 }; |
| 78 | 72 |
| 79 } // namespace compiler | 73 } // namespace compiler |
| 80 } // namespace internal | 74 } // namespace internal |
| 81 } // namespace v8 | 75 } // namespace v8 |
| 82 | 76 |
| 83 #endif // V8_COMPILER_BYTECODE_ANALYSIS_H_ | 77 #endif // V8_COMPILER_BYTECODE_ANALYSIS_H_ |
| OLD | NEW |