Changeset 251106 in webkit for trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
- Timestamp:
- Oct 14, 2019, 3:52:11 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r251090 r251106 453 453 void JIT::emit_op_negate(const Instruction* currentInstruction) 454 454 { 455 UnaryArithProfile* arithProfile = ¤tInstruction->as<OpNegate>().metadata(m_codeBlock).m_arithProfile;455 ArithProfile* arithProfile = ¤tInstruction->as<OpNegate>().metadata(m_codeBlock).m_arithProfile; 456 456 JITNegIC* negateIC = m_codeBlock->addJITNegIC(arithProfile); 457 457 m_instructionToMathIC.add(currentInstruction, negateIC); … … 634 634 } 635 635 636 ALWAYS_INLINE static OperandTypes getOperandTypes(const ArithProfile& arithProfile) 637 { 638 return OperandTypes(arithProfile.lhsResultType(), arithProfile.rhsResultType()); 639 } 640 636 641 void JIT::emit_op_add(const Instruction* currentInstruction) 637 642 { 638 BinaryArithProfile* arithProfile = ¤tInstruction->as<OpAdd>().metadata(m_codeBlock).m_arithProfile;643 ArithProfile* arithProfile = ¤tInstruction->as<OpAdd>().metadata(m_codeBlock).m_arithProfile; 639 644 JITAddIC* addIC = m_codeBlock->addJITAddIC(arithProfile); 640 645 m_instructionToMathIC.add(currentInstruction, addIC); … … 681 686 bool generatedInlineCode = mathIC->generateInline(*this, mathICGenerationState); 682 687 if (!generatedInlineCode) { 683 UnaryArithProfile* arithProfile = mathIC->arithProfile();688 ArithProfile* arithProfile = mathIC->arithProfile(); 684 689 if (arithProfile && shouldEmitProfiling()) 685 690 callOperationWithResult(profiledFunction, resultRegs, srcRegs, arithProfile); … … 704 709 { 705 710 auto bytecode = currentInstruction->as<Op>(); 706 BinaryArithProfile arithProfile = copiedArithProfile(bytecode);711 OperandTypes types = getOperandTypes(copiedArithProfile(bytecode)); 707 712 int result = bytecode.m_dst.offset(); 708 713 int op1 = bytecode.m_lhs.offset(); … … 723 728 #endif 724 729 725 SnippetOperand leftOperand( arithProfile.lhsResultType());726 SnippetOperand rightOperand( arithProfile.rhsResultType());730 SnippetOperand leftOperand(types.first()); 731 SnippetOperand rightOperand(types.second()); 727 732 728 733 if (isOperandConstantInt(op1)) … … 754 759 else if (rightOperand.isConst()) 755 760 emitGetVirtualRegister(op2, rightRegs); 756 BinaryArithProfile* arithProfile = mathIC->arithProfile();761 ArithProfile* arithProfile = mathIC->arithProfile(); 757 762 if (arithProfile && shouldEmitProfiling()) 758 763 callOperationWithResult(profiledFunction, resultRegs, leftRegs, rightRegs, arithProfile); … … 794 799 #endif 795 800 796 UnaryArithProfile* arithProfile = mathIC->arithProfile();801 ArithProfile* arithProfile = mathIC->arithProfile(); 797 802 if (arithProfile && shouldEmitProfiling()) { 798 803 if (mathICGenerationState.shouldSlowPathRepatch) … … 826 831 827 832 auto bytecode = currentInstruction->as<Op>(); 828 BinaryArithProfile consistentArithProfile = copiedArithProfile(bytecode);833 OperandTypes types = getOperandTypes(copiedArithProfile(bytecode)); 829 834 int result = bytecode.m_dst.offset(); 830 835 int op1 = bytecode.m_lhs.offset(); … … 841 846 #endif 842 847 843 SnippetOperand leftOperand( consistentArithProfile.lhsResultType());844 SnippetOperand rightOperand( consistentArithProfile.rhsResultType());848 SnippetOperand leftOperand(types.first()); 849 SnippetOperand rightOperand(types.second()); 845 850 846 851 if (isOperandConstantInt(op1)) … … 860 865 #endif 861 866 862 BinaryArithProfile* arithProfile = mathIC->arithProfile();867 ArithProfile* arithProfile = mathIC->arithProfile(); 863 868 if (arithProfile && shouldEmitProfiling()) { 864 869 if (mathICGenerationState.shouldSlowPathRepatch) … … 888 893 { 889 894 auto bytecode = currentInstruction->as<OpDiv>(); 890 BinaryArithProfile consistentArithProfile = copiedArithProfile(bytecode);895 auto& metadata = bytecode.metadata(m_codeBlock); 891 896 int result = bytecode.m_dst.offset(); 892 897 int op1 = bytecode.m_lhs.offset(); … … 894 899 895 900 #if USE(JSVALUE64) 901 OperandTypes types = getOperandTypes(metadata.m_arithProfile); 896 902 JSValueRegs leftRegs = JSValueRegs(regT0); 897 903 JSValueRegs rightRegs = JSValueRegs(regT1); … … 899 905 GPRReg scratchGPR = regT2; 900 906 #else 907 OperandTypes types = getOperandTypes(metadata.m_arithProfile); 901 908 JSValueRegs leftRegs = JSValueRegs(regT1, regT0); 902 909 JSValueRegs rightRegs = JSValueRegs(regT3, regT2); … … 906 913 FPRReg scratchFPR = fpRegT2; 907 914 908 BinaryArithProfile* arithProfile = nullptr;915 ArithProfile* arithProfile = nullptr; 909 916 if (shouldEmitProfiling()) 910 917 arithProfile = ¤tInstruction->as<OpDiv>().metadata(m_codeBlock).m_arithProfile; 911 918 912 SnippetOperand leftOperand( consistentArithProfile.lhsResultType());913 SnippetOperand rightOperand( consistentArithProfile.rhsResultType());919 SnippetOperand leftOperand(types.first()); 920 SnippetOperand rightOperand(types.second()); 914 921 915 922 if (isOperandConstantInt(op1)) … … 953 960 void JIT::emit_op_mul(const Instruction* currentInstruction) 954 961 { 955 BinaryArithProfile* arithProfile = ¤tInstruction->as<OpMul>().metadata(m_codeBlock).m_arithProfile;962 ArithProfile* arithProfile = ¤tInstruction->as<OpMul>().metadata(m_codeBlock).m_arithProfile; 956 963 JITMulIC* mulIC = m_codeBlock->addJITMulIC(arithProfile); 957 964 m_instructionToMathIC.add(currentInstruction, mulIC); … … 969 976 void JIT::emit_op_sub(const Instruction* currentInstruction) 970 977 { 971 BinaryArithProfile* arithProfile = ¤tInstruction->as<OpSub>().metadata(m_codeBlock).m_arithProfile;978 ArithProfile* arithProfile = ¤tInstruction->as<OpSub>().metadata(m_codeBlock).m_arithProfile; 972 979 JITSubIC* subIC = m_codeBlock->addJITSubIC(arithProfile); 973 980 m_instructionToMathIC.add(currentInstruction, subIC);
Note:
See TracChangeset
for help on using the changeset viewer.