Changeset 252680 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Nov 19, 2019, 7:41:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r252422 r252680 947 947 case ArithSub: 948 948 case ValueAdd: { 949 BinaryArithProfile* arithProfile = m_inlineStackTop->m_profiledBlock->binaryArithProfileForBytecodeIndex(m_currentIndex); 950 if (!arithProfile) 949 ObservedResults observed; 950 if (BinaryArithProfile* arithProfile = m_inlineStackTop->m_profiledBlock->binaryArithProfileForBytecodeIndex(m_currentIndex)) 951 observed = arithProfile->observedResults(); 952 else if (UnaryArithProfile* arithProfile = m_inlineStackTop->m_profiledBlock->unaryArithProfileForBytecodeIndex(m_currentIndex)) { 953 // Happens for OpInc/OpDec 954 observed = arithProfile->observedResults(); 955 } else 951 956 break; 952 if (arithProfile->didObserveDouble()) 957 958 if (observed.didObserveDouble()) 953 959 node->mergeFlags(NodeMayHaveDoubleResult); 954 if ( arithProfile->didObserveNonNumeric())960 if (observed.didObserveNonNumeric()) 955 961 node->mergeFlags(NodeMayHaveNonNumericResult); 956 if ( arithProfile->didObserveBigInt())962 if (observed.didObserveBigInt()) 957 963 node->mergeFlags(NodeMayHaveBigIntResult); 958 964 break; … … 978 984 } 979 985 case ValueNegate: 980 case ArithNegate: { 986 case ArithNegate: 987 case Inc: 988 case Dec: { 981 989 UnaryArithProfile* arithProfile = m_inlineStackTop->m_profiledBlock->unaryArithProfileForBytecodeIndex(m_currentIndex); 982 990 if (!arithProfile) … … 5216 5224 auto bytecode = currentInstruction->as<OpInc>(); 5217 5225 Node* op = get(bytecode.m_srcDst); 5218 set(bytecode.m_srcDst, makeSafe(addToGraph(ArithAdd, op, addToGraph(JSConstant, OpInfo(m_constantOne))))); 5226 // FIXME: we can replace the Inc by either ArithAdd with m_constantOne or ArithAdd with the equivalent BigInt in many cases. 5227 // For now we only do so in DFGFixupPhase. 5228 // We could probably do it earlier in some cases, but it is not clearly worth the trouble. 5229 set(bytecode.m_srcDst, makeSafe(addToGraph(Inc, op))); 5219 5230 NEXT_OPCODE(op_inc); 5220 5231 } … … 5223 5234 auto bytecode = currentInstruction->as<OpDec>(); 5224 5235 Node* op = get(bytecode.m_srcDst); 5225 set(bytecode.m_srcDst, makeSafe(addToGraph(ArithSub, op, addToGraph(JSConstant, OpInfo(m_constantOne))))); 5236 // FIXME: we can replace the Inc by either ArithSub with m_constantOne or ArithSub with the equivalent BigInt in many cases. 5237 // For now we only do so in DFGFixupPhase. 5238 // We could probably do it earlier in some cases, but it is not clearly worth the trouble. 5239 set(bytecode.m_srcDst, makeSafe(addToGraph(Dec, op))); 5226 5240 NEXT_OPCODE(op_dec); 5227 5241 } … … 6972 6986 } 6973 6987 6988 case op_to_numeric: { 6989 auto bytecode = currentInstruction->as<OpToNumeric>(); 6990 SpeculatedType prediction = getPrediction(); 6991 Node* value = get(bytecode.m_operand); 6992 set(bytecode.m_dst, addToGraph(ToNumeric, OpInfo(0), OpInfo(prediction), value)); 6993 NEXT_OPCODE(op_to_numeric); 6994 } 6995 6974 6996 case op_to_string: { 6975 6997 auto bytecode = currentInstruction->as<OpToString>();
Note:
See TracChangeset
for help on using the changeset viewer.