| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2321 Bailout("Unsupported phi use of uninitialized constant"); | 2321 Bailout("Unsupported phi use of uninitialized constant"); |
| 2322 return NULL; | 2322 return NULL; |
| 2323 } | 2323 } |
| 2324 | 2324 |
| 2325 HInferRepresentation rep(graph()); | 2325 HInferRepresentation rep(graph()); |
| 2326 rep.Analyze(); | 2326 rep.Analyze(); |
| 2327 | 2327 |
| 2328 graph()->MarkDeoptimizeOnUndefined(); | 2328 graph()->MarkDeoptimizeOnUndefined(); |
| 2329 graph()->InsertRepresentationChanges(); | 2329 graph()->InsertRepresentationChanges(); |
| 2330 | 2330 |
| 2331 if (FLAG_use_range) { | |
| 2332 HRangeAnalysis rangeAnalysis(graph()); | |
| 2333 rangeAnalysis.Analyze(); | |
| 2334 } | |
| 2335 graph()->InitializeInferredTypes(); | 2331 graph()->InitializeInferredTypes(); |
| 2336 graph()->Canonicalize(); | 2332 graph()->Canonicalize(); |
| 2337 graph()->ComputeMinusZeroChecks(); | |
| 2338 | |
| 2339 // Eliminate redundant stack checks on backwards branches. | |
| 2340 HStackCheckEliminator sce(graph()); | |
| 2341 sce.Process(); | |
| 2342 | 2333 |
| 2343 // Perform common subexpression elimination and loop-invariant code motion. | 2334 // Perform common subexpression elimination and loop-invariant code motion. |
| 2344 if (FLAG_use_gvn) { | 2335 if (FLAG_use_gvn) { |
| 2345 HPhase phase("Global value numbering", graph()); | 2336 HPhase phase("Global value numbering", graph()); |
| 2346 HGlobalValueNumberer gvn(graph(), info()); | 2337 HGlobalValueNumberer gvn(graph(), info()); |
| 2347 gvn.Analyze(); | 2338 gvn.Analyze(); |
| 2348 } | 2339 } |
| 2349 | 2340 |
| 2341 if (FLAG_use_range) { |
| 2342 HRangeAnalysis rangeAnalysis(graph()); |
| 2343 rangeAnalysis.Analyze(); |
| 2344 } |
| 2345 graph()->ComputeMinusZeroChecks(); |
| 2346 |
| 2347 // Eliminate redundant stack checks on backwards branches. |
| 2348 HStackCheckEliminator sce(graph()); |
| 2349 sce.Process(); |
| 2350 |
| 2350 // Replace the results of check instructions with the original value, if the | 2351 // Replace the results of check instructions with the original value, if the |
| 2351 // result is used. This is safe now, since we don't do code motion after this | 2352 // result is used. This is safe now, since we don't do code motion after this |
| 2352 // point. It enables better register allocation since the value produced by | 2353 // point. It enables better register allocation since the value produced by |
| 2353 // check instructions is really a copy of the original value. | 2354 // check instructions is really a copy of the original value. |
| 2354 graph()->ReplaceCheckedValues(); | 2355 graph()->ReplaceCheckedValues(); |
| 2355 | 2356 |
| 2356 return graph(); | 2357 return graph(); |
| 2357 } | 2358 } |
| 2358 | 2359 |
| 2359 | 2360 |
| (...skipping 4390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6750 } | 6751 } |
| 6751 } | 6752 } |
| 6752 | 6753 |
| 6753 #ifdef DEBUG | 6754 #ifdef DEBUG |
| 6754 if (graph_ != NULL) graph_->Verify(); | 6755 if (graph_ != NULL) graph_->Verify(); |
| 6755 if (allocator_ != NULL) allocator_->Verify(); | 6756 if (allocator_ != NULL) allocator_->Verify(); |
| 6756 #endif | 6757 #endif |
| 6757 } | 6758 } |
| 6758 | 6759 |
| 6759 } } // namespace v8::internal | 6760 } } // namespace v8::internal |
| OLD | NEW |