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_LOOP_ANALYSIS_H_ | 5 #ifndef V8_COMPILER_BYTECODE_LOOP_ANALYSIS_H_ |
6 #define V8_COMPILER_BYTECODE_LOOP_ANALYSIS_H_ | 6 #define V8_COMPILER_BYTECODE_LOOP_ANALYSIS_H_ |
7 | 7 |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/zone-containers.h" | 9 #include "src/zone-containers.h" |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 void AddBranch(int origin_offset, int target_offset); | 40 void AddBranch(int origin_offset, int target_offset); |
41 | 41 |
42 Zone* zone() const { return zone_; } | 42 Zone* zone() const { return zone_; } |
43 Handle<BytecodeArray> bytecode_array() const { return bytecode_array_; } | 43 Handle<BytecodeArray> bytecode_array() const { return bytecode_array_; } |
44 | 44 |
45 Handle<BytecodeArray> bytecode_array_; | 45 Handle<BytecodeArray> bytecode_array_; |
46 const BytecodeBranchAnalysis* branch_analysis_; | 46 const BytecodeBranchAnalysis* branch_analysis_; |
47 Zone* zone_; | 47 Zone* zone_; |
48 | 48 |
49 int current_loop_offset_; | 49 int current_loop_offset_; |
| 50 bool found_current_backedge_; |
50 | 51 |
51 // Map from the offset of a backedge jump to the offset of the corresponding | 52 // Map from the offset of a backedge jump to the offset of the corresponding |
52 // loop header. Since we assume exactly one backedge per loop, the map will | 53 // loop header. There might be multiple backedges for do-while loops. |
53 // have as many entries as there are loops. | |
54 ZoneMap<int, int> backedge_to_header_; | 54 ZoneMap<int, int> backedge_to_header_; |
55 // Map from the offset of a loop header to the offset of its parent's loop | 55 // Map from the offset of a loop header to the offset of its parent's loop |
56 // header. This map will have as many entries as there are loops in the | 56 // header. This map will have as many entries as there are loops in the |
57 // function. | 57 // function. |
58 ZoneMap<int, int> loop_header_to_parent_; | 58 ZoneMap<int, int> loop_header_to_parent_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(BytecodeLoopAnalysis); | 60 DISALLOW_COPY_AND_ASSIGN(BytecodeLoopAnalysis); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace compiler | 63 } // namespace compiler |
64 } // namespace internal | 64 } // namespace internal |
65 } // namespace v8 | 65 } // namespace v8 |
66 | 66 |
67 #endif // V8_COMPILER_BYTECODE_LOOP_ANALYSIS_H_ | 67 #endif // V8_COMPILER_BYTECODE_LOOP_ANALYSIS_H_ |
OLD | NEW |