| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { | 120 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { |
| 121 // If a Phi is used as a non-truncating int32 or as a double, | 121 // If a Phi is used as a non-truncating int32 or as a double, |
| 122 // clear its "truncating" flag. | 122 // clear its "truncating" flag. |
| 123 HValue* use = it.value(); | 123 HValue* use = it.value(); |
| 124 Representation input_representation = | 124 Representation input_representation = |
| 125 use->RequiredInputRepresentation(it.index()); | 125 use->RequiredInputRepresentation(it.index()); |
| 126 if ((phi->representation().IsInteger32() && | 126 if ((phi->representation().IsInteger32() && |
| 127 !(input_representation.IsInteger32() && | 127 !(input_representation.IsInteger32() && |
| 128 use->CheckFlag(HValue::kTruncatingToInt32))) || | 128 use->CheckFlag(HValue::kTruncatingToInt32))) || |
| 129 (phi->representation().IsSmi() && | 129 (phi->representation().IsSmi() && |
| 130 !(input_representation.IsSmi() || | 130 !(input_representation.IsSmi() && |
| 131 use->CheckFlag(HValue::kTruncatingToSmi)))) { | 131 use->CheckFlag(HValue::kTruncatingToSmi)))) { |
| 132 if (FLAG_trace_representation) { | 132 if (FLAG_trace_representation) { |
| 133 PrintF("#%d Phi is not truncating because of #%d %s\n", | 133 PrintF("#%d Phi is not truncating because of #%d %s\n", |
| 134 phi->id(), it.value()->id(), it.value()->Mnemonic()); | 134 phi->id(), it.value()->id(), it.value()->Mnemonic()); |
| 135 } | 135 } |
| 136 phi->ClearFlag(HValue::kTruncatingToInt32); | 136 phi->ClearFlag(HValue::kTruncatingToInt32); |
| 137 phi->ClearFlag(HValue::kTruncatingToSmi); | 137 phi->ClearFlag(HValue::kTruncatingToSmi); |
| 138 worklist.Add(phi, zone()); | 138 worklist.Add(phi, zone()); |
| 139 break; | 139 break; |
| 140 } | 140 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Process normal instructions. | 173 // Process normal instructions. |
| 174 for (HInstruction* current = block->first(); current != NULL; ) { | 174 for (HInstruction* current = block->first(); current != NULL; ) { |
| 175 HInstruction* next = current->next(); | 175 HInstruction* next = current->next(); |
| 176 InsertRepresentationChangesForValue(current); | 176 InsertRepresentationChangesForValue(current); |
| 177 current = next; | 177 current = next; |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 } } // namespace v8::internal | 182 } } // namespace v8::internal |
| OLD | NEW |