OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/simplified-operator.h" | 5 #include "src/compiler/simplified-operator.h" |
6 | 6 |
7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
10 #include "src/types.h" | 10 #include "src/types.h" |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 517 } |
518 UNREACHABLE(); | 518 UNREACHABLE(); |
519 return nullptr; | 519 return nullptr; |
520 } | 520 } |
521 | 521 |
522 #define SPECULATIVE_BINOP_DEF(Name) \ | 522 #define SPECULATIVE_BINOP_DEF(Name) \ |
523 const Operator* SimplifiedOperatorBuilder::Name( \ | 523 const Operator* SimplifiedOperatorBuilder::Name( \ |
524 BinaryOperationHints::Hint hint) { \ | 524 BinaryOperationHints::Hint hint) { \ |
525 return new (zone()) Operator1<BinaryOperationHints::Hint>( \ | 525 return new (zone()) Operator1<BinaryOperationHints::Hint>( \ |
526 IrOpcode::k##Name, Operator::kFoldable | Operator::kNoThrow, #Name, 2, \ | 526 IrOpcode::k##Name, Operator::kFoldable | Operator::kNoThrow, #Name, 2, \ |
527 1, 1, 1, 1, 1, hint); \ | 527 1, 1, 1, 1, 0, hint); \ |
528 } | 528 } |
529 SPECULATIVE_BINOP_LIST(SPECULATIVE_BINOP_DEF) | 529 SPECULATIVE_BINOP_LIST(SPECULATIVE_BINOP_DEF) |
530 #undef SPECULATIVE_BINOP_DEF | 530 #undef SPECULATIVE_BINOP_DEF |
531 | 531 |
532 const Operator* SimplifiedOperatorBuilder::SpeculativeNumberEqual( | 532 const Operator* SimplifiedOperatorBuilder::SpeculativeNumberEqual( |
533 CompareOperationHints::Hint hint) { | 533 CompareOperationHints::Hint hint) { |
534 return new (zone()) Operator1<CompareOperationHints::Hint>( | 534 return new (zone()) Operator1<CompareOperationHints::Hint>( |
535 IrOpcode::kSpeculativeNumberEqual, | 535 IrOpcode::kSpeculativeNumberEqual, |
536 Operator::kFoldable | Operator::kNoThrow, "SpeculativeNumberEqual", 2, 1, | 536 Operator::kFoldable | Operator::kNoThrow, "SpeculativeNumberEqual", 2, 1, |
537 1, 1, 1, 1, hint); | 537 1, 1, 1, 0, hint); |
538 } | 538 } |
539 | 539 |
540 const Operator* SimplifiedOperatorBuilder::SpeculativeNumberLessThan( | 540 const Operator* SimplifiedOperatorBuilder::SpeculativeNumberLessThan( |
541 CompareOperationHints::Hint hint) { | 541 CompareOperationHints::Hint hint) { |
542 return new (zone()) Operator1<CompareOperationHints::Hint>( | 542 return new (zone()) Operator1<CompareOperationHints::Hint>( |
543 IrOpcode::kSpeculativeNumberLessThan, | 543 IrOpcode::kSpeculativeNumberLessThan, |
544 Operator::kFoldable | Operator::kNoThrow, "SpeculativeNumberLessThan", 2, | 544 Operator::kFoldable | Operator::kNoThrow, "SpeculativeNumberLessThan", 2, |
545 1, 1, 1, 1, 1, hint); | 545 1, 1, 1, 1, 0, hint); |
546 } | 546 } |
547 | 547 |
548 const Operator* SimplifiedOperatorBuilder::SpeculativeNumberLessThanOrEqual( | 548 const Operator* SimplifiedOperatorBuilder::SpeculativeNumberLessThanOrEqual( |
549 CompareOperationHints::Hint hint) { | 549 CompareOperationHints::Hint hint) { |
550 return new (zone()) Operator1<CompareOperationHints::Hint>( | 550 return new (zone()) Operator1<CompareOperationHints::Hint>( |
551 IrOpcode::kSpeculativeNumberLessThanOrEqual, | 551 IrOpcode::kSpeculativeNumberLessThanOrEqual, |
552 Operator::kFoldable | Operator::kNoThrow, | 552 Operator::kFoldable | Operator::kNoThrow, |
553 "SpeculativeNumberLessThanOrEqual", 2, 1, 1, 1, 1, 1, hint); | 553 "SpeculativeNumberLessThanOrEqual", 2, 1, 1, 1, 1, 0, hint); |
554 } | 554 } |
555 | 555 |
556 #define ACCESS_OP_LIST(V) \ | 556 #define ACCESS_OP_LIST(V) \ |
557 V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1, 1) \ | 557 V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1, 1) \ |
558 V(StoreField, FieldAccess, Operator::kNoRead, 2, 1, 0) \ | 558 V(StoreField, FieldAccess, Operator::kNoRead, 2, 1, 0) \ |
559 V(LoadElement, ElementAccess, Operator::kNoWrite, 2, 1, 1) \ | 559 V(LoadElement, ElementAccess, Operator::kNoWrite, 2, 1, 1) \ |
560 V(StoreElement, ElementAccess, Operator::kNoRead, 3, 1, 0) | 560 V(StoreElement, ElementAccess, Operator::kNoRead, 3, 1, 0) |
561 | 561 |
562 #define ACCESS(Name, Type, properties, value_input_count, control_input_count, \ | 562 #define ACCESS(Name, Type, properties, value_input_count, control_input_count, \ |
563 output_count) \ | 563 output_count) \ |
564 const Operator* SimplifiedOperatorBuilder::Name(const Type& access) { \ | 564 const Operator* SimplifiedOperatorBuilder::Name(const Type& access) { \ |
565 return new (zone()) \ | 565 return new (zone()) \ |
566 Operator1<Type>(IrOpcode::k##Name, \ | 566 Operator1<Type>(IrOpcode::k##Name, \ |
567 Operator::kNoDeopt | Operator::kNoThrow | properties, \ | 567 Operator::kNoDeopt | Operator::kNoThrow | properties, \ |
568 #Name, value_input_count, 1, control_input_count, \ | 568 #Name, value_input_count, 1, control_input_count, \ |
569 output_count, 1, 0, access); \ | 569 output_count, 1, 0, access); \ |
570 } | 570 } |
571 ACCESS_OP_LIST(ACCESS) | 571 ACCESS_OP_LIST(ACCESS) |
572 #undef ACCESS | 572 #undef ACCESS |
573 | 573 |
574 } // namespace compiler | 574 } // namespace compiler |
575 } // namespace internal | 575 } // namespace internal |
576 } // namespace v8 | 576 } // namespace v8 |
OLD | NEW |