From 470286ecfe79d59df14944e5b5d34630fc739391 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 22 Nov 2012 09:09:45 +0100 Subject: Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485) Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66 Reviewed-by: Simon Hausmann --- Source/JavaScriptCore/runtime/JSFunction.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSFunction.h') 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 m_executable; WriteBarrier m_scope; WriteBarrier m_cachedInheritorID; + InlineWatchpointSet m_inheritorIDWatchpoint; }; inline bool JSValue::isFunction() const -- cgit v1.2.1