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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 Maybe<HConstant*> res = constant->CopyToTruncatedInt32(graph()->zone()); | 54 Maybe<HConstant*> res = constant->CopyToTruncatedInt32(graph()->zone()); |
55 if (res.has_value) new_value = res.value; | 55 if (res.has_value) new_value = res.value; |
56 } else { | 56 } else { |
57 new_value = constant->CopyToRepresentation(to, graph()->zone()); | 57 new_value = constant->CopyToRepresentation(to, graph()->zone()); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 if (new_value == NULL) { | 61 if (new_value == NULL) { |
62 new_value = new(graph()->zone()) HChange( | 62 new_value = new(graph()->zone()) HChange( |
63 value, to, is_truncating_to_smi, is_truncating_to_int); | 63 value, to, is_truncating_to_smi, is_truncating_to_int); |
| 64 if (use_value->position() != RelocInfo::kNoPosition) { |
| 65 new_value->set_position(use_value->position()); |
| 66 } else { |
| 67 ASSERT(!FLAG_opt_code_positions || !graph()->info()->IsOptimizing()); |
| 68 } |
64 } | 69 } |
65 | 70 |
66 new_value->InsertBefore(next); | 71 new_value->InsertBefore(next); |
67 use_value->SetOperandAt(use_index, new_value); | 72 use_value->SetOperandAt(use_index, new_value); |
68 } | 73 } |
69 | 74 |
70 | 75 |
71 void HRepresentationChangesPhase::InsertRepresentationChangesForValue( | 76 void HRepresentationChangesPhase::InsertRepresentationChangesForValue( |
72 HValue* value) { | 77 HValue* value) { |
73 Representation r = value->representation(); | 78 Representation r = value->representation(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // Process normal instructions. | 188 // Process normal instructions. |
184 for (HInstruction* current = block->first(); current != NULL; ) { | 189 for (HInstruction* current = block->first(); current != NULL; ) { |
185 HInstruction* next = current->next(); | 190 HInstruction* next = current->next(); |
186 InsertRepresentationChangesForValue(current); | 191 InsertRepresentationChangesForValue(current); |
187 current = next; | 192 current = next; |
188 } | 193 } |
189 } | 194 } |
190 } | 195 } |
191 | 196 |
192 } } // namespace v8::internal | 197 } } // namespace v8::internal |
OLD | NEW |