| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_EFFECTS_H_ | 5 #ifndef V8_EFFECTS_H_ |
| 6 #define V8_EFFECTS_H_ | 6 #define V8_EFFECTS_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast-types.h" | 8 #include "src/ast/ast-types.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 DCHECK(var != kNoVar); | 268 DCHECK(var != kNoVar); |
| 269 for (Node* node = node_; node != NULL; node = node->previous) { | 269 for (Node* node = node_; node != NULL; node = node->previous) { |
| 270 if (node->effects.Find(var, locator)) return true; | 270 if (node->effects.Find(var, locator)) return true; |
| 271 } | 271 } |
| 272 return false; | 272 return false; |
| 273 } | 273 } |
| 274 | 274 |
| 275 bool Insert(Var var, Locator* locator); | 275 bool Insert(Var var, Locator* locator); |
| 276 | 276 |
| 277 private: | 277 private: |
| 278 struct Node: ZoneObject { | 278 struct Node : ZoneObject { |
| 279 Zone* zone; | 279 Zone* zone; |
| 280 Effects<Var, kNoVar> effects; | 280 Effects<Var, kNoVar> effects; |
| 281 Node* previous; | 281 Node* previous; |
| 282 explicit Node(Zone* zone, Node* previous = NULL) | 282 explicit Node(Zone* zone, Node* previous = NULL) |
| 283 : zone(zone), effects(zone), previous(previous) {} | 283 : zone(zone), effects(zone), previous(previous) {} |
| 284 }; | 284 }; |
| 285 | 285 |
| 286 explicit NestedEffectsBase(Node* node) : node_(node) {} | 286 explicit NestedEffectsBase(Node* node) : node_(node) {} |
| 287 | 287 |
| 288 Node* node_; | 288 Node* node_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 result.pop(); | 326 result.pop(); |
| 327 DCHECK(!this->is_empty()); | 327 DCHECK(!this->is_empty()); |
| 328 return result; | 328 return result; |
| 329 } | 329 } |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 } // namespace internal | 332 } // namespace internal |
| 333 } // namespace v8 | 333 } // namespace v8 |
| 334 | 334 |
| 335 #endif // V8_EFFECTS_H_ | 335 #endif // V8_EFFECTS_H_ |
| OLD | NEW |