| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 bool Equals(const BitVector& other) { | 123 bool Equals(const BitVector& other) { |
| 124 for (int i = 0; i < data_length_; i++) { | 124 for (int i = 0; i < data_length_; i++) { |
| 125 if (data_[i] != other.data_[i]) return false; | 125 if (data_[i] != other.data_[i]) return false; |
| 126 } | 126 } |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 | 129 |
| 130 int length() const { return length_; } | 130 int length() const { return length_; } |
| 131 | 131 |
| 132 #ifdef DEBUG |
| 133 void Print(); |
| 134 #endif |
| 135 |
| 132 private: | 136 private: |
| 133 int length_; | 137 int length_; |
| 134 int data_length_; | 138 int data_length_; |
| 135 uint32_t* data_; | 139 uint32_t* data_; |
| 136 }; | 140 }; |
| 137 | 141 |
| 138 | 142 |
| 139 // Simple fixed-capacity list-based worklist (managed as a queue) of | 143 // Simple fixed-capacity list-based worklist (managed as a queue) of |
| 140 // pointers to T. | 144 // pointers to T. |
| 141 template<typename T> | 145 template<typename T> |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 int number() { return number_; } | 232 int number() { return number_; } |
| 229 void set_number(int number) { number_ = number; } | 233 void set_number(int number) { number_ = number; } |
| 230 | 234 |
| 231 // Functions used by data-flow analyses. | 235 // Functions used by data-flow analyses. |
| 232 virtual void InitializeReachingDefinitions(int definition_count, | 236 virtual void InitializeReachingDefinitions(int definition_count, |
| 233 List<BitVector*>* variables, | 237 List<BitVector*>* variables, |
| 234 WorkList<Node>* worklist, | 238 WorkList<Node>* worklist, |
| 235 bool mark); | 239 bool mark); |
| 236 virtual void ComputeRDOut(BitVector* result) = 0; | 240 virtual void ComputeRDOut(BitVector* result) = 0; |
| 237 virtual void UpdateRDIn(WorkList<Node>* worklist, bool mark) = 0; | 241 virtual void UpdateRDIn(WorkList<Node>* worklist, bool mark) = 0; |
| 242 virtual void PropagateReachingDefinitions(List<BitVector*>* variables); |
| 238 | 243 |
| 239 #ifdef DEBUG | 244 #ifdef DEBUG |
| 240 void AssignNodeNumber(); | 245 void AssignNodeNumber(); |
| 241 void PrintReachingDefinitions(); | 246 void PrintReachingDefinitions(); |
| 242 virtual void PrintText() = 0; | 247 virtual void PrintText() = 0; |
| 243 #endif | 248 #endif |
| 244 | 249 |
| 245 protected: | 250 protected: |
| 246 ReachingDefinitionsData rd_; | 251 ReachingDefinitionsData rd_; |
| 247 | 252 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 void Traverse(bool mark, | 322 void Traverse(bool mark, |
| 318 ZoneList<Node*>* preorder, | 323 ZoneList<Node*>* preorder, |
| 319 ZoneList<Node*>* postorder); | 324 ZoneList<Node*>* postorder); |
| 320 | 325 |
| 321 void InitializeReachingDefinitions(int definition_count, | 326 void InitializeReachingDefinitions(int definition_count, |
| 322 List<BitVector*>* variables, | 327 List<BitVector*>* variables, |
| 323 WorkList<Node>* worklist, | 328 WorkList<Node>* worklist, |
| 324 bool mark); | 329 bool mark); |
| 325 void ComputeRDOut(BitVector* result); | 330 void ComputeRDOut(BitVector* result); |
| 326 void UpdateRDIn(WorkList<Node>* worklist, bool mark); | 331 void UpdateRDIn(WorkList<Node>* worklist, bool mark); |
| 332 void PropagateReachingDefinitions(List<BitVector*>* variables); |
| 327 | 333 |
| 328 #ifdef DEBUG | 334 #ifdef DEBUG |
| 329 void PrintText(); | 335 void PrintText(); |
| 330 #endif | 336 #endif |
| 331 | 337 |
| 332 private: | 338 private: |
| 333 Node* predecessor_; | 339 Node* predecessor_; |
| 334 Node* successor_; | 340 Node* successor_; |
| 335 ZoneList<AstNode*> instructions_; | 341 ZoneList<AstNode*> instructions_; |
| 336 | 342 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 List<BitVector*> variables_; | 664 List<BitVector*> variables_; |
| 659 | 665 |
| 660 DISALLOW_COPY_AND_ASSIGN(ReachingDefinitions); | 666 DISALLOW_COPY_AND_ASSIGN(ReachingDefinitions); |
| 661 }; | 667 }; |
| 662 | 668 |
| 663 | 669 |
| 664 } } // namespace v8::internal | 670 } } // namespace v8::internal |
| 665 | 671 |
| 666 | 672 |
| 667 #endif // V8_DATAFLOW_H_ | 673 #endif // V8_DATAFLOW_H_ |
| OLD | NEW |