101 template<
class Var,
class Base,
class Effects>
108 return this->Find(var, &locator)
121 if (!this->Insert(var, &locator)) {
122 effect =
Effect::Seq(locator.value(), effect, Base::zone());
124 locator.set_value(effect);
128 SeqMerger<EffectsMixin> merge = { *
this };
135 if (!this->Insert(var, &locator)) {
136 effect =
Effect::Alt(locator.value(), effect, Base::zone());
138 locator.set_value(effect);
142 AltWeakener<EffectsMixin> weaken = { *
this, that };
143 this->ForEach(&weaken);
144 AltMerger<EffectsMixin> merge = { *
this };
150 Overrider
override = {
152 this->ForEach(&
override);
153 Seq(
override.effects);
177 self.Insert(var, &locator);
178 locator.set_value(effect);
193 template<
class Var, Var kNoVar>
class Effects;
196 template<
class Var, Var kNoVar>
215 static int Compare(
int x,
int y) {
return y - x; }
218 typedef typename Mapping::Locator
Locator;
226 return map_->
Find(var, locator);
230 return map_->
Insert(var, locator);
233 template<
class Callback>
234 void ForEach(Callback* callback) {
235 return map_->
ForEach(callback);
242 template<
class Var, Var kNoVar>
245 template<
class Var, Var kNoVar>
246 class Effects:
public
247 EffectsMixin<Var, EffectsBase<Var, kNoVar>, Effects<Var, kNoVar> > {
255 template<
class Var, Var kNoVar>
256 class NestedEffectsBase {
260 template<
class Callback>
263 node_->effects.ForEach(callback);
269 for (Node* node = node_; node !=
NULL; node = node->previous) {
270 if (!node->effects.IsEmpty())
return false;
280 void push() { node_ =
new(node_->zone) Node(node_->zone, node_); }
281 void pop() { node_ = node_->previous; }
286 for (Node* node = node_; node !=
NULL; node = node->previous) {
287 if (node->effects.Contains(var))
return true;
294 for (Node* node = node_; node !=
NULL; node = node->previous) {
295 if (node->effects.Find(var, locator))
return true;
308 : zone(zone), effects(zone), previous(previous) {}
317 template<
class Var, Var kNoVar>
320 if (!node_->effects.Insert(var, locator))
return false;
322 for (Node* node = node_->previous; node !=
NULL; node = node->previous) {
323 if (node->effects.Find(var, &shadowed)) {
325 locator->set_value(shadowed.value());
333 template<
class Var, Var kNoVar>
335 EffectsMixin<Var, NestedEffectsBase<Var, kNoVar>, Effects<Var, kNoVar> > {
352 ASSERT(!this->is_empty());
359 #endif // V8_EFFECTS_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
void Call(Var var, Effect effect)
Bounds LookupBounds(Var var)
bool Find(const Key &key, Locator *locator)
bool Insert(const Key &key, Locator *locator)
void ForEach(Callback *callback)
NestedEffects(Zone *zone)
bool Contains(const Key &key)
void ForEach(Callback *callback)
Effect(Bounds b, Modality m=DEFINITE)
void Alt(Var var, Effect effect)
#define ASSERT(condition)
NestedEffectsBase(Zone *zone)
EffectsBase< Var, kNoVar >::Locator Locator
bool Find(Var var, Locator *locator)
void Call(Var var, Effect effect)
static int Compare(int x, int y)
bool Insert(Var var, Locator *locator)
static BoundsImpl Either(BoundsImpl b1, BoundsImpl b2, Region *region)
void Call(Var var, Effect effect)
void Seq(Var var, Effect effect)
AllocationPolicy allocator()
static Effect Seq(Effect e1, Effect e2, Zone *zone)
void Call(Var var, Effect effect)
Effects< Var, kNoVar > Top()
bool Find(Var var, Locator *locator)
static BoundsImpl Unbounded(Region *region)
static Effect Unknown(Zone *zone)
ZoneSplayTree< SplayTreeConfig > Mapping
void ForEach(Callback *callback)
static Effect Alt(Effect e1, Effect e2, Zone *zone)
static Effect Forget(Zone *zone)
bool Insert(Var var, Locator *locator)