diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/JavaScriptCore/runtime/JSFunction.h | |
parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSFunction.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSFunction.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h index c1f066585..322ee58e3 100644 --- a/Source/JavaScriptCore/runtime/JSFunction.h +++ b/Source/JavaScriptCore/runtime/JSFunction.h @@ -25,7 +25,9 @@ #define JSFunction_h #include "InternalFunction.h" +#include "JSDestructibleObject.h" #include "JSScope.h" +#include "Watchpoint.h" namespace JSC { @@ -46,14 +48,14 @@ namespace JSC { JS_EXPORT_PRIVATE String getCalculatedDisplayName(CallFrame*, JSObject*); - class JSFunction : public JSNonFinalObject { + class JSFunction : public JSDestructibleObject { friend class JIT; friend class DFG::SpeculativeJIT; friend class DFG::JITCompiler; friend class JSGlobalData; public: - typedef JSNonFinalObject Base; + typedef JSDestructibleObject Base; JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const String& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor); @@ -66,6 +68,8 @@ namespace JSC { return function; } + static void destroy(JSCell*); + JS_EXPORT_PRIVATE String name(ExecState*); JS_EXPORT_PRIVATE String displayName(ExecState*); const String calculatedDisplayName(ExecState*); @@ -129,6 +133,21 @@ namespace JSC { return m_cachedInheritorID.get(); } + Structure* tryGetKnownInheritorID() + { + if (!m_cachedInheritorID) + return 0; + if (m_inheritorIDWatchpoint.hasBeenInvalidated()) + return 0; + return m_cachedInheritorID.get(); + } + + void addInheritorIDWatchpoint(Watchpoint* watchpoint) + { + ASSERT(tryGetKnownInheritorID()); + m_inheritorIDWatchpoint.add(watchpoint); + } + static size_t offsetOfCachedInheritorID() { return OBJECT_OFFSETOF(JSFunction, m_cachedInheritorID); @@ -169,6 +188,7 @@ namespace JSC { WriteBarrier<ExecutableBase> m_executable; WriteBarrier<JSScope> m_scope; WriteBarrier<Structure> m_cachedInheritorID; + InlineWatchpointSet m_inheritorIDWatchpoint; }; inline bool JSValue::isFunction() const |