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