5 #ifndef V8_COMPILER_BYTECODE_LIVENESS_MAP_H_ 6 #define V8_COMPILER_BYTECODE_LIVENESS_MAP_H_ 8 #include "src/base/hashmap.h" 9 #include "src/bit-vector.h" 10 #include "src/zone/zone.h" 22 : bit_vector_(register_count + 1, zone) {}
24 const BitVector& bit_vector()
const {
return bit_vector_; }
26 BitVector& bit_vector() {
return bit_vector_; }
28 bool RegisterIsLive(
int index)
const {
30 DCHECK_LT(index, bit_vector_.length() - 1);
31 return bit_vector_.Contains(index);
34 bool AccumulatorIsLive()
const {
35 return bit_vector_.Contains(bit_vector_.length() - 1);
39 return bit_vector_.Equals(other.bit_vector_);
42 void MarkRegisterLive(
int index) {
44 DCHECK_LT(index, bit_vector_.length() - 1);
45 bit_vector_.Add(index);
48 void MarkRegisterDead(
int index) {
50 DCHECK_LT(index, bit_vector_.length() - 1);
51 bit_vector_.Remove(index);
54 void MarkAccumulatorLive() { bit_vector_.Add(bit_vector_.length() - 1); }
56 void MarkAccumulatorDead() { bit_vector_.Remove(bit_vector_.length() - 1); }
58 void MarkAllLive() { bit_vector_.AddAll(); }
61 bit_vector_.Union(other.bit_vector_);
65 return bit_vector_.UnionIsChanged(other.bit_vector_);
69 bit_vector_.CopyFrom(other.bit_vector_);
96 return GetLiveness(offset).in;
99 return GetLiveness(offset).in;
103 return GetLiveness(offset).out;
106 return GetLiveness(offset).out;
119 #endif // V8_COMPILER_BYTECODE_LIVENESS_MAP_H_