Changeset 34587 in webkit for trunk/JavaScriptCore/kjs/string_object.cpp
- Timestamp:
- Jun 15, 2008, 10:28:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/string_object.cpp
r34582 r34587 306 306 if (replacementFunction) { 307 307 int completeMatchStart = ovector[0]; 308 List args;308 ArgList args; 309 309 310 310 for (unsigned i = 0; i < reg->numSubpatterns() + 1; i++) { … … 364 364 365 365 if (replacementFunction) { 366 List args;366 ArgList args; 367 367 368 368 args.append(jsString(source.substr(matchPos, matchLen))); … … 376 376 } 377 377 378 JSValue* stringProtoFuncToString(ExecState* exec, JSObject* thisObj, const List&)378 JSValue* stringProtoFuncToString(ExecState* exec, JSObject* thisObj, const ArgList&) 379 379 { 380 380 if (!thisObj->inherits(&StringObject::info)) … … 384 384 } 385 385 386 JSValue* stringProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const List&)386 JSValue* stringProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const ArgList&) 387 387 { 388 388 if (!thisObj->inherits(&StringObject::info)) … … 392 392 } 393 393 394 JSValue* stringProtoFuncCharAt(ExecState* exec, JSObject* thisObj, const List& args)394 JSValue* stringProtoFuncCharAt(ExecState* exec, JSObject* thisObj, const ArgList& args) 395 395 { 396 396 // This optimizes the common case that thisObj is a StringObject … … 408 408 } 409 409 410 JSValue* stringProtoFuncCharCodeAt(ExecState* exec, JSObject* thisObj, const List& args)410 JSValue* stringProtoFuncCharCodeAt(ExecState* exec, JSObject* thisObj, const ArgList& args) 411 411 { 412 412 // This optimizes the common case that thisObj is a StringObject … … 425 425 } 426 426 427 JSValue* stringProtoFuncConcat(ExecState* exec, JSObject* thisObj, const List& args)428 { 429 // This optimizes the common case that thisObj is a StringObject 430 UString s = thisObj->inherits(&StringObject::info) ? static_cast<StringObject*>(thisObj)->internalValue()->value() : thisObj->toString(exec); 431 432 List::const_iterator end = args.end();433 for ( List::const_iterator it = args.begin(); it != end; ++it) {427 JSValue* stringProtoFuncConcat(ExecState* exec, JSObject* thisObj, const ArgList& args) 428 { 429 // This optimizes the common case that thisObj is a StringObject 430 UString s = thisObj->inherits(&StringObject::info) ? static_cast<StringObject*>(thisObj)->internalValue()->value() : thisObj->toString(exec); 431 432 ArgList::const_iterator end = args.end(); 433 for (ArgList::const_iterator it = args.begin(); it != end; ++it) { 434 434 s += (*it)->toString(exec); 435 435 } … … 437 437 } 438 438 439 JSValue* stringProtoFuncIndexOf(ExecState* exec, JSObject* thisObj, const List& args)439 JSValue* stringProtoFuncIndexOf(ExecState* exec, JSObject* thisObj, const ArgList& args) 440 440 { 441 441 // This optimizes the common case that thisObj is a StringObject … … 454 454 } 455 455 456 JSValue* stringProtoFuncLastIndexOf(ExecState* exec, JSObject* thisObj, const List& args)456 JSValue* stringProtoFuncLastIndexOf(ExecState* exec, JSObject* thisObj, const ArgList& args) 457 457 { 458 458 // This optimizes the common case that thisObj is a StringObject … … 472 472 } 473 473 474 JSValue* stringProtoFuncMatch(ExecState* exec, JSObject* thisObj, const List& args)474 JSValue* stringProtoFuncMatch(ExecState* exec, JSObject* thisObj, const ArgList& args) 475 475 { 476 476 // This optimizes the common case that thisObj is a StringObject … … 505 505 } else { 506 506 // return array of matches 507 List list;507 ArgList list; 508 508 int lastIndex = 0; 509 509 while (pos >= 0) { … … 527 527 } 528 528 529 JSValue* stringProtoFuncSearch(ExecState* exec, JSObject* thisObj, const List& args)529 JSValue* stringProtoFuncSearch(ExecState* exec, JSObject* thisObj, const ArgList& args) 530 530 { 531 531 // This optimizes the common case that thisObj is a StringObject … … 553 553 } 554 554 555 JSValue* stringProtoFuncReplace(ExecState* exec, JSObject* thisObj, const List& args)555 JSValue* stringProtoFuncReplace(ExecState* exec, JSObject* thisObj, const ArgList& args) 556 556 { 557 557 // This optimizes the common case that thisObj is a StringObject … … 568 568 } 569 569 570 JSValue* stringProtoFuncSlice(ExecState* exec, JSObject* thisObj, const List& args)570 JSValue* stringProtoFuncSlice(ExecState* exec, JSObject* thisObj, const ArgList& args) 571 571 { 572 572 // This optimizes the common case that thisObj is a StringObject … … 593 593 } 594 594 595 JSValue* stringProtoFuncSplit(ExecState* exec, JSObject* thisObj, const List& args)595 JSValue* stringProtoFuncSplit(ExecState* exec, JSObject* thisObj, const ArgList& args) 596 596 { 597 597 // This optimizes the common case that thisObj is a StringObject … … 663 663 } 664 664 665 JSValue* stringProtoFuncSubstr(ExecState* exec, JSObject* thisObj, const List& args)665 JSValue* stringProtoFuncSubstr(ExecState* exec, JSObject* thisObj, const ArgList& args) 666 666 { 667 667 // This optimizes the common case that thisObj is a StringObject … … 688 688 } 689 689 690 JSValue* stringProtoFuncSubstring(ExecState* exec, JSObject* thisObj, const List& args)690 JSValue* stringProtoFuncSubstring(ExecState* exec, JSObject* thisObj, const ArgList& args) 691 691 { 692 692 // This optimizes the common case that thisObj is a StringObject … … 721 721 } 722 722 723 JSValue* stringProtoFuncToLowerCase(ExecState* exec, JSObject* thisObj, const List&)723 JSValue* stringProtoFuncToLowerCase(ExecState* exec, JSObject* thisObj, const ArgList&) 724 724 { 725 725 // This optimizes the common case that thisObj is a StringObject … … 746 746 } 747 747 748 JSValue* stringProtoFuncToUpperCase(ExecState* exec, JSObject* thisObj, const List&)748 JSValue* stringProtoFuncToUpperCase(ExecState* exec, JSObject* thisObj, const ArgList&) 749 749 { 750 750 // This optimizes the common case that thisObj is a StringObject … … 771 771 } 772 772 773 JSValue* stringProtoFuncToLocaleLowerCase(ExecState* exec, JSObject* thisObj, const List&)773 JSValue* stringProtoFuncToLocaleLowerCase(ExecState* exec, JSObject* thisObj, const ArgList&) 774 774 { 775 775 // This optimizes the common case that thisObj is a StringObject … … 797 797 } 798 798 799 JSValue* stringProtoFuncToLocaleUpperCase(ExecState* exec, JSObject* thisObj, const List&)799 JSValue* stringProtoFuncToLocaleUpperCase(ExecState* exec, JSObject* thisObj, const ArgList&) 800 800 { 801 801 // This optimizes the common case that thisObj is a StringObject … … 822 822 } 823 823 824 JSValue* stringProtoFuncLocaleCompare(ExecState* exec, JSObject* thisObj, const List& args)824 JSValue* stringProtoFuncLocaleCompare(ExecState* exec, JSObject* thisObj, const ArgList& args) 825 825 { 826 826 if (args.size() < 1) … … 833 833 } 834 834 835 JSValue* stringProtoFuncBig(ExecState* exec, JSObject* thisObj, const List&)835 JSValue* stringProtoFuncBig(ExecState* exec, JSObject* thisObj, const ArgList&) 836 836 { 837 837 // This optimizes the common case that thisObj is a StringObject … … 840 840 } 841 841 842 JSValue* stringProtoFuncSmall(ExecState* exec, JSObject* thisObj, const List&)842 JSValue* stringProtoFuncSmall(ExecState* exec, JSObject* thisObj, const ArgList&) 843 843 { 844 844 // This optimizes the common case that thisObj is a StringObject … … 847 847 } 848 848 849 JSValue* stringProtoFuncBlink(ExecState* exec, JSObject* thisObj, const List&)849 JSValue* stringProtoFuncBlink(ExecState* exec, JSObject* thisObj, const ArgList&) 850 850 { 851 851 // This optimizes the common case that thisObj is a StringObject … … 854 854 } 855 855 856 JSValue* stringProtoFuncBold(ExecState* exec, JSObject* thisObj, const List&)856 JSValue* stringProtoFuncBold(ExecState* exec, JSObject* thisObj, const ArgList&) 857 857 { 858 858 // This optimizes the common case that thisObj is a StringObject … … 861 861 } 862 862 863 JSValue* stringProtoFuncFixed(ExecState* exec, JSObject* thisObj, const List&)863 JSValue* stringProtoFuncFixed(ExecState* exec, JSObject* thisObj, const ArgList&) 864 864 { 865 865 // This optimizes the common case that thisObj is a StringObject … … 868 868 } 869 869 870 JSValue* stringProtoFuncItalics(ExecState* exec, JSObject* thisObj, const List&)870 JSValue* stringProtoFuncItalics(ExecState* exec, JSObject* thisObj, const ArgList&) 871 871 { 872 872 // This optimizes the common case that thisObj is a StringObject … … 875 875 } 876 876 877 JSValue* stringProtoFuncStrike(ExecState* exec, JSObject* thisObj, const List&)877 JSValue* stringProtoFuncStrike(ExecState* exec, JSObject* thisObj, const ArgList&) 878 878 { 879 879 // This optimizes the common case that thisObj is a StringObject … … 882 882 } 883 883 884 JSValue* stringProtoFuncSub(ExecState* exec, JSObject* thisObj, const List&)884 JSValue* stringProtoFuncSub(ExecState* exec, JSObject* thisObj, const ArgList&) 885 885 { 886 886 // This optimizes the common case that thisObj is a StringObject … … 889 889 } 890 890 891 JSValue* stringProtoFuncSup(ExecState* exec, JSObject* thisObj, const List&)891 JSValue* stringProtoFuncSup(ExecState* exec, JSObject* thisObj, const ArgList&) 892 892 { 893 893 // This optimizes the common case that thisObj is a StringObject … … 896 896 } 897 897 898 JSValue* stringProtoFuncFontcolor(ExecState* exec, JSObject* thisObj, const List& args)898 JSValue* stringProtoFuncFontcolor(ExecState* exec, JSObject* thisObj, const ArgList& args) 899 899 { 900 900 // This optimizes the common case that thisObj is a StringObject … … 904 904 } 905 905 906 JSValue* stringProtoFuncFontsize(ExecState* exec, JSObject* thisObj, const List& args)906 JSValue* stringProtoFuncFontsize(ExecState* exec, JSObject* thisObj, const ArgList& args) 907 907 { 908 908 // This optimizes the common case that thisObj is a StringObject … … 912 912 } 913 913 914 JSValue* stringProtoFuncAnchor(ExecState* exec, JSObject* thisObj, const List& args)914 JSValue* stringProtoFuncAnchor(ExecState* exec, JSObject* thisObj, const ArgList& args) 915 915 { 916 916 // This optimizes the common case that thisObj is a StringObject … … 920 920 } 921 921 922 JSValue* stringProtoFuncLink(ExecState* exec, JSObject* thisObj, const List& args)922 JSValue* stringProtoFuncLink(ExecState* exec, JSObject* thisObj, const ArgList& args) 923 923 { 924 924 // This optimizes the common case that thisObj is a StringObject … … 949 949 950 950 // ECMA 15.5.2 951 JSObject *StringConstructor::construct(ExecState *exec, const List &args)951 JSObject *StringConstructor::construct(ExecState *exec, const ArgList &args) 952 952 { 953 953 JSObject *proto = exec->lexicalGlobalObject()->stringPrototype(); … … 958 958 959 959 // ECMA 15.5.1 960 JSValue *StringConstructor::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)960 JSValue *StringConstructor::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const ArgList &args) 961 961 { 962 962 if (args.isEmpty()) … … 977 977 } 978 978 979 JSValue *StringConstructorFunction::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)979 JSValue *StringConstructorFunction::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const ArgList &args) 980 980 { 981 981 UString s; … … 983 983 UChar *buf = static_cast<UChar *>(fastMalloc(args.size() * sizeof(UChar))); 984 984 UChar *p = buf; 985 List::const_iterator end = args.end();986 for ( List::const_iterator it = args.begin(); it != end; ++it) {985 ArgList::const_iterator end = args.end(); 986 for (ArgList::const_iterator it = args.begin(); it != end; ++it) { 987 987 unsigned short u = static_cast<unsigned short>((*it)->toUInt32(exec)); 988 988 *p++ = UChar(u);
Note:
See TracChangeset
for help on using the changeset viewer.