OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_COMPILER_BYTECODE_LIVENESS_MAP_H_ |
| 6 #define V8_COMPILER_BYTECODE_LIVENESS_MAP_H_ |
| 7 |
| 8 #include "src/base/hashmap.h" |
| 9 #include "src/bit-vector.h" |
| 10 #include "src/zone/zone.h" |
| 11 |
| 12 namespace v8 { |
| 13 namespace internal { |
| 14 |
| 15 class Zone; |
| 16 |
| 17 namespace compiler { |
| 18 |
| 19 struct Liveness { |
| 20 BitVector* in; |
| 21 BitVector* out; |
| 22 |
| 23 Liveness(int size, Zone* zone); |
| 24 }; |
| 25 |
| 26 class V8_EXPORT_PRIVATE BytecodeLivenessMap { |
| 27 public: |
| 28 BytecodeLivenessMap(int size, Zone* zone); |
| 29 |
| 30 Liveness& InitializeLiveness(int offset, int size, Zone* zone); |
| 31 |
| 32 Liveness& GetLiveness(int offset); |
| 33 const Liveness& GetLiveness(int offset) const; |
| 34 |
| 35 BitVector* GetInLiveness(int offset) { return GetLiveness(offset).in; } |
| 36 const BitVector* GetInLiveness(int offset) const { |
| 37 return GetLiveness(offset).in; |
| 38 } |
| 39 |
| 40 BitVector* GetOutLiveness(int offset) { return GetLiveness(offset).out; } |
| 41 const BitVector* GetOutLiveness(int offset) const { |
| 42 return GetLiveness(offset).out; |
| 43 } |
| 44 |
| 45 private: |
| 46 base::TemplateHashMapImpl<int, Liveness, base::KeyEqualityMatcher<int>, |
| 47 ZoneAllocationPolicy> |
| 48 liveness_map_; |
| 49 }; |
| 50 |
| 51 } // namespace compiler |
| 52 } // namespace internal |
| 53 } // namespace v8 |
| 54 |
| 55 #endif // V8_COMPILER_BYTECODE_LIVENESS_MAP_H_ |
OLD | NEW |