Ignore:
Timestamp:
Aug 26, 2009, 4:00:39 PM (16 years ago)
Author:
[email protected]
Message:

A bit of Collector refatoring.

Patch by Geoffrey Garen <[email protected]> on 2009-08-26
Reviewed by Oliver Hunt.

SunSpider says no change. v8 says 1.003x faster (1.02x faster on splay).

  • runtime/JSCell.cpp:

(JSC::JSCell::toPrimitive):
(JSC::JSCell::getPrimitiveNumber):
(JSC::JSCell::toBoolean):
(JSC::JSCell::toNumber):
(JSC::JSCell::toString):
(JSC::JSCell::toObject): Removed pure virtual functions from
JSCell, so the collector can construct one. This allowed
me to remove a bunch of ASSERT_NOT_REACHED throughout the
code, too.

  • runtime/JSCell.h:

(JSC::JSCell::JSCell): ditto
(JSC::Heap::heap): Inlined this function because it's trivial.

  • runtime/Collector.cpp:

(JSC::Heap::destroy):
(JSC::Heap::allocateBlock):
(JSC::Heap::freeBlock):
(JSC::Heap::freeBlocks): Renamed freeHeap to freeBlocks, since
it doesn't actually free the Heap object.
(JSC::Heap::heapAllocate):
(JSC::Heap::sweep):

  • runtime/Collector.h: Refactored block allocation and destruction

into helper functions.

  • runtime/GetterSetter.cpp:
  • runtime/JSAPIValueWrapper.cpp:
  • runtime/JSPropertyNameIterator.cpp: Removed dummy implementations

of pure virtual functions. (See above.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSAPIValueWrapper.h

    r47267 r47799  
    3838        virtual bool isAPIValueWrapper() const { return true; }
    3939
    40         virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
    41         virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue&);
    42         virtual bool toBoolean(ExecState*) const;
    43         virtual double toNumber(ExecState*) const;
    44         virtual UString toString(ExecState*) const;
    45         virtual JSObject* toObject(ExecState*) const;
    4640        static PassRefPtr<Structure> createStructure(JSValue prototype)
    4741        {
Note: See TracChangeset for help on using the changeset viewer.