From d441d6f39bb846989d95bcf5caf387b42414718d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 13 Sep 2013 12:51:20 +0200 Subject: Import Qt5x2 branch of QtWebkit for Qt 5.2 Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen --- Source/JavaScriptCore/dfg/DFGOSRExit.cpp | 33 +++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'Source/JavaScriptCore/dfg/DFGOSRExit.cpp') diff --git a/Source/JavaScriptCore/dfg/DFGOSRExit.cpp b/Source/JavaScriptCore/dfg/DFGOSRExit.cpp index b3701722e..ac085ec06 100644 --- a/Source/JavaScriptCore/dfg/DFGOSRExit.cpp +++ b/Source/JavaScriptCore/dfg/DFGOSRExit.cpp @@ -30,14 +30,14 @@ #include "DFGAssemblyHelpers.h" #include "DFGSpeculativeJIT.h" +#include "JSCellInlines.h" namespace JSC { namespace DFG { -OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, MacroAssembler::Jump check, SpeculativeJIT* jit, unsigned streamIndex, unsigned recoveryIndex) +OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, SpeculativeJIT* jit, unsigned streamIndex, unsigned recoveryIndex) : m_jsValueSource(jsValueSource) , m_valueProfile(valueProfile) - , m_check(check) - , m_nodeIndex(jit->m_compileIndex) + , m_patchableCodeOffset(0) , m_codeOrigin(jit->m_codeOriginForOSR) , m_codeOriginForExitProfile(m_codeOrigin) , m_recoveryIndex(recoveryIndex) @@ -50,11 +50,30 @@ OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAVal ASSERT(m_codeOrigin.isSet()); } -bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock) +void OSRExit::setPatchableCodeOffset(MacroAssembler::PatchableJump check) +{ + m_patchableCodeOffset = check.m_jump.m_label.m_offset; +} + +MacroAssembler::Jump OSRExit::getPatchableCodeOffsetAsJump() const +{ + return MacroAssembler::Jump(AssemblerLabel(m_patchableCodeOffset)); +} + +CodeLocationJump OSRExit::codeLocationForRepatch(CodeBlock* dfgCodeBlock) const +{ + return CodeLocationJump(dfgCodeBlock->getJITCode().dataAddressAtOffset(m_patchableCodeOffset)); +} + +void OSRExit::correctJump(LinkBuffer& linkBuffer) +{ + MacroAssembler::Label label; + label.m_label.m_offset = m_patchableCodeOffset; + m_patchableCodeOffset = linkBuffer.offsetOf(label); +} + +bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* profiledCodeBlock) { - if (static_cast(m_count) / dfgCodeBlock->osrExitCounter() <= Options::osrExitProminenceForFrequentExitSite()) - return false; - FrequentExitSite exitSite; if (m_kind == ArgumentsEscaped) { -- cgit v1.2.1