Ignore:
Timestamp:
Aug 17, 2008, 1:23:49 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-08-17 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.

Made room for a free word in JSCell.


SunSpider says no change.


I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
store auxiliary data in a secondary structure.

I changed InternalFunction to store the function's name in the property
map.


I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
JSDOMWindowBaseData could inherit from it safely. (It's a strange design
for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
but that's really our only option, given the size constraint.)


I also added a bunch of compile-time ASSERTs, and removed lots of comments
in JSObject.h because they were often out of date, and they got in the
way of reading what was actually going on.


Also renamed JSArray::getLength to JSArray::length, to match our style
guidelines.

WebCore:

2008-08-17 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.

Made room for a free word in JSCell.


Changed JSDOMWindowBase to store its auxiliary data in a subclass of
JSGlobalData, so the two could share a pointer.


Added a bunch of ASSERTs, to help catch over-sized objects.

WebKit/mac:

2008-08-17 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.

Made room for a free word in JSCell.


(Updated for JavaScriptCore changes.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSFunction.cpp

    r35022 r35807  
    2626#include "JSFunction.h"
    2727
     28#include "CommonIdentifiers.h"
    2829#include "ExecState.h"
    2930#include "FunctionPrototype.h"
     
    4041namespace KJS {
    4142
    42 const ClassInfo JSFunction::info = { "Function", &InternalFunction::info, 0, 0 };
     43ASSERT_CLASS_FITS_IN_CELL(JSFunction);
     44
     45const ClassInfo JSFunction::info = { "Function", 0, 0, 0 };
    4346
    4447JSFunction::JSFunction(ExecState* exec, const Identifier& name, FunctionBodyNode* body, ScopeChainNode* scopeChainNode)
    45     : InternalFunction(exec->lexicalGlobalObject()->functionPrototype(), name)
     48    : Base(exec, exec->lexicalGlobalObject()->functionPrototype(), name)
    4649    , m_body(body)
    4750    , m_scopeChain(scopeChainNode)
     
    5154void JSFunction::mark()
    5255{
    53     InternalFunction::mark();
     56    Base::mark();
    5457    m_body->mark();
    5558    m_scopeChain.mark();
     
    103106    }
    104107
    105     return InternalFunction::getOwnPropertySlot(exec, propertyName, slot);
     108    return Base::getOwnPropertySlot(exec, propertyName, slot);
    106109}
    107110
     
    110113    if (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().length)
    111114        return;
    112     InternalFunction::put(exec, propertyName, value);
     115    Base::put(exec, propertyName, value);
    113116}
    114117
     
    117120    if (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().length)
    118121        return false;
    119     return InternalFunction::deleteProperty(exec, propertyName);
     122    return Base::deleteProperty(exec, propertyName);
    120123}
    121124
Note: See TracChangeset for help on using the changeset viewer.