source: webkit/trunk/JavaScriptCore/kjs/RegExpObject.h@ 37240

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

JavaScriptCore:

2008-09-26 Sam Weinig <[email protected]>

Reviewed by Darin Adler.

Patch for https://bugs.webkit.org/show_bug.cgi?id=21152
Speedup static property get/put

Convert getting/setting static property values to use static functions
instead of storing an integer and switching in getValueProperty/putValueProperty.

  • kjs/JSObject.cpp: (JSC::JSObject::deleteProperty): (JSC::JSObject::getPropertyAttributes):
  • kjs/MathObject.cpp: (JSC::MathObject::getOwnPropertySlot):
  • kjs/NumberConstructor.cpp: (JSC::numberConstructorNaNValue): (JSC::numberConstructorNegInfinity): (JSC::numberConstructorPosInfinity): (JSC::numberConstructorMaxValue): (JSC::numberConstructorMinValue):
  • kjs/PropertySlot.h: (JSC::PropertySlot::):
  • kjs/RegExpConstructor.cpp: (JSC::regExpConstructorDollar1): (JSC::regExpConstructorDollar2): (JSC::regExpConstructorDollar3): (JSC::regExpConstructorDollar4): (JSC::regExpConstructorDollar5): (JSC::regExpConstructorDollar6): (JSC::regExpConstructorDollar7): (JSC::regExpConstructorDollar8): (JSC::regExpConstructorDollar9): (JSC::regExpConstructorInput): (JSC::regExpConstructorMultiline): (JSC::regExpConstructorLastMatch): (JSC::regExpConstructorLastParen): (JSC::regExpConstructorLeftContext): (JSC::regExpConstructorRightContext): (JSC::setRegExpConstructorInput): (JSC::setRegExpConstructorMultiline): (JSC::RegExpConstructor::setInput): (JSC::RegExpConstructor::setMultiline): (JSC::RegExpConstructor::multiline):
  • kjs/RegExpConstructor.h:
  • kjs/RegExpObject.cpp: (JSC::regExpObjectGlobal): (JSC::regExpObjectIgnoreCase): (JSC::regExpObjectMultiline): (JSC::regExpObjectSource): (JSC::regExpObjectLastIndex): (JSC::setRegExpObjectLastIndex):
  • kjs/RegExpObject.h: (JSC::RegExpObject::setLastIndex): (JSC::RegExpObject::lastIndex): (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
  • kjs/StructureID.cpp: (JSC::StructureID::getEnumerablePropertyNames):
  • kjs/create_hash_table:
  • kjs/lexer.cpp: (JSC::Lexer::lex):
  • kjs/lookup.cpp: (JSC::HashTable::createTable): (JSC::HashTable::deleteTable): (JSC::setUpStaticFunctionSlot):
  • kjs/lookup.h: (JSC::HashEntry::initialize): (JSC::HashEntry::setKey): (JSC::HashEntry::key): (JSC::HashEntry::attributes): (JSC::HashEntry::function): (JSC::HashEntry::functionLength): (JSC::HashEntry::propertyGetter): (JSC::HashEntry::propertyPutter): (JSC::HashEntry::lexerValue): (JSC::HashEntry::): (JSC::HashTable::entry): (JSC::getStaticPropertySlot): (JSC::getStaticValueSlot): (JSC::lookupPut):

WebCore:

2008-09-26 Sam Weinig <[email protected]>

Reviewed by Darin Adler.

Patch for https://bugs.webkit.org/show_bug.cgi?id=21152
Speedup static property get/put

  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMBinding.cpp:
  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::getDOMConstructor): (WebCore::jsDOMWindowBaseCrypto): (WebCore::jsDOMWindowBaseEvent): (WebCore::jsDOMWindowBaseImage): (WebCore::jsDOMWindowBaseMessageChannel): (WebCore::jsDOMWindowBaseOption): (WebCore::jsDOMWindowBaseXMLHttpRequest): (WebCore::jsDOMWindowBaseAudio): (WebCore::jsDOMWindowBaseXSLTProcessor): (WebCore::jsDOMWindowBaseOnabort): (WebCore::jsDOMWindowBaseOnblur): (WebCore::jsDOMWindowBaseOnchange): (WebCore::jsDOMWindowBaseOnclick): (WebCore::jsDOMWindowBaseOndblclick): (WebCore::jsDOMWindowBaseOnerror): (WebCore::jsDOMWindowBaseOnfocus): (WebCore::jsDOMWindowBaseOnkeydown): (WebCore::jsDOMWindowBaseOnkeypress): (WebCore::jsDOMWindowBaseOnkeyup): (WebCore::jsDOMWindowBaseOnload): (WebCore::jsDOMWindowBaseOnmousedown): (WebCore::jsDOMWindowBaseOnmousemove): (WebCore::jsDOMWindowBaseOnmouseout): (WebCore::jsDOMWindowBaseOnmouseover): (WebCore::jsDOMWindowBaseOnmouseup): (WebCore::jsDOMWindowBaseOnMouseWheel): (WebCore::jsDOMWindowBaseOnreset): (WebCore::jsDOMWindowBaseOnresize): (WebCore::jsDOMWindowBaseOnscroll): (WebCore::jsDOMWindowBaseOnsearch): (WebCore::jsDOMWindowBaseOnselect): (WebCore::jsDOMWindowBaseOnsubmit): (WebCore::jsDOMWindowBaseOnbeforeunload): (WebCore::jsDOMWindowBaseOnunload): (WebCore::jsDOMWindowBaseOnWebKitAnimationStart): (WebCore::jsDOMWindowBaseOnWebKitAnimationIteration): (WebCore::jsDOMWindowBaseOnWebKitAnimationEnd): (WebCore::jsDOMWindowBaseOnWebKitTransitionEnd): (WebCore::JSDOMWindowBase::getOwnPropertySlot): (WebCore::JSDOMWindowBase::put): (WebCore::setJSDOMWindowBaseOnabort): (WebCore::setJSDOMWindowBaseOnblur): (WebCore::setJSDOMWindowBaseOnchange): (WebCore::setJSDOMWindowBaseOnclick): (WebCore::setJSDOMWindowBaseOndblclick): (WebCore::setJSDOMWindowBaseOnerror): (WebCore::setJSDOMWindowBaseOnfocus): (WebCore::setJSDOMWindowBaseOnkeydown): (WebCore::setJSDOMWindowBaseOnkeypress): (WebCore::setJSDOMWindowBaseOnkeyup): (WebCore::setJSDOMWindowBaseOnload): (WebCore::setJSDOMWindowBaseOnmousedown): (WebCore::setJSDOMWindowBaseOnmousemove): (WebCore::setJSDOMWindowBaseOnmouseout): (WebCore::setJSDOMWindowBaseOnmouseover): (WebCore::setJSDOMWindowBaseOnmouseup): (WebCore::setJSDOMWindowBaseOnMouseWheel): (WebCore::setJSDOMWindowBaseOnreset): (WebCore::setJSDOMWindowBaseOnresize): (WebCore::setJSDOMWindowBaseOnscroll): (WebCore::setJSDOMWindowBaseOnsearch): (WebCore::setJSDOMWindowBaseOnselect): (WebCore::setJSDOMWindowBaseOnsubmit): (WebCore::setJSDOMWindowBaseOnbeforeunload): (WebCore::setJSDOMWindowBaseOnunload): (WebCore::setJSDOMWindowBaseOnWebKitAnimationStart): (WebCore::setJSDOMWindowBaseOnWebKitAnimationIteration): (WebCore::setJSDOMWindowBaseOnWebKitAnimationEnd): (WebCore::setJSDOMWindowBaseOnWebKitTransitionEnd): (WebCore::setJSDOMWindowBaseEvent): (WebCore::setJSDOMWindowBaseAudio): (WebCore::setJSDOMWindowBaseImage): (WebCore::setJSDOMWindowBaseMessageChannel): (WebCore::setJSDOMWindowBaseOption): (WebCore::setJSDOMWindowBaseXMLHttpRequest): (WebCore::setJSDOMWindowBaseXSLTProcessor):
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::nonCachingStaticCloseFunctionGetter): (WebCore::nonCachingStaticBlurFunctionGetter): (WebCore::nonCachingStaticFocusFunctionGetter): (WebCore::nonCachingStaticPostMessageFunctionGetter):
  • bindings/js/JSDOMWindowCustom.h: (WebCore::JSDOMWindow::customGetOwnPropertySlot):
  • bindings/js/JSEventTargetBase.cpp:
  • bindings/js/JSEventTargetBase.h: (WebCore::JSEventTargetBasePrototype::getOwnPropertySlot): (WebCore::JSEventTargetBasePrototype::classInfo):
  • bindings/js/JSEventTargetNode.cpp: (WebCore::): (WebCore::JSEventTargetNode::getOwnPropertySlot): (WebCore::JSEventTargetNode::put):
  • bindings/js/JSEventTargetNode.h: (WebCore::JSEventTargetNode::classInfo): (WebCore::JSEventTargetNode::prototypeClassName):
  • bindings/js/JSEventTargetSVGElementInstance.cpp: (WebCore::): (WebCore::JSEventTargetSVGElementInstance::getOwnPropertySlot): (WebCore::JSEventTargetSVGElementInstance::put):
  • bindings/js/JSEventTargetSVGElementInstance.h: (WebCore::JSEventTargetSVGElementInstance::classInfo): (WebCore::JSEventTargetSVGElementInstance::prototypeClassName):
  • bindings/js/JSHTMLInputElementCustom.cpp: (WebCore::JSHTMLInputElement::customGetOwnPropertySlot):
  • bindings/js/JSHistoryCustom.cpp: (WebCore::nonCachingStaticBackFunctionGetter): (WebCore::nonCachingStaticForwardFunctionGetter): (WebCore::nonCachingStaticGoFunctionGetter): (WebCore::JSHistory::customGetOwnPropertySlot):
  • bindings/js/JSLocationCustom.cpp: (WebCore::nonCachingStaticReplaceFunctionGetter): (WebCore::nonCachingStaticReloadFunctionGetter): (WebCore::nonCachingStaticAssignFunctionGetter): (WebCore::JSLocation::customGetOwnPropertySlot): (WebCore::JSLocation::customPut):
  • bindings/scripts/CodeGeneratorJS.pm:
  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 * Copyright (C) 2003, 2007, 2008 Apple Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef RegExpObject_h
22#define RegExpObject_h
23
24#include "JSObject.h"
25#include "regexp.h"
26
27namespace JSC {
28
29 class RegExpObject : public JSObject {
30 public:
31 RegExpObject(PassRefPtr<StructureID>, PassRefPtr<RegExp>);
32 virtual ~RegExpObject();
33
34 void setRegExp(PassRefPtr<RegExp> r) { d->regExp = r; }
35 RegExp* regExp() const { return d->regExp.get(); }
36
37 void setLastIndex(double lastIndex) { d->lastIndex = lastIndex; }
38 double lastIndex() const { return d->lastIndex; }
39
40 JSValue* test(ExecState*, const ArgList&);
41 JSValue* exec(ExecState*, const ArgList&);
42
43 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
44 virtual void put(ExecState*, const Identifier& propertyName, JSValue*, PutPropertySlot&);
45
46 virtual const ClassInfo* classInfo() const { return &info; }
47 static const ClassInfo info;
48
49 private:
50 bool match(ExecState*, const ArgList&);
51
52 virtual CallType getCallData(CallData&);
53
54 struct RegExpObjectData {
55 RegExpObjectData(PassRefPtr<RegExp> regExp, double lastIndex)
56 : regExp(regExp)
57 , lastIndex(lastIndex)
58 {
59 }
60
61 RefPtr<RegExp> regExp;
62 double lastIndex;
63 };
64
65 OwnPtr<RegExpObjectData> d;
66 };
67
68} // namespace JSC
69
70#endif // RegExpObject_h
Note: See TracBrowser for help on using the repository browser.