Changeset 28527 in webkit for trunk/JavaScriptCore/kjs/function.h


Ignore:
Timestamp:
Dec 7, 2007, 2:05:55 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Sam Weinig.

Next step in refactoring JSGlobalObject: Added JSVariableObject class,
and factored symbol-table-related code into it. (JSGlobalObject doesn't
use the symbol table code yet, though.)


Layout and JS tests, and testapi, pass. SunSpider reports no regression.

WebCore:

Reviewed by Sam Weinig.

Added some namespace qualifications and a forwarding header, now that
KJS::Node is sometimes #included in WebCore by JavaScriptCore headers.

  • ForwardingHeaders/wtf/ListRefPtr.h: Added.
  • bindings/js/JSXSLTProcessor.cpp: (KJS::JSXSLTProcessorPrototypeFunctionTransformToFragment::callAsFunction):
  • bindings/js/kjs_binding.cpp: (KJS::ScriptInterpreter::getDOMNodeForDocument): (KJS::ScriptInterpreter::forgetDOMNodeForDocument): (KJS::ScriptInterpreter::putDOMNodeForDocument): (KJS::ScriptInterpreter::markDOMNodesForDocument): (KJS::ScriptInterpreter::updateDOMNodeDocument):

WebKit/mac:

Reviewed by Sam Weinig.


Added a forwarding header, since we now #include nodes.h through some
JavaScriptCore headers.

  • ForwardingHeaders/wtf/ListRefPtr.h: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function.h

    r28110 r28527  
    2626#define KJS_FUNCTION_H
    2727
     28#include "JSVariableObject.h"
    2829#include "LocalStorage.h"
    2930#include "SymbolTable.h"
     31#include "nodes.h"
    3032#include "object.h"
    31 #include <wtf/OwnPtr.h>
    3233
    3334namespace KJS {
     
    138139  };
    139140
    140   class ActivationImp : public JSObject {
    141   private:
    142     struct ActivationImpPrivate {
    143         ActivationImpPrivate(ExecState* e)
    144             : exec(e)
    145             , function(e->function())
     141  class ActivationImp : public JSVariableObject {
     142  private:
     143    using JSVariableObject::JSVariableObjectData;
     144
     145    struct ActivationImpData : public JSVariableObjectData {
     146        ActivationImpData(ExecState* e)
     147            : JSVariableObjectData(&e->function()->body->symbolTable())
     148            , exec(e)
    146149            , argumentsObject(0)
    147150        {
    148151        }
    149        
    150         LocalStorage localStorage;
     152
    151153        ExecState* exec;
    152         FunctionImp* function;
    153154        Arguments* argumentsObject;
    154155    };
    155156
    156157  public:
    157     ActivationImp(ExecState*);
     158    ActivationImp::ActivationImp(ExecState* exec)
     159        : JSVariableObject(new ActivationImpData(exec))
     160    {
     161    }
     162
     163    virtual ~ActivationImp()
     164    {
     165        delete d();
     166    }
    158167
    159168    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    160169    virtual void put(ExecState*, const Identifier& propertyName, JSValue* value, int attr = None);
    161170    virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
    162     virtual void getPropertyNames(ExecState*, PropertyNameArray&);
    163171
    164172    virtual const ClassInfo* classInfo() const { return &info; }
     
    167175    virtual void mark();
    168176
    169     bool isActivation() { return true; }
    170 
    171     LocalStorage& localStorage() { return d->localStorage; }
    172     SymbolTable& symbolTable() { return *m_symbolTable; }
     177    virtual bool isActivationObject() { return true; }
    173178
    174179  private:
     
    176181    static JSValue* argumentsGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
    177182    void createArgumentsObject(ExecState*);
    178    
    179     OwnPtr<ActivationImpPrivate> d;
    180     SymbolTable* m_symbolTable;
     183    ActivationImpData* d() { return static_cast<ActivationImpData*>(JSVariableObject::d); }
    181184  };
    182185
Note: See TracChangeset for help on using the changeset viewer.