| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 265 |
| 266 FunctionLiteral* fun_; | 266 FunctionLiteral* fun_; |
| 267 | 267 |
| 268 // Accumulator for assigned variables set. | 268 // Accumulator for assigned variables set. |
| 269 BitVector av_; | 269 BitVector av_; |
| 270 | 270 |
| 271 DISALLOW_COPY_AND_ASSIGN(AssignedVariablesAnalyzer); | 271 DISALLOW_COPY_AND_ASSIGN(AssignedVariablesAnalyzer); |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 | 274 |
| 275 class ReachingDefinitions BASE_EMBEDDED { | |
| 276 public: | |
| 277 ReachingDefinitions(ZoneList<Node*>* postorder, | |
| 278 ZoneList<Expression*>* body_definitions, | |
| 279 int variable_count) | |
| 280 : postorder_(postorder), | |
| 281 body_definitions_(body_definitions), | |
| 282 variable_count_(variable_count) { | |
| 283 } | |
| 284 | |
| 285 static int IndexFor(Variable* var, int variable_count); | |
| 286 | |
| 287 void Compute(); | |
| 288 | |
| 289 private: | |
| 290 // A (postorder) list of flow-graph nodes in the body. | |
| 291 ZoneList<Node*>* postorder_; | |
| 292 | |
| 293 // A list of all the definitions in the body. | |
| 294 ZoneList<Expression*>* body_definitions_; | |
| 295 | |
| 296 int variable_count_; | |
| 297 | |
| 298 DISALLOW_COPY_AND_ASSIGN(ReachingDefinitions); | |
| 299 }; | |
| 300 | |
| 301 | |
| 302 class TypeAnalyzer BASE_EMBEDDED { | |
| 303 public: | |
| 304 TypeAnalyzer(ZoneList<Node*>* postorder, | |
| 305 ZoneList<Expression*>* body_definitions, | |
| 306 int variable_count, | |
| 307 int param_count) | |
| 308 : postorder_(postorder), | |
| 309 body_definitions_(body_definitions), | |
| 310 variable_count_(variable_count), | |
| 311 param_count_(param_count) {} | |
| 312 | |
| 313 void Compute(); | |
| 314 | |
| 315 private: | |
| 316 // Get the primitity of definition number i. Definitions are numbered | |
| 317 // by the flow graph builder. | |
| 318 bool IsPrimitiveDef(int def_num); | |
| 319 | |
| 320 ZoneList<Node*>* postorder_; | |
| 321 ZoneList<Expression*>* body_definitions_; | |
| 322 int variable_count_; | |
| 323 int param_count_; | |
| 324 | |
| 325 DISALLOW_COPY_AND_ASSIGN(TypeAnalyzer); | |
| 326 }; | |
| 327 | |
| 328 | |
| 329 void MarkLiveCode(ZoneList<Node*>* nodes, | |
| 330 ZoneList<Expression*>* body_definitions, | |
| 331 int variable_count); | |
| 332 | |
| 333 | |
| 334 } } // namespace v8::internal | 275 } } // namespace v8::internal |
| 335 | 276 |
| 336 | 277 |
| 337 #endif // V8_DATAFLOW_H_ | 278 #endif // V8_DATAFLOW_H_ |
| OLD | NEW |