Changeset 29508 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 15, 2008, 10:43:15 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Geoffrey Garen.

Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size

  • This changes the way JS functions that use Lookup tables are handled. Instead using one class per function, which allowed specialization of the virtual callAsFunction method, we now use on class, PrototypeFunction, which takes a pointer to a static function to use as the implementation. This significantly decreases the binary size of JavaScriptCore (about 145k on an Intel only build) while still keeping some of the speedup r27608 garnered (SunSpider says this is 1.005x as slow, which should leave some wiggle room from the original 1% speedup) and keeps the functions implementations in separate functions to help with optimizations.
  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/array_object.cpp: (KJS::arrayProtoFuncToString): (KJS::arrayProtoFuncToLocaleString): (KJS::arrayProtoFuncJoin): (KJS::arrayProtoFuncConcat): (KJS::arrayProtoFuncPop): (KJS::arrayProtoFuncPush): (KJS::arrayProtoFuncReverse): (KJS::arrayProtoFuncShift): (KJS::arrayProtoFuncSlice): (KJS::arrayProtoFuncSort): (KJS::arrayProtoFuncSplice): (KJS::arrayProtoFuncUnShift): (KJS::arrayProtoFuncFilter): (KJS::arrayProtoFuncMap): (KJS::arrayProtoFuncEvery): (KJS::arrayProtoFuncForEach): (KJS::arrayProtoFuncSome): (KJS::arrayProtoFuncIndexOf): (KJS::arrayProtoFuncLastIndexOf):
  • kjs/array_object.h:
  • kjs/date_object.cpp: (KJS::DatePrototype::getOwnPropertySlot): (KJS::dateProtoFuncToString): (KJS::dateProtoFuncToUTCString): (KJS::dateProtoFuncToDateString): (KJS::dateProtoFuncToTimeString): (KJS::dateProtoFuncToLocaleString): (KJS::dateProtoFuncToLocaleDateString): (KJS::dateProtoFuncToLocaleTimeString): (KJS::dateProtoFuncValueOf): (KJS::dateProtoFuncGetTime): (KJS::dateProtoFuncGetFullYear): (KJS::dateProtoFuncGetUTCFullYear): (KJS::dateProtoFuncToGMTString): (KJS::dateProtoFuncGetMonth): (KJS::dateProtoFuncGetUTCMonth): (KJS::dateProtoFuncGetDate): (KJS::dateProtoFuncGetUTCDate): (KJS::dateProtoFuncGetDay): (KJS::dateProtoFuncGetUTCDay): (KJS::dateProtoFuncGetHours): (KJS::dateProtoFuncGetUTCHours): (KJS::dateProtoFuncGetMinutes): (KJS::dateProtoFuncGetUTCMinutes): (KJS::dateProtoFuncGetSeconds): (KJS::dateProtoFuncGetUTCSeconds): (KJS::dateProtoFuncGetMilliSeconds): (KJS::dateProtoFuncGetUTCMilliseconds): (KJS::dateProtoFuncGetTimezoneOffset): (KJS::dateProtoFuncSetTime): (KJS::dateProtoFuncSetMilliSeconds): (KJS::dateProtoFuncSetUTCMilliseconds): (KJS::dateProtoFuncSetSeconds): (KJS::dateProtoFuncSetUTCSeconds): (KJS::dateProtoFuncSetMinutes): (KJS::dateProtoFuncSetUTCMinutes): (KJS::dateProtoFuncSetHours): (KJS::dateProtoFuncSetUTCHours): (KJS::dateProtoFuncSetDate): (KJS::dateProtoFuncSetUTCDate): (KJS::dateProtoFuncSetMonth): (KJS::dateProtoFuncSetUTCMonth): (KJS::dateProtoFuncSetFullYear): (KJS::dateProtoFuncSetUTCFullYear): (KJS::dateProtoFuncSetYear): (KJS::dateProtoFuncGetYear):
  • kjs/date_object.h:
  • kjs/function.cpp: (KJS::PrototypeFunction::PrototypeFunction): (KJS::PrototypeFunction::callAsFunction):
  • kjs/function.h:
  • kjs/lookup.h: (KJS::HashEntry::): (KJS::staticFunctionGetter):
  • kjs/math_object.cpp: (KJS::mathProtoFuncAbs): (KJS::mathProtoFuncACos): (KJS::mathProtoFuncASin): (KJS::mathProtoFuncATan): (KJS::mathProtoFuncATan2): (KJS::mathProtoFuncCeil): (KJS::mathProtoFuncCos): (KJS::mathProtoFuncExp): (KJS::mathProtoFuncFloor): (KJS::mathProtoFuncLog): (KJS::mathProtoFuncMax): (KJS::mathProtoFuncMin): (KJS::mathProtoFuncPow): (KJS::mathProtoFuncRandom): (KJS::mathProtoFuncRound): (KJS::mathProtoFuncSin): (KJS::mathProtoFuncSqrt): (KJS::mathProtoFuncTan):
  • kjs/math_object.h:
  • kjs/string_object.cpp: (KJS::stringProtoFuncToString): (KJS::stringProtoFuncValueOf): (KJS::stringProtoFuncCharAt): (KJS::stringProtoFuncCharCodeAt): (KJS::stringProtoFuncConcat): (KJS::stringProtoFuncIndexOf): (KJS::stringProtoFuncLastIndexOf): (KJS::stringProtoFuncMatch): (KJS::stringProtoFuncSearch): (KJS::stringProtoFuncReplace): (KJS::stringProtoFuncSlice): (KJS::stringProtoFuncSplit): (KJS::stringProtoFuncSubstr): (KJS::stringProtoFuncSubstring): (KJS::stringProtoFuncToLowerCase): (KJS::stringProtoFuncToUpperCase): (KJS::stringProtoFuncToLocaleLowerCase): (KJS::stringProtoFuncToLocaleUpperCase): (KJS::stringProtoFuncLocaleCompare): (KJS::stringProtoFuncBig): (KJS::stringProtoFuncSmall): (KJS::stringProtoFuncBlink): (KJS::stringProtoFuncBold): (KJS::stringProtoFuncFixed): (KJS::stringProtoFuncItalics): (KJS::stringProtoFuncStrike): (KJS::stringProtoFuncSub): (KJS::stringProtoFuncSup): (KJS::stringProtoFuncFontcolor): (KJS::stringProtoFuncFontsize): (KJS::stringProtoFuncAnchor): (KJS::stringProtoFuncLink):
  • kjs/string_object.h:

WebCore:

Reviewed by Geoffrey Garen.

Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size

  • Update JS Function implementations to use a static function based method. This decreases the binary size of an Intel only build by 1013.5K.
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::customGetOwnPropertySlot):
  • bindings/js/JSEventTargetBase.cpp: (WebCore::jsEventTargetAddEventListener): (WebCore::jsEventTargetRemoveEventListener): (WebCore::jsEventTargetDispatchEvent): (WebCore::retrieveEventTargetAndCorrespondingNode):
  • bindings/js/JSEventTargetBase.h:
  • bindings/js/JSHTMLInputElementBase.cpp: (WebCore::jsHTMLInputElementBaseFunctionSetSelectionRange): (WebCore::JSHTMLInputElementBase::getOwnPropertySlot):
  • bindings/js/JSHTMLInputElementBase.h:
  • bindings/js/JSLocation.cpp: (WebCore::JSLocation::getOwnPropertySlot): (WebCore::jsLocationProtoFuncReplace): (WebCore::jsLocationProtoFuncReload): (WebCore::jsLocationProtoFuncAssign): (WebCore::jsLocationProtoFuncToString):
  • bindings/js/JSLocation.h:
  • bindings/js/JSXMLHttpRequest.cpp: (KJS::jsXMLHttpRequestPrototypeFunctionAbort): (KJS::jsXMLHttpRequestPrototypeFunctionGetAllResponseHeaders): (KJS::jsXMLHttpRequestPrototypeFunctionGetResponseHeader): (KJS::jsXMLHttpRequestPrototypeFunctionOpen): (KJS::jsXMLHttpRequestPrototypeFunctionSend): (KJS::jsXMLHttpRequestPrototypeFunctionSetRequestHeader): (KJS::jsXMLHttpRequestPrototypeFunctionOverrideMIMEType): (KJS::jsXMLHttpRequestPrototypeFunctionAddEventListener): (KJS::jsXMLHttpRequestPrototypeFunctionRemoveEventListener): (KJS::jsXMLHttpRequestPrototypeFunctionDispatchEvent):
  • bindings/js/JSXMLHttpRequest.h:
  • bindings/js/JSXSLTProcessor.cpp: (KJS::jsXSLTProcessorPrototypeFunctionImportStylesheet): (KJS::jsXSLTProcessorPrototypeFunctionTransformToFragment): (KJS::jsXSLTProcessorPrototypeFunctionTransformToDocument): (KJS::jsXSLTProcessorPrototypeFunctionSetParameter): (KJS::jsXSLTProcessorPrototypeFunctionGetParameter): (KJS::jsXSLTProcessorPrototypeFunctionRemoveParameter): (KJS::jsXSLTProcessorPrototypeFunctionClearParameters): (KJS::jsXSLTProcessorPrototypeFunctionReset):
  • bindings/js/JSXSLTProcessor.h:
  • bindings/js/kjs_events.cpp: (WebCore::jsClipboardPrototypeFunctionClearData): (WebCore::jsClipboardPrototypeFunctionGetData): (WebCore::jsClipboardPrototypeFunctionSetData): (WebCore::jsClipboardPrototypeFunctionSetDragImage):
  • bindings/js/kjs_events.h:
  • bindings/js/kjs_navigator.cpp: (KJS::pluginsFunctionRefresh): (KJS::navigatorProtoFuncJavaEnabled):
  • bindings/js/kjs_navigator.h:
  • bindings/js/kjs_window.cpp: (KJS::Window::getOwnPropertySlot): (KJS::windowProtoFuncAToB): (KJS::windowProtoFuncBToA): (KJS::windowProtoFuncOpen): (KJS::windowProtoFuncSetTimeout): (KJS::windowProtoFuncClearTimeout): (KJS::windowProtoFuncSetInterval): (KJS::windowProtoFuncAddEventListener): (KJS::windowProtoFuncRemoveEventListener): (KJS::windowProtoFuncShowModalDialog): (KJS::windowProtoFuncNotImplemented):
  • bindings/js/kjs_window.h:
  • bindings/scripts/CodeGenerator.pm:
  • bindings/scripts/CodeGeneratorJS.pm:
Location:
trunk/JavaScriptCore
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r29506 r29508  
     12008-01-15  Sam Weinig  <[email protected]>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size
     6
     7        - This changes the way JS functions that use Lookup tables are handled.  Instead using
     8          one class per function, which allowed specialization of the virtual callAsFunction
     9          method, we now use on class, PrototypeFunction, which takes a pointer to a static
     10          function to use as the implementation.  This significantly decreases the binary size
     11          of JavaScriptCore (about 145k on an Intel only build) while still keeping some of the
     12          speedup r27608 garnered (SunSpider says this is 1.005x as slow, which should leave some
     13          wiggle room from the original 1% speedup) and keeps the functions implementations in separate
     14          functions to help with optimizations.
     15
     16        * JavaScriptCore.exp:
     17        * JavaScriptCore.xcodeproj/project.pbxproj:
     18        * kjs/array_object.cpp:
     19        (KJS::arrayProtoFuncToString):
     20        (KJS::arrayProtoFuncToLocaleString):
     21        (KJS::arrayProtoFuncJoin):
     22        (KJS::arrayProtoFuncConcat):
     23        (KJS::arrayProtoFuncPop):
     24        (KJS::arrayProtoFuncPush):
     25        (KJS::arrayProtoFuncReverse):
     26        (KJS::arrayProtoFuncShift):
     27        (KJS::arrayProtoFuncSlice):
     28        (KJS::arrayProtoFuncSort):
     29        (KJS::arrayProtoFuncSplice):
     30        (KJS::arrayProtoFuncUnShift):
     31        (KJS::arrayProtoFuncFilter):
     32        (KJS::arrayProtoFuncMap):
     33        (KJS::arrayProtoFuncEvery):
     34        (KJS::arrayProtoFuncForEach):
     35        (KJS::arrayProtoFuncSome):
     36        (KJS::arrayProtoFuncIndexOf):
     37        (KJS::arrayProtoFuncLastIndexOf):
     38        * kjs/array_object.h:
     39        * kjs/date_object.cpp:
     40        (KJS::DatePrototype::getOwnPropertySlot):
     41        (KJS::dateProtoFuncToString):
     42        (KJS::dateProtoFuncToUTCString):
     43        (KJS::dateProtoFuncToDateString):
     44        (KJS::dateProtoFuncToTimeString):
     45        (KJS::dateProtoFuncToLocaleString):
     46        (KJS::dateProtoFuncToLocaleDateString):
     47        (KJS::dateProtoFuncToLocaleTimeString):
     48        (KJS::dateProtoFuncValueOf):
     49        (KJS::dateProtoFuncGetTime):
     50        (KJS::dateProtoFuncGetFullYear):
     51        (KJS::dateProtoFuncGetUTCFullYear):
     52        (KJS::dateProtoFuncToGMTString):
     53        (KJS::dateProtoFuncGetMonth):
     54        (KJS::dateProtoFuncGetUTCMonth):
     55        (KJS::dateProtoFuncGetDate):
     56        (KJS::dateProtoFuncGetUTCDate):
     57        (KJS::dateProtoFuncGetDay):
     58        (KJS::dateProtoFuncGetUTCDay):
     59        (KJS::dateProtoFuncGetHours):
     60        (KJS::dateProtoFuncGetUTCHours):
     61        (KJS::dateProtoFuncGetMinutes):
     62        (KJS::dateProtoFuncGetUTCMinutes):
     63        (KJS::dateProtoFuncGetSeconds):
     64        (KJS::dateProtoFuncGetUTCSeconds):
     65        (KJS::dateProtoFuncGetMilliSeconds):
     66        (KJS::dateProtoFuncGetUTCMilliseconds):
     67        (KJS::dateProtoFuncGetTimezoneOffset):
     68        (KJS::dateProtoFuncSetTime):
     69        (KJS::dateProtoFuncSetMilliSeconds):
     70        (KJS::dateProtoFuncSetUTCMilliseconds):
     71        (KJS::dateProtoFuncSetSeconds):
     72        (KJS::dateProtoFuncSetUTCSeconds):
     73        (KJS::dateProtoFuncSetMinutes):
     74        (KJS::dateProtoFuncSetUTCMinutes):
     75        (KJS::dateProtoFuncSetHours):
     76        (KJS::dateProtoFuncSetUTCHours):
     77        (KJS::dateProtoFuncSetDate):
     78        (KJS::dateProtoFuncSetUTCDate):
     79        (KJS::dateProtoFuncSetMonth):
     80        (KJS::dateProtoFuncSetUTCMonth):
     81        (KJS::dateProtoFuncSetFullYear):
     82        (KJS::dateProtoFuncSetUTCFullYear):
     83        (KJS::dateProtoFuncSetYear):
     84        (KJS::dateProtoFuncGetYear):
     85        * kjs/date_object.h:
     86        * kjs/function.cpp:
     87        (KJS::PrototypeFunction::PrototypeFunction):
     88        (KJS::PrototypeFunction::callAsFunction):
     89        * kjs/function.h:
     90        * kjs/lookup.h:
     91        (KJS::HashEntry::):
     92        (KJS::staticFunctionGetter):
     93        * kjs/math_object.cpp:
     94        (KJS::mathProtoFuncAbs):
     95        (KJS::mathProtoFuncACos):
     96        (KJS::mathProtoFuncASin):
     97        (KJS::mathProtoFuncATan):
     98        (KJS::mathProtoFuncATan2):
     99        (KJS::mathProtoFuncCeil):
     100        (KJS::mathProtoFuncCos):
     101        (KJS::mathProtoFuncExp):
     102        (KJS::mathProtoFuncFloor):
     103        (KJS::mathProtoFuncLog):
     104        (KJS::mathProtoFuncMax):
     105        (KJS::mathProtoFuncMin):
     106        (KJS::mathProtoFuncPow):
     107        (KJS::mathProtoFuncRandom):
     108        (KJS::mathProtoFuncRound):
     109        (KJS::mathProtoFuncSin):
     110        (KJS::mathProtoFuncSqrt):
     111        (KJS::mathProtoFuncTan):
     112        * kjs/math_object.h:
     113        * kjs/string_object.cpp:
     114        (KJS::stringProtoFuncToString):
     115        (KJS::stringProtoFuncValueOf):
     116        (KJS::stringProtoFuncCharAt):
     117        (KJS::stringProtoFuncCharCodeAt):
     118        (KJS::stringProtoFuncConcat):
     119        (KJS::stringProtoFuncIndexOf):
     120        (KJS::stringProtoFuncLastIndexOf):
     121        (KJS::stringProtoFuncMatch):
     122        (KJS::stringProtoFuncSearch):
     123        (KJS::stringProtoFuncReplace):
     124        (KJS::stringProtoFuncSlice):
     125        (KJS::stringProtoFuncSplit):
     126        (KJS::stringProtoFuncSubstr):
     127        (KJS::stringProtoFuncSubstring):
     128        (KJS::stringProtoFuncToLowerCase):
     129        (KJS::stringProtoFuncToUpperCase):
     130        (KJS::stringProtoFuncToLocaleLowerCase):
     131        (KJS::stringProtoFuncToLocaleUpperCase):
     132        (KJS::stringProtoFuncLocaleCompare):
     133        (KJS::stringProtoFuncBig):
     134        (KJS::stringProtoFuncSmall):
     135        (KJS::stringProtoFuncBlink):
     136        (KJS::stringProtoFuncBold):
     137        (KJS::stringProtoFuncFixed):
     138        (KJS::stringProtoFuncItalics):
     139        (KJS::stringProtoFuncStrike):
     140        (KJS::stringProtoFuncSub):
     141        (KJS::stringProtoFuncSup):
     142        (KJS::stringProtoFuncFontcolor):
     143        (KJS::stringProtoFuncFontsize):
     144        (KJS::stringProtoFuncAnchor):
     145        (KJS::stringProtoFuncLink):
     146        * kjs/string_object.h:
     147
    11482008-01-15  Geoffrey Garen  <[email protected]>
    2149
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r29447 r29508  
    160160__ZN3KJS16RuntimeObjectImp4infoE
    161161__ZN3KJS17PropertyNameArray3addERKNS_10IdentifierE
     162__ZN3KJS17PrototypeFunctionC1EPNS_9ExecStateEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectERKNS_4ListEE
    162163__ZN3KJS19InternalFunctionImp4infoE
    163164__ZN3KJS19InternalFunctionImpC2EPNS_17FunctionPrototypeERKNS_10IdentifierE
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r29425 r29508  
    392392                146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringRefCF.cpp; sourceTree = "<group>"; };
    393393                14760863099C633800437128 /* JSImmediate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSImmediate.cpp; sourceTree = "<group>"; };
    394                 1482B6EA0A4300B300517CFC /* JSValueRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSValueRef.h; path = ../API/JSValueRef.h; sourceTree = "<group>"; };
     394                1482B6EA0A4300B300517CFC /* JSValueRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSValueRef.h; sourceTree = "<group>"; };
    395395                1482B74B0A43032800517CFC /* JSStringRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringRef.h; sourceTree = "<group>"; };
    396396                1482B74C0A43032800517CFC /* JSStringRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringRef.cpp; sourceTree = "<group>"; };
     
    742742                        isa = PBXGroup;
    743743                        children = (
     744                                1482B78A0A4305AB00517CFC /* APICast.h */,
    744745                                1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */,
    745746                                1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */,
    746                                 1482B78A0A4305AB00517CFC /* APICast.h */,
    747747                                1421359A0A677F4F00A8195E /* JSBase.cpp */,
    748748                                142711380A460BBB0080EEEA /* JSBase.h */,
     
    766766                                146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */,
    767767                                14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */,
     768                                1482B6EA0A4300B300517CFC /* JSValueRef.h */,
    768769                        );
    769770                        path = API;
     
    931932                        isa = PBXGroup;
    932933                        children = (
    933                                 14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
    934934                                659126BC0BDD1728001921FB /* AllInOneFile.cpp */,
    935935                                93ADFCE60CCBD7AC00D30B08 /* array_instance.cpp */,
     
    978978                                65EA4C9A092AF9E20093D800 /* JSLock.h */,
    979979                                14ABB454099C2A0F00E2A24F /* JSType.h */,
    980                                 1482B6EA0A4300B300517CFC /* JSValueRef.h */,
     980                                14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
    981981                                14F252560D08DD8D004ECFFF /* JSVariableObject.h */,
    982982                                65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */,
  • trunk/JavaScriptCore/kjs/array_object.cpp

    r29459 r29508  
    4343/* Source for array_object.lut.h
    4444@begin arrayTable 16
    45   toString       &ArrayProtoFuncToString::create       DontEnum|Function 0
    46   toLocaleString &ArrayProtoFuncToLocaleString::create DontEnum|Function 0
    47   concat         &ArrayProtoFuncConcat::create         DontEnum|Function 1
    48   join           &ArrayProtoFuncJoin::create           DontEnum|Function 1
    49   pop            &ArrayProtoFuncPop::create            DontEnum|Function 0
    50   push           &ArrayProtoFuncPush::create           DontEnum|Function 1
    51   reverse        &ArrayProtoFuncReverse::create        DontEnum|Function 0
    52   shift          &ArrayProtoFuncShift::create          DontEnum|Function 0
    53   slice          &ArrayProtoFuncSlice::create          DontEnum|Function 2
    54   sort           &ArrayProtoFuncSort::create           DontEnum|Function 1
    55   splice         &ArrayProtoFuncSplice::create         DontEnum|Function 2
    56   unshift        &ArrayProtoFuncUnShift::create        DontEnum|Function 1
    57   every          &ArrayProtoFuncEvery::create          DontEnum|Function 1
    58   forEach        &ArrayProtoFuncForEach::create        DontEnum|Function 1
    59   some           &ArrayProtoFuncSome::create           DontEnum|Function 1
    60   indexOf        &ArrayProtoFuncIndexOf::create        DontEnum|Function 1
    61   lastIndexOf    &ArrayProtoFuncLastIndexOf::create    DontEnum|Function 1
    62   filter         &ArrayProtoFuncFilter::create         DontEnum|Function 1
    63   map            &ArrayProtoFuncMap::create            DontEnum|Function 1
     45  toString       arrayProtoFuncToString       DontEnum|Function 0
     46  toLocaleString arrayProtoFuncToLocaleString DontEnum|Function 0
     47  concat         arrayProtoFuncConcat         DontEnum|Function 1
     48  join           arrayProtoFuncJoin           DontEnum|Function 1
     49  pop            arrayProtoFuncPop            DontEnum|Function 0
     50  push           arrayProtoFuncPush           DontEnum|Function 1
     51  reverse        arrayProtoFuncReverse        DontEnum|Function 0
     52  shift          arrayProtoFuncShift          DontEnum|Function 0
     53  slice          arrayProtoFuncSlice          DontEnum|Function 2
     54  sort           arrayProtoFuncSort           DontEnum|Function 1
     55  splice         arrayProtoFuncSplice         DontEnum|Function 2
     56  unshift        arrayProtoFuncUnShift        DontEnum|Function 1
     57  every          arrayProtoFuncEvery          DontEnum|Function 1
     58  forEach        arrayProtoFuncForEach        DontEnum|Function 1
     59  some           arrayProtoFuncSome           DontEnum|Function 1
     60  indexOf        arrayProtoFuncIndexOf        DontEnum|Function 1
     61  lastIndexOf    arrayProtoFuncLastIndexOf    DontEnum|Function 1
     62  filter         arrayProtoFuncFilter         DontEnum|Function 1
     63  map            arrayProtoFuncMap            DontEnum|Function 1
    6464@end
    6565*/
     
    8888}
    8989
    90 JSValue* ArrayProtoFuncToString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     90JSValue* arrayProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&)
    9191{
    9292    if (!thisObj->inherits(&ArrayInstance::info))
     
    130130}
    131131
    132 JSValue* ArrayProtoFuncToLocaleString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     132JSValue* arrayProtoFuncToLocaleString(ExecState* exec, JSObject* thisObj, const List&)
    133133{
    134134    if (!thisObj->inherits(&ArrayInstance::info))
     
    177177}
    178178
    179 JSValue* ArrayProtoFuncJoin::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     179JSValue* arrayProtoFuncJoin(ExecState* exec, JSObject* thisObj, const List& args)
    180180{
    181181    static HashSet<JSObject*> visitedElems;
     
    219219}
    220220
    221 JSValue* ArrayProtoFuncConcat::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     221JSValue* arrayProtoFuncConcat(ExecState* exec, JSObject* thisObj, const List& args)
    222222{
    223223    JSObject* arr = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, exec->emptyList()));
     
    254254}
    255255
    256 JSValue* ArrayProtoFuncPop::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     256JSValue* arrayProtoFuncPop(ExecState* exec, JSObject* thisObj, const List&)
    257257{
    258258    JSValue* result = 0;
     
    268268}
    269269
    270 JSValue* ArrayProtoFuncPush::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     270JSValue* arrayProtoFuncPush(ExecState* exec, JSObject* thisObj, const List& args)
    271271{
    272272    unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
     
    278278}
    279279
    280 JSValue* ArrayProtoFuncReverse::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     280JSValue* arrayProtoFuncReverse(ExecState* exec, JSObject* thisObj, const List&)
    281281{
    282282    unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
     
    301301}
    302302
    303 JSValue* ArrayProtoFuncShift::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     303JSValue* arrayProtoFuncShift(ExecState* exec, JSObject* thisObj, const List&)
    304304{
    305305    JSValue* result = 0;
     
    323323}
    324324
    325 JSValue* ArrayProtoFuncSlice::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     325JSValue* arrayProtoFuncSlice(ExecState* exec, JSObject* thisObj, const List& args)
    326326{
    327327    // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
     
    366366}
    367367
    368 JSValue* ArrayProtoFuncSort::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     368JSValue* arrayProtoFuncSort(ExecState* exec, JSObject* thisObj, const List& args)
    369369{
    370370    JSObject* sortFunction = 0;
     
    425425}
    426426
    427 JSValue* ArrayProtoFuncSplice::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     427JSValue* arrayProtoFuncSplice(ExecState* exec, JSObject* thisObj, const List& args)
    428428{
    429429    // 15.4.4.12
     
    478478}
    479479
    480 JSValue* ArrayProtoFuncUnShift::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     480JSValue* arrayProtoFuncUnShift(ExecState* exec, JSObject* thisObj, const List& args)
    481481{
    482482    // 15.4.4.13
     
    496496}
    497497
    498 JSValue* ArrayProtoFuncFilter::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     498JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject* thisObj, const List& args)
    499499{
    500500    JSObject* eachFunction = args[0]->toObject(exec);
     
    530530}
    531531
    532 JSValue* ArrayProtoFuncMap::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     532JSValue* arrayProtoFuncMap(ExecState* exec, JSObject* thisObj, const List& args)
    533533{
    534534    JSObject* eachFunction = args[0]->toObject(exec);
     
    569569// http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some
    570570
    571 JSValue* ArrayProtoFuncEvery::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     571JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject* thisObj, const List& args)
    572572{
    573573    JSObject* eachFunction = args[0]->toObject(exec);
     
    604604}
    605605
    606 JSValue* ArrayProtoFuncForEach::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     606JSValue* arrayProtoFuncForEach(ExecState* exec, JSObject* thisObj, const List& args)
    607607{
    608608    JSObject* eachFunction = args[0]->toObject(exec);
     
    629629}
    630630
    631 JSValue* ArrayProtoFuncSome::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     631JSValue* arrayProtoFuncSome(ExecState* exec, JSObject* thisObj, const List& args)
    632632{
    633633    JSObject* eachFunction = args[0]->toObject(exec);
     
    661661}
    662662
    663 JSValue* ArrayProtoFuncIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     663JSValue* arrayProtoFuncIndexOf(ExecState* exec, JSObject* thisObj, const List& args)
    664664{
    665665    // JavaScript 1.5 Extension by Mozilla
     
    690690}
    691691
    692 JSValue* ArrayProtoFuncLastIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     692JSValue* arrayProtoFuncLastIndexOf(ExecState* exec, JSObject* thisObj, const List& args)
    693693{
    694694    // JavaScript 1.6 Extension by Mozilla
  • trunk/JavaScriptCore/kjs/array_object.h

    r27608 r29508  
    4949  };
    5050
    51 #define FOR_EACH_CLASS(macro) \
    52     macro(ArrayProtoFuncToString) \
    53     macro(ArrayProtoFuncToLocaleString) \
    54     macro(ArrayProtoFuncConcat) \
    55     macro(ArrayProtoFuncJoin) \
    56     macro(ArrayProtoFuncPop) \
    57     macro(ArrayProtoFuncPush) \
    58     macro(ArrayProtoFuncReverse) \
    59     macro(ArrayProtoFuncShift) \
    60     macro(ArrayProtoFuncSlice) \
    61     macro(ArrayProtoFuncSort) \
    62     macro(ArrayProtoFuncSplice) \
    63     macro(ArrayProtoFuncUnShift) \
    64     macro(ArrayProtoFuncEvery) \
    65     macro(ArrayProtoFuncForEach) \
    66     macro(ArrayProtoFuncSome) \
    67     macro(ArrayProtoFuncIndexOf) \
    68     macro(ArrayProtoFuncFilter) \
    69     macro(ArrayProtoFuncMap) \
    70     macro(ArrayProtoFuncLastIndexOf) \
    71 
    72 FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
    73 #undef FOR_EACH_CLASS
     51  JSValue* arrayProtoFuncToString(ExecState*, JSObject*, const List&);
     52  JSValue* arrayProtoFuncToLocaleString(ExecState*, JSObject*, const List&);
     53  JSValue* arrayProtoFuncConcat(ExecState*, JSObject*, const List&);
     54  JSValue* arrayProtoFuncJoin(ExecState*, JSObject*, const List&);
     55  JSValue* arrayProtoFuncPop(ExecState*, JSObject*, const List&);
     56  JSValue* arrayProtoFuncPush(ExecState*, JSObject*, const List&);
     57  JSValue* arrayProtoFuncReverse(ExecState*, JSObject*, const List&);
     58  JSValue* arrayProtoFuncShift(ExecState*, JSObject*, const List&);
     59  JSValue* arrayProtoFuncSlice(ExecState*, JSObject*, const List&);
     60  JSValue* arrayProtoFuncSort(ExecState*, JSObject*, const List&);
     61  JSValue* arrayProtoFuncSplice(ExecState*, JSObject*, const List&);
     62  JSValue* arrayProtoFuncUnShift(ExecState*, JSObject*, const List&);
     63  JSValue* arrayProtoFuncEvery(ExecState*, JSObject*, const List&);
     64  JSValue* arrayProtoFuncForEach(ExecState*, JSObject*, const List&);
     65  JSValue* arrayProtoFuncSome(ExecState*, JSObject*, const List&);
     66  JSValue* arrayProtoFuncIndexOf(ExecState*, JSObject*, const List&);
     67  JSValue* arrayProtoFuncFilter(ExecState*, JSObject*, const List&);
     68  JSValue* arrayProtoFuncMap(ExecState*, JSObject*, const List&);
     69  JSValue* arrayProtoFuncLastIndexOf(ExecState*, JSObject*, const List&);
    7470
    7571} // namespace KJS
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r29217 r29508  
    376376   FIXMEL We could use templates to simplify the UTC variants.
    377377@begin dateTable 61
    378   toString              &DateProtoFuncToString::create                DontEnum|Function       0
    379   toUTCString           &DateProtoFuncToUTCString::create             DontEnum|Function       0
    380   toDateString          &DateProtoFuncToDateString::create            DontEnum|Function       0
    381   toTimeString          &DateProtoFuncToTimeString::create            DontEnum|Function       0
    382   toLocaleString        &DateProtoFuncToLocaleString::create          DontEnum|Function       0
    383   toLocaleDateString    &DateProtoFuncToLocaleDateString::create      DontEnum|Function       0
    384   toLocaleTimeString    &DateProtoFuncToLocaleTimeString::create      DontEnum|Function       0
    385   valueOf               &DateProtoFuncValueOf::create                 DontEnum|Function       0
    386   getTime               &DateProtoFuncGetTime::create                 DontEnum|Function       0
    387   getFullYear           &DateProtoFuncGetFullYear::create             DontEnum|Function       0
    388   getUTCFullYear        &DateProtoFuncGetUTCFullYear::create          DontEnum|Function       0
    389   toGMTString           &DateProtoFuncToGMTString::create             DontEnum|Function       0
    390   getMonth              &DateProtoFuncGetMonth::create                DontEnum|Function       0
    391   getUTCMonth           &DateProtoFuncGetUTCMonth::create             DontEnum|Function       0
    392   getDate               &DateProtoFuncGetDate::create                 DontEnum|Function       0
    393   getUTCDate            &DateProtoFuncGetUTCDate::create              DontEnum|Function       0
    394   getDay                &DateProtoFuncGetDay::create                  DontEnum|Function       0
    395   getUTCDay             &DateProtoFuncGetUTCDay::create               DontEnum|Function       0
    396   getHours              &DateProtoFuncGetHours::create                DontEnum|Function       0
    397   getUTCHours           &DateProtoFuncGetUTCHours::create             DontEnum|Function       0
    398   getMinutes            &DateProtoFuncGetMinutes::create              DontEnum|Function       0
    399   getUTCMinutes         &DateProtoFuncGetUTCMinutes::create           DontEnum|Function       0
    400   getSeconds            &DateProtoFuncGetSeconds::create              DontEnum|Function       0
    401   getUTCSeconds         &DateProtoFuncGetUTCSeconds::create           DontEnum|Function       0
    402   getMilliseconds       &DateProtoFuncGetMilliSeconds::create         DontEnum|Function       0
    403   getUTCMilliseconds    &DateProtoFuncGetUTCMilliseconds::create      DontEnum|Function       0
    404   getTimezoneOffset     &DateProtoFuncGetTimezoneOffset::create       DontEnum|Function       0
    405   setTime               &DateProtoFuncSetTime::create                 DontEnum|Function       1
    406   setMilliseconds       &DateProtoFuncSetMilliSeconds::create         DontEnum|Function       1
    407   setUTCMilliseconds    &DateProtoFuncSetUTCMilliseconds::create      DontEnum|Function       1
    408   setSeconds            &DateProtoFuncSetSeconds::create              DontEnum|Function       2
    409   setUTCSeconds         &DateProtoFuncSetUTCSeconds::create           DontEnum|Function       2
    410   setMinutes            &DateProtoFuncSetMinutes::create              DontEnum|Function       3
    411   setUTCMinutes         &DateProtoFuncSetUTCMinutes::create           DontEnum|Function       3
    412   setHours              &DateProtoFuncSetHours::create                DontEnum|Function       4
    413   setUTCHours           &DateProtoFuncSetUTCHours::create             DontEnum|Function       4
    414   setDate               &DateProtoFuncSetDate::create                 DontEnum|Function       1
    415   setUTCDate            &DateProtoFuncSetUTCDate::create              DontEnum|Function       1
    416   setMonth              &DateProtoFuncSetMonth::create                DontEnum|Function       2
    417   setUTCMonth           &DateProtoFuncSetUTCMonth::create             DontEnum|Function       2
    418   setFullYear           &DateProtoFuncSetFullYear::create             DontEnum|Function       3
    419   setUTCFullYear        &DateProtoFuncSetUTCFullYear::create          DontEnum|Function       3
    420   setYear               &DateProtoFuncSetYear::create                 DontEnum|Function       1
    421   getYear               &DateProtoFuncGetYear::create                 DontEnum|Function       0
     378  toString              dateProtoFuncToString                DontEnum|Function       0
     379  toUTCString           dateProtoFuncToUTCString             DontEnum|Function       0
     380  toDateString          dateProtoFuncToDateString            DontEnum|Function       0
     381  toTimeString          dateProtoFuncToTimeString            DontEnum|Function       0
     382  toLocaleString        dateProtoFuncToLocaleString          DontEnum|Function       0
     383  toLocaleDateString    dateProtoFuncToLocaleDateString      DontEnum|Function       0
     384  toLocaleTimeString    dateProtoFuncToLocaleTimeString      DontEnum|Function       0
     385  valueOf               dateProtoFuncValueOf                 DontEnum|Function       0
     386  getTime               dateProtoFuncGetTime                 DontEnum|Function       0
     387  getFullYear           dateProtoFuncGetFullYear             DontEnum|Function       0
     388  getUTCFullYear        dateProtoFuncGetUTCFullYear          DontEnum|Function       0
     389  toGMTString           dateProtoFuncToGMTString             DontEnum|Function       0
     390  getMonth              dateProtoFuncGetMonth                DontEnum|Function       0
     391  getUTCMonth           dateProtoFuncGetUTCMonth             DontEnum|Function       0
     392  getDate               dateProtoFuncGetDate                 DontEnum|Function       0
     393  getUTCDate            dateProtoFuncGetUTCDate              DontEnum|Function       0
     394  getDay                dateProtoFuncGetDay                  DontEnum|Function       0
     395  getUTCDay             dateProtoFuncGetUTCDay               DontEnum|Function       0
     396  getHours              dateProtoFuncGetHours                DontEnum|Function       0
     397  getUTCHours           dateProtoFuncGetUTCHours             DontEnum|Function       0
     398  getMinutes            dateProtoFuncGetMinutes              DontEnum|Function       0
     399  getUTCMinutes         dateProtoFuncGetUTCMinutes           DontEnum|Function       0
     400  getSeconds            dateProtoFuncGetSeconds              DontEnum|Function       0
     401  getUTCSeconds         dateProtoFuncGetUTCSeconds           DontEnum|Function       0
     402  getMilliseconds       dateProtoFuncGetMilliSeconds         DontEnum|Function       0
     403  getUTCMilliseconds    dateProtoFuncGetUTCMilliseconds      DontEnum|Function       0
     404  getTimezoneOffset     dateProtoFuncGetTimezoneOffset       DontEnum|Function       0
     405  setTime               dateProtoFuncSetTime                 DontEnum|Function       1
     406  setMilliseconds       dateProtoFuncSetMilliSeconds         DontEnum|Function       1
     407  setUTCMilliseconds    dateProtoFuncSetUTCMilliseconds      DontEnum|Function       1
     408  setSeconds            dateProtoFuncSetSeconds              DontEnum|Function       2
     409  setUTCSeconds         dateProtoFuncSetUTCSeconds           DontEnum|Function       2
     410  setMinutes            dateProtoFuncSetMinutes              DontEnum|Function       3
     411  setUTCMinutes         dateProtoFuncSetUTCMinutes           DontEnum|Function       3
     412  setHours              dateProtoFuncSetHours                DontEnum|Function       4
     413  setUTCHours           dateProtoFuncSetUTCHours             DontEnum|Function       4
     414  setDate               dateProtoFuncSetDate                 DontEnum|Function       1
     415  setUTCDate            dateProtoFuncSetUTCDate              DontEnum|Function       1
     416  setMonth              dateProtoFuncSetMonth                DontEnum|Function       2
     417  setUTCMonth           dateProtoFuncSetUTCMonth             DontEnum|Function       2
     418  setFullYear           dateProtoFuncSetFullYear             DontEnum|Function       3
     419  setUTCFullYear        dateProtoFuncSetUTCFullYear          DontEnum|Function       3
     420  setYear               dateProtoFuncSetYear                 DontEnum|Function       1
     421  getYear               dateProtoFuncGetYear                 DontEnum|Function       0
    422422@end
    423423*/
     
    431431}
    432432
    433 bool DatePrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
     433bool DatePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    434434{
    435435    return getStaticFunctionSlot<JSObject>(exec, &dateTable, this, propertyName, slot);
     
    936936// Functions
    937937
    938 JSValue* DateProtoFuncToString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     938JSValue* dateProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&)
    939939{
    940940    if (!thisObj->inherits(&DateInstance::info))
     
    954954}
    955955
    956 JSValue* DateProtoFuncToUTCString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     956JSValue* dateProtoFuncToUTCString(ExecState* exec, JSObject* thisObj, const List&)
    957957{
    958958    if (!thisObj->inherits(&DateInstance::info))
     
    972972}
    973973
    974 JSValue* DateProtoFuncToDateString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     974JSValue* dateProtoFuncToDateString(ExecState* exec, JSObject* thisObj, const List&)
    975975{
    976976    if (!thisObj->inherits(&DateInstance::info))
     
    990990}
    991991
    992 JSValue* DateProtoFuncToTimeString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     992JSValue* dateProtoFuncToTimeString(ExecState* exec, JSObject* thisObj, const List&)
    993993{
    994994    if (!thisObj->inherits(&DateInstance::info))
     
    10081008}
    10091009
    1010 JSValue* DateProtoFuncToLocaleString::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1010JSValue* dateProtoFuncToLocaleString(ExecState* exec, JSObject* thisObj, const List& args)
    10111011{
    10121012    if (!thisObj->inherits(&DateInstance::info))
     
    10331033}
    10341034
    1035 JSValue* DateProtoFuncToLocaleDateString::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1035JSValue* dateProtoFuncToLocaleDateString(ExecState* exec, JSObject* thisObj, const List& args)
    10361036{
    10371037    if (!thisObj->inherits(&DateInstance::info))
     
    10581058}
    10591059
    1060 JSValue* DateProtoFuncToLocaleTimeString::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1060JSValue* dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject* thisObj, const List& args)
    10611061{
    10621062    if (!thisObj->inherits(&DateInstance::info))
     
    10831083}
    10841084
    1085 JSValue* DateProtoFuncValueOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1085JSValue* dateProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const List&)
    10861086{
    10871087    if (!thisObj->inherits(&DateInstance::info))
     
    10971097}
    10981098
    1099 JSValue* DateProtoFuncGetTime::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1099JSValue* dateProtoFuncGetTime(ExecState* exec, JSObject* thisObj, const List&)
    11001100{
    11011101    if (!thisObj->inherits(&DateInstance::info))
     
    11111111}
    11121112
    1113 JSValue* DateProtoFuncGetFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1113JSValue* dateProtoFuncGetFullYear(ExecState* exec, JSObject* thisObj, const List&)
    11141114{
    11151115    if (!thisObj->inherits(&DateInstance::info))
     
    11291129}
    11301130
    1131 JSValue* DateProtoFuncGetUTCFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1131JSValue* dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject* thisObj, const List&)
    11321132{
    11331133    if (!thisObj->inherits(&DateInstance::info))
     
    11471147}
    11481148
    1149 JSValue* DateProtoFuncToGMTString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1149JSValue* dateProtoFuncToGMTString(ExecState* exec, JSObject* thisObj, const List&)
    11501150{
    11511151    if (!thisObj->inherits(&DateInstance::info))
     
    11651165}
    11661166
    1167 JSValue* DateProtoFuncGetMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1167JSValue* dateProtoFuncGetMonth(ExecState* exec, JSObject* thisObj, const List&)
    11681168{
    11691169    if (!thisObj->inherits(&DateInstance::info))
     
    11831183}
    11841184
    1185 JSValue* DateProtoFuncGetUTCMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1185JSValue* dateProtoFuncGetUTCMonth(ExecState* exec, JSObject* thisObj, const List&)
    11861186{
    11871187    if (!thisObj->inherits(&DateInstance::info))
     
    12011201}
    12021202
    1203 JSValue* DateProtoFuncGetDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1203JSValue* dateProtoFuncGetDate(ExecState* exec, JSObject* thisObj, const List&)
    12041204{
    12051205    if (!thisObj->inherits(&DateInstance::info))
     
    12191219}
    12201220
    1221 JSValue* DateProtoFuncGetUTCDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1221JSValue* dateProtoFuncGetUTCDate(ExecState* exec, JSObject* thisObj, const List&)
    12221222{
    12231223    if (!thisObj->inherits(&DateInstance::info))
     
    12371237}
    12381238
    1239 JSValue* DateProtoFuncGetDay::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1239JSValue* dateProtoFuncGetDay(ExecState* exec, JSObject* thisObj, const List&)
    12401240{
    12411241    if (!thisObj->inherits(&DateInstance::info))
     
    12551255}
    12561256
    1257 JSValue* DateProtoFuncGetUTCDay::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1257JSValue* dateProtoFuncGetUTCDay(ExecState* exec, JSObject* thisObj, const List&)
    12581258{
    12591259    if (!thisObj->inherits(&DateInstance::info))
     
    12731273}
    12741274
    1275 JSValue* DateProtoFuncGetHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1275JSValue* dateProtoFuncGetHours(ExecState* exec, JSObject* thisObj, const List&)
    12761276{
    12771277    if (!thisObj->inherits(&DateInstance::info))
     
    12911291}
    12921292
    1293 JSValue* DateProtoFuncGetUTCHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1293JSValue* dateProtoFuncGetUTCHours(ExecState* exec, JSObject* thisObj, const List&)
    12941294{
    12951295    if (!thisObj->inherits(&DateInstance::info))
     
    13091309}
    13101310
    1311 JSValue* DateProtoFuncGetMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1311JSValue* dateProtoFuncGetMinutes(ExecState* exec, JSObject* thisObj, const List&)
    13121312{
    13131313    if (!thisObj->inherits(&DateInstance::info))
     
    13271327}
    13281328
    1329 JSValue* DateProtoFuncGetUTCMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1329JSValue* dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject* thisObj, const List&)
    13301330{
    13311331    if (!thisObj->inherits(&DateInstance::info))
     
    13451345}
    13461346
    1347 JSValue* DateProtoFuncGetSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1347JSValue* dateProtoFuncGetSeconds(ExecState* exec, JSObject* thisObj, const List&)
    13481348{
    13491349    if (!thisObj->inherits(&DateInstance::info))
     
    13631363}
    13641364
    1365 JSValue* DateProtoFuncGetUTCSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1365JSValue* dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject* thisObj, const List&)
    13661366{
    13671367    if (!thisObj->inherits(&DateInstance::info))
     
    13811381}
    13821382
    1383 JSValue* DateProtoFuncGetMilliSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1383JSValue* dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject* thisObj, const List&)
    13841384{
    13851385    if (!thisObj->inherits(&DateInstance::info))
     
    13971397}
    13981398
    1399 JSValue* DateProtoFuncGetUTCMilliseconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1399JSValue* dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject* thisObj, const List&)
    14001400{
    14011401    if (!thisObj->inherits(&DateInstance::info))
     
    14131413}
    14141414
    1415 JSValue* DateProtoFuncGetTimezoneOffset::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1415JSValue* dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject* thisObj, const List&)
    14161416{
    14171417    if (!thisObj->inherits(&DateInstance::info))
     
    14311431}
    14321432
    1433 JSValue* DateProtoFuncSetTime::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1433JSValue* dateProtoFuncSetTime(ExecState* exec, JSObject* thisObj, const List& args)
    14341434{
    14351435    if (!thisObj->inherits(&DateInstance::info))
     
    14861486}
    14871487
    1488 JSValue* DateProtoFuncSetMilliSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1488JSValue* dateProtoFuncSetMilliSeconds(ExecState* exec, JSObject* thisObj, const List& args)
    14891489{
    14901490    const bool inputIsUTC = false;
     
    14921492}
    14931493
    1494 JSValue* DateProtoFuncSetUTCMilliseconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1494JSValue* dateProtoFuncSetUTCMilliseconds(ExecState* exec, JSObject* thisObj, const List& args)
    14951495{
    14961496    const bool inputIsUTC = true;
     
    14981498}
    14991499
    1500 JSValue* DateProtoFuncSetSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1500JSValue* dateProtoFuncSetSeconds(ExecState* exec, JSObject* thisObj, const List& args)
    15011501{
    15021502    const bool inputIsUTC = false;
     
    15041504}
    15051505
    1506 JSValue* DateProtoFuncSetUTCSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1506JSValue* dateProtoFuncSetUTCSeconds(ExecState* exec, JSObject* thisObj, const List& args)
    15071507{
    15081508    const bool inputIsUTC = true;
     
    15101510}
    15111511
    1512 JSValue* DateProtoFuncSetMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1512JSValue* dateProtoFuncSetMinutes(ExecState* exec, JSObject* thisObj, const List& args)
    15131513{
    15141514    const bool inputIsUTC = false;
     
    15161516}
    15171517
    1518 JSValue* DateProtoFuncSetUTCMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1518JSValue* dateProtoFuncSetUTCMinutes(ExecState* exec, JSObject* thisObj, const List& args)
    15191519{
    15201520    const bool inputIsUTC = true;
     
    15221522}
    15231523
    1524 JSValue* DateProtoFuncSetHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1524JSValue* dateProtoFuncSetHours(ExecState* exec, JSObject* thisObj, const List& args)
    15251525{
    15261526    const bool inputIsUTC = false;
     
    15281528}
    15291529
    1530 JSValue* DateProtoFuncSetUTCHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1530JSValue* dateProtoFuncSetUTCHours(ExecState* exec, JSObject* thisObj, const List& args)
    15311531{
    15321532    const bool inputIsUTC = true;
     
    15341534}
    15351535
    1536 JSValue* DateProtoFuncSetDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1536JSValue* dateProtoFuncSetDate(ExecState* exec, JSObject* thisObj, const List& args)
    15371537{
    15381538    const bool inputIsUTC = false;
     
    15401540}
    15411541
    1542 JSValue* DateProtoFuncSetUTCDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1542JSValue* dateProtoFuncSetUTCDate(ExecState* exec, JSObject* thisObj, const List& args)
    15431543{
    15441544    const bool inputIsUTC = true;
     
    15461546}
    15471547
    1548 JSValue* DateProtoFuncSetMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1548JSValue* dateProtoFuncSetMonth(ExecState* exec, JSObject* thisObj, const List& args)
    15491549{
    15501550    const bool inputIsUTC = false;
     
    15521552}
    15531553
    1554 JSValue* DateProtoFuncSetUTCMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1554JSValue* dateProtoFuncSetUTCMonth(ExecState* exec, JSObject* thisObj, const List& args)
    15551555{
    15561556    const bool inputIsUTC = true;
     
    15581558}
    15591559
    1560 JSValue* DateProtoFuncSetFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1560JSValue* dateProtoFuncSetFullYear(ExecState* exec, JSObject* thisObj, const List& args)
    15611561{
    15621562    const bool inputIsUTC = false;
     
    15641564}
    15651565
    1566 JSValue* DateProtoFuncSetUTCFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1566JSValue* dateProtoFuncSetUTCFullYear(ExecState* exec, JSObject* thisObj, const List& args)
    15671567{
    15681568    const bool inputIsUTC = true;
     
    15701570}
    15711571
    1572 JSValue* DateProtoFuncSetYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     1572JSValue* dateProtoFuncSetYear(ExecState* exec, JSObject* thisObj, const List& args)
    15731573{
    15741574    if (!thisObj->inherits(&DateInstance::info))
     
    15931593}
    15941594
    1595 JSValue* DateProtoFuncGetYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     1595JSValue* dateProtoFuncGetYear(ExecState* exec, JSObject* thisObj, const List&)
    15961596{
    15971597    if (!thisObj->inherits(&DateInstance::info))
  • trunk/JavaScriptCore/kjs/date_object.h

    r28907 r29508  
    6161
    6262    /**
    63         * @internal
     63     * @internal
    6464     *
    65      * Class to implement all methods that are properties of the
     65     * Functions to implement all methods that are properties of the
    6666     * Date.prototype object
    6767     */
     
    7070    // GetYear, SetYear, ToGMTString
    7171
    72 #define FOR_EACH_CLASS(macro) \
    73     macro(DateProtoFuncToString) \
    74     macro(DateProtoFuncToUTCString) \
    75     macro(DateProtoFuncToDateString) \
    76     macro(DateProtoFuncToTimeString) \
    77     macro(DateProtoFuncToLocaleString) \
    78     macro(DateProtoFuncToLocaleDateString) \
    79     macro(DateProtoFuncToLocaleTimeString) \
    80     macro(DateProtoFuncValueOf) \
    81     macro(DateProtoFuncGetTime) \
    82     macro(DateProtoFuncGetFullYear) \
    83     macro(DateProtoFuncGetUTCFullYear) \
    84     macro(DateProtoFuncToGMTString) \
    85     macro(DateProtoFuncGetMonth) \
    86     macro(DateProtoFuncGetUTCMonth) \
    87     macro(DateProtoFuncGetDate) \
    88     macro(DateProtoFuncGetUTCDate) \
    89     macro(DateProtoFuncGetDay) \
    90     macro(DateProtoFuncGetUTCDay) \
    91     macro(DateProtoFuncGetHours) \
    92     macro(DateProtoFuncGetUTCHours) \
    93     macro(DateProtoFuncGetMinutes) \
    94     macro(DateProtoFuncGetUTCMinutes) \
    95     macro(DateProtoFuncGetSeconds) \
    96     macro(DateProtoFuncGetUTCSeconds) \
    97     macro(DateProtoFuncGetMilliSeconds) \
    98     macro(DateProtoFuncGetUTCMilliseconds) \
    99     macro(DateProtoFuncGetTimezoneOffset) \
    100     macro(DateProtoFuncSetTime) \
    101     macro(DateProtoFuncSetMilliSeconds) \
    102     macro(DateProtoFuncSetUTCMilliseconds) \
    103     macro(DateProtoFuncSetSeconds) \
    104     macro(DateProtoFuncSetUTCSeconds) \
    105     macro(DateProtoFuncSetMinutes) \
    106     macro(DateProtoFuncSetUTCMinutes) \
    107     macro(DateProtoFuncSetHours) \
    108     macro(DateProtoFuncSetUTCHours) \
    109     macro(DateProtoFuncSetDate) \
    110     macro(DateProtoFuncSetUTCDate) \
    111     macro(DateProtoFuncSetMonth) \
    112     macro(DateProtoFuncSetUTCMonth) \
    113     macro(DateProtoFuncSetFullYear) \
    114     macro(DateProtoFuncSetUTCFullYear) \
    115     macro(DateProtoFuncSetYear) \
    116     macro(DateProtoFuncGetYear) \
    117 
    118 FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
    119 #undef FOR_EACH_CLASS
    120 
     72    JSValue* dateProtoFuncToString(ExecState*, JSObject*, const List&);
     73    JSValue* dateProtoFuncToUTCString(ExecState*, JSObject*, const List&);
     74    JSValue* dateProtoFuncToDateString(ExecState*, JSObject*, const List&);
     75    JSValue* dateProtoFuncToTimeString(ExecState*, JSObject*, const List&);
     76    JSValue* dateProtoFuncToLocaleString(ExecState*, JSObject*, const List&);
     77    JSValue* dateProtoFuncToLocaleDateString(ExecState*, JSObject*, const List&);
     78    JSValue* dateProtoFuncToLocaleTimeString(ExecState*, JSObject*, const List&);
     79    JSValue* dateProtoFuncValueOf(ExecState*, JSObject*, const List&);
     80    JSValue* dateProtoFuncGetTime(ExecState*, JSObject*, const List&);
     81    JSValue* dateProtoFuncGetFullYear(ExecState*, JSObject*, const List&);
     82    JSValue* dateProtoFuncGetUTCFullYear(ExecState*, JSObject*, const List&);
     83    JSValue* dateProtoFuncToGMTString(ExecState*, JSObject*, const List&);
     84    JSValue* dateProtoFuncGetMonth(ExecState*, JSObject*, const List&);
     85    JSValue* dateProtoFuncGetUTCMonth(ExecState*, JSObject*, const List&);
     86    JSValue* dateProtoFuncGetDate(ExecState*, JSObject*, const List&);
     87    JSValue* dateProtoFuncGetUTCDate(ExecState*, JSObject*, const List&);
     88    JSValue* dateProtoFuncGetDay(ExecState*, JSObject*, const List&);
     89    JSValue* dateProtoFuncGetUTCDay(ExecState*, JSObject*, const List&);
     90    JSValue* dateProtoFuncGetHours(ExecState*, JSObject*, const List&);
     91    JSValue* dateProtoFuncGetUTCHours(ExecState*, JSObject*, const List&);
     92    JSValue* dateProtoFuncGetMinutes(ExecState*, JSObject*, const List&);
     93    JSValue* dateProtoFuncGetUTCMinutes(ExecState*, JSObject*, const List&);
     94    JSValue* dateProtoFuncGetSeconds(ExecState*, JSObject*, const List&);
     95    JSValue* dateProtoFuncGetUTCSeconds(ExecState*, JSObject*, const List&);
     96    JSValue* dateProtoFuncGetMilliSeconds(ExecState*, JSObject*, const List&);
     97    JSValue* dateProtoFuncGetUTCMilliseconds(ExecState*, JSObject*, const List&);
     98    JSValue* dateProtoFuncGetTimezoneOffset(ExecState*, JSObject*, const List&);
     99    JSValue* dateProtoFuncSetTime(ExecState*, JSObject*, const List&);
     100    JSValue* dateProtoFuncSetMilliSeconds(ExecState*, JSObject*, const List&);
     101    JSValue* dateProtoFuncSetUTCMilliseconds(ExecState*, JSObject*, const List&);
     102    JSValue* dateProtoFuncSetSeconds(ExecState*, JSObject*, const List&);
     103    JSValue* dateProtoFuncSetUTCSeconds(ExecState*, JSObject*, const List&);
     104    JSValue* dateProtoFuncSetMinutes(ExecState*, JSObject*, const List&);
     105    JSValue* dateProtoFuncSetUTCMinutes(ExecState*, JSObject*, const List&);
     106    JSValue* dateProtoFuncSetHours(ExecState*, JSObject*, const List&);
     107    JSValue* dateProtoFuncSetUTCHours(ExecState*, JSObject*, const List&);
     108    JSValue* dateProtoFuncSetDate(ExecState*, JSObject*, const List&);
     109    JSValue* dateProtoFuncSetUTCDate(ExecState*, JSObject*, const List&);
     110    JSValue* dateProtoFuncSetMonth(ExecState*, JSObject*, const List&);
     111    JSValue* dateProtoFuncSetUTCMonth(ExecState*, JSObject*, const List&);
     112    JSValue* dateProtoFuncSetFullYear(ExecState*, JSObject*, const List&);
     113    JSValue* dateProtoFuncSetUTCFullYear(ExecState*, JSObject*, const List&);
     114    JSValue* dateProtoFuncSetYear(ExecState*, JSObject*, const List&);
     115    JSValue* dateProtoFuncGetYear(ExecState*, JSObject*, const List&);
    121116
    122117    /**
  • trunk/JavaScriptCore/kjs/function.cpp

    r29439 r29508  
    857857}
    858858
    859 } // namespace
     859// ------------------------------ PrototypeFunction -------------------------------
     860
     861PrototypeFunction::PrototypeFunction(ExecState* exec, int len, const Identifier& name, JSMemberFunction function)
     862    : InternalFunctionImp(exec->lexicalGlobalObject()->functionPrototype(), name)
     863    , m_function(function)
     864{
     865    ASSERT_ARG(function, function);
     866    put(exec, exec->propertyNames().length, jsNumber(len), DontDelete | ReadOnly | DontEnum);
     867}
     868
     869JSValue* PrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     870{
     871    return m_function(exec, thisObj, args);
     872}
     873
     874} // namespace KJS
  • trunk/JavaScriptCore/kjs/function.h

    r29425 r29508  
    139139  };
    140140
     141  class PrototypeFunction : public InternalFunctionImp {
     142  public:
     143    typedef KJS::JSValue* (*JSMemberFunction)(ExecState*, JSObject*, const List&);
     144
     145    PrototypeFunction(ExecState*, int len, const Identifier&, JSMemberFunction);
     146
     147    virtual JSValue* callAsFunction(ExecState* exec, JSObject* thisObj, const List&);
     148
     149  private:
     150    const JSMemberFunction m_function;
     151  };
     152
    141153  class GlobalFuncImp : public InternalFunctionImp {
    142154  public:
  • trunk/JavaScriptCore/kjs/lookup.h

    r28884 r29508  
    3737   */
    3838  struct HashEntry {
    39     typedef InternalFunctionImp* (*ConstructFunctionObject)(ExecState*, int, const Identifier&);
    40 
    4139    /**
    4240     * s is the key (e.g. a property name)
     
    4947    union {
    5048      intptr_t intValue;
    51       ConstructFunctionObject functionValue;
     49      PrototypeFunction::JSMemberFunction functionValue;
    5250    } value;
    5351
     
    135133
    136134      const HashEntry* entry = slot.staticEntry();
    137       JSValue* val = entry->value.functionValue(exec, entry->params, propertyName);
     135      JSValue* val = new PrototypeFunction(exec, entry->params, propertyName, entry->value.functionValue);
    138136      thisObj->putDirect(propertyName, val, entry->attr);
    139137      return val;
     
    299297 * Using those macros is very simple: define the hashtable (e.g. "DOMNodePrototypeTable"), then
    300298 * KJS_DEFINE_PROTOTYPE(DOMNodePrototype)
    301  * KJS_IMPLEMENT_PROTOFUNC(DOMNodePrototypeFunction)
    302299 * KJS_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodePrototype, DOMNodePrototypeFunction)
    303300 * and use DOMNodePrototype::self(exec) as prototype in the DOMNode constructor.
     
    343340    }
    344341
    345 #define KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE(ClassFunction) \
    346     class ClassFunction : public KJS::InternalFunctionImp { \
    347     public: \
    348         static KJS::InternalFunctionImp* create(KJS::ExecState* exec, int len, const KJS::Identifier& name) \
    349         { \
    350             return new ClassFunction(exec, len, name); \
    351         } \
    352         ClassFunction(KJS::ExecState* exec, int len, const KJS::Identifier& name) \
    353             : KJS::InternalFunctionImp(static_cast<KJS::FunctionPrototype*>(exec->lexicalGlobalObject()->functionPrototype()), name) \
    354         { \
    355             put(exec, exec->propertyNames().length, KJS::jsNumber(len), KJS::DontDelete | KJS::ReadOnly | KJS::DontEnum); \
    356         } \
    357         \
    358         /* Macro user needs to implement the callAsFunction function. */ \
    359         virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List&); \
    360     }; \
    361 
    362342#endif // KJS_lookup_h
  • trunk/JavaScriptCore/kjs/math_object.cpp

    r27608 r29508  
    4545  SQRT1_2       MathObjectImp::Sqrt1_2         DontEnum|DontDelete|ReadOnly
    4646  SQRT2         MathObjectImp::Sqrt2           DontEnum|DontDelete|ReadOnly
    47   abs           &MathProtoFuncAbs::create      DontEnum|Function 1
    48   acos          &MathProtoFuncACos::create     DontEnum|Function 1
    49   asin          &MathProtoFuncASin::create     DontEnum|Function 1
    50   atan          &MathProtoFuncATan::create     DontEnum|Function 1
    51   atan2         &MathProtoFuncATan2::create    DontEnum|Function 2
    52   ceil          &MathProtoFuncCeil::create     DontEnum|Function 1
    53   cos           &MathProtoFuncCos::create      DontEnum|Function 1
    54   exp           &MathProtoFuncExp::create      DontEnum|Function 1
    55   floor         &MathProtoFuncFloor::create    DontEnum|Function 1
    56   log           &MathProtoFuncLog::create      DontEnum|Function 1
    57   max           &MathProtoFuncMax::create      DontEnum|Function 2
    58   min           &MathProtoFuncMin::create      DontEnum|Function 2
    59   pow           &MathProtoFuncPow::create      DontEnum|Function 2
    60   random        &MathProtoFuncRandom::create   DontEnum|Function 0
    61   round         &MathProtoFuncRound::create    DontEnum|Function 1
    62   sin           &MathProtoFuncSin::create      DontEnum|Function 1
    63   sqrt          &MathProtoFuncSqrt::create     DontEnum|Function 1
    64   tan           &MathProtoFuncTan::create      DontEnum|Function 1
     47  abs           mathProtoFuncAbs               DontEnum|Function 1
     48  acos          mathProtoFuncACos              DontEnum|Function 1
     49  asin          mathProtoFuncASin              DontEnum|Function 1
     50  atan          mathProtoFuncATan              DontEnum|Function 1
     51  atan2         mathProtoFuncATan2             DontEnum|Function 2
     52  ceil          mathProtoFuncCeil              DontEnum|Function 1
     53  cos           mathProtoFuncCos               DontEnum|Function 1
     54  exp           mathProtoFuncExp               DontEnum|Function 1
     55  floor         mathProtoFuncFloor             DontEnum|Function 1
     56  log           mathProtoFuncLog               DontEnum|Function 1
     57  max           mathProtoFuncMax               DontEnum|Function 2
     58  min           mathProtoFuncMin               DontEnum|Function 2
     59  pow           mathProtoFuncPow               DontEnum|Function 2
     60  random        mathProtoFuncRandom            DontEnum|Function 0
     61  round         mathProtoFuncRound             DontEnum|Function 1
     62  sin           mathProtoFuncSin               DontEnum|Function 1
     63  sqrt          mathProtoFuncSqrt              DontEnum|Function 1
     64  tan           mathProtoFuncTan               DontEnum|Function 1
    6565@end
    6666*/
     
    116116// ------------------------------ Functions --------------------------------
    117117
    118 JSValue* MathProtoFuncAbs::callAsFunction(ExecState* exec, JSObject*, const List& args)
     118JSValue* mathProtoFuncAbs(ExecState* exec, JSObject*, const List& args)
    119119{
    120120    double arg = args[0]->toNumber(exec);
     
    122122}
    123123
    124 JSValue* MathProtoFuncACos::callAsFunction(ExecState* exec, JSObject*, const List& args)
     124JSValue* mathProtoFuncACos(ExecState* exec, JSObject*, const List& args)
    125125{
    126126    double arg = args[0]->toNumber(exec);
     
    128128}
    129129
    130 JSValue* MathProtoFuncASin::callAsFunction(ExecState* exec, JSObject*, const List& args)
     130JSValue* mathProtoFuncASin(ExecState* exec, JSObject*, const List& args)
    131131{
    132132    double arg = args[0]->toNumber(exec);
     
    134134}
    135135
    136 JSValue* MathProtoFuncATan::callAsFunction(ExecState* exec, JSObject*, const List& args)
     136JSValue* mathProtoFuncATan(ExecState* exec, JSObject*, const List& args)
    137137{
    138138    double arg = args[0]->toNumber(exec);
     
    140140}
    141141
    142 JSValue* MathProtoFuncATan2::callAsFunction(ExecState* exec, JSObject*, const List& args)
     142JSValue* mathProtoFuncATan2(ExecState* exec, JSObject*, const List& args)
    143143{
    144144    double arg = args[0]->toNumber(exec);
     
    147147}
    148148
    149 JSValue* MathProtoFuncCeil::callAsFunction(ExecState* exec, JSObject*, const List& args)
     149JSValue* mathProtoFuncCeil(ExecState* exec, JSObject*, const List& args)
    150150{
    151151    double arg = args[0]->toNumber(exec);
     
    155155}
    156156
    157 JSValue* MathProtoFuncCos::callAsFunction(ExecState* exec, JSObject*, const List& args)
     157JSValue* mathProtoFuncCos(ExecState* exec, JSObject*, const List& args)
    158158{
    159159    double arg = args[0]->toNumber(exec);
     
    161161}
    162162
    163 JSValue* MathProtoFuncExp::callAsFunction(ExecState* exec, JSObject*, const List& args)
     163JSValue* mathProtoFuncExp(ExecState* exec, JSObject*, const List& args)
    164164{
    165165    double arg = args[0]->toNumber(exec);
     
    167167}
    168168
    169 JSValue* MathProtoFuncFloor::callAsFunction(ExecState* exec, JSObject*, const List& args)
     169JSValue* mathProtoFuncFloor(ExecState* exec, JSObject*, const List& args)
    170170{
    171171    double arg = args[0]->toNumber(exec);
     
    175175}
    176176
    177 JSValue* MathProtoFuncLog::callAsFunction(ExecState* exec, JSObject*, const List& args)
     177JSValue* mathProtoFuncLog(ExecState* exec, JSObject*, const List& args)
    178178{
    179179    double arg = args[0]->toNumber(exec);
     
    181181}
    182182
    183 JSValue* MathProtoFuncMax::callAsFunction(ExecState* exec, JSObject*, const List& args)
     183JSValue* mathProtoFuncMax(ExecState* exec, JSObject*, const List& args)
    184184{
    185185    unsigned argsCount = args.size();
     
    197197}
    198198
    199 JSValue* MathProtoFuncMin::callAsFunction(ExecState* exec, JSObject*, const List& args)
     199JSValue* mathProtoFuncMin(ExecState* exec, JSObject*, const List& args)
    200200{
    201201    unsigned argsCount = args.size();
     
    213213}
    214214
    215 JSValue* MathProtoFuncPow::callAsFunction(ExecState* exec, JSObject*, const List& args)
     215JSValue* mathProtoFuncPow(ExecState* exec, JSObject*, const List& args)
    216216{
    217217    // ECMA 15.8.2.1.13
     
    229229static bool didInitRandom;
    230230
    231 JSValue* MathProtoFuncRandom::callAsFunction(ExecState*, JSObject*, const List&)
     231JSValue* mathProtoFuncRandom(ExecState*, JSObject*, const List&)
    232232{
    233233    if (!didInitRandom) {
     
    238238}
    239239
    240 JSValue* MathProtoFuncRound::callAsFunction(ExecState* exec, JSObject*, const List& args)
     240JSValue* mathProtoFuncRound(ExecState* exec, JSObject*, const List& args)
    241241{
    242242    double arg = args[0]->toNumber(exec);
     
    246246}
    247247
    248 JSValue* MathProtoFuncSin::callAsFunction(ExecState* exec, JSObject*, const List& args)
     248JSValue* mathProtoFuncSin(ExecState* exec, JSObject*, const List& args)
    249249{
    250250    double arg = args[0]->toNumber(exec);
     
    252252}
    253253
    254 JSValue* MathProtoFuncSqrt::callAsFunction(ExecState* exec, JSObject*, const List& args)
     254JSValue* mathProtoFuncSqrt(ExecState* exec, JSObject*, const List& args)
    255255{
    256256    double arg = args[0]->toNumber(exec);
     
    258258}
    259259
    260 JSValue* MathProtoFuncTan::callAsFunction(ExecState* exec, JSObject*, const List& args)
     260JSValue* mathProtoFuncTan(ExecState* exec, JSObject*, const List& args)
    261261{
    262262    double arg = args[0]->toNumber(exec);
  • trunk/JavaScriptCore/kjs/math_object.h

    r27608 r29508  
    4141  };
    4242
    43 
    44 #define FOR_EACH_CLASS(macro) \
    45     macro(MathProtoFuncAbs) \
    46     macro(MathProtoFuncACos) \
    47     macro(MathProtoFuncASin) \
    48     macro(MathProtoFuncATan) \
    49     macro(MathProtoFuncATan2) \
    50     macro(MathProtoFuncCeil) \
    51     macro(MathProtoFuncCos) \
    52     macro(MathProtoFuncExp) \
    53     macro(MathProtoFuncFloor) \
    54     macro(MathProtoFuncLog) \
    55     macro(MathProtoFuncMax) \
    56     macro(MathProtoFuncMin) \
    57     macro(MathProtoFuncPow) \
    58     macro(MathProtoFuncRandom) \
    59     macro(MathProtoFuncRound) \
    60     macro(MathProtoFuncSin) \
    61     macro(MathProtoFuncSqrt) \
    62     macro(MathProtoFuncTan) \
    63 
    64 FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
    65 #undef FOR_EACH_CLASS
    66 
     43  JSValue* mathProtoFuncAbs(ExecState*, JSObject*, const List&);
     44  JSValue* mathProtoFuncACos(ExecState*, JSObject*, const List&);
     45  JSValue* mathProtoFuncASin(ExecState*, JSObject*, const List&);
     46  JSValue* mathProtoFuncATan(ExecState*, JSObject*, const List&);
     47  JSValue* mathProtoFuncATan2(ExecState*, JSObject*, const List&);
     48  JSValue* mathProtoFuncCeil(ExecState*, JSObject*, const List&);
     49  JSValue* mathProtoFuncCos(ExecState*, JSObject*, const List&);
     50  JSValue* mathProtoFuncExp(ExecState*, JSObject*, const List&);
     51  JSValue* mathProtoFuncFloor(ExecState*, JSObject*, const List&);
     52  JSValue* mathProtoFuncLog(ExecState*, JSObject*, const List&);
     53  JSValue* mathProtoFuncMax(ExecState*, JSObject*, const List&);
     54  JSValue* mathProtoFuncMin(ExecState*, JSObject*, const List&);
     55  JSValue* mathProtoFuncPow(ExecState*, JSObject*, const List&);
     56  JSValue* mathProtoFuncRandom(ExecState*, JSObject*, const List&);
     57  JSValue* mathProtoFuncRound(ExecState*, JSObject*, const List&);
     58  JSValue* mathProtoFuncSin(ExecState*, JSObject*, const List&);
     59  JSValue* mathProtoFuncSqrt(ExecState*, JSObject*, const List&);
     60  JSValue* mathProtoFuncTan(ExecState*, JSObject*, const List&);
    6761
    6862} // namespace KJS
  • trunk/JavaScriptCore/kjs/string_object.cpp

    r29503 r29508  
    135135/* Source for string_object.lut.h
    136136@begin stringTable 26
    137   toString              &StringProtoFuncToString::create          DontEnum|Function       0
    138   valueOf               &StringProtoFuncValueOf::create           DontEnum|Function       0
    139   charAt                &StringProtoFuncCharAt::create            DontEnum|Function       1
    140   charCodeAt            &StringProtoFuncCharCodeAt::create        DontEnum|Function       1
    141   concat                &StringProtoFuncConcat::create            DontEnum|Function       1
    142   indexOf               &StringProtoFuncIndexOf::create           DontEnum|Function       1
    143   lastIndexOf           &StringProtoFuncLastIndexOf::create       DontEnum|Function       1
    144   match                 &StringProtoFuncMatch::create             DontEnum|Function       1
    145   replace               &StringProtoFuncReplace::create           DontEnum|Function       2
    146   search                &StringProtoFuncSearch::create            DontEnum|Function       1
    147   slice                 &StringProtoFuncSlice::create             DontEnum|Function       2
    148   split                 &StringProtoFuncSplit::create             DontEnum|Function       2
    149   substr                &StringProtoFuncSubstr::create            DontEnum|Function       2
    150   substring             &StringProtoFuncSubstring::create         DontEnum|Function       2
    151   toLowerCase           &StringProtoFuncToLowerCase::create       DontEnum|Function       0
    152   toUpperCase           &StringProtoFuncToUpperCase::create       DontEnum|Function       0
    153   toLocaleLowerCase     &StringProtoFuncToLocaleLowerCase::create DontEnum|Function       0
    154   toLocaleUpperCase     &StringProtoFuncToLocaleUpperCase::create DontEnum|Function       0
    155   localeCompare         &StringProtoFuncLocaleCompare::create     DontEnum|Function       1
     137  toString              &stringProtoFuncToString          DontEnum|Function       0
     138  valueOf               &stringProtoFuncValueOf           DontEnum|Function       0
     139  charAt                &stringProtoFuncCharAt            DontEnum|Function       1
     140  charCodeAt            &stringProtoFuncCharCodeAt        DontEnum|Function       1
     141  concat                &stringProtoFuncConcat            DontEnum|Function       1
     142  indexOf               &stringProtoFuncIndexOf           DontEnum|Function       1
     143  lastIndexOf           &stringProtoFuncLastIndexOf       DontEnum|Function       1
     144  match                 &stringProtoFuncMatch             DontEnum|Function       1
     145  replace               &stringProtoFuncReplace           DontEnum|Function       2
     146  search                &stringProtoFuncSearch            DontEnum|Function       1
     147  slice                 &stringProtoFuncSlice             DontEnum|Function       2
     148  split                 &stringProtoFuncSplit             DontEnum|Function       2
     149  substr                &stringProtoFuncSubstr            DontEnum|Function       2
     150  substring             &stringProtoFuncSubstring         DontEnum|Function       2
     151  toLowerCase           &stringProtoFuncToLowerCase       DontEnum|Function       0
     152  toUpperCase           &stringProtoFuncToUpperCase       DontEnum|Function       0
     153  toLocaleLowerCase     &stringProtoFuncToLocaleLowerCase DontEnum|Function       0
     154  toLocaleUpperCase     &stringProtoFuncToLocaleUpperCase DontEnum|Function       0
     155  localeCompare         &stringProtoFuncLocaleCompare     DontEnum|Function       1
    156156#
    157157# Under here: html extension, should only exist if KJS_PURE_ECMA is not defined
    158158# I guess we need to generate two hashtables in the .lut.h file, and use #ifdef
    159159# to select the right one... TODO. #####
    160   big                   &StringProtoFuncBig::create               DontEnum|Function       0
    161   small                 &StringProtoFuncSmall::create             DontEnum|Function       0
    162   blink                 &StringProtoFuncBlink::create             DontEnum|Function       0
    163   bold                  &StringProtoFuncBold::create              DontEnum|Function       0
    164   fixed                 &StringProtoFuncFixed::create             DontEnum|Function       0
    165   italics               &StringProtoFuncItalics::create           DontEnum|Function       0
    166   strike                &StringProtoFuncStrike::create            DontEnum|Function       0
    167   sub                   &StringProtoFuncSub::create               DontEnum|Function       0
    168   sup                   &StringProtoFuncSup::create               DontEnum|Function       0
    169   fontcolor             &StringProtoFuncFontcolor::create         DontEnum|Function       1
    170   fontsize              &StringProtoFuncFontsize::create          DontEnum|Function       1
    171   anchor                &StringProtoFuncAnchor::create            DontEnum|Function       1
    172   link                  &StringProtoFuncLink::create              DontEnum|Function       1
     160  big                   &stringProtoFuncBig               DontEnum|Function       0
     161  small                 &stringProtoFuncSmall             DontEnum|Function       0
     162  blink                 &stringProtoFuncBlink             DontEnum|Function       0
     163  bold                  &stringProtoFuncBold              DontEnum|Function       0
     164  fixed                 &stringProtoFuncFixed             DontEnum|Function       0
     165  italics               &stringProtoFuncItalics           DontEnum|Function       0
     166  strike                &stringProtoFuncStrike            DontEnum|Function       0
     167  sub                   &stringProtoFuncSub               DontEnum|Function       0
     168  sup                   &stringProtoFuncSup               DontEnum|Function       0
     169  fontcolor             &stringProtoFuncFontcolor         DontEnum|Function       1
     170  fontsize              &stringProtoFuncFontsize          DontEnum|Function       1
     171  anchor                &stringProtoFuncAnchor            DontEnum|Function       1
     172  link                  &stringProtoFuncLink              DontEnum|Function       1
    173173@end
    174174*/
     
    433433}
    434434
    435 JSValue* StringProtoFuncToString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     435JSValue* stringProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&)
    436436{
    437437    if (!thisObj->inherits(&StringInstance::info))
     
    441441}
    442442
    443 JSValue* StringProtoFuncValueOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     443JSValue* stringProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const List&)
    444444{
    445445    if (!thisObj->inherits(&StringInstance::info))
     
    449449}
    450450
    451 JSValue* StringProtoFuncCharAt::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     451JSValue* stringProtoFuncCharAt(ExecState* exec, JSObject* thisObj, const List& args)
    452452{
    453453    // This optimizes the common case that thisObj is a StringInstance
     
    465465}
    466466
    467 JSValue* StringProtoFuncCharCodeAt::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     467JSValue* stringProtoFuncCharCodeAt(ExecState* exec, JSObject* thisObj, const List& args)
    468468{
    469469    // This optimizes the common case that thisObj is a StringInstance
     
    482482}
    483483
    484 JSValue* StringProtoFuncConcat::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     484JSValue* stringProtoFuncConcat(ExecState* exec, JSObject* thisObj, const List& args)
    485485{
    486486    // This optimizes the common case that thisObj is a StringInstance
     
    494494}
    495495
    496 JSValue* StringProtoFuncIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     496JSValue* stringProtoFuncIndexOf(ExecState* exec, JSObject* thisObj, const List& args)
    497497{
    498498    // This optimizes the common case that thisObj is a StringInstance
     
    511511}
    512512
    513 JSValue* StringProtoFuncLastIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     513JSValue* stringProtoFuncLastIndexOf(ExecState* exec, JSObject* thisObj, const List& args)
    514514{
    515515    // This optimizes the common case that thisObj is a StringInstance
     
    529529}
    530530
    531 JSValue* StringProtoFuncMatch::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     531JSValue* stringProtoFuncMatch(ExecState* exec, JSObject* thisObj, const List& args)
    532532{
    533533    // This optimizes the common case that thisObj is a StringInstance
     
    586586}
    587587
    588 JSValue* StringProtoFuncSearch::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     588JSValue* stringProtoFuncSearch(ExecState* exec, JSObject* thisObj, const List& args)
    589589{
    590590    // This optimizes the common case that thisObj is a StringInstance
     
    614614}
    615615
    616 JSValue* StringProtoFuncReplace::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     616JSValue* stringProtoFuncReplace(ExecState* exec, JSObject* thisObj, const List& args)
    617617{
    618618    // This optimizes the common case that thisObj is a StringInstance
     
    629629}
    630630
    631 JSValue* StringProtoFuncSlice::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     631JSValue* stringProtoFuncSlice(ExecState* exec, JSObject* thisObj, const List& args)
    632632{
    633633    // This optimizes the common case that thisObj is a StringInstance
     
    654654}
    655655
    656 JSValue* StringProtoFuncSplit::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     656JSValue* stringProtoFuncSplit(ExecState* exec, JSObject* thisObj, const List& args)
    657657{
    658658    // This optimizes the common case that thisObj is a StringInstance
     
    703703        if (u.isEmpty()) {
    704704          // empty separator matches empty string -> empty array
    705           put(exec, exec->propertyNames().length, jsNumber(0));
     705          res->put(exec, exec->propertyNames().length, jsNumber(0));
    706706          return result;
    707707        } else {
     
    724724}
    725725
    726 JSValue* StringProtoFuncSubstr::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     726JSValue* stringProtoFuncSubstr(ExecState* exec, JSObject* thisObj, const List& args)
    727727{
    728728    // This optimizes the common case that thisObj is a StringInstance
     
    749749}
    750750
    751 JSValue* StringProtoFuncSubstring::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     751JSValue* stringProtoFuncSubstring(ExecState* exec, JSObject* thisObj, const List& args)
    752752{
    753753    // This optimizes the common case that thisObj is a StringInstance
     
    782782}
    783783
    784 JSValue* StringProtoFuncToLowerCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     784JSValue* stringProtoFuncToLowerCase(ExecState* exec, JSObject* thisObj, const List&)
    785785{
    786786    // This optimizes the common case that thisObj is a StringInstance
     
    807807}
    808808
    809 JSValue* StringProtoFuncToUpperCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     809JSValue* stringProtoFuncToUpperCase(ExecState* exec, JSObject* thisObj, const List&)
    810810{
    811811    // This optimizes the common case that thisObj is a StringInstance
     
    832832}
    833833
    834 JSValue* StringProtoFuncToLocaleLowerCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     834JSValue* stringProtoFuncToLocaleLowerCase(ExecState* exec, JSObject* thisObj, const List&)
    835835{
    836836    // This optimizes the common case that thisObj is a StringInstance
     
    858858}
    859859
    860 JSValue* StringProtoFuncToLocaleUpperCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     860JSValue* stringProtoFuncToLocaleUpperCase(ExecState* exec, JSObject* thisObj, const List&)
    861861{
    862862    // This optimizes the common case that thisObj is a StringInstance
     
    883883}
    884884
    885 JSValue* StringProtoFuncLocaleCompare::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     885JSValue* stringProtoFuncLocaleCompare(ExecState* exec, JSObject* thisObj, const List& args)
    886886{
    887887    if (args.size() < 1)
     
    896896#ifndef KJS_PURE_ECMA
    897897
    898 JSValue* StringProtoFuncBig::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     898JSValue* stringProtoFuncBig(ExecState* exec, JSObject* thisObj, const List&)
    899899{
    900900    // This optimizes the common case that thisObj is a StringInstance
     
    903903}
    904904
    905 JSValue* StringProtoFuncSmall::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     905JSValue* stringProtoFuncSmall(ExecState* exec, JSObject* thisObj, const List&)
    906906{
    907907    // This optimizes the common case that thisObj is a StringInstance
     
    910910}
    911911
    912 JSValue* StringProtoFuncBlink::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     912JSValue* stringProtoFuncBlink(ExecState* exec, JSObject* thisObj, const List&)
    913913{
    914914    // This optimizes the common case that thisObj is a StringInstance
     
    917917}
    918918
    919 JSValue* StringProtoFuncBold::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     919JSValue* stringProtoFuncBold(ExecState* exec, JSObject* thisObj, const List&)
    920920{
    921921    // This optimizes the common case that thisObj is a StringInstance
     
    924924}
    925925
    926 JSValue* StringProtoFuncFixed::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     926JSValue* stringProtoFuncFixed(ExecState* exec, JSObject* thisObj, const List&)
    927927{
    928928    // This optimizes the common case that thisObj is a StringInstance
     
    931931}
    932932
    933 JSValue* StringProtoFuncItalics::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     933JSValue* stringProtoFuncItalics(ExecState* exec, JSObject* thisObj, const List&)
    934934{
    935935    // This optimizes the common case that thisObj is a StringInstance
     
    938938}
    939939
    940 JSValue* StringProtoFuncStrike::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     940JSValue* stringProtoFuncStrike(ExecState* exec, JSObject* thisObj, const List&)
    941941{
    942942    // This optimizes the common case that thisObj is a StringInstance
     
    945945}
    946946
    947 JSValue* StringProtoFuncSub::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     947JSValue* stringProtoFuncSub(ExecState* exec, JSObject* thisObj, const List&)
    948948{
    949949    // This optimizes the common case that thisObj is a StringInstance
     
    952952}
    953953
    954 JSValue* StringProtoFuncSup::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)
     954JSValue* stringProtoFuncSup(ExecState* exec, JSObject* thisObj, const List&)
    955955{
    956956    // This optimizes the common case that thisObj is a StringInstance
     
    959959}
    960960
    961 JSValue* StringProtoFuncFontcolor::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     961JSValue* stringProtoFuncFontcolor(ExecState* exec, JSObject* thisObj, const List& args)
    962962{
    963963    // This optimizes the common case that thisObj is a StringInstance
     
    967967}
    968968
    969 JSValue* StringProtoFuncFontsize::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     969JSValue* stringProtoFuncFontsize(ExecState* exec, JSObject* thisObj, const List& args)
    970970{
    971971    // This optimizes the common case that thisObj is a StringInstance
     
    975975}
    976976
    977 JSValue* StringProtoFuncAnchor::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     977JSValue* stringProtoFuncAnchor(ExecState* exec, JSObject* thisObj, const List& args)
    978978{
    979979    // This optimizes the common case that thisObj is a StringInstance
     
    983983}
    984984
    985 JSValue* StringProtoFuncLink::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
     985JSValue* stringProtoFuncLink(ExecState* exec, JSObject* thisObj, const List& args)
    986986{
    987987    // This optimizes the common case that thisObj is a StringInstance
  • trunk/JavaScriptCore/kjs/string_object.h

    r28110 r29508  
    8282   * @internal
    8383   *
    84    * Classes to implement all methods that are properties of the
     84   * Functions to implement all methods that are properties of the
    8585   * String.prototype object
    8686   */
    87 #define FOR_EACH_CLASS(macro) \
    88     macro(StringProtoFuncToString) \
    89     macro(StringProtoFuncValueOf) \
    90     macro(StringProtoFuncCharAt) \
    91     macro(StringProtoFuncCharCodeAt) \
    92     macro(StringProtoFuncConcat) \
    93     macro(StringProtoFuncIndexOf) \
    94     macro(StringProtoFuncLastIndexOf) \
    95     macro(StringProtoFuncMatch) \
    96     macro(StringProtoFuncReplace) \
    97     macro(StringProtoFuncSearch) \
    98     macro(StringProtoFuncSlice) \
    99     macro(StringProtoFuncSplit) \
    100     macro(StringProtoFuncSubstr) \
    101     macro(StringProtoFuncSubstring) \
    102     macro(StringProtoFuncToLowerCase) \
    103     macro(StringProtoFuncToUpperCase) \
    104     macro(StringProtoFuncToLocaleLowerCase) \
    105     macro(StringProtoFuncToLocaleUpperCase) \
    106     macro(StringProtoFuncLocaleCompare) \
    10787
    108 #define FOR_EACH_CLASS_NOT_PURE_ECMA(macro) \
    109     macro(StringProtoFuncBig) \
    110     macro(StringProtoFuncSmall) \
    111     macro(StringProtoFuncBlink) \
    112     macro(StringProtoFuncBold) \
    113     macro(StringProtoFuncFixed) \
    114     macro(StringProtoFuncItalics) \
    115     macro(StringProtoFuncStrike) \
    116     macro(StringProtoFuncSub) \
    117     macro(StringProtoFuncSup) \
    118     macro(StringProtoFuncFontcolor) \
    119     macro(StringProtoFuncFontsize) \
    120     macro(StringProtoFuncAnchor) \
    121     macro(StringProtoFuncLink) \
     88  JSValue* stringProtoFuncToString(ExecState*, JSObject*, const List&);
     89  JSValue* stringProtoFuncValueOf(ExecState*, JSObject*, const List&);
     90  JSValue* stringProtoFuncCharAt(ExecState*, JSObject*, const List&);
     91  JSValue* stringProtoFuncCharCodeAt(ExecState*, JSObject*, const List&);
     92  JSValue* stringProtoFuncConcat(ExecState*, JSObject*, const List&);
     93  JSValue* stringProtoFuncIndexOf(ExecState*, JSObject*, const List&);
     94  JSValue* stringProtoFuncLastIndexOf(ExecState*, JSObject*, const List&);
     95  JSValue* stringProtoFuncMatch(ExecState*, JSObject*, const List&);
     96  JSValue* stringProtoFuncReplace(ExecState*, JSObject*, const List&);
     97  JSValue* stringProtoFuncSearch(ExecState*, JSObject*, const List&);
     98  JSValue* stringProtoFuncSlice(ExecState*, JSObject*, const List&);
     99  JSValue* stringProtoFuncSplit(ExecState*, JSObject*, const List&);
     100  JSValue* stringProtoFuncSubstr(ExecState*, JSObject*, const List&);
     101  JSValue* stringProtoFuncSubstring(ExecState*, JSObject*, const List&);
     102  JSValue* stringProtoFuncToLowerCase(ExecState*, JSObject*, const List&);
     103  JSValue* stringProtoFuncToUpperCase(ExecState*, JSObject*, const List&);
     104  JSValue* stringProtoFuncToLocaleLowerCase(ExecState*, JSObject*, const List&);
     105  JSValue* stringProtoFuncToLocaleUpperCase(ExecState*, JSObject*, const List&);
     106  JSValue* stringProtoFuncLocaleCompare(ExecState*, JSObject*, const List&);
    122107
    123 FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
    124108#ifndef KJS_PURE_ECMA
    125 FOR_EACH_CLASS_NOT_PURE_ECMA(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
    126 #endif
    127 
    128 #undef FOR_EACH_CLASS
    129 #undef FOR_EACH_CLASS_NOT_PURE_ECMA
    130 
     109  JSValue* stringProtoFuncBig(ExecState*, JSObject*, const List&);
     110  JSValue* stringProtoFuncSmall(ExecState*, JSObject*, const List&);
     111  JSValue* stringProtoFuncBlink(ExecState*, JSObject*, const List&);
     112  JSValue* stringProtoFuncBold(ExecState*, JSObject*, const List&);
     113  JSValue* stringProtoFuncFixed(ExecState*, JSObject*, const List&);
     114  JSValue* stringProtoFuncItalics(ExecState*, JSObject*, const List&);
     115  JSValue* stringProtoFuncStrike(ExecState*, JSObject*, const List&);
     116  JSValue* stringProtoFuncSub(ExecState*, JSObject*, const List&);
     117  JSValue* stringProtoFuncSup(ExecState*, JSObject*, const List&);
     118  JSValue* stringProtoFuncFontcolor(ExecState*, JSObject*, const List&);
     119  JSValue* stringProtoFuncFontsize(ExecState*, JSObject*, const List&);
     120  JSValue* stringProtoFuncAnchor(ExecState*, JSObject*, const List&);
     121  JSValue* stringProtoFuncLink(ExecState*, JSObject*, const List&);
     122#endif // KJS_PURE_ECMA
    131123
    132124  /**
Note: See TracChangeset for help on using the changeset viewer.