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 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 // (Before each HEnterInlined, there is a non-foldable HSimulate | 3003 // (Before each HEnterInlined, there is a non-foldable HSimulate |
3004 // anyway, so we get the barrier in the other direction for free.) | 3004 // anyway, so we get the barrier in the other direction for free.) |
3005 // Simply remove all accumulated simulates without merging. This | 3005 // Simply remove all accumulated simulates without merging. This |
3006 // is safe because simulates after instructions with side effects | 3006 // is safe because simulates after instructions with side effects |
3007 // are never added to the merge list. | 3007 // are never added to the merge list. |
3008 while (!mergelist.is_empty()) { | 3008 while (!mergelist.is_empty()) { |
3009 mergelist.RemoveLast()->DeleteAndReplaceWith(NULL); | 3009 mergelist.RemoveLast()->DeleteAndReplaceWith(NULL); |
3010 } | 3010 } |
3011 continue; | 3011 continue; |
3012 } | 3012 } |
| 3013 if (current->IsReturn()) { |
| 3014 // Drop mergeable simulates in the list. This is safe because |
| 3015 // simulates after instructions with side effects are never added |
| 3016 // to the merge list. |
| 3017 while (!mergelist.is_empty()) { |
| 3018 mergelist.RemoveLast()->DeleteAndReplaceWith(NULL); |
| 3019 } |
| 3020 continue; |
| 3021 } |
3013 // Skip the non-simulates and the first simulate. | 3022 // Skip the non-simulates and the first simulate. |
3014 if (!current->IsSimulate()) continue; | 3023 if (!current->IsSimulate()) continue; |
3015 if (first) { | 3024 if (first) { |
3016 first = false; | 3025 first = false; |
3017 continue; | 3026 continue; |
3018 } | 3027 } |
3019 HSimulate* current_simulate = HSimulate::cast(current); | 3028 HSimulate* current_simulate = HSimulate::cast(current); |
3020 if ((current_simulate->previous()->HasObservableSideEffects() && | 3029 if ((current_simulate->previous()->HasObservableSideEffects() && |
3021 !current_simulate->next()->IsSimulate()) || | 3030 !current_simulate->next()->IsSimulate()) || |
3022 !current_simulate->is_candidate_for_removal()) { | 3031 !current_simulate->is_candidate_for_removal()) { |
(...skipping 8588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11611 } | 11620 } |
11612 } | 11621 } |
11613 | 11622 |
11614 #ifdef DEBUG | 11623 #ifdef DEBUG |
11615 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11624 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
11616 if (allocator_ != NULL) allocator_->Verify(); | 11625 if (allocator_ != NULL) allocator_->Verify(); |
11617 #endif | 11626 #endif |
11618 } | 11627 } |
11619 | 11628 |
11620 } } // namespace v8::internal | 11629 } } // namespace v8::internal |
OLD | NEW |