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