Ignore:
Timestamp:
Sep 1, 2008, 12:51:33 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-01 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Eagerly allocate the Math object's numeric constants. This avoids
constantly reallocating them in loops, and also ensures that the Math
object will not use the single property optimization, which makes
properties ineligible for caching.

SunSpider reports a small speedup, in combination with inline caching.

  • kjs/MathObject.cpp: (KJS::MathObject::MathObject): (KJS::MathObject::getOwnPropertySlot):
  • kjs/MathObject.h:
File:
1 edited

Legend:

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

    r34854 r36015  
    3131
    3232        bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    33         JSValue* getValueProperty(ExecState*, int token) const;
    3433
    3534        virtual const ClassInfo* classInfo() const { return &info; }
    3635        static const ClassInfo info;
    37 
    38         enum { Euler, Ln2, Ln10, Log2E, Log10E, Pi, Sqrt1_2, Sqrt2 };
    3936    };
    4037
Note: See TracChangeset for help on using the changeset viewer.