| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 case IrOpcode::kNumberBitwiseAnd: | 421 case IrOpcode::kNumberBitwiseAnd: |
| 422 return machine()->Word32And(); | 422 return machine()->Word32And(); |
| 423 case IrOpcode::kNumberEqual: | 423 case IrOpcode::kNumberEqual: |
| 424 return machine()->Word32Equal(); | 424 return machine()->Word32Equal(); |
| 425 case IrOpcode::kNumberLessThan: | 425 case IrOpcode::kNumberLessThan: |
| 426 return machine()->Int32LessThan(); | 426 return machine()->Int32LessThan(); |
| 427 case IrOpcode::kNumberLessThanOrEqual: | 427 case IrOpcode::kNumberLessThanOrEqual: |
| 428 return machine()->Int32LessThanOrEqual(); | 428 return machine()->Int32LessThanOrEqual(); |
| 429 default: | 429 default: |
| 430 UNREACHABLE(); | 430 UNREACHABLE(); |
| 431 return NULL; | 431 return nullptr; |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 const Operator* RepresentationChanger::Uint32OperatorFor( | 436 const Operator* RepresentationChanger::Uint32OperatorFor( |
| 437 IrOpcode::Value opcode) { | 437 IrOpcode::Value opcode) { |
| 438 switch (opcode) { | 438 switch (opcode) { |
| 439 case IrOpcode::kNumberAdd: | 439 case IrOpcode::kNumberAdd: |
| 440 return machine()->Int32Add(); | 440 return machine()->Int32Add(); |
| 441 case IrOpcode::kNumberSubtract: | 441 case IrOpcode::kNumberSubtract: |
| 442 return machine()->Int32Sub(); | 442 return machine()->Int32Sub(); |
| 443 case IrOpcode::kNumberMultiply: | 443 case IrOpcode::kNumberMultiply: |
| 444 return machine()->Int32Mul(); | 444 return machine()->Int32Mul(); |
| 445 case IrOpcode::kNumberDivide: | 445 case IrOpcode::kNumberDivide: |
| 446 return machine()->Uint32Div(); | 446 return machine()->Uint32Div(); |
| 447 case IrOpcode::kNumberModulus: | 447 case IrOpcode::kNumberModulus: |
| 448 return machine()->Uint32Mod(); | 448 return machine()->Uint32Mod(); |
| 449 case IrOpcode::kNumberEqual: | 449 case IrOpcode::kNumberEqual: |
| 450 return machine()->Word32Equal(); | 450 return machine()->Word32Equal(); |
| 451 case IrOpcode::kNumberLessThan: | 451 case IrOpcode::kNumberLessThan: |
| 452 return machine()->Uint32LessThan(); | 452 return machine()->Uint32LessThan(); |
| 453 case IrOpcode::kNumberLessThanOrEqual: | 453 case IrOpcode::kNumberLessThanOrEqual: |
| 454 return machine()->Uint32LessThanOrEqual(); | 454 return machine()->Uint32LessThanOrEqual(); |
| 455 default: | 455 default: |
| 456 UNREACHABLE(); | 456 UNREACHABLE(); |
| 457 return NULL; | 457 return nullptr; |
| 458 } | 458 } |
| 459 } | 459 } |
| 460 | 460 |
| 461 | 461 |
| 462 const Operator* RepresentationChanger::Float64OperatorFor( | 462 const Operator* RepresentationChanger::Float64OperatorFor( |
| 463 IrOpcode::Value opcode) { | 463 IrOpcode::Value opcode) { |
| 464 switch (opcode) { | 464 switch (opcode) { |
| 465 case IrOpcode::kNumberAdd: | 465 case IrOpcode::kNumberAdd: |
| 466 return machine()->Float64Add(); | 466 return machine()->Float64Add(); |
| 467 case IrOpcode::kNumberSubtract: | 467 case IrOpcode::kNumberSubtract: |
| 468 return machine()->Float64Sub(); | 468 return machine()->Float64Sub(); |
| 469 case IrOpcode::kNumberMultiply: | 469 case IrOpcode::kNumberMultiply: |
| 470 return machine()->Float64Mul(); | 470 return machine()->Float64Mul(); |
| 471 case IrOpcode::kNumberDivide: | 471 case IrOpcode::kNumberDivide: |
| 472 return machine()->Float64Div(); | 472 return machine()->Float64Div(); |
| 473 case IrOpcode::kNumberModulus: | 473 case IrOpcode::kNumberModulus: |
| 474 return machine()->Float64Mod(); | 474 return machine()->Float64Mod(); |
| 475 case IrOpcode::kNumberEqual: | 475 case IrOpcode::kNumberEqual: |
| 476 return machine()->Float64Equal(); | 476 return machine()->Float64Equal(); |
| 477 case IrOpcode::kNumberLessThan: | 477 case IrOpcode::kNumberLessThan: |
| 478 return machine()->Float64LessThan(); | 478 return machine()->Float64LessThan(); |
| 479 case IrOpcode::kNumberLessThanOrEqual: | 479 case IrOpcode::kNumberLessThanOrEqual: |
| 480 return machine()->Float64LessThanOrEqual(); | 480 return machine()->Float64LessThanOrEqual(); |
| 481 default: | 481 default: |
| 482 UNREACHABLE(); | 482 UNREACHABLE(); |
| 483 return NULL; | 483 return nullptr; |
| 484 } | 484 } |
| 485 } | 485 } |
| 486 | 486 |
| 487 | 487 |
| 488 MachineSemantic RepresentationChanger::TypeFromUpperBound(Type* type) { | 488 MachineSemantic RepresentationChanger::TypeFromUpperBound(Type* type) { |
| 489 CHECK(!type->Is(Type::None())); | 489 CHECK(!type->Is(Type::None())); |
| 490 if (type->Is(Type::Signed32())) return MachineSemantic::kInt32; | 490 if (type->Is(Type::Signed32())) return MachineSemantic::kInt32; |
| 491 if (type->Is(Type::Unsigned32())) return MachineSemantic::kUint32; | 491 if (type->Is(Type::Unsigned32())) return MachineSemantic::kUint32; |
| 492 if (type->Is(Type::Number())) return MachineSemantic::kNumber; | 492 if (type->Is(Type::Number())) return MachineSemantic::kNumber; |
| 493 if (type->Is(Type::Boolean())) return MachineSemantic::kBool; | 493 if (type->Is(Type::Boolean())) return MachineSemantic::kBool; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 521 | 521 |
| 522 | 522 |
| 523 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { | 523 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { |
| 524 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), | 524 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), |
| 525 node); | 525 node); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace compiler | 528 } // namespace compiler |
| 529 } // namespace internal | 529 } // namespace internal |
| 530 } // namespace v8 | 530 } // namespace v8 |
| OLD | NEW |