Ignore:
Timestamp:
Sep 12, 2008, 9:57:35 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-12 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Bug 20819: JSValue::isObject() is slow
<https://bugs.webkit.org/show_bug.cgi?id=20819>

Optimize JSCell::isObject() and JSCell::isString() by making them
non-virtual calls that rely on the StructureID type information.

This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
benchmark suite.

  • JavaScriptCore.exp:
  • kjs/JSCell.cpp:
  • kjs/JSCell.h: (JSC::JSCell::isObject): (JSC::JSCell::isString):
  • kjs/JSObject.cpp:
  • kjs/JSObject.h:
  • kjs/JSString.cpp:
  • kjs/JSString.h: (JSC::JSString::JSString):
  • kjs/StructureID.h: (JSC::StructureID::type):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSString.cpp

    r36316 r36368  
    110110}
    111111
    112 bool JSString::isString() const
    113 {
    114     // FIXME: Change JSCell::isString to a non-virtual implementation like the one in Machine::isJSString.
    115     return true;
    116 }
    117 
    118112JSString* jsString(ExecState* exec, const UString& s)
    119113{
Note: See TracChangeset for help on using the changeset viewer.