| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Try to create a new copy of the constant with the new representation. | 52 // Try to create a new copy of the constant with the new representation. |
| 53 if (is_truncating_to_int && to.IsInteger32()) { | 53 if (is_truncating_to_int && to.IsInteger32()) { |
| 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 if (((to.IsFloat32x4() || to.IsInt32x4()) && |
| 63 value, to, is_truncating_to_smi, is_truncating_to_int); | 63 !value->representation().IsTagged()) || |
| 64 ((value->representation().IsFloat32x4() || |
| 65 value->representation().IsInt32x4()) && |
| 66 !to.IsTagged())) { |
| 67 new_value = HUnarySIMDOperation::New(graph()->zone(), |
| 68 graph()->entry_block()->last_environment()->context(), |
| 69 value, kFloat32x4OrInt32x4Change, to); |
| 70 } else { |
| 71 new_value = new(graph()->zone()) HChange( |
| 72 value, to, is_truncating_to_smi, is_truncating_to_int); |
| 73 } |
| 64 if (use_value->operand_position(use_index) != RelocInfo::kNoPosition) { | 74 if (use_value->operand_position(use_index) != RelocInfo::kNoPosition) { |
| 65 new_value->set_position(use_value->operand_position(use_index)); | 75 new_value->set_position(use_value->operand_position(use_index)); |
| 66 } else { | 76 } else { |
| 67 ASSERT(!FLAG_emit_opt_code_positions || !graph()->info()->IsOptimizing()); | 77 ASSERT(!FLAG_emit_opt_code_positions || !graph()->info()->IsOptimizing()); |
| 68 } | 78 } |
| 69 } | 79 } |
| 70 | 80 |
| 71 new_value->InsertBefore(next); | 81 new_value->InsertBefore(next); |
| 72 use_value->SetOperandAt(use_index, new_value); | 82 use_value->SetOperandAt(use_index, new_value); |
| 73 } | 83 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // Process normal instructions. | 198 // Process normal instructions. |
| 189 for (HInstruction* current = block->first(); current != NULL; ) { | 199 for (HInstruction* current = block->first(); current != NULL; ) { |
| 190 HInstruction* next = current->next(); | 200 HInstruction* next = current->next(); |
| 191 InsertRepresentationChangesForValue(current); | 201 InsertRepresentationChangesForValue(current); |
| 192 current = next; | 202 current = next; |
| 193 } | 203 } |
| 194 } | 204 } |
| 195 } | 205 } |
| 196 | 206 |
| 197 } } // namespace v8::internal | 207 } } // namespace v8::internal |
| OLD | NEW |