X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/a253471d7f8e4d91bf6ebabab00155c3b387d3d0..93a3786624b2768d89bfa27e46598dc64e2fb70a:/dfg/DFGOSRExit.h diff --git a/dfg/DFGOSRExit.h b/dfg/DFGOSRExit.h index 841fddd..c7c6168 100644 --- a/dfg/DFGOSRExit.h +++ b/dfg/DFGOSRExit.h @@ -32,9 +32,9 @@ #include "CodeOrigin.h" #include "DFGCommon.h" -#include "DFGCorrectableJumpPoint.h" #include "DFGExitProfile.h" #include "DFGGPRInfo.h" +#include "DFGValueRecoveryOverride.h" #include "MacroAssembler.h" #include "MethodOfGettingAValueProfile.h" #include "Operands.h" @@ -83,78 +83,47 @@ private: // This structure describes how to exit the speculative path by // going into baseline code. struct OSRExit { - OSRExit(ExitKind, JSValueSource, MethodOfGettingAValueProfile, MacroAssembler::Jump, SpeculativeJIT*, unsigned recoveryIndex = 0); + OSRExit(ExitKind, JSValueSource, MethodOfGettingAValueProfile, SpeculativeJIT*, unsigned streamIndex, unsigned recoveryIndex = 0); MacroAssemblerCodeRef m_code; JSValueSource m_jsValueSource; MethodOfGettingAValueProfile m_valueProfile; - - CorrectableJumpPoint m_check; - NodeIndex m_nodeIndex; + + unsigned m_patchableCodeOffset; CodeOrigin m_codeOrigin; CodeOrigin m_codeOriginForExitProfile; unsigned m_recoveryIndex; + unsigned m_watchpointIndex; ExitKind m_kind; uint32_t m_count; - // Convenient way of iterating over ValueRecoveries while being - // generic over argument versus variable. - int numberOfRecoveries() const { return m_arguments.size() + m_variables.size(); } - const ValueRecovery& valueRecovery(int index) const - { - if (index < (int)m_arguments.size()) - return m_arguments[index]; - return m_variables[index - m_arguments.size()]; - } - ValueRecovery& valueRecoveryForOperand(int operand) - { - if (operandIsArgument(operand)) - return m_arguments[operandToArgument(operand)]; - return m_variables[operand]; - } - bool isArgument(int index) const { return index < (int)m_arguments.size(); } - bool isVariable(int index) const { return !isArgument(index); } - int argumentForIndex(int index) const - { - return index; - } - int variableForIndex(int index) const - { - return index - m_arguments.size(); - } - int operandForIndex(int index) const - { - if (index < (int)m_arguments.size()) - return operandToArgument(index); - return index - m_arguments.size(); - } - - bool considerAddingAsFrequentExitSite(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock) + bool considerAddingAsFrequentExitSite(CodeBlock* profiledCodeBlock) { if (!m_count || !exitKindIsCountable(m_kind)) return false; - return considerAddingAsFrequentExitSiteSlow(dfgCodeBlock, profiledCodeBlock); + return considerAddingAsFrequentExitSiteSlow(profiledCodeBlock); } - - void dump(FILE* out) const; - - Vector m_arguments; - Vector m_variables; + + void setPatchableCodeOffset(MacroAssembler::PatchableJump); + MacroAssembler::Jump getPatchableCodeOffsetAsJump() const; + CodeLocationJump codeLocationForRepatch(CodeBlock*) const; + void correctJump(LinkBuffer&); + + unsigned m_streamIndex; int m_lastSetOperand; + + RefPtr m_valueRecoveryOverride; private: - bool considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock); + bool considerAddingAsFrequentExitSiteSlow(CodeBlock* profiledCodeBlock); }; -#if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE) struct SpeculationFailureDebugInfo { CodeBlock* codeBlock; - NodeIndex nodeIndex; }; -#endif } } // namespace JSC::DFG