| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 case IrOpcode::kNumberLessThanOrEqual: | 464 case IrOpcode::kNumberLessThanOrEqual: |
| 465 return machine()->Float64LessThanOrEqual(); | 465 return machine()->Float64LessThanOrEqual(); |
| 466 default: | 466 default: |
| 467 UNREACHABLE(); | 467 UNREACHABLE(); |
| 468 return NULL; | 468 return NULL; |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 | 471 |
| 472 | 472 |
| 473 MachineType RepresentationChanger::TypeFromUpperBound(Type* type) { | 473 MachineType RepresentationChanger::TypeFromUpperBound(Type* type) { |
| 474 if (type->Is(Type::None())) | 474 CHECK(!type->Is(Type::None())); |
| 475 return kTypeAny; // TODO(titzer): should be an error | |
| 476 if (type->Is(Type::Signed32())) return kTypeInt32; | 475 if (type->Is(Type::Signed32())) return kTypeInt32; |
| 477 if (type->Is(Type::Unsigned32())) return kTypeUint32; | 476 if (type->Is(Type::Unsigned32())) return kTypeUint32; |
| 478 if (type->Is(Type::Number())) return kTypeNumber; | 477 if (type->Is(Type::Number())) return kTypeNumber; |
| 479 if (type->Is(Type::Boolean())) return kTypeBool; | 478 if (type->Is(Type::Boolean())) return kTypeBool; |
| 480 return kTypeAny; | 479 return kTypeAny; |
| 481 } | 480 } |
| 482 | 481 |
| 483 | 482 |
| 484 Node* RepresentationChanger::TypeError(Node* node, MachineTypeUnion output_type, | 483 Node* RepresentationChanger::TypeError(Node* node, MachineTypeUnion output_type, |
| 485 MachineTypeUnion use) { | 484 MachineTypeUnion use) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 507 | 506 |
| 508 | 507 |
| 509 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { | 508 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { |
| 510 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), | 509 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), |
| 511 node); | 510 node); |
| 512 } | 511 } |
| 513 | 512 |
| 514 } // namespace compiler | 513 } // namespace compiler |
| 515 } // namespace internal | 514 } // namespace internal |
| 516 } // namespace v8 | 515 } // namespace v8 |
| OLD | NEW |