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

    r46598 r47799  
    2929namespace JSC {
    3030
    31 JSValue JSAPIValueWrapper::toPrimitive(ExecState*, PreferredPrimitiveType) const
    32 {
    33     ASSERT_NOT_REACHED();
    34     return JSValue();
    35 }
    36 
    37 bool JSAPIValueWrapper::getPrimitiveNumber(ExecState*, double&, JSValue&)
    38 {
    39     ASSERT_NOT_REACHED();
    40     return false;
    41 }
    42 
    43 bool JSAPIValueWrapper::toBoolean(ExecState*) const
    44 {
    45     ASSERT_NOT_REACHED();
    46     return false;
    47 }
    48 
    49 double JSAPIValueWrapper::toNumber(ExecState*) const
    50 {
    51     ASSERT_NOT_REACHED();
    52     return 0;
    53 }
    54 
    55 UString JSAPIValueWrapper::toString(ExecState*) const
    56 {
    57     ASSERT_NOT_REACHED();
    58     return UString();
    59 }
    60 
    61 JSObject* JSAPIValueWrapper::toObject(ExecState*) const
    62 {
    63     ASSERT_NOT_REACHED();
    64     return 0;
    65 }
    66 
    6731} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.