Ignore:
Timestamp:
Nov 13, 2012, 11:58:18 AM (13 years ago)
Author:
[email protected]
Message:

JSFunction and its descendants should be destructible
https://bugs.webkit.org/show_bug.cgi?id=102062

Reviewed by Mark Hahnenberg.

This will make it easy to place an InlineWatchpointSet inside JSFunction. In the
future, we could make JSFunction non-destructible again by making a version of
WatchpointSet that is entirely GC'd, but this seems like overkill for now.

This is performance-neutral.

  • runtime/JSBoundFunction.cpp:

(JSC::JSBoundFunction::destroy):
(JSC):

  • runtime/JSBoundFunction.h:

(JSBoundFunction):

  • runtime/JSFunction.cpp:

(JSC):
(JSC::JSFunction::destroy):

  • runtime/JSFunction.h:

(JSFunction):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r128400 r134460  
    2626
    2727#include "InternalFunction.h"
     28#include "JSDestructibleObject.h"
    2829#include "JSScope.h"
    2930
     
    4748    JS_EXPORT_PRIVATE String getCalculatedDisplayName(CallFrame*, JSObject*);
    4849   
    49     class JSFunction : public JSNonFinalObject {
     50    class JSFunction : public JSDestructibleObject {
    5051        friend class JIT;
    5152        friend class DFG::SpeculativeJIT;
     
    5455
    5556    public:
    56         typedef JSNonFinalObject Base;
     57        typedef JSDestructibleObject Base;
    5758
    5859        JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const String& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor);
     
    6667            return function;
    6768        }
     69       
     70        static void destroy(JSCell*);
    6871       
    6972        JS_EXPORT_PRIVATE String name(ExecState*);
Note: See TracChangeset for help on using the changeset viewer.