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/compiler/types.h" | 10 #include "src/compiler/types.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 StringFromCodePointOperator<UnicodeEncoding::UTF32> | 488 StringFromCodePointOperator<UnicodeEncoding::UTF32> |
489 kStringFromCodePointOperatorUTF32; | 489 kStringFromCodePointOperatorUTF32; |
490 | 490 |
491 struct ArrayBufferWasNeuteredOperator final : public Operator { | 491 struct ArrayBufferWasNeuteredOperator final : public Operator { |
492 ArrayBufferWasNeuteredOperator() | 492 ArrayBufferWasNeuteredOperator() |
493 : Operator(IrOpcode::kArrayBufferWasNeutered, Operator::kEliminatable, | 493 : Operator(IrOpcode::kArrayBufferWasNeutered, Operator::kEliminatable, |
494 "ArrayBufferWasNeutered", 1, 1, 1, 1, 1, 0) {} | 494 "ArrayBufferWasNeutered", 1, 1, 1, 1, 1, 0) {} |
495 }; | 495 }; |
496 ArrayBufferWasNeuteredOperator kArrayBufferWasNeutered; | 496 ArrayBufferWasNeuteredOperator kArrayBufferWasNeutered; |
497 | 497 |
498 struct LoadFunctionPrototypeOperator final : public Operator { | |
499 LoadFunctionPrototypeOperator() | |
500 : Operator(IrOpcode::kLoadFunctionPrototype, Operator::kEliminatable, | |
501 "LoadFunctionPrototype", 1, 1, 1, 1, 1, 0) {} | |
502 }; | |
503 LoadFunctionPrototypeOperator kLoadFunctionPrototype; | |
504 | |
505 template <CheckForMinusZeroMode kMode> | 498 template <CheckForMinusZeroMode kMode> |
506 struct CheckedInt32MulOperator final | 499 struct CheckedInt32MulOperator final |
507 : public Operator1<CheckForMinusZeroMode> { | 500 : public Operator1<CheckForMinusZeroMode> { |
508 CheckedInt32MulOperator() | 501 CheckedInt32MulOperator() |
509 : Operator1<CheckForMinusZeroMode>( | 502 : Operator1<CheckForMinusZeroMode>( |
510 IrOpcode::kCheckedInt32Mul, | 503 IrOpcode::kCheckedInt32Mul, |
511 Operator::kFoldable | Operator::kNoThrow, "CheckedInt32Mul", 2, 1, | 504 Operator::kFoldable | Operator::kNoThrow, "CheckedInt32Mul", 2, 1, |
512 1, 1, 1, 0, kMode) {} | 505 1, 1, 1, 0, kMode) {} |
513 }; | 506 }; |
514 CheckedInt32MulOperator<CheckForMinusZeroMode::kCheckForMinusZero> | 507 CheckedInt32MulOperator<CheckForMinusZeroMode::kCheckForMinusZero> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 632 |
640 | 633 |
641 SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone) | 634 SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone) |
642 : cache_(kCache.Get()), zone_(zone) {} | 635 : cache_(kCache.Get()), zone_(zone) {} |
643 | 636 |
644 #define GET_FROM_CACHE(Name, ...) \ | 637 #define GET_FROM_CACHE(Name, ...) \ |
645 const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; } | 638 const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; } |
646 PURE_OP_LIST(GET_FROM_CACHE) | 639 PURE_OP_LIST(GET_FROM_CACHE) |
647 CHECKED_OP_LIST(GET_FROM_CACHE) | 640 CHECKED_OP_LIST(GET_FROM_CACHE) |
648 GET_FROM_CACHE(ArrayBufferWasNeutered) | 641 GET_FROM_CACHE(ArrayBufferWasNeutered) |
649 GET_FROM_CACHE(LoadFunctionPrototype) | |
650 #undef GET_FROM_CACHE | 642 #undef GET_FROM_CACHE |
651 | 643 |
652 const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul( | 644 const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul( |
653 CheckForMinusZeroMode mode) { | 645 CheckForMinusZeroMode mode) { |
654 switch (mode) { | 646 switch (mode) { |
655 case CheckForMinusZeroMode::kCheckForMinusZero: | 647 case CheckForMinusZeroMode::kCheckForMinusZero: |
656 return &cache_.kCheckedInt32MulCheckForMinusZeroOperator; | 648 return &cache_.kCheckedInt32MulCheckForMinusZeroOperator; |
657 case CheckForMinusZeroMode::kDontCheckForMinusZero: | 649 case CheckForMinusZeroMode::kDontCheckForMinusZero: |
658 return &cache_.kCheckedInt32MulDontCheckForMinusZeroOperator; | 650 return &cache_.kCheckedInt32MulDontCheckForMinusZeroOperator; |
659 } | 651 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 Operator::kNoDeopt | Operator::kNoThrow | properties, \ | 820 Operator::kNoDeopt | Operator::kNoThrow | properties, \ |
829 #Name, value_input_count, 1, control_input_count, \ | 821 #Name, value_input_count, 1, control_input_count, \ |
830 output_count, 1, 0, access); \ | 822 output_count, 1, 0, access); \ |
831 } | 823 } |
832 ACCESS_OP_LIST(ACCESS) | 824 ACCESS_OP_LIST(ACCESS) |
833 #undef ACCESS | 825 #undef ACCESS |
834 | 826 |
835 } // namespace compiler | 827 } // namespace compiler |
836 } // namespace internal | 828 } // namespace internal |
837 } // namespace v8 | 829 } // namespace v8 |
OLD | NEW |