source: webkit/trunk/JavaScriptCore/kjs/MathObject.h@ 36100

Last change on this file since 36100 was 36015, checked in by [email protected], 17 years ago

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:
  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1/*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 */
19
20#ifndef MathObject_h
21#define MathObject_h
22
23#include "JSObject.h"
24#include "lookup.h"
25
26namespace KJS {
27
28 class MathObject : public JSObject {
29 public:
30 MathObject(ExecState*, ObjectPrototype*);
31
32 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
33
34 virtual const ClassInfo* classInfo() const { return &info; }
35 static const ClassInfo info;
36 };
37
38} // namespace KJS
39
40#endif // MathObject_h
Note: See TracBrowser for help on using the repository browser.