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;
207 : it_(target->bits_ ==
NULL
210 bool Done()
const {
return it_.Done(); }
214 BitVector::Iterator it_;
219 : bits_(new(zone)
BitVector(length, zone)) { }
222 if (!InBitsRange(value))
return false;
223 return bits_->Contains(value);
227 EnsureCapacity(value, zone);
231 void Union(
const GrowableBitVector& other,
Zone* zone) {
232 for (Iterator it(&other, zone); !it.Done(); it.Advance()) {
233 Add(it.Current(), zone);
240 static const int kInitialLength = 1024;
242 bool InBitsRange(
int value)
const {
243 return bits_ !=
NULL && bits_->length() > value;
246 void EnsureCapacity(
int value, Zone* zone) {
247 if (InBitsRange(value))
return;
248 int new_length = bits_ ==
NULL ? kInitialLength : bits_->length();
249 while (new_length <= value) new_length *= 2;
250 BitVector* new_bits =
new(zone) BitVector(new_length, zone);
251 if (bits_ !=
NULL) new_bits->CopyFrom(*bits_);
262 #endif // V8_DATAFLOW_H_
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
GrowableBitVector(int length, Zone *zone)
void Add(int value, Zone *zone)
static int SizeFor(int length)
void Intersect(const BitVector &other)
Iterator(BitVector *target)
#define ASSERT(condition)
bool Contains(int i) const
T * NewArray(size_t size)
bool UnionIsChanged(const BitVector &other)
Iterator(const GrowableBitVector *target, Zone *zone)
void CopyFrom(const BitVector &other)
void Union(const BitVector &other)
BitVector & operator=(const BitVector &rhs)
void Union(const GrowableBitVector &other, Zone *zone)
bool Equals(const BitVector &other)
BitVector(const BitVector &other, Zone *zone)
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
void Subtract(const BitVector &other)
bool Contains(int value) const
BitVector(int length, Zone *zone)