source: webkit/trunk/JavaScriptCore/kjs/SavedBuiltins.h@ 28479

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

JavaScriptCore:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and
functions accessing data members from Interpreter to JSGlobalObject.
Changed Interpreter member functions to static functions.


This resolves a bug in global object bootstrapping, where the global
ExecState could be used when uninitialized.


This is a big change, but it's mostly code motion and renaming.


Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
a .7% regression, but Shark sees no difference related to this patch,
and SunSpider reported a .7% speedup from an earlier step in this
refactoring, so I think it's fair to call that a wash.

JavaScriptGlue:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject. Replaced JSInterpreter
subclass with JSGlobalObject subclass.


  • JSRun.cpp: (JSRun::JSRun): (JSRun::Evaluate): (JSRun::CheckSyntax):
  • JSRun.h: (JSGlueGlobalObject::JSGlueGlobalObject):
  • JSUtils.cpp: (KJSValueToCFTypeInternal):
  • JSValueWrapper.cpp: (getThreadGlobalExecState):

WebCore:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject. Changed Interpreter
member functions to static functions. Same for the subclass,
ScriptInterpreter.


This is a big change, but it's mostly code motion and renaming.

WebKit/mac:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject.


  • WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]):

WebKit/win:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject.


  • WebFrame.cpp: (WebFrame::globalContext): (WebFrame::attachScriptDebugger): (WebFrame::windowObjectCleared):
  • WebScriptDebugger.cpp: (WebScriptDebugger::WebScriptDebugger):
File size: 3.2 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2001 Harri Porten ([email protected])
5 * Copyright (C) 2001 Peter Kelly ([email protected])
6 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25#ifndef SavedBuiltins_H
26#define SavedBuiltins_H
27
28#include "protect.h"
29#include "object_object.h"
30#include "string_object.h"
31#include "error_object.h"
32#include "regexp_object.h"
33#include "array_object.h"
34#include "bool_object.h"
35#include "date_object.h"
36#include "number_object.h"
37#include "math_object.h"
38
39namespace KJS {
40
41struct SavedBuiltinsInternal {
42 ProtectedPtr<ObjectObjectImp> objectConstructor;
43 ProtectedPtr<FunctionObjectImp> functionConstructor;
44 ProtectedPtr<ArrayObjectImp> arrayConstructor;
45 ProtectedPtr<BooleanObjectImp> booleanConstructor;
46 ProtectedPtr<StringObjectImp> stringConstructor;
47 ProtectedPtr<NumberObjectImp> numberConstructor;
48 ProtectedPtr<DateObjectImp> dateConstructor;
49 ProtectedPtr<RegExpObjectImp> regExpConstructor;
50 ProtectedPtr<ErrorObjectImp> errorConstructor;
51 ProtectedPtr<NativeErrorImp> evalErrorConstructor;
52 ProtectedPtr<NativeErrorImp> rangeErrorConstructor;
53 ProtectedPtr<NativeErrorImp> referenceErrorConstructor;
54 ProtectedPtr<NativeErrorImp> syntaxErrorConstructor;
55 ProtectedPtr<NativeErrorImp> typeErrorConstructor;
56 ProtectedPtr<NativeErrorImp> URIErrorConstructor;
57
58 ProtectedPtr<ObjectPrototype> objectPrototype;
59 ProtectedPtr<FunctionPrototype> functionPrototype;
60 ProtectedPtr<ArrayPrototype> arrayPrototype;
61 ProtectedPtr<BooleanPrototype> booleanPrototype;
62 ProtectedPtr<StringPrototype> stringPrototype;
63 ProtectedPtr<NumberPrototype> numberPrototype;
64 ProtectedPtr<DatePrototype> datePrototype;
65 ProtectedPtr<RegExpPrototype> regExpPrototype;
66 ProtectedPtr<ErrorPrototype> errorPrototype;
67 ProtectedPtr<NativeErrorPrototype> evalErrorPrototype;
68 ProtectedPtr<NativeErrorPrototype> rangeErrorPrototype;
69 ProtectedPtr<NativeErrorPrototype> referenceErrorPrototype;
70 ProtectedPtr<NativeErrorPrototype> syntaxErrorPrototype;
71 ProtectedPtr<NativeErrorPrototype> typeErrorPrototype;
72 ProtectedPtr<NativeErrorPrototype> URIErrorPrototype;
73};
74
75class SavedBuiltins {
76 friend class JSGlobalObject;
77public:
78 SavedBuiltins()
79 : _internal(0)
80 {
81 }
82
83 ~SavedBuiltins()
84 {
85 delete _internal;
86 }
87
88private:
89 SavedBuiltinsInternal* _internal;
90};
91
92} // namespace
93
94#endif // SavedBuiltins_H
Note: See TracBrowser for help on using the repository browser.