| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2873 } | 2873 } |
| 2874 } | 2874 } |
| 2875 | 2875 |
| 2876 // Simplify constant phi inputs where possible. | 2876 // Simplify constant phi inputs where possible. |
| 2877 // This step uses kTruncatingToInt32 flags of phis. | 2877 // This step uses kTruncatingToInt32 flags of phis. |
| 2878 for (int i = 0; i < phi_count; ++i) { | 2878 for (int i = 0; i < phi_count; ++i) { |
| 2879 phi_list->at(i)->SimplifyConstantInputs(); | 2879 phi_list->at(i)->SimplifyConstantInputs(); |
| 2880 } | 2880 } |
| 2881 | 2881 |
| 2882 // Use the phi reachability information from step 2 to | 2882 // Use the phi reachability information from step 2 to |
| 2883 // push information about values which can't be converted to integer | |
| 2884 // without deoptimization through the phi use-def chains, avoiding | |
| 2885 // unnecessary deoptimizations later. | |
| 2886 for (int i = 0; i < phi_count; ++i) { | |
| 2887 HPhi* phi = phi_list->at(i); | |
| 2888 bool cti = phi->AllOperandsConvertibleToInteger(); | |
| 2889 if (cti) continue; | |
| 2890 | |
| 2891 for (BitVector::Iterator it(connected_phis.at(i)); | |
| 2892 !it.Done(); | |
| 2893 it.Advance()) { | |
| 2894 HPhi* phi = phi_list->at(it.Current()); | |
| 2895 phi->set_is_convertible_to_integer(false); | |
| 2896 } | |
| 2897 } | |
| 2898 | |
| 2899 // Use the phi reachability information from step 2 to | |
| 2900 // sum up the non-phi use counts of all connected phis. | 2883 // sum up the non-phi use counts of all connected phis. |
| 2901 for (int i = 0; i < phi_count; ++i) { | 2884 for (int i = 0; i < phi_count; ++i) { |
| 2902 HPhi* phi = phi_list->at(i); | 2885 HPhi* phi = phi_list->at(i); |
| 2903 for (BitVector::Iterator it(connected_phis.at(i)); | 2886 for (BitVector::Iterator it(connected_phis.at(i)); |
| 2904 !it.Done(); | 2887 !it.Done(); |
| 2905 it.Advance()) { | 2888 it.Advance()) { |
| 2906 int index = it.Current(); | 2889 int index = it.Current(); |
| 2907 HPhi* it_use = phi_list->at(index); | 2890 HPhi* it_use = phi_list->at(index); |
| 2908 if (index != i) phi->AddNonPhiUsesFrom(it_use); // Don't count twice. | 2891 if (index != i) phi->AddNonPhiUsesFrom(it_use); // Don't count twice. |
| 2909 } | 2892 } |
| (...skipping 8588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11498 } | 11481 } |
| 11499 } | 11482 } |
| 11500 | 11483 |
| 11501 #ifdef DEBUG | 11484 #ifdef DEBUG |
| 11502 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11485 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 11503 if (allocator_ != NULL) allocator_->Verify(); | 11486 if (allocator_ != NULL) allocator_->Verify(); |
| 11504 #endif | 11487 #endif |
| 11505 } | 11488 } |
| 11506 | 11489 |
| 11507 } } // namespace v8::internal | 11490 } } // namespace v8::internal |
| OLD | NEW |