| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/representation-change.h" | 5 #include "src/compiler/representation-change.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 node = InsertConversion(node, op, use_node); | 264 node = InsertConversion(node, op, use_node); |
| 265 if (SmiValuesAre32Bits()) { | 265 if (SmiValuesAre32Bits()) { |
| 266 op = simplified()->ChangeInt32ToTagged(); | 266 op = simplified()->ChangeInt32ToTagged(); |
| 267 } else { | 267 } else { |
| 268 op = simplified()->CheckedInt32ToTaggedSigned(); | 268 op = simplified()->CheckedInt32ToTaggedSigned(); |
| 269 } | 269 } |
| 270 } else { | 270 } else { |
| 271 return TypeError(node, output_rep, output_type, | 271 return TypeError(node, output_rep, output_type, |
| 272 MachineRepresentation::kTaggedSigned); | 272 MachineRepresentation::kTaggedSigned); |
| 273 } | 273 } |
| 274 } else if (CanBeTaggedPointer(output_rep) && | 274 } else if (CanBeTaggedPointer(output_rep)) { |
| 275 use_info.type_check() == TypeCheckKind::kSignedSmall) { | 275 if (use_info.type_check() == TypeCheckKind::kSignedSmall) { |
| 276 op = simplified()->CheckedTaggedToTaggedSigned(); | 276 op = simplified()->CheckedTaggedToTaggedSigned(); |
| 277 } else if (output_type->Is(Type::SignedSmall())) { |
| 278 op = simplified()->ChangeTaggedToTaggedSigned(); |
| 279 } else { |
| 280 return TypeError(node, output_rep, output_type, |
| 281 MachineRepresentation::kTaggedSigned); |
| 282 } |
| 277 } else if (output_rep == MachineRepresentation::kBit && | 283 } else if (output_rep == MachineRepresentation::kBit && |
| 278 use_info.type_check() == TypeCheckKind::kSignedSmall) { | 284 use_info.type_check() == TypeCheckKind::kSignedSmall) { |
| 279 // TODO(turbofan): Consider adding a Bailout operator that just deopts. | 285 // TODO(turbofan): Consider adding a Bailout operator that just deopts. |
| 280 // Also use that for MachineRepresentation::kPointer case above. | 286 // Also use that for MachineRepresentation::kPointer case above. |
| 281 node = InsertChangeBitToTagged(node); | 287 node = InsertChangeBitToTagged(node); |
| 282 op = simplified()->CheckedTaggedToTaggedSigned(); | 288 op = simplified()->CheckedTaggedToTaggedSigned(); |
| 283 } else { | 289 } else { |
| 284 return TypeError(node, output_rep, output_type, | 290 return TypeError(node, output_rep, output_type, |
| 285 MachineRepresentation::kTaggedSigned); | 291 MachineRepresentation::kTaggedSigned); |
| 286 } | 292 } |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 node); | 1036 node); |
| 1031 } | 1037 } |
| 1032 | 1038 |
| 1033 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { | 1039 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { |
| 1034 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); | 1040 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); |
| 1035 } | 1041 } |
| 1036 | 1042 |
| 1037 } // namespace compiler | 1043 } // namespace compiler |
| 1038 } // namespace internal | 1044 } // namespace internal |
| 1039 } // namespace v8 | 1045 } // namespace v8 |
| OLD | NEW |