Ignore:
Timestamp:
May 9, 2005, 4:57:33 PM (20 years ago)
Author:
darin
Message:

Reviewed by John.

  • turn on conservative GC unconditionally and start on SPI changes to eliminate the now-unneeded smart pointers since we don't ref count any more
  • kjs/value.h: Removed macros to turn conservative GC on and off. Removed ref and deref functions. (KJS::ValueImp::ValueImp): Removed non-conservative-GC code path. (KJS::ValueImp::isUndefined): Added. New SPI to make it easier to deal with ValueImp directly. (KJS::ValueImp::isNull): Ditto. (KJS::ValueImp::isBoolean): Ditto. (KJS::ValueImp::isNumber): Ditto. (KJS::ValueImp::isString): Ditto. (KJS::ValueImp::isObject): Ditto. (KJS::Value::Value): Removed non-conservative-GC code path and made constructor no longer explicit so we can quietly create Value wrappers from ValueImp *; inexpensive with conservative GC and eases the transition. (KJS::Value::operator ValueImp *): Added. Quietly creates ValueImp * from Value. (KJS::ValueImp::marked): Removed non-conservative-GC code path.
  • kjs/value.cpp: (KJS::ValueImp::mark): Removed non-conservative-GC code path. (KJS::ValueImp::isUndefinedOrNull): Added. New SPI to make it easier to deal with ValueImp directly. (KJS::ValueImp::isBoolean): Ditto. (KJS::ValueImp::isNumber): Ditto. (KJS::ValueImp::isString): Ditto. (KJS::ValueImp::asString): Ditto. (KJS::ValueImp::isObject): Ditto. (KJS::undefined): Ditto. (KJS::null): Ditto. (KJS::boolean): Ditto. (KJS::string): Ditto. (KJS::zero): Ditto. (KJS::one): Ditto. (KJS::two): Ditto. (KJS::number): Ditto.
  • kjs/object.h: Made constructor no longer explicit so we can quietly create Object wrappers from ObjectImp *; inexpensive with conservative GC and eases the transition. (KJS::Object::operator ObjectImp *): Added. Quietly creates ObjectImp * from Object. (KJS::ValueImp::isObject): Added. Implementation of new object-related ValueImp function. (KJS::ValueImp::asObject): Ditto.
  • kjs/object.cpp: (KJS::ObjectImp::setInternalValue): Remove non-conservative-GC code path. (KJS::ObjectImp::putDirect): Ditto. (KJS::error): Added. Function in the new SPI style to create an error object.
  • kjs/internal.h: Added the new number-constructing functions as friends of NumberImp. There may be a more elegant way to do this later; what's important now is the new SPI.
  • kjs/collector.h: Remove non-conservative-GC code path and also take out some unneeded APPLE_CHANGES.
  • bindings/runtime_root.cpp: (KJS::Bindings::addNativeReference): Remove non-conservative-GC code path. (KJS::Bindings::removeNativeReference): Ditto. (RootObject::removeAllNativeReferences): Ditto.
  • bindings/runtime_root.h: (KJS::Bindings::RootObject::~RootObject): Ditto. (KJS::Bindings::RootObject::setRootObjectImp): Ditto.
  • kjs/collector.cpp: (KJS::Collector::allocate): Ditto. (KJS::Collector::collect): Ditto. (KJS::Collector::numGCNotAllowedObjects): Ditto. (KJS::Collector::numReferencedObjects): Ditto. (KJS::Collector::rootObjectClasses): Ditto.
  • kjs/internal.cpp: (NumberImp::create): Ditto. (InterpreterImp::globalInit): Ditto. (InterpreterImp::globalClear): Ditto.
  • kjs/list.cpp: (KJS::List::markProtectedLists): Ditto. (KJS::List::clear): Ditto. (KJS::List::append): Ditto.
  • kjs/list.h: (KJS::List::List): Ditto. (KJS::List::deref): Ditto. (KJS::List::operator=): Ditto.
  • kjs/protect.h: (KJS::gcProtect): Ditto. (KJS::gcUnprotect): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/runtime_root.h

    r9110 r9145  
    4949public:
    5050    RootObject (const void *nativeHandle) : _nativeHandle(nativeHandle), _imp(0), _interpreter(0) {}
    51     ~RootObject (){
    52 #if !USE_CONSERVATIVE_GC
    53         _imp->deref();
    54 #endif
    55 #if USE_CONSERVATIVE_GC | TEST_CONSERVATIVE_GC
     51    ~RootObject () {
    5652        gcUnprotect(_imp);
    57 #endif
    5853    }
    5954   
    6055    void setRootObjectImp (ObjectImp *i) {
    6156        _imp = i;
    62 #if !USE_CONSERVATIVE_GC
    63         _imp->ref();
    64 
    65 #endif
    66 #if USE_CONSERVATIVE_GC | TEST_CONSERVATIVE_GC
    6757        gcProtect(_imp);
    68 #endif
    6958    }
    7059   
Note: See TracChangeset for help on using the changeset viewer.