Changeset 29508 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jan 15, 2008, 10:43:15 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r29506 r29508 1 2008-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 1 148 2008-01-15 Geoffrey Garen <[email protected]> 2 149 -
trunk/JavaScriptCore/JavaScriptCore.exp
r29447 r29508 160 160 __ZN3KJS16RuntimeObjectImp4infoE 161 161 __ZN3KJS17PropertyNameArray3addERKNS_10IdentifierE 162 __ZN3KJS17PrototypeFunctionC1EPNS_9ExecStateEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectERKNS_4ListEE 162 163 __ZN3KJS19InternalFunctionImp4infoE 163 164 __ZN3KJS19InternalFunctionImpC2EPNS_17FunctionPrototypeERKNS_10IdentifierE -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r29425 r29508 392 392 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringRefCF.cpp; sourceTree = "<group>"; }; 393 393 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>"; }; 395 395 1482B74B0A43032800517CFC /* JSStringRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringRef.h; sourceTree = "<group>"; }; 396 396 1482B74C0A43032800517CFC /* JSStringRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringRef.cpp; sourceTree = "<group>"; }; … … 742 742 isa = PBXGroup; 743 743 children = ( 744 1482B78A0A4305AB00517CFC /* APICast.h */, 744 745 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */, 745 746 1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */, 746 1482B78A0A4305AB00517CFC /* APICast.h */,747 747 1421359A0A677F4F00A8195E /* JSBase.cpp */, 748 748 142711380A460BBB0080EEEA /* JSBase.h */, … … 766 766 146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */, 767 767 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */, 768 1482B6EA0A4300B300517CFC /* JSValueRef.h */, 768 769 ); 769 770 path = API; … … 931 932 isa = PBXGroup; 932 933 children = ( 933 14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,934 934 659126BC0BDD1728001921FB /* AllInOneFile.cpp */, 935 935 93ADFCE60CCBD7AC00D30B08 /* array_instance.cpp */, … … 978 978 65EA4C9A092AF9E20093D800 /* JSLock.h */, 979 979 14ABB454099C2A0F00E2A24F /* JSType.h */, 980 14 82B6EA0A4300B300517CFC /* JSValueRef.h*/,980 14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */, 981 981 14F252560D08DD8D004ECFFF /* JSVariableObject.h */, 982 982 65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */, -
trunk/JavaScriptCore/kjs/array_object.cpp
r29459 r29508 43 43 /* Source for array_object.lut.h 44 44 @begin arrayTable 16 45 toString &ArrayProtoFuncToString::createDontEnum|Function 046 toLocaleString &ArrayProtoFuncToLocaleString::createDontEnum|Function 047 concat &ArrayProtoFuncConcat::createDontEnum|Function 148 join &ArrayProtoFuncJoin::createDontEnum|Function 149 pop &ArrayProtoFuncPop::createDontEnum|Function 050 push &ArrayProtoFuncPush::createDontEnum|Function 151 reverse &ArrayProtoFuncReverse::create DontEnum|Function 052 shift &ArrayProtoFuncShift::createDontEnum|Function 053 slice &ArrayProtoFuncSlice::create DontEnum|Function 254 sort &ArrayProtoFuncSort::createDontEnum|Function 155 splice &ArrayProtoFuncSplice::create DontEnum|Function 256 unshift &ArrayProtoFuncUnShift::createDontEnum|Function 157 every &ArrayProtoFuncEvery::createDontEnum|Function 158 forEach &ArrayProtoFuncForEach::createDontEnum|Function 159 some &ArrayProtoFuncSome::create DontEnum|Function 160 indexOf &ArrayProtoFuncIndexOf::createDontEnum|Function 161 lastIndexOf &ArrayProtoFuncLastIndexOf::createDontEnum|Function 162 filter &ArrayProtoFuncFilter::createDontEnum|Function 163 map &ArrayProtoFuncMap::createDontEnum|Function 145 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 64 64 @end 65 65 */ … … 88 88 } 89 89 90 JSValue* ArrayProtoFuncToString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)90 JSValue* arrayProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&) 91 91 { 92 92 if (!thisObj->inherits(&ArrayInstance::info)) … … 130 130 } 131 131 132 JSValue* ArrayProtoFuncToLocaleString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)132 JSValue* arrayProtoFuncToLocaleString(ExecState* exec, JSObject* thisObj, const List&) 133 133 { 134 134 if (!thisObj->inherits(&ArrayInstance::info)) … … 177 177 } 178 178 179 JSValue* ArrayProtoFuncJoin::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)179 JSValue* arrayProtoFuncJoin(ExecState* exec, JSObject* thisObj, const List& args) 180 180 { 181 181 static HashSet<JSObject*> visitedElems; … … 219 219 } 220 220 221 JSValue* ArrayProtoFuncConcat::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)221 JSValue* arrayProtoFuncConcat(ExecState* exec, JSObject* thisObj, const List& args) 222 222 { 223 223 JSObject* arr = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, exec->emptyList())); … … 254 254 } 255 255 256 JSValue* ArrayProtoFuncPop::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)256 JSValue* arrayProtoFuncPop(ExecState* exec, JSObject* thisObj, const List&) 257 257 { 258 258 JSValue* result = 0; … … 268 268 } 269 269 270 JSValue* ArrayProtoFuncPush::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)270 JSValue* arrayProtoFuncPush(ExecState* exec, JSObject* thisObj, const List& args) 271 271 { 272 272 unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec); … … 278 278 } 279 279 280 JSValue* ArrayProtoFuncReverse::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)280 JSValue* arrayProtoFuncReverse(ExecState* exec, JSObject* thisObj, const List&) 281 281 { 282 282 unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec); … … 301 301 } 302 302 303 JSValue* ArrayProtoFuncShift::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)303 JSValue* arrayProtoFuncShift(ExecState* exec, JSObject* thisObj, const List&) 304 304 { 305 305 JSValue* result = 0; … … 323 323 } 324 324 325 JSValue* ArrayProtoFuncSlice::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)325 JSValue* arrayProtoFuncSlice(ExecState* exec, JSObject* thisObj, const List& args) 326 326 { 327 327 // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10 … … 366 366 } 367 367 368 JSValue* ArrayProtoFuncSort::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)368 JSValue* arrayProtoFuncSort(ExecState* exec, JSObject* thisObj, const List& args) 369 369 { 370 370 JSObject* sortFunction = 0; … … 425 425 } 426 426 427 JSValue* ArrayProtoFuncSplice::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)427 JSValue* arrayProtoFuncSplice(ExecState* exec, JSObject* thisObj, const List& args) 428 428 { 429 429 // 15.4.4.12 … … 478 478 } 479 479 480 JSValue* ArrayProtoFuncUnShift::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)480 JSValue* arrayProtoFuncUnShift(ExecState* exec, JSObject* thisObj, const List& args) 481 481 { 482 482 // 15.4.4.13 … … 496 496 } 497 497 498 JSValue* ArrayProtoFuncFilter::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)498 JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject* thisObj, const List& args) 499 499 { 500 500 JSObject* eachFunction = args[0]->toObject(exec); … … 530 530 } 531 531 532 JSValue* ArrayProtoFuncMap::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)532 JSValue* arrayProtoFuncMap(ExecState* exec, JSObject* thisObj, const List& args) 533 533 { 534 534 JSObject* eachFunction = args[0]->toObject(exec); … … 569 569 // http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some 570 570 571 JSValue* ArrayProtoFuncEvery::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)571 JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject* thisObj, const List& args) 572 572 { 573 573 JSObject* eachFunction = args[0]->toObject(exec); … … 604 604 } 605 605 606 JSValue* ArrayProtoFuncForEach::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)606 JSValue* arrayProtoFuncForEach(ExecState* exec, JSObject* thisObj, const List& args) 607 607 { 608 608 JSObject* eachFunction = args[0]->toObject(exec); … … 629 629 } 630 630 631 JSValue* ArrayProtoFuncSome::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)631 JSValue* arrayProtoFuncSome(ExecState* exec, JSObject* thisObj, const List& args) 632 632 { 633 633 JSObject* eachFunction = args[0]->toObject(exec); … … 661 661 } 662 662 663 JSValue* ArrayProtoFuncIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)663 JSValue* arrayProtoFuncIndexOf(ExecState* exec, JSObject* thisObj, const List& args) 664 664 { 665 665 // JavaScript 1.5 Extension by Mozilla … … 690 690 } 691 691 692 JSValue* ArrayProtoFuncLastIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)692 JSValue* arrayProtoFuncLastIndexOf(ExecState* exec, JSObject* thisObj, const List& args) 693 693 { 694 694 // JavaScript 1.6 Extension by Mozilla -
trunk/JavaScriptCore/kjs/array_object.h
r27608 r29508 49 49 }; 50 50 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&); 74 70 75 71 } // namespace KJS -
trunk/JavaScriptCore/kjs/date_object.cpp
r29217 r29508 376 376 FIXMEL We could use templates to simplify the UTC variants. 377 377 @begin dateTable 61 378 toString &DateProtoFuncToString::createDontEnum|Function 0379 toUTCString &DateProtoFuncToUTCString::createDontEnum|Function 0380 toDateString &DateProtoFuncToDateString::createDontEnum|Function 0381 toTimeString &DateProtoFuncToTimeString::createDontEnum|Function 0382 toLocaleString &DateProtoFuncToLocaleString::createDontEnum|Function 0383 toLocaleDateString &DateProtoFuncToLocaleDateString::createDontEnum|Function 0384 toLocaleTimeString &DateProtoFuncToLocaleTimeString::createDontEnum|Function 0385 valueOf &DateProtoFuncValueOf::createDontEnum|Function 0386 getTime &DateProtoFuncGetTime::create DontEnum|Function 0387 getFullYear &DateProtoFuncGetFullYear::createDontEnum|Function 0388 getUTCFullYear &DateProtoFuncGetUTCFullYear::createDontEnum|Function 0389 toGMTString &DateProtoFuncToGMTString::createDontEnum|Function 0390 getMonth &DateProtoFuncGetMonth::createDontEnum|Function 0391 getUTCMonth &DateProtoFuncGetUTCMonth::createDontEnum|Function 0392 getDate &DateProtoFuncGetDate::create DontEnum|Function 0393 getUTCDate &DateProtoFuncGetUTCDate::create DontEnum|Function 0394 getDay &DateProtoFuncGetDay::createDontEnum|Function 0395 getUTCDay &DateProtoFuncGetUTCDay::createDontEnum|Function 0396 getHours &DateProtoFuncGetHours::createDontEnum|Function 0397 getUTCHours &DateProtoFuncGetUTCHours::createDontEnum|Function 0398 getMinutes &DateProtoFuncGetMinutes::createDontEnum|Function 0399 getUTCMinutes &DateProtoFuncGetUTCMinutes::createDontEnum|Function 0400 getSeconds &DateProtoFuncGetSeconds::createDontEnum|Function 0401 getUTCSeconds &DateProtoFuncGetUTCSeconds::createDontEnum|Function 0402 getMilliseconds &DateProtoFuncGetMilliSeconds::createDontEnum|Function 0403 getUTCMilliseconds &DateProtoFuncGetUTCMilliseconds::createDontEnum|Function 0404 getTimezoneOffset &DateProtoFuncGetTimezoneOffset::createDontEnum|Function 0405 setTime &DateProtoFuncSetTime::create DontEnum|Function 1406 setMilliseconds &DateProtoFuncSetMilliSeconds::createDontEnum|Function 1407 setUTCMilliseconds &DateProtoFuncSetUTCMilliseconds::createDontEnum|Function 1408 setSeconds &DateProtoFuncSetSeconds::createDontEnum|Function 2409 setUTCSeconds &DateProtoFuncSetUTCSeconds::createDontEnum|Function 2410 setMinutes &DateProtoFuncSetMinutes::createDontEnum|Function 3411 setUTCMinutes &DateProtoFuncSetUTCMinutes::createDontEnum|Function 3412 setHours &DateProtoFuncSetHours::createDontEnum|Function 4413 setUTCHours &DateProtoFuncSetUTCHours::createDontEnum|Function 4414 setDate &DateProtoFuncSetDate::create DontEnum|Function 1415 setUTCDate &DateProtoFuncSetUTCDate::create DontEnum|Function 1416 setMonth &DateProtoFuncSetMonth::createDontEnum|Function 2417 setUTCMonth &DateProtoFuncSetUTCMonth::createDontEnum|Function 2418 setFullYear &DateProtoFuncSetFullYear::createDontEnum|Function 3419 setUTCFullYear &DateProtoFuncSetUTCFullYear::createDontEnum|Function 3420 setYear &DateProtoFuncSetYear::createDontEnum|Function 1421 getYear &DateProtoFuncGetYear::createDontEnum|Function 0378 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 422 422 @end 423 423 */ … … 431 431 } 432 432 433 bool DatePrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)433 bool DatePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 434 434 { 435 435 return getStaticFunctionSlot<JSObject>(exec, &dateTable, this, propertyName, slot); … … 936 936 // Functions 937 937 938 JSValue* DateProtoFuncToString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)938 JSValue* dateProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&) 939 939 { 940 940 if (!thisObj->inherits(&DateInstance::info)) … … 954 954 } 955 955 956 JSValue* DateProtoFuncToUTCString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)956 JSValue* dateProtoFuncToUTCString(ExecState* exec, JSObject* thisObj, const List&) 957 957 { 958 958 if (!thisObj->inherits(&DateInstance::info)) … … 972 972 } 973 973 974 JSValue* DateProtoFuncToDateString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)974 JSValue* dateProtoFuncToDateString(ExecState* exec, JSObject* thisObj, const List&) 975 975 { 976 976 if (!thisObj->inherits(&DateInstance::info)) … … 990 990 } 991 991 992 JSValue* DateProtoFuncToTimeString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)992 JSValue* dateProtoFuncToTimeString(ExecState* exec, JSObject* thisObj, const List&) 993 993 { 994 994 if (!thisObj->inherits(&DateInstance::info)) … … 1008 1008 } 1009 1009 1010 JSValue* DateProtoFuncToLocaleString::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1010 JSValue* dateProtoFuncToLocaleString(ExecState* exec, JSObject* thisObj, const List& args) 1011 1011 { 1012 1012 if (!thisObj->inherits(&DateInstance::info)) … … 1033 1033 } 1034 1034 1035 JSValue* DateProtoFuncToLocaleDateString::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1035 JSValue* dateProtoFuncToLocaleDateString(ExecState* exec, JSObject* thisObj, const List& args) 1036 1036 { 1037 1037 if (!thisObj->inherits(&DateInstance::info)) … … 1058 1058 } 1059 1059 1060 JSValue* DateProtoFuncToLocaleTimeString::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1060 JSValue* dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject* thisObj, const List& args) 1061 1061 { 1062 1062 if (!thisObj->inherits(&DateInstance::info)) … … 1083 1083 } 1084 1084 1085 JSValue* DateProtoFuncValueOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1085 JSValue* dateProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const List&) 1086 1086 { 1087 1087 if (!thisObj->inherits(&DateInstance::info)) … … 1097 1097 } 1098 1098 1099 JSValue* DateProtoFuncGetTime::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1099 JSValue* dateProtoFuncGetTime(ExecState* exec, JSObject* thisObj, const List&) 1100 1100 { 1101 1101 if (!thisObj->inherits(&DateInstance::info)) … … 1111 1111 } 1112 1112 1113 JSValue* DateProtoFuncGetFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1113 JSValue* dateProtoFuncGetFullYear(ExecState* exec, JSObject* thisObj, const List&) 1114 1114 { 1115 1115 if (!thisObj->inherits(&DateInstance::info)) … … 1129 1129 } 1130 1130 1131 JSValue* DateProtoFuncGetUTCFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1131 JSValue* dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject* thisObj, const List&) 1132 1132 { 1133 1133 if (!thisObj->inherits(&DateInstance::info)) … … 1147 1147 } 1148 1148 1149 JSValue* DateProtoFuncToGMTString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1149 JSValue* dateProtoFuncToGMTString(ExecState* exec, JSObject* thisObj, const List&) 1150 1150 { 1151 1151 if (!thisObj->inherits(&DateInstance::info)) … … 1165 1165 } 1166 1166 1167 JSValue* DateProtoFuncGetMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1167 JSValue* dateProtoFuncGetMonth(ExecState* exec, JSObject* thisObj, const List&) 1168 1168 { 1169 1169 if (!thisObj->inherits(&DateInstance::info)) … … 1183 1183 } 1184 1184 1185 JSValue* DateProtoFuncGetUTCMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1185 JSValue* dateProtoFuncGetUTCMonth(ExecState* exec, JSObject* thisObj, const List&) 1186 1186 { 1187 1187 if (!thisObj->inherits(&DateInstance::info)) … … 1201 1201 } 1202 1202 1203 JSValue* DateProtoFuncGetDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1203 JSValue* dateProtoFuncGetDate(ExecState* exec, JSObject* thisObj, const List&) 1204 1204 { 1205 1205 if (!thisObj->inherits(&DateInstance::info)) … … 1219 1219 } 1220 1220 1221 JSValue* DateProtoFuncGetUTCDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1221 JSValue* dateProtoFuncGetUTCDate(ExecState* exec, JSObject* thisObj, const List&) 1222 1222 { 1223 1223 if (!thisObj->inherits(&DateInstance::info)) … … 1237 1237 } 1238 1238 1239 JSValue* DateProtoFuncGetDay::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1239 JSValue* dateProtoFuncGetDay(ExecState* exec, JSObject* thisObj, const List&) 1240 1240 { 1241 1241 if (!thisObj->inherits(&DateInstance::info)) … … 1255 1255 } 1256 1256 1257 JSValue* DateProtoFuncGetUTCDay::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1257 JSValue* dateProtoFuncGetUTCDay(ExecState* exec, JSObject* thisObj, const List&) 1258 1258 { 1259 1259 if (!thisObj->inherits(&DateInstance::info)) … … 1273 1273 } 1274 1274 1275 JSValue* DateProtoFuncGetHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1275 JSValue* dateProtoFuncGetHours(ExecState* exec, JSObject* thisObj, const List&) 1276 1276 { 1277 1277 if (!thisObj->inherits(&DateInstance::info)) … … 1291 1291 } 1292 1292 1293 JSValue* DateProtoFuncGetUTCHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1293 JSValue* dateProtoFuncGetUTCHours(ExecState* exec, JSObject* thisObj, const List&) 1294 1294 { 1295 1295 if (!thisObj->inherits(&DateInstance::info)) … … 1309 1309 } 1310 1310 1311 JSValue* DateProtoFuncGetMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1311 JSValue* dateProtoFuncGetMinutes(ExecState* exec, JSObject* thisObj, const List&) 1312 1312 { 1313 1313 if (!thisObj->inherits(&DateInstance::info)) … … 1327 1327 } 1328 1328 1329 JSValue* DateProtoFuncGetUTCMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1329 JSValue* dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject* thisObj, const List&) 1330 1330 { 1331 1331 if (!thisObj->inherits(&DateInstance::info)) … … 1345 1345 } 1346 1346 1347 JSValue* DateProtoFuncGetSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1347 JSValue* dateProtoFuncGetSeconds(ExecState* exec, JSObject* thisObj, const List&) 1348 1348 { 1349 1349 if (!thisObj->inherits(&DateInstance::info)) … … 1363 1363 } 1364 1364 1365 JSValue* DateProtoFuncGetUTCSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1365 JSValue* dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject* thisObj, const List&) 1366 1366 { 1367 1367 if (!thisObj->inherits(&DateInstance::info)) … … 1381 1381 } 1382 1382 1383 JSValue* DateProtoFuncGetMilliSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1383 JSValue* dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject* thisObj, const List&) 1384 1384 { 1385 1385 if (!thisObj->inherits(&DateInstance::info)) … … 1397 1397 } 1398 1398 1399 JSValue* DateProtoFuncGetUTCMilliseconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1399 JSValue* dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject* thisObj, const List&) 1400 1400 { 1401 1401 if (!thisObj->inherits(&DateInstance::info)) … … 1413 1413 } 1414 1414 1415 JSValue* DateProtoFuncGetTimezoneOffset::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1415 JSValue* dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject* thisObj, const List&) 1416 1416 { 1417 1417 if (!thisObj->inherits(&DateInstance::info)) … … 1431 1431 } 1432 1432 1433 JSValue* DateProtoFuncSetTime::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1433 JSValue* dateProtoFuncSetTime(ExecState* exec, JSObject* thisObj, const List& args) 1434 1434 { 1435 1435 if (!thisObj->inherits(&DateInstance::info)) … … 1486 1486 } 1487 1487 1488 JSValue* DateProtoFuncSetMilliSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1488 JSValue* dateProtoFuncSetMilliSeconds(ExecState* exec, JSObject* thisObj, const List& args) 1489 1489 { 1490 1490 const bool inputIsUTC = false; … … 1492 1492 } 1493 1493 1494 JSValue* DateProtoFuncSetUTCMilliseconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1494 JSValue* dateProtoFuncSetUTCMilliseconds(ExecState* exec, JSObject* thisObj, const List& args) 1495 1495 { 1496 1496 const bool inputIsUTC = true; … … 1498 1498 } 1499 1499 1500 JSValue* DateProtoFuncSetSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1500 JSValue* dateProtoFuncSetSeconds(ExecState* exec, JSObject* thisObj, const List& args) 1501 1501 { 1502 1502 const bool inputIsUTC = false; … … 1504 1504 } 1505 1505 1506 JSValue* DateProtoFuncSetUTCSeconds::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1506 JSValue* dateProtoFuncSetUTCSeconds(ExecState* exec, JSObject* thisObj, const List& args) 1507 1507 { 1508 1508 const bool inputIsUTC = true; … … 1510 1510 } 1511 1511 1512 JSValue* DateProtoFuncSetMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1512 JSValue* dateProtoFuncSetMinutes(ExecState* exec, JSObject* thisObj, const List& args) 1513 1513 { 1514 1514 const bool inputIsUTC = false; … … 1516 1516 } 1517 1517 1518 JSValue* DateProtoFuncSetUTCMinutes::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1518 JSValue* dateProtoFuncSetUTCMinutes(ExecState* exec, JSObject* thisObj, const List& args) 1519 1519 { 1520 1520 const bool inputIsUTC = true; … … 1522 1522 } 1523 1523 1524 JSValue* DateProtoFuncSetHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1524 JSValue* dateProtoFuncSetHours(ExecState* exec, JSObject* thisObj, const List& args) 1525 1525 { 1526 1526 const bool inputIsUTC = false; … … 1528 1528 } 1529 1529 1530 JSValue* DateProtoFuncSetUTCHours::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1530 JSValue* dateProtoFuncSetUTCHours(ExecState* exec, JSObject* thisObj, const List& args) 1531 1531 { 1532 1532 const bool inputIsUTC = true; … … 1534 1534 } 1535 1535 1536 JSValue* DateProtoFuncSetDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1536 JSValue* dateProtoFuncSetDate(ExecState* exec, JSObject* thisObj, const List& args) 1537 1537 { 1538 1538 const bool inputIsUTC = false; … … 1540 1540 } 1541 1541 1542 JSValue* DateProtoFuncSetUTCDate::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1542 JSValue* dateProtoFuncSetUTCDate(ExecState* exec, JSObject* thisObj, const List& args) 1543 1543 { 1544 1544 const bool inputIsUTC = true; … … 1546 1546 } 1547 1547 1548 JSValue* DateProtoFuncSetMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1548 JSValue* dateProtoFuncSetMonth(ExecState* exec, JSObject* thisObj, const List& args) 1549 1549 { 1550 1550 const bool inputIsUTC = false; … … 1552 1552 } 1553 1553 1554 JSValue* DateProtoFuncSetUTCMonth::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1554 JSValue* dateProtoFuncSetUTCMonth(ExecState* exec, JSObject* thisObj, const List& args) 1555 1555 { 1556 1556 const bool inputIsUTC = true; … … 1558 1558 } 1559 1559 1560 JSValue* DateProtoFuncSetFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1560 JSValue* dateProtoFuncSetFullYear(ExecState* exec, JSObject* thisObj, const List& args) 1561 1561 { 1562 1562 const bool inputIsUTC = false; … … 1564 1564 } 1565 1565 1566 JSValue* DateProtoFuncSetUTCFullYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1566 JSValue* dateProtoFuncSetUTCFullYear(ExecState* exec, JSObject* thisObj, const List& args) 1567 1567 { 1568 1568 const bool inputIsUTC = true; … … 1570 1570 } 1571 1571 1572 JSValue* DateProtoFuncSetYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)1572 JSValue* dateProtoFuncSetYear(ExecState* exec, JSObject* thisObj, const List& args) 1573 1573 { 1574 1574 if (!thisObj->inherits(&DateInstance::info)) … … 1593 1593 } 1594 1594 1595 JSValue* DateProtoFuncGetYear::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)1595 JSValue* dateProtoFuncGetYear(ExecState* exec, JSObject* thisObj, const List&) 1596 1596 { 1597 1597 if (!thisObj->inherits(&DateInstance::info)) -
trunk/JavaScriptCore/kjs/date_object.h
r28907 r29508 61 61 62 62 /** 63 63 * @internal 64 64 * 65 * Class to implement all methods that are properties of the65 * Functions to implement all methods that are properties of the 66 66 * Date.prototype object 67 67 */ … … 70 70 // GetYear, SetYear, ToGMTString 71 71 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&); 121 116 122 117 /** -
trunk/JavaScriptCore/kjs/function.cpp
r29439 r29508 857 857 } 858 858 859 } // namespace 859 // ------------------------------ PrototypeFunction ------------------------------- 860 861 PrototypeFunction::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 869 JSValue* 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 139 139 }; 140 140 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 141 153 class GlobalFuncImp : public InternalFunctionImp { 142 154 public: -
trunk/JavaScriptCore/kjs/lookup.h
r28884 r29508 37 37 */ 38 38 struct HashEntry { 39 typedef InternalFunctionImp* (*ConstructFunctionObject)(ExecState*, int, const Identifier&);40 41 39 /** 42 40 * s is the key (e.g. a property name) … … 49 47 union { 50 48 intptr_t intValue; 51 ConstructFunctionObjectfunctionValue;49 PrototypeFunction::JSMemberFunction functionValue; 52 50 } value; 53 51 … … 135 133 136 134 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); 138 136 thisObj->putDirect(propertyName, val, entry->attr); 139 137 return val; … … 299 297 * Using those macros is very simple: define the hashtable (e.g. "DOMNodePrototypeTable"), then 300 298 * KJS_DEFINE_PROTOTYPE(DOMNodePrototype) 301 * KJS_IMPLEMENT_PROTOFUNC(DOMNodePrototypeFunction)302 299 * KJS_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodePrototype, DOMNodePrototypeFunction) 303 300 * and use DOMNodePrototype::self(exec) as prototype in the DOMNode constructor. … … 343 340 } 344 341 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 362 342 #endif // KJS_lookup_h -
trunk/JavaScriptCore/kjs/math_object.cpp
r27608 r29508 45 45 SQRT1_2 MathObjectImp::Sqrt1_2 DontEnum|DontDelete|ReadOnly 46 46 SQRT2 MathObjectImp::Sqrt2 DontEnum|DontDelete|ReadOnly 47 abs &MathProtoFuncAbs::createDontEnum|Function 148 acos &MathProtoFuncACos::createDontEnum|Function 149 asin &MathProtoFuncASin::createDontEnum|Function 150 atan &MathProtoFuncATan::createDontEnum|Function 151 atan2 &MathProtoFuncATan2::createDontEnum|Function 252 ceil &MathProtoFuncCeil::createDontEnum|Function 153 cos &MathProtoFuncCos::createDontEnum|Function 154 exp &MathProtoFuncExp::createDontEnum|Function 155 floor &MathProtoFuncFloor::createDontEnum|Function 156 log &MathProtoFuncLog::createDontEnum|Function 157 max &MathProtoFuncMax::createDontEnum|Function 258 min &MathProtoFuncMin::createDontEnum|Function 259 pow &MathProtoFuncPow::createDontEnum|Function 260 random &MathProtoFuncRandom::createDontEnum|Function 061 round &MathProtoFuncRound::createDontEnum|Function 162 sin &MathProtoFuncSin::createDontEnum|Function 163 sqrt &MathProtoFuncSqrt::createDontEnum|Function 164 tan &MathProtoFuncTan::createDontEnum|Function 147 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 65 65 @end 66 66 */ … … 116 116 // ------------------------------ Functions -------------------------------- 117 117 118 JSValue* MathProtoFuncAbs::callAsFunction(ExecState* exec, JSObject*, const List& args)118 JSValue* mathProtoFuncAbs(ExecState* exec, JSObject*, const List& args) 119 119 { 120 120 double arg = args[0]->toNumber(exec); … … 122 122 } 123 123 124 JSValue* MathProtoFuncACos::callAsFunction(ExecState* exec, JSObject*, const List& args)124 JSValue* mathProtoFuncACos(ExecState* exec, JSObject*, const List& args) 125 125 { 126 126 double arg = args[0]->toNumber(exec); … … 128 128 } 129 129 130 JSValue* MathProtoFuncASin::callAsFunction(ExecState* exec, JSObject*, const List& args)130 JSValue* mathProtoFuncASin(ExecState* exec, JSObject*, const List& args) 131 131 { 132 132 double arg = args[0]->toNumber(exec); … … 134 134 } 135 135 136 JSValue* MathProtoFuncATan::callAsFunction(ExecState* exec, JSObject*, const List& args)136 JSValue* mathProtoFuncATan(ExecState* exec, JSObject*, const List& args) 137 137 { 138 138 double arg = args[0]->toNumber(exec); … … 140 140 } 141 141 142 JSValue* MathProtoFuncATan2::callAsFunction(ExecState* exec, JSObject*, const List& args)142 JSValue* mathProtoFuncATan2(ExecState* exec, JSObject*, const List& args) 143 143 { 144 144 double arg = args[0]->toNumber(exec); … … 147 147 } 148 148 149 JSValue* MathProtoFuncCeil::callAsFunction(ExecState* exec, JSObject*, const List& args)149 JSValue* mathProtoFuncCeil(ExecState* exec, JSObject*, const List& args) 150 150 { 151 151 double arg = args[0]->toNumber(exec); … … 155 155 } 156 156 157 JSValue* MathProtoFuncCos::callAsFunction(ExecState* exec, JSObject*, const List& args)157 JSValue* mathProtoFuncCos(ExecState* exec, JSObject*, const List& args) 158 158 { 159 159 double arg = args[0]->toNumber(exec); … … 161 161 } 162 162 163 JSValue* MathProtoFuncExp::callAsFunction(ExecState* exec, JSObject*, const List& args)163 JSValue* mathProtoFuncExp(ExecState* exec, JSObject*, const List& args) 164 164 { 165 165 double arg = args[0]->toNumber(exec); … … 167 167 } 168 168 169 JSValue* MathProtoFuncFloor::callAsFunction(ExecState* exec, JSObject*, const List& args)169 JSValue* mathProtoFuncFloor(ExecState* exec, JSObject*, const List& args) 170 170 { 171 171 double arg = args[0]->toNumber(exec); … … 175 175 } 176 176 177 JSValue* MathProtoFuncLog::callAsFunction(ExecState* exec, JSObject*, const List& args)177 JSValue* mathProtoFuncLog(ExecState* exec, JSObject*, const List& args) 178 178 { 179 179 double arg = args[0]->toNumber(exec); … … 181 181 } 182 182 183 JSValue* MathProtoFuncMax::callAsFunction(ExecState* exec, JSObject*, const List& args)183 JSValue* mathProtoFuncMax(ExecState* exec, JSObject*, const List& args) 184 184 { 185 185 unsigned argsCount = args.size(); … … 197 197 } 198 198 199 JSValue* MathProtoFuncMin::callAsFunction(ExecState* exec, JSObject*, const List& args)199 JSValue* mathProtoFuncMin(ExecState* exec, JSObject*, const List& args) 200 200 { 201 201 unsigned argsCount = args.size(); … … 213 213 } 214 214 215 JSValue* MathProtoFuncPow::callAsFunction(ExecState* exec, JSObject*, const List& args)215 JSValue* mathProtoFuncPow(ExecState* exec, JSObject*, const List& args) 216 216 { 217 217 // ECMA 15.8.2.1.13 … … 229 229 static bool didInitRandom; 230 230 231 JSValue* MathProtoFuncRandom::callAsFunction(ExecState*, JSObject*, const List&)231 JSValue* mathProtoFuncRandom(ExecState*, JSObject*, const List&) 232 232 { 233 233 if (!didInitRandom) { … … 238 238 } 239 239 240 JSValue* MathProtoFuncRound::callAsFunction(ExecState* exec, JSObject*, const List& args)240 JSValue* mathProtoFuncRound(ExecState* exec, JSObject*, const List& args) 241 241 { 242 242 double arg = args[0]->toNumber(exec); … … 246 246 } 247 247 248 JSValue* MathProtoFuncSin::callAsFunction(ExecState* exec, JSObject*, const List& args)248 JSValue* mathProtoFuncSin(ExecState* exec, JSObject*, const List& args) 249 249 { 250 250 double arg = args[0]->toNumber(exec); … … 252 252 } 253 253 254 JSValue* MathProtoFuncSqrt::callAsFunction(ExecState* exec, JSObject*, const List& args)254 JSValue* mathProtoFuncSqrt(ExecState* exec, JSObject*, const List& args) 255 255 { 256 256 double arg = args[0]->toNumber(exec); … … 258 258 } 259 259 260 JSValue* MathProtoFuncTan::callAsFunction(ExecState* exec, JSObject*, const List& args)260 JSValue* mathProtoFuncTan(ExecState* exec, JSObject*, const List& args) 261 261 { 262 262 double arg = args[0]->toNumber(exec); -
trunk/JavaScriptCore/kjs/math_object.h
r27608 r29508 41 41 }; 42 42 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&); 67 61 68 62 } // namespace KJS -
trunk/JavaScriptCore/kjs/string_object.cpp
r29503 r29508 135 135 /* Source for string_object.lut.h 136 136 @begin stringTable 26 137 toString & StringProtoFuncToString::createDontEnum|Function 0138 valueOf & StringProtoFuncValueOf::createDontEnum|Function 0139 charAt & StringProtoFuncCharAt::createDontEnum|Function 1140 charCodeAt & StringProtoFuncCharCodeAt::createDontEnum|Function 1141 concat & StringProtoFuncConcat::createDontEnum|Function 1142 indexOf & StringProtoFuncIndexOf::createDontEnum|Function 1143 lastIndexOf & StringProtoFuncLastIndexOf::createDontEnum|Function 1144 match & StringProtoFuncMatch::createDontEnum|Function 1145 replace & StringProtoFuncReplace::create DontEnum|Function 2146 search & StringProtoFuncSearch::createDontEnum|Function 1147 slice & StringProtoFuncSlice::create DontEnum|Function 2148 split & StringProtoFuncSplit::createDontEnum|Function 2149 substr & StringProtoFuncSubstr::createDontEnum|Function 2150 substring & StringProtoFuncSubstring::createDontEnum|Function 2151 toLowerCase & StringProtoFuncToLowerCase::create DontEnum|Function 0152 toUpperCase & StringProtoFuncToUpperCase::create DontEnum|Function 0153 toLocaleLowerCase & StringProtoFuncToLocaleLowerCase::create DontEnum|Function 0154 toLocaleUpperCase & StringProtoFuncToLocaleUpperCase::create DontEnum|Function 0155 localeCompare & StringProtoFuncLocaleCompare::create DontEnum|Function 1137 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 156 156 # 157 157 # Under here: html extension, should only exist if KJS_PURE_ECMA is not defined 158 158 # I guess we need to generate two hashtables in the .lut.h file, and use #ifdef 159 159 # to select the right one... TODO. ##### 160 big & StringProtoFuncBig::createDontEnum|Function 0161 small & StringProtoFuncSmall::createDontEnum|Function 0162 blink & StringProtoFuncBlink::createDontEnum|Function 0163 bold & StringProtoFuncBold::createDontEnum|Function 0164 fixed & StringProtoFuncFixed::createDontEnum|Function 0165 italics & StringProtoFuncItalics::createDontEnum|Function 0166 strike & StringProtoFuncStrike::create DontEnum|Function 0167 sub & StringProtoFuncSub::createDontEnum|Function 0168 sup & StringProtoFuncSup::createDontEnum|Function 0169 fontcolor & StringProtoFuncFontcolor::createDontEnum|Function 1170 fontsize & StringProtoFuncFontsize::create DontEnum|Function 1171 anchor & StringProtoFuncAnchor::createDontEnum|Function 1172 link & StringProtoFuncLink::createDontEnum|Function 1160 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 173 173 @end 174 174 */ … … 433 433 } 434 434 435 JSValue* StringProtoFuncToString::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)435 JSValue* stringProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&) 436 436 { 437 437 if (!thisObj->inherits(&StringInstance::info)) … … 441 441 } 442 442 443 JSValue* StringProtoFuncValueOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)443 JSValue* stringProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const List&) 444 444 { 445 445 if (!thisObj->inherits(&StringInstance::info)) … … 449 449 } 450 450 451 JSValue* StringProtoFuncCharAt::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)451 JSValue* stringProtoFuncCharAt(ExecState* exec, JSObject* thisObj, const List& args) 452 452 { 453 453 // This optimizes the common case that thisObj is a StringInstance … … 465 465 } 466 466 467 JSValue* StringProtoFuncCharCodeAt::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)467 JSValue* stringProtoFuncCharCodeAt(ExecState* exec, JSObject* thisObj, const List& args) 468 468 { 469 469 // This optimizes the common case that thisObj is a StringInstance … … 482 482 } 483 483 484 JSValue* StringProtoFuncConcat::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)484 JSValue* stringProtoFuncConcat(ExecState* exec, JSObject* thisObj, const List& args) 485 485 { 486 486 // This optimizes the common case that thisObj is a StringInstance … … 494 494 } 495 495 496 JSValue* StringProtoFuncIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)496 JSValue* stringProtoFuncIndexOf(ExecState* exec, JSObject* thisObj, const List& args) 497 497 { 498 498 // This optimizes the common case that thisObj is a StringInstance … … 511 511 } 512 512 513 JSValue* StringProtoFuncLastIndexOf::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)513 JSValue* stringProtoFuncLastIndexOf(ExecState* exec, JSObject* thisObj, const List& args) 514 514 { 515 515 // This optimizes the common case that thisObj is a StringInstance … … 529 529 } 530 530 531 JSValue* StringProtoFuncMatch::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)531 JSValue* stringProtoFuncMatch(ExecState* exec, JSObject* thisObj, const List& args) 532 532 { 533 533 // This optimizes the common case that thisObj is a StringInstance … … 586 586 } 587 587 588 JSValue* StringProtoFuncSearch::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)588 JSValue* stringProtoFuncSearch(ExecState* exec, JSObject* thisObj, const List& args) 589 589 { 590 590 // This optimizes the common case that thisObj is a StringInstance … … 614 614 } 615 615 616 JSValue* StringProtoFuncReplace::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)616 JSValue* stringProtoFuncReplace(ExecState* exec, JSObject* thisObj, const List& args) 617 617 { 618 618 // This optimizes the common case that thisObj is a StringInstance … … 629 629 } 630 630 631 JSValue* StringProtoFuncSlice::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)631 JSValue* stringProtoFuncSlice(ExecState* exec, JSObject* thisObj, const List& args) 632 632 { 633 633 // This optimizes the common case that thisObj is a StringInstance … … 654 654 } 655 655 656 JSValue* StringProtoFuncSplit::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)656 JSValue* stringProtoFuncSplit(ExecState* exec, JSObject* thisObj, const List& args) 657 657 { 658 658 // This optimizes the common case that thisObj is a StringInstance … … 703 703 if (u.isEmpty()) { 704 704 // empty separator matches empty string -> empty array 705 put(exec, exec->propertyNames().length, jsNumber(0));705 res->put(exec, exec->propertyNames().length, jsNumber(0)); 706 706 return result; 707 707 } else { … … 724 724 } 725 725 726 JSValue* StringProtoFuncSubstr::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)726 JSValue* stringProtoFuncSubstr(ExecState* exec, JSObject* thisObj, const List& args) 727 727 { 728 728 // This optimizes the common case that thisObj is a StringInstance … … 749 749 } 750 750 751 JSValue* StringProtoFuncSubstring::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)751 JSValue* stringProtoFuncSubstring(ExecState* exec, JSObject* thisObj, const List& args) 752 752 { 753 753 // This optimizes the common case that thisObj is a StringInstance … … 782 782 } 783 783 784 JSValue* StringProtoFuncToLowerCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)784 JSValue* stringProtoFuncToLowerCase(ExecState* exec, JSObject* thisObj, const List&) 785 785 { 786 786 // This optimizes the common case that thisObj is a StringInstance … … 807 807 } 808 808 809 JSValue* StringProtoFuncToUpperCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)809 JSValue* stringProtoFuncToUpperCase(ExecState* exec, JSObject* thisObj, const List&) 810 810 { 811 811 // This optimizes the common case that thisObj is a StringInstance … … 832 832 } 833 833 834 JSValue* StringProtoFuncToLocaleLowerCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)834 JSValue* stringProtoFuncToLocaleLowerCase(ExecState* exec, JSObject* thisObj, const List&) 835 835 { 836 836 // This optimizes the common case that thisObj is a StringInstance … … 858 858 } 859 859 860 JSValue* StringProtoFuncToLocaleUpperCase::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)860 JSValue* stringProtoFuncToLocaleUpperCase(ExecState* exec, JSObject* thisObj, const List&) 861 861 { 862 862 // This optimizes the common case that thisObj is a StringInstance … … 883 883 } 884 884 885 JSValue* StringProtoFuncLocaleCompare::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)885 JSValue* stringProtoFuncLocaleCompare(ExecState* exec, JSObject* thisObj, const List& args) 886 886 { 887 887 if (args.size() < 1) … … 896 896 #ifndef KJS_PURE_ECMA 897 897 898 JSValue* StringProtoFuncBig::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)898 JSValue* stringProtoFuncBig(ExecState* exec, JSObject* thisObj, const List&) 899 899 { 900 900 // This optimizes the common case that thisObj is a StringInstance … … 903 903 } 904 904 905 JSValue* StringProtoFuncSmall::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)905 JSValue* stringProtoFuncSmall(ExecState* exec, JSObject* thisObj, const List&) 906 906 { 907 907 // This optimizes the common case that thisObj is a StringInstance … … 910 910 } 911 911 912 JSValue* StringProtoFuncBlink::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)912 JSValue* stringProtoFuncBlink(ExecState* exec, JSObject* thisObj, const List&) 913 913 { 914 914 // This optimizes the common case that thisObj is a StringInstance … … 917 917 } 918 918 919 JSValue* StringProtoFuncBold::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)919 JSValue* stringProtoFuncBold(ExecState* exec, JSObject* thisObj, const List&) 920 920 { 921 921 // This optimizes the common case that thisObj is a StringInstance … … 924 924 } 925 925 926 JSValue* StringProtoFuncFixed::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)926 JSValue* stringProtoFuncFixed(ExecState* exec, JSObject* thisObj, const List&) 927 927 { 928 928 // This optimizes the common case that thisObj is a StringInstance … … 931 931 } 932 932 933 JSValue* StringProtoFuncItalics::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)933 JSValue* stringProtoFuncItalics(ExecState* exec, JSObject* thisObj, const List&) 934 934 { 935 935 // This optimizes the common case that thisObj is a StringInstance … … 938 938 } 939 939 940 JSValue* StringProtoFuncStrike::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)940 JSValue* stringProtoFuncStrike(ExecState* exec, JSObject* thisObj, const List&) 941 941 { 942 942 // This optimizes the common case that thisObj is a StringInstance … … 945 945 } 946 946 947 JSValue* StringProtoFuncSub::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)947 JSValue* stringProtoFuncSub(ExecState* exec, JSObject* thisObj, const List&) 948 948 { 949 949 // This optimizes the common case that thisObj is a StringInstance … … 952 952 } 953 953 954 JSValue* StringProtoFuncSup::callAsFunction(ExecState* exec, JSObject* thisObj, const List&)954 JSValue* stringProtoFuncSup(ExecState* exec, JSObject* thisObj, const List&) 955 955 { 956 956 // This optimizes the common case that thisObj is a StringInstance … … 959 959 } 960 960 961 JSValue* StringProtoFuncFontcolor::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)961 JSValue* stringProtoFuncFontcolor(ExecState* exec, JSObject* thisObj, const List& args) 962 962 { 963 963 // This optimizes the common case that thisObj is a StringInstance … … 967 967 } 968 968 969 JSValue* StringProtoFuncFontsize::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)969 JSValue* stringProtoFuncFontsize(ExecState* exec, JSObject* thisObj, const List& args) 970 970 { 971 971 // This optimizes the common case that thisObj is a StringInstance … … 975 975 } 976 976 977 JSValue* StringProtoFuncAnchor::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)977 JSValue* stringProtoFuncAnchor(ExecState* exec, JSObject* thisObj, const List& args) 978 978 { 979 979 // This optimizes the common case that thisObj is a StringInstance … … 983 983 } 984 984 985 JSValue* StringProtoFuncLink::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)985 JSValue* stringProtoFuncLink(ExecState* exec, JSObject* thisObj, const List& args) 986 986 { 987 987 // This optimizes the common case that thisObj is a StringInstance -
trunk/JavaScriptCore/kjs/string_object.h
r28110 r29508 82 82 * @internal 83 83 * 84 * Classes to implement all methods that are properties of the84 * Functions to implement all methods that are properties of the 85 85 * String.prototype object 86 86 */ 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) \107 87 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&); 122 107 123 FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)124 108 #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 131 123 132 124 /**
Note:
See TracChangeset
for help on using the changeset viewer.