#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"
// 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<ValueRecovery, 0> m_arguments;
- Vector<ValueRecovery, 0> m_variables;
+
+ void setPatchableCodeOffset(MacroAssembler::PatchableJump);
+ MacroAssembler::Jump getPatchableCodeOffsetAsJump() const;
+ CodeLocationJump codeLocationForRepatch(CodeBlock*) const;
+ void correctJump(LinkBuffer&);
+
+ unsigned m_streamIndex;
int m_lastSetOperand;
+
+ RefPtr<ValueRecoveryOverride> 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