Ignore:
Timestamp:
Dec 27, 2005, 1:24:14 AM (19 years ago)
Author:
mjs
Message:

Reviewed by Darin and Geoff.

Changes by me and Anders.

  • also fixed some warnings reported by -Winline
  • JavaScriptCorePrefix.h: Move new and delete definitions higher so there aren't conflicts with use in standard C++ headers
  • kjs/object.cpp: (KJS::throwSetterError): Moved this piece of put into a seprate function to avoid the PIC branch. (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff when not needed. Also use GetterSetter properties attribute. (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter properties any more, if this one was one. (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter properties now (and use the new attribute). (KJS::JSObject::defineSetter): Ditto. (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot, to avoid global variable access in the hot code path.
  • kjs/object.h: (KJS::): Added GetterSetter attribute. (KJS::JSCell::isObject): Moved lower to be after inline methods it uses. (KJS::JSValue::isObject): ditto (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters as much as possible in the case where they are not being used
  • kjs/property_map.cpp: (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
  • kjs/property_map.h: (KJS::PropertyMap::hasGetterSetterProperties): Ditto (KJS::PropertyMap::setHasGetterSetterProperties): Ditto (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the global "has getter/setter properties" flag in the property map single entry, to avoid making objects any bigger.
  • kjs/value.h: Moved some things to object.h to make -Winline happier
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCorePrefix.h

    r10701 r11773  
     1#ifdef __cplusplus
     2#define new ("if you use new/delete make sure to include config.h at the top of the file"())
     3#define delete ("if you use new/delete make sure to include config.h at the top of the file"())
     4#endif
     5
    16#ifdef __cplusplus
    27#define NULL __null
     
    49#define NULL ((void *)0)
    510#endif
     11
     12#include "config.h"
    613
    714#include <assert.h>
     
    4148#include <typeinfo>
    4249
    43 #ifdef __cplusplus
    44 #define new ("if you use new/delete make sure to include config.h at the top of the file"())
    45 #define delete ("if you use new/delete make sure to include config.h at the top of the file"())
    4650#endif
    47 #endif
Note: See TracChangeset for help on using the changeset viewer.