diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/JavaScriptCore/runtime/Executable.h | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/JavaScriptCore/runtime/Executable.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/Executable.h | 13 |
1 files changed, 9 insertions, 4 deletions
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<ProgramCodeBlock> m_programCodeBlock; }; - class FunctionExecutable : public ScriptExecutable { + class FunctionExecutable : public ScriptExecutable, public DoublyLinkedListNode<FunctionExecutable> { friend class JIT; friend class LLIntOffsetsExtractor; + friend class WTF::DoublyLinkedListNode<FunctionExecutable>; public: typedef ScriptExecutable Base; @@ -473,6 +474,7 @@ namespace JSC { { FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(*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<FunctionExecutable>(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<JSFunction*>(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<JSFunction*>(exec->callee())->jsExecutable() == this); if (kind == CodeForCall) return compileOptimizedForCall(exec, scopeChainNode); @@ -688,6 +691,8 @@ namespace JSC { Identifier m_inferredName; WriteBarrier<JSString> 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<JSFunction*>(getJSFunction(value)); + JSFunction* function = jsCast<JSFunction*>(getJSFunction(value)); if (!function || !function->isHostFunction()) return false; return function->nativeFunction() == nativeFunction; |