Lines Matching defs:Bytecode

545 enum class Bytecode : uint8_t {
564 static const int kBytecodeCount = static_cast<int>(Bytecode::kLast) + 1;
567 static_cast<int>(Bytecode::kLastShortStar) -
568 static_cast<int>(Bytecode::kFirstShortStar) + 1;
571 static const char* ToString(Bytecode bytecode);
575 static std::string ToString(Bytecode bytecode, OperandScale operand_scale,
579 static uint8_t ToByte(Bytecode bytecode) {
580 DCHECK_LE(bytecode, Bytecode::kLast);
585 static Bytecode FromByte(uint8_t value) {
586 Bytecode bytecode = static_cast<Bytecode>(value);
587 DCHECK_LE(bytecode, Bytecode::kLast);
593 static Bytecode OperandScaleToPrefixBytecode(OperandScale operand_scale) {
596 return Bytecode::kExtraWide;
598 return Bytecode::kWide;
611 static OperandScale PrefixBytecodeToOperandScale(Bytecode bytecode) {
613 case Bytecode::kExtraWide:
614 case Bytecode::kDebugBreakExtraWide:
616 case Bytecode::kWide:
617 case Bytecode::kDebugBreakWide:
625 static ImplicitRegisterUse GetImplicitRegisterUse(Bytecode bytecode) {
626 DCHECK_LE(bytecode, Bytecode::kLast);
631 static bool ReadsAccumulator(Bytecode bytecode) {
636 static bool WritesAccumulator(Bytecode bytecode) {
643 static bool WritesImplicitRegister(Bytecode bytecode) {
650 static constexpr bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) {
651 STATIC_ASSERT(Bytecode::kLdar < Bytecode::kLdaImmutableCurrentContextSlot);
652 return bytecode >= Bytecode::kLdar &&
653 bytecode <= Bytecode::kLdaImmutableCurrentContextSlot;
658 static constexpr bool IsCompareWithoutEffects(Bytecode bytecode) {
659 STATIC_ASSERT(Bytecode::kTestReferenceEqual < Bytecode::kTestTypeOf);
660 return bytecode >= Bytecode::kTestReferenceEqual &&
661 bytecode <= Bytecode::kTestTypeOf;
664 static constexpr bool IsShortStar(Bytecode bytecode) {
665 return bytecode >= Bytecode::kFirstShortStar &&
666 bytecode <= Bytecode::kLastShortStar;
669 static constexpr bool IsAnyStar(Bytecode bytecode) {
670 return bytecode == Bytecode::kStar || IsShortStar(bytecode);
675 static constexpr bool IsRegisterLoadWithoutEffects(Bytecode bytecode) {
677 (bytecode >= Bytecode::kStar && bytecode <= Bytecode::kPopContext);
682 static constexpr bool IsConditionalJumpImmediate(Bytecode bytecode) {
683 return bytecode >= Bytecode::kJumpIfToBooleanTrue &&
684 bytecode <= Bytecode::kJumpIfJSReceiver;
689 static constexpr bool IsConditionalJumpConstant(Bytecode bytecode) {
690 return bytecode >= Bytecode::kJumpIfNullConstant &&
691 bytecode <= Bytecode::kJumpIfToBooleanFalseConstant;
696 static constexpr bool IsConditionalJump(Bytecode bytecode) {
697 return bytecode >= Bytecode::kJumpIfNullConstant &&
698 bytecode <= Bytecode::kJumpIfJSReceiver;
702 static constexpr bool IsUnconditionalJump(Bytecode bytecode) {
703 return bytecode >= Bytecode::kJumpLoop &&
704 bytecode <= Bytecode::kJumpConstant;
709 static constexpr bool IsJumpImmediate(Bytecode bytecode) {
710 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpLoop ||
716 static constexpr bool IsJumpConstant(Bytecode bytecode) {
717 return bytecode >= Bytecode::kJumpConstant &&
718 bytecode <= Bytecode::kJumpIfToBooleanFalseConstant;
723 static constexpr bool IsJumpIfToBoolean(Bytecode bytecode) {
724 return bytecode >= Bytecode::kJumpIfToBooleanTrueConstant &&
725 bytecode <= Bytecode::kJumpIfToBooleanFalse;
730 static constexpr bool IsJump(Bytecode bytecode) {
731 return bytecode >= Bytecode::kJumpLoop &&
732 bytecode <= Bytecode::kJumpIfJSReceiver;
737 static constexpr bool IsForwardJump(Bytecode bytecode) {
738 return bytecode >= Bytecode::kJump &&
739 bytecode <= Bytecode::kJumpIfJSReceiver;
745 static constexpr bool IsJumpWithoutEffects(Bytecode bytecode) {
747 bytecode != Bytecode::kJumpLoop;
751 static constexpr bool IsSwitch(Bytecode bytecode) {
752 return bytecode == Bytecode::kSwitchOnSmiNoFeedback ||
753 bytecode == Bytecode::kSwitchOnGeneratorState;
758 static constexpr bool IsWithoutExternalSideEffects(Bytecode bytecode) {
766 static constexpr bool IsLdarOrStar(Bytecode bytecode) {
767 return bytecode == Bytecode::kLdar || IsAnyStar(bytecode);
771 static constexpr bool IsCallOrConstruct(Bytecode bytecode) {
772 return bytecode == Bytecode::kCallAnyReceiver ||
773 bytecode == Bytecode::kCallProperty ||
774 bytecode == Bytecode::kCallProperty0 ||
775 bytecode == Bytecode::kCallProperty1 ||
776 bytecode == Bytecode::kCallProperty2 ||
777 bytecode == Bytecode::kCallUndefinedReceiver ||
778 bytecode == Bytecode::kCallUndefinedReceiver0 ||
779 bytecode == Bytecode::kCallUndefinedReceiver1 ||
780 bytecode == Bytecode::kCallUndefinedReceiver2 ||
781 bytecode == Bytecode::kConstruct ||
782 bytecode == Bytecode::kCallWithSpread ||
783 bytecode == Bytecode::kConstructWithSpread ||
784 bytecode == Bytecode::kCallJSRuntime;
788 static constexpr bool IsCallRuntime(Bytecode bytecode) {
789 return bytecode == Bytecode::kCallRuntime ||
790 bytecode == Bytecode::kCallRuntimeForPair ||
791 bytecode == Bytecode::kInvokeIntrinsic;
795 static constexpr bool IsPrefixScalingBytecode(Bytecode bytecode) {
796 return bytecode == Bytecode::kExtraWide || bytecode == Bytecode::kWide ||
797 bytecode == Bytecode::kDebugBreakExtraWide ||
798 bytecode == Bytecode::kDebugBreakWide;
802 static constexpr bool Returns(Bytecode bytecode) {
803 #define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME
809 static constexpr bool UnconditionallyThrows(Bytecode bytecode) {
810 #define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME
816 static int NumberOfOperands(Bytecode bytecode) {
817 DCHECK_LE(bytecode, Bytecode::kLast);
822 static OperandType GetOperandType(Bytecode bytecode, int i) {
823 DCHECK_LE(bytecode, Bytecode::kLast);
831 static const OperandType* GetOperandTypes(Bytecode bytecode) {
832 DCHECK_LE(bytecode, Bytecode::kLast);
836 static bool OperandIsScalableSignedByte(Bytecode bytecode,
838 DCHECK_LE(bytecode, Bytecode::kLast);
843 static bool OperandIsScalableUnsignedByte(Bytecode bytecode,
845 DCHECK_LE(bytecode, Bytecode::kLast);
850 static bool OperandIsScalable(Bytecode bytecode, int operand_index) {
856 static bool IsBytecodeWithScalableOperands(Bytecode bytecode);
859 static OperandSize GetOperandSize(Bytecode bytecode, int i,
866 static const OperandSize* GetOperandSizes(Bytecode bytecode,
868 DCHECK_LE(bytecode, Bytecode::kLast);
879 static int GetOperandOffset(Bytecode bytecode, int i,
884 static int Size(Bytecode bytecode, OperandScale operand_scale) {
885 DCHECK_LE(bytecode, Bytecode::kLast);
893 static Bytecode GetDebugBreak(Bytecode bytecode);
896 static Bytecode GetJumpWithoutToBoolean(Bytecode bytecode);
900 static bool MakesCallAlongCriticalPath(Bytecode bytecode);
903 static ConvertReceiverMode GetReceiverMode(Bytecode bytecode) {
905 bytecode == Bytecode::kInvokeIntrinsic);
907 case Bytecode::kCallProperty:
908 case Bytecode::kCallProperty0:
909 case Bytecode::kCallProperty1:
910 case Bytecode::kCallProperty2:
912 case Bytecode::kCallUndefinedReceiver:
913 case Bytecode::kCallUndefinedReceiver0:
914 case Bytecode::kCallUndefinedReceiver1:
915 case Bytecode::kCallUndefinedReceiver2:
916 case Bytecode::kCallJSRuntime:
918 case Bytecode::kCallAnyReceiver:
919 case Bytecode::kConstruct:
920 case Bytecode::kCallWithSpread:
921 case Bytecode::kConstructWithSpread:
922 case Bytecode::kInvokeIntrinsic:
930 static bool IsDebugBreak(Bytecode bytecode);
946 static bool IsStarLookahead(Bytecode bytecode, OperandScale operand_scale);
993 static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale);
1047 const Bytecode& bytecode);