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