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