28 #ifndef V8_DATAFLOW_H_
29 #define V8_DATAFLOW_H_
49 current_value_(target->data_[0]),
51 ASSERT(target->data_length_ > 0);
56 bool Done()
const {
return current_index_ >= target_->data_length_; }
65 uint32_t SkipZeroBytes(uint32_t val) {
66 while ((val & 0xFF) == 0) {
72 uint32_t SkipZeroBits(uint32_t val) {
73 while ((val & 0x1) == 0) {
82 uint32_t current_value_;
91 data_(zone->
NewArray<uint32_t>(data_length_)) {
99 data_(zone->
NewArray<uint32_t>(data_length_)) {
104 return 1 + ((length - 1) / 32);
114 for (
int i = 0; i < other.data_length_; i++) {
115 data_[i] = other.data_[i];
117 for (
int i = other.data_length_; i < data_length_; i++) {
124 uint32_t block = data_[i / 32];
125 return (block & (1
U << (i % 32))) != 0;
130 data_[i / 32] |= (1
U << (i % 32));
135 data_[i / 32] &= ~(1
U << (i % 32));
140 for (
int i = 0; i < data_length_; i++) {
141 data_[i] |= other.data_[i];
147 bool changed =
false;
148 for (
int i = 0; i < data_length_; i++) {
149 uint32_t old_data = data_[i];
150 data_[i] |= other.data_[i];
151 if (data_[i] != old_data) changed =
true;
158 for (
int i = 0; i < data_length_; i++) {
159 data_[i] &= other.data_[i];
165 for (
int i = 0; i < data_length_; i++) {
166 data_[i] &= ~other.data_[i];
171 for (
int i = 0; i < data_length_; i++) {
177 for (
int i = 0; i < data_length_; i++) {
178 if (data_[i] != 0)
return false;
184 for (
int i = 0; i < data_length_; i++) {
185 if (data_[i] != other.data_[i])
return false;
205 #endif // V8_DATAFLOW_H_
static int SizeFor(int length)
void Intersect(const BitVector &other)
Iterator(BitVector *target)
#define ASSERT(condition)
v8::Handle< v8::Value > Print(const v8::Arguments &args)
bool Contains(int i) const
T * NewArray(size_t size)
bool UnionIsChanged(const BitVector &other)
void CopyFrom(const BitVector &other)
void Union(const BitVector &other)
BitVector & operator=(const BitVector &rhs)
bool Equals(const BitVector &other)
BitVector(const BitVector &other, Zone *zone)
void Subtract(const BitVector &other)
BitVector(int length, Zone *zone)