summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp
index f456451..b79074f 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.cpp
@@ -48,7 +48,7 @@ const ClassInfo JSFunction::info = { "Function", &InternalFunction::info, 0, 0 }
JSFunction::JSFunction(ExecState* exec, PassRefPtr<Structure> structure, int length, const Identifier& name, NativeFunction func)
: Base(&exec->globalData(), structure, name)
#if ENABLE(JIT)
- , m_body(exec->globalData().nativeFunctionThunk())
+ , m_body(FunctionBodyNode::createNativeThunk(&exec->globalData()))
#else
, m_body(0)
#endif
@@ -76,22 +76,19 @@ JSFunction::~JSFunction()
// JIT code for other functions may have had calls linked directly to the code for this function; these links
// are based on a check for the this pointer value for this JSFunction - which will no longer be valid once
// this memory is freed and may be reused (potentially for another, different JSFunction).
- if (!isHostFunction()) {
- if (m_body && m_body->isGenerated())
- m_body->generatedBytecode().unlinkCallers();
- scopeChain().~ScopeChain();
- }
-
+ if (m_body && m_body->isGenerated())
+ m_body->generatedBytecode().unlinkCallers();
#endif
+ if (!isHostFunction())
+ scopeChain().~ScopeChain();
}
void JSFunction::mark()
{
Base::mark();
- if (!isHostFunction()) {
- m_body->mark();
+ m_body->mark();
+ if (!isHostFunction())
scopeChain().mark();
- }
}
CallType JSFunction::getCallData(CallData& callData)