From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/JavaScriptCore/runtime/Executable.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Source/JavaScriptCore/runtime/Executable.h') diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h index 08b39fcf0..3b979ba82 100644 --- a/Source/JavaScriptCore/runtime/Executable.h +++ b/Source/JavaScriptCore/runtime/Executable.h @@ -463,9 +463,10 @@ namespace JSC { OwnPtr m_programCodeBlock; }; - class FunctionExecutable : public ScriptExecutable { + class FunctionExecutable : public ScriptExecutable, public DoublyLinkedListNode { friend class JIT; friend class LLIntOffsetsExtractor; + friend class WTF::DoublyLinkedListNode; public: typedef ScriptExecutable Base; @@ -473,6 +474,7 @@ namespace JSC { { FunctionExecutable* executable = new (NotNull, allocateCell(*exec->heap())) FunctionExecutable(exec, name, inferredName, source, forceUsesArguments, parameters, isInStrictContext); executable->finishCreation(exec->globalData(), name, firstLine, lastLine); + exec->globalData().heap.addFunctionExecutable(executable); exec->globalData().heap.addFinalizer(executable, &finalize); return executable; } @@ -481,6 +483,7 @@ namespace JSC { { FunctionExecutable* executable = new (NotNull, allocateCell(globalData.heap)) FunctionExecutable(globalData, name, inferredName, source, forceUsesArguments, parameters, isInStrictContext); executable->finishCreation(globalData, name, firstLine, lastLine); + globalData.heap.addFunctionExecutable(executable); globalData.heap.addFinalizer(executable, &finalize); return executable; } @@ -567,7 +570,7 @@ namespace JSC { { ASSERT(exec->callee()); ASSERT(exec->callee()->inherits(&JSFunction::s_info)); - ASSERT(asFunction(exec->callee())->jsExecutable() == this); + ASSERT(jsCast(exec->callee())->jsExecutable() == this); if (kind == CodeForCall) return compileForCall(exec, scopeChainNode); @@ -579,7 +582,7 @@ namespace JSC { { ASSERT(exec->callee()); ASSERT(exec->callee()->inherits(&JSFunction::s_info)); - ASSERT(asFunction(exec->callee())->jsExecutable() == this); + ASSERT(jsCast(exec->callee())->jsExecutable() == this); if (kind == CodeForCall) return compileOptimizedForCall(exec, scopeChainNode); @@ -688,6 +691,8 @@ namespace JSC { Identifier m_inferredName; WriteBarrier m_nameValue; SharedSymbolTable* m_symbolTable; + FunctionExecutable* m_next; + FunctionExecutable* m_prev; }; inline FunctionExecutable* JSFunction::jsExecutable() const @@ -716,7 +721,7 @@ namespace JSC { inline bool isHostFunction(JSValue value, NativeFunction nativeFunction) { - JSFunction* function = static_cast(getJSFunction(value)); + JSFunction* function = jsCast(getJSFunction(value)); if (!function || !function->isHostFunction()) return false; return function->nativeFunction() == nativeFunction; -- cgit v1.2.1