Lines Matching refs:bytecode
571 static const char* ToString(Bytecode bytecode);
575 static std::string ToString(Bytecode bytecode, OperandScale operand_scale,
579 static uint8_t ToByte(Bytecode bytecode) { in ToByte() argument
580 DCHECK_LE(bytecode, Bytecode::kLast); in ToByte()
581 return static_cast<uint8_t>(bytecode); in ToByte()
586 Bytecode bytecode = static_cast<Bytecode>(value); in FromByte() local
587 DCHECK_LE(bytecode, Bytecode::kLast); in FromByte()
588 return bytecode; in FromByte()
611 static OperandScale PrefixBytecodeToOperandScale(Bytecode bytecode) { in PrefixBytecodeToOperandScale() argument
612 switch (bytecode) { in PrefixBytecodeToOperandScale()
625 static ImplicitRegisterUse GetImplicitRegisterUse(Bytecode bytecode) { in GetImplicitRegisterUse() argument
626 DCHECK_LE(bytecode, Bytecode::kLast); in GetImplicitRegisterUse()
627 return kImplicitRegisterUse[static_cast<size_t>(bytecode)]; in GetImplicitRegisterUse()
631 static bool ReadsAccumulator(Bytecode bytecode) { in ReadsAccumulator() argument
632 return BytecodeOperands::ReadsAccumulator(GetImplicitRegisterUse(bytecode)); in ReadsAccumulator()
636 static bool WritesAccumulator(Bytecode bytecode) { in WritesAccumulator() argument
638 GetImplicitRegisterUse(bytecode)); in WritesAccumulator()
643 static bool WritesImplicitRegister(Bytecode bytecode) { in WritesImplicitRegister() argument
645 GetImplicitRegisterUse(bytecode)); in WritesImplicitRegister()
650 static constexpr bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { in IsAccumulatorLoadWithoutEffects() argument
652 return bytecode >= Bytecode::kLdar && in IsAccumulatorLoadWithoutEffects()
653 bytecode <= Bytecode::kLdaImmutableCurrentContextSlot; in IsAccumulatorLoadWithoutEffects()
658 static constexpr bool IsCompareWithoutEffects(Bytecode bytecode) { in IsCompareWithoutEffects() argument
660 return bytecode >= Bytecode::kTestReferenceEqual && in IsCompareWithoutEffects()
661 bytecode <= Bytecode::kTestTypeOf; in IsCompareWithoutEffects()
664 static constexpr bool IsShortStar(Bytecode bytecode) { in IsShortStar() argument
665 return bytecode >= Bytecode::kFirstShortStar && in IsShortStar()
666 bytecode <= Bytecode::kLastShortStar; in IsShortStar()
669 static constexpr bool IsAnyStar(Bytecode bytecode) { in IsAnyStar() argument
670 return bytecode == Bytecode::kStar || IsShortStar(bytecode); in IsAnyStar()
675 static constexpr bool IsRegisterLoadWithoutEffects(Bytecode bytecode) { in IsRegisterLoadWithoutEffects() argument
676 return IsShortStar(bytecode) || in IsRegisterLoadWithoutEffects()
677 (bytecode >= Bytecode::kStar && bytecode <= Bytecode::kPopContext); in IsRegisterLoadWithoutEffects()
682 static constexpr bool IsConditionalJumpImmediate(Bytecode bytecode) { in IsConditionalJumpImmediate() argument
683 return bytecode >= Bytecode::kJumpIfToBooleanTrue && in IsConditionalJumpImmediate()
684 bytecode <= Bytecode::kJumpIfJSReceiver; in IsConditionalJumpImmediate()
689 static constexpr bool IsConditionalJumpConstant(Bytecode bytecode) { in IsConditionalJumpConstant() argument
690 return bytecode >= Bytecode::kJumpIfNullConstant && in IsConditionalJumpConstant()
691 bytecode <= Bytecode::kJumpIfToBooleanFalseConstant; in IsConditionalJumpConstant()
696 static constexpr bool IsConditionalJump(Bytecode bytecode) { in IsConditionalJump() argument
697 return bytecode >= Bytecode::kJumpIfNullConstant && in IsConditionalJump()
698 bytecode <= Bytecode::kJumpIfJSReceiver; in IsConditionalJump()
702 static constexpr bool IsUnconditionalJump(Bytecode bytecode) { in IsUnconditionalJump() argument
703 return bytecode >= Bytecode::kJumpLoop && in IsUnconditionalJump()
704 bytecode <= Bytecode::kJumpConstant; in IsUnconditionalJump()
709 static constexpr bool IsJumpImmediate(Bytecode bytecode) { in IsJumpImmediate() argument
710 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpLoop || in IsJumpImmediate()
711 IsConditionalJumpImmediate(bytecode); in IsJumpImmediate()
716 static constexpr bool IsJumpConstant(Bytecode bytecode) { in IsJumpConstant() argument
717 return bytecode >= Bytecode::kJumpConstant && in IsJumpConstant()
718 bytecode <= Bytecode::kJumpIfToBooleanFalseConstant; in IsJumpConstant()
723 static constexpr bool IsJumpIfToBoolean(Bytecode bytecode) { in IsJumpIfToBoolean() argument
724 return bytecode >= Bytecode::kJumpIfToBooleanTrueConstant && in IsJumpIfToBoolean()
725 bytecode <= Bytecode::kJumpIfToBooleanFalse; in IsJumpIfToBoolean()
730 static constexpr bool IsJump(Bytecode bytecode) { in IsJump() argument
731 return bytecode >= Bytecode::kJumpLoop && in IsJump()
732 bytecode <= Bytecode::kJumpIfJSReceiver; in IsJump()
737 static constexpr bool IsForwardJump(Bytecode bytecode) { in IsForwardJump() argument
738 return bytecode >= Bytecode::kJump && in IsForwardJump()
739 bytecode <= Bytecode::kJumpIfJSReceiver; in IsForwardJump()
745 static constexpr bool IsJumpWithoutEffects(Bytecode bytecode) { in IsJumpWithoutEffects() argument
746 return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode) && in IsJumpWithoutEffects()
747 bytecode != Bytecode::kJumpLoop; in IsJumpWithoutEffects()
751 static constexpr bool IsSwitch(Bytecode bytecode) { in IsSwitch() argument
752 return bytecode == Bytecode::kSwitchOnSmiNoFeedback || in IsSwitch()
753 bytecode == Bytecode::kSwitchOnGeneratorState; in IsSwitch()
758 static constexpr bool IsWithoutExternalSideEffects(Bytecode bytecode) { in IsWithoutExternalSideEffects() argument
759 return (IsAccumulatorLoadWithoutEffects(bytecode) || in IsWithoutExternalSideEffects()
760 IsRegisterLoadWithoutEffects(bytecode) || in IsWithoutExternalSideEffects()
761 IsCompareWithoutEffects(bytecode) || in IsWithoutExternalSideEffects()
762 IsJumpWithoutEffects(bytecode) || IsSwitch(bytecode)); in IsWithoutExternalSideEffects()
766 static constexpr bool IsLdarOrStar(Bytecode bytecode) { in IsLdarOrStar() argument
767 return bytecode == Bytecode::kLdar || IsAnyStar(bytecode); in IsLdarOrStar()
771 static constexpr bool IsCallOrConstruct(Bytecode bytecode) { in IsCallOrConstruct() argument
772 return bytecode == Bytecode::kCallAnyReceiver || in IsCallOrConstruct()
773 bytecode == Bytecode::kCallProperty || in IsCallOrConstruct()
774 bytecode == Bytecode::kCallProperty0 || in IsCallOrConstruct()
775 bytecode == Bytecode::kCallProperty1 || in IsCallOrConstruct()
776 bytecode == Bytecode::kCallProperty2 || in IsCallOrConstruct()
777 bytecode == Bytecode::kCallUndefinedReceiver || in IsCallOrConstruct()
778 bytecode == Bytecode::kCallUndefinedReceiver0 || in IsCallOrConstruct()
779 bytecode == Bytecode::kCallUndefinedReceiver1 || in IsCallOrConstruct()
780 bytecode == Bytecode::kCallUndefinedReceiver2 || in IsCallOrConstruct()
781 bytecode == Bytecode::kConstruct || in IsCallOrConstruct()
782 bytecode == Bytecode::kCallWithSpread || in IsCallOrConstruct()
783 bytecode == Bytecode::kConstructWithSpread || in IsCallOrConstruct()
784 bytecode == Bytecode::kCallJSRuntime; in IsCallOrConstruct()
788 static constexpr bool IsCallRuntime(Bytecode bytecode) { in IsCallRuntime() argument
789 return bytecode == Bytecode::kCallRuntime || in IsCallRuntime()
790 bytecode == Bytecode::kCallRuntimeForPair || in IsCallRuntime()
791 bytecode == Bytecode::kInvokeIntrinsic; in IsCallRuntime()
795 static constexpr bool IsPrefixScalingBytecode(Bytecode bytecode) { in IsPrefixScalingBytecode() argument
796 return bytecode == Bytecode::kExtraWide || bytecode == Bytecode::kWide || in IsPrefixScalingBytecode()
797 bytecode == Bytecode::kDebugBreakExtraWide || in IsPrefixScalingBytecode()
798 bytecode == Bytecode::kDebugBreakWide; in IsPrefixScalingBytecode()
802 static constexpr bool Returns(Bytecode bytecode) { in Returns() argument
803 #define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME in Returns()
809 static constexpr bool UnconditionallyThrows(Bytecode bytecode) { in UnconditionallyThrows() argument
810 #define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME in UnconditionallyThrows()
816 static int NumberOfOperands(Bytecode bytecode) { in NumberOfOperands() argument
817 DCHECK_LE(bytecode, Bytecode::kLast); in NumberOfOperands()
818 return kOperandCount[static_cast<size_t>(bytecode)]; in NumberOfOperands()
822 static OperandType GetOperandType(Bytecode bytecode, int i) { in GetOperandType() argument
823 DCHECK_LE(bytecode, Bytecode::kLast); in GetOperandType()
824 DCHECK_LT(i, NumberOfOperands(bytecode)); in GetOperandType()
826 return GetOperandTypes(bytecode)[i]; in GetOperandType()
831 static const OperandType* GetOperandTypes(Bytecode bytecode) { in GetOperandTypes() argument
832 DCHECK_LE(bytecode, Bytecode::kLast); in GetOperandTypes()
833 return kOperandTypes[static_cast<size_t>(bytecode)]; in GetOperandTypes()
836 static bool OperandIsScalableSignedByte(Bytecode bytecode, in OperandIsScalableSignedByte() argument
838 DCHECK_LE(bytecode, Bytecode::kLast); in OperandIsScalableSignedByte()
839 return kOperandTypeInfos[static_cast<size_t>(bytecode)][operand_index] == in OperandIsScalableSignedByte()
843 static bool OperandIsScalableUnsignedByte(Bytecode bytecode, in OperandIsScalableUnsignedByte() argument
845 DCHECK_LE(bytecode, Bytecode::kLast); in OperandIsScalableUnsignedByte()
846 return kOperandTypeInfos[static_cast<size_t>(bytecode)][operand_index] == in OperandIsScalableUnsignedByte()
850 static bool OperandIsScalable(Bytecode bytecode, int operand_index) { in OperandIsScalable() argument
851 return OperandIsScalableSignedByte(bytecode, operand_index) || in OperandIsScalable()
852 OperandIsScalableUnsignedByte(bytecode, operand_index); in OperandIsScalable()
856 static bool IsBytecodeWithScalableOperands(Bytecode bytecode);
859 static OperandSize GetOperandSize(Bytecode bytecode, int i, in GetOperandSize() argument
861 CHECK_LT(i, NumberOfOperands(bytecode)); in GetOperandSize()
862 return GetOperandSizes(bytecode, operand_scale)[i]; in GetOperandSize()
866 static const OperandSize* GetOperandSizes(Bytecode bytecode, in GetOperandSizes() argument
868 DCHECK_LE(bytecode, Bytecode::kLast); in GetOperandSizes()
874 return kOperandSizes[scale_index][static_cast<size_t>(bytecode)]; in GetOperandSizes()
879 static int GetOperandOffset(Bytecode bytecode, int i,
884 static int Size(Bytecode bytecode, OperandScale operand_scale) { in Size() argument
885 DCHECK_LE(bytecode, Bytecode::kLast); in Size()
889 return kBytecodeSizes[scale_index][static_cast<size_t>(bytecode)]; in Size()
893 static Bytecode GetDebugBreak(Bytecode bytecode);
896 static Bytecode GetJumpWithoutToBoolean(Bytecode bytecode);
900 static bool MakesCallAlongCriticalPath(Bytecode bytecode);
903 static ConvertReceiverMode GetReceiverMode(Bytecode bytecode) { in GetReceiverMode() argument
904 DCHECK(IsCallOrConstruct(bytecode) || in GetReceiverMode()
905 bytecode == Bytecode::kInvokeIntrinsic); in GetReceiverMode()
906 switch (bytecode) { in GetReceiverMode()
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);