Ignore:
Timestamp:
Mar 21, 2008, 4:14:49 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Oliver Hunt.

Consolidate static identifier initializers within CommonIdentifiers.

No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).

  • kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized throughout the code.
  • kjs/date_object.cpp: (KJS::DateObjectImp::DateObjectImp):
  • kjs/function_object.cpp: (KJS::FunctionPrototype::FunctionPrototype):
  • kjs/object_object.cpp: (KJS::ObjectPrototype::ObjectPrototype):
  • kjs/regexp_object.cpp: (KJS::RegExpPrototype::RegExpPrototype): Use the values from CommonIdentifiers.
  • kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
  • kjs/value.h: (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
  • wtf/MathExtras.h: (wtf_atan2): Having local variables for numeric_limits constants is good for readability, but there is no reason to keep them static.
File:
1 edited

Legend:

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

    r30942 r31208  
    4545FunctionPrototype::FunctionPrototype(ExecState* exec)
    4646{
    47     static const Identifier* applyPropertyName = new Identifier("apply");
    48     static const Identifier* callPropertyName = new Identifier("call");
    49 
    5047    putDirect(exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
    5148
    5249    putDirectFunction(new PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);
    53     putDirectFunction(new PrototypeFunction(exec, this, 2, *applyPropertyName, functionProtoFuncApply), DontEnum);
    54     putDirectFunction(new PrototypeFunction(exec, this, 1, *callPropertyName, functionProtoFuncCall), DontEnum);
     50    putDirectFunction(new PrototypeFunction(exec, this, 2, CommonIdentifiers::shared()->apply, functionProtoFuncApply), DontEnum);
     51    putDirectFunction(new PrototypeFunction(exec, this, 1, CommonIdentifiers::shared()->call, functionProtoFuncCall), DontEnum);
    5552}
    5653
Note: See TracChangeset for help on using the changeset viewer.