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 #ifndef V8_INTERPRETER_BYTECODES_H_ | 5 #ifndef V8_INTERPRETER_BYTECODES_H_ |
6 #define V8_INTERPRETER_BYTECODES_H_ | 6 #define V8_INTERPRETER_BYTECODES_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <string> | 10 #include <string> |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 bytecode == Bytecode::kCallProperty1 || | 633 bytecode == Bytecode::kCallProperty1 || |
634 bytecode == Bytecode::kCallProperty2 || | 634 bytecode == Bytecode::kCallProperty2 || |
635 bytecode == Bytecode::kCallUndefinedReceiver || | 635 bytecode == Bytecode::kCallUndefinedReceiver || |
636 bytecode == Bytecode::kCallUndefinedReceiver0 || | 636 bytecode == Bytecode::kCallUndefinedReceiver0 || |
637 bytecode == Bytecode::kCallUndefinedReceiver1 || | 637 bytecode == Bytecode::kCallUndefinedReceiver1 || |
638 bytecode == Bytecode::kCallUndefinedReceiver2 || | 638 bytecode == Bytecode::kCallUndefinedReceiver2 || |
639 bytecode == Bytecode::kTailCall || | 639 bytecode == Bytecode::kTailCall || |
640 bytecode == Bytecode::kConstruct || | 640 bytecode == Bytecode::kConstruct || |
641 bytecode == Bytecode::kCallWithSpread || | 641 bytecode == Bytecode::kCallWithSpread || |
642 bytecode == Bytecode::kConstructWithSpread || | 642 bytecode == Bytecode::kConstructWithSpread || |
643 bytecode == Bytecode::kInvokeIntrinsic || | |
644 bytecode == Bytecode::kCallJSRuntime; | 643 bytecode == Bytecode::kCallJSRuntime; |
645 } | 644 } |
646 | 645 |
647 // Returns true if the bytecode is a call to the runtime. | 646 // Returns true if the bytecode is a call to the runtime. |
648 static constexpr bool IsCallRuntime(Bytecode bytecode) { | 647 static constexpr bool IsCallRuntime(Bytecode bytecode) { |
649 return bytecode == Bytecode::kCallRuntime || | 648 return bytecode == Bytecode::kCallRuntime || |
650 bytecode == Bytecode::kCallRuntimeForPair || | 649 bytecode == Bytecode::kCallRuntimeForPair || |
651 bytecode == Bytecode::kInvokeIntrinsic; | 650 bytecode == Bytecode::kInvokeIntrinsic; |
652 } | 651 } |
653 | 652 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
745 | 744 |
746 // Returns the equivalent jump bytecode without the accumulator coercion. | 745 // Returns the equivalent jump bytecode without the accumulator coercion. |
747 static Bytecode GetJumpWithoutToBoolean(Bytecode bytecode); | 746 static Bytecode GetJumpWithoutToBoolean(Bytecode bytecode); |
748 | 747 |
749 // Returns true if there is a call in the most-frequently executed path | 748 // Returns true if there is a call in the most-frequently executed path |
750 // through the bytecode's handler. | 749 // through the bytecode's handler. |
751 static bool MakesCallAlongCriticalPath(Bytecode bytecode); | 750 static bool MakesCallAlongCriticalPath(Bytecode bytecode); |
752 | 751 |
753 // Returns the receiver mode of the given call bytecode. | 752 // Returns the receiver mode of the given call bytecode. |
754 static ConvertReceiverMode GetReceiverMode(Bytecode bytecode) { | 753 static ConvertReceiverMode GetReceiverMode(Bytecode bytecode) { |
755 DCHECK(IsCallOrConstruct(bytecode)); | 754 DCHECK(IsCallOrConstruct(bytecode) || |
755 bytecode == Bytecode::kInvokeIntrinsic); | |
rmcilroy
2017/05/05 09:44:11
please remove this and the kInvokeIntrinsic in the
mvstanton
2017/05/05 11:50:26
This is a side-effect of the location identified w
rmcilroy
2017/05/05 13:50:32
Right, makes sense, thanks for checking.
| |
756 switch (bytecode) { | 756 switch (bytecode) { |
757 case Bytecode::kCallProperty: | 757 case Bytecode::kCallProperty: |
758 case Bytecode::kCallProperty0: | 758 case Bytecode::kCallProperty0: |
759 case Bytecode::kCallProperty1: | 759 case Bytecode::kCallProperty1: |
760 case Bytecode::kCallProperty2: | 760 case Bytecode::kCallProperty2: |
761 return ConvertReceiverMode::kNotNullOrUndefined; | 761 return ConvertReceiverMode::kNotNullOrUndefined; |
762 case Bytecode::kCallUndefinedReceiver: | 762 case Bytecode::kCallUndefinedReceiver: |
763 case Bytecode::kCallUndefinedReceiver0: | 763 case Bytecode::kCallUndefinedReceiver0: |
764 case Bytecode::kCallUndefinedReceiver1: | 764 case Bytecode::kCallUndefinedReceiver1: |
765 case Bytecode::kCallUndefinedReceiver2: | 765 case Bytecode::kCallUndefinedReceiver2: |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
878 }; | 878 }; |
879 | 879 |
880 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, | 880 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
881 const Bytecode& bytecode); | 881 const Bytecode& bytecode); |
882 | 882 |
883 } // namespace interpreter | 883 } // namespace interpreter |
884 } // namespace internal | 884 } // namespace internal |
885 } // namespace v8 | 885 } // namespace v8 |
886 | 886 |
887 #endif // V8_INTERPRETER_BYTECODES_H_ | 887 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |