Ignore:
Timestamp:
Oct 24, 2007, 11:02:07 AM (18 years ago)
Author:
ggaren
Message:

Reviewed by Sam Weinig.


Inlined the fast path for creating an Identifier from an Identifier.


This is a .4% speedup on SunSpider overall, but as big as a 2.5%
speedup on certain individual tests. 65% of the Identifiers creating
by SunSpider are already Identifiers.


(The main reason I'm making this change is that it resolves a large
regression in a patch I haven't checked in yet.)

  • JavaScriptCore.exp:
  • kjs/identifier.cpp: (KJS::Identifier::addSlowCase):
  • kjs/identifier.h: (KJS::Identifier::Identifier::add):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/identifier.h

    r20310 r26994  
    7676        static PassRefPtr<UString::Rep> add(const char*);
    7777        static PassRefPtr<UString::Rep> add(const UChar*, int length);
    78         static PassRefPtr<UString::Rep> add(UString::Rep*);
     78        static PassRefPtr<UString::Rep> Identifier::add(UString::Rep* r)
     79        {
     80            if (r->isIdentifier)
     81                return r;
     82            return addSlowCase(r);
     83        }
     84        static PassRefPtr<UString::Rep> addSlowCase(UString::Rep *r);
    7985    };
    8086   
Note: See TracChangeset for help on using the changeset viewer.