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/JSPropertyNameIterator.cpp

    r47022 r47799  
    3838}
    3939
    40 JSValue JSPropertyNameIterator::toPrimitive(ExecState*, PreferredPrimitiveType) const
    41 {
    42     ASSERT_NOT_REACHED();
    43     return JSValue();
    44 }
    45 
    46 bool JSPropertyNameIterator::getPrimitiveNumber(ExecState*, double&, JSValue&)
    47 {
    48     ASSERT_NOT_REACHED();
    49     return false;
    50 }
    51 
    52 bool JSPropertyNameIterator::toBoolean(ExecState*) const
    53 {
    54     ASSERT_NOT_REACHED();
    55     return false;
    56 }
    57 
    58 double JSPropertyNameIterator::toNumber(ExecState*) const
    59 {
    60     ASSERT_NOT_REACHED();
    61     return 0;
    62 }
    63 
    64 UString JSPropertyNameIterator::toString(ExecState*) const
    65 {
    66     ASSERT_NOT_REACHED();
    67     return "";
    68 }
    69 
    70 JSObject* JSPropertyNameIterator::toObject(ExecState*) const
    71 {
    72     ASSERT_NOT_REACHED();
    73     return 0;
    74 }
    75 
    7640void JSPropertyNameIterator::markChildren(MarkStack& markStack)
    7741{
Note: See TracChangeset for help on using the changeset viewer.