Changeset 47288 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Aug 14, 2009, 11:12:49 AM (16 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ArrayConstructor.cpp
r47276 r47288 92 92 JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*, JSObject*, JSValue, const ArgList& args) 93 93 { 94 if (!args.at(0).isObject()) 95 return jsBoolean(false); 96 return jsBoolean(asObject(args.at(0))->isObject(&JSArray::info)); 94 return jsBoolean(args.at(0).inherits(&JSArray::info)); 97 95 } 98 96 -
trunk/JavaScriptCore/runtime/ArrayPrototype.cpp
r44286 r47288 145 145 JSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 146 146 { 147 if (!thisValue.i sObject(&JSArray::info))147 if (!thisValue.inherits(&JSArray::info)) 148 148 return throwError(exec, TypeError); 149 149 JSObject* thisObj = asArray(thisValue); … … 191 191 JSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 192 192 { 193 if (!thisValue.i sObject(&JSArray::info))193 if (!thisValue.inherits(&JSArray::info)) 194 194 return throwError(exec, TypeError); 195 195 JSObject* thisObj = asArray(thisValue); … … 299 299 ArgList::const_iterator end = args.end(); 300 300 while (1) { 301 if (curArg.i sObject(&JSArray::info)) {301 if (curArg.inherits(&JSArray::info)) { 302 302 unsigned length = curArg.get(exec, exec->propertyNames().length).toUInt32(exec); 303 303 JSObject* curObject = curArg.toObject(exec); -
trunk/JavaScriptCore/runtime/BooleanPrototype.cpp
r43372 r47288 60 60 return jsNontrivialString(exec, "true"); 61 61 62 if (!thisValue.i sObject(&BooleanObject::info))62 if (!thisValue.inherits(&BooleanObject::info)) 63 63 return throwError(exec, TypeError); 64 64 … … 75 75 return thisValue; 76 76 77 if (!thisValue.i sObject(&BooleanObject::info))77 if (!thisValue.inherits(&BooleanObject::info)) 78 78 return throwError(exec, TypeError); 79 79 -
trunk/JavaScriptCore/runtime/DateConstructor.cpp
r46992 r47288 80 80 value = getCurrentUTCTime(); 81 81 else if (numArgs == 1) { 82 if (args.at(0).i sObject(&DateInstance::info))82 if (args.at(0).inherits(&DateInstance::info)) 83 83 value = asDateInstance(args.at(0))->internalNumber(); 84 84 else { -
trunk/JavaScriptCore/runtime/DatePrototype.cpp
r44931 r47288 412 412 JSValue JSC_HOST_CALL dateProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 413 413 { 414 if (!thisValue.i sObject(&DateInstance::info))414 if (!thisValue.inherits(&DateInstance::info)) 415 415 return throwError(exec, TypeError); 416 416 … … 429 429 JSValue JSC_HOST_CALL dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 430 430 { 431 if (!thisValue.i sObject(&DateInstance::info))431 if (!thisValue.inherits(&DateInstance::info)) 432 432 return throwError(exec, TypeError); 433 433 … … 446 446 JSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 447 447 { 448 if (!thisValue.i sObject(&DateInstance::info))448 if (!thisValue.inherits(&DateInstance::info)) 449 449 return throwError(exec, TypeError); 450 450 … … 468 468 JSValue JSC_HOST_CALL dateProtoFuncToDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 469 469 { 470 if (!thisValue.i sObject(&DateInstance::info))470 if (!thisValue.inherits(&DateInstance::info)) 471 471 return throwError(exec, TypeError); 472 472 … … 485 485 JSValue JSC_HOST_CALL dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 486 486 { 487 if (!thisValue.i sObject(&DateInstance::info))487 if (!thisValue.inherits(&DateInstance::info)) 488 488 return throwError(exec, TypeError); 489 489 … … 502 502 JSValue JSC_HOST_CALL dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 503 503 { 504 if (!thisValue.i sObject(&DateInstance::info))504 if (!thisValue.inherits(&DateInstance::info)) 505 505 return throwError(exec, TypeError); 506 506 … … 515 515 JSValue JSC_HOST_CALL dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 516 516 { 517 if (!thisValue.i sObject(&DateInstance::info))517 if (!thisValue.inherits(&DateInstance::info)) 518 518 return throwError(exec, TypeError); 519 519 … … 528 528 JSValue JSC_HOST_CALL dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 529 529 { 530 if (!thisValue.i sObject(&DateInstance::info))530 if (!thisValue.inherits(&DateInstance::info)) 531 531 return throwError(exec, TypeError); 532 532 … … 541 541 JSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 542 542 { 543 if (!thisValue.i sObject(&DateInstance::info))543 if (!thisValue.inherits(&DateInstance::info)) 544 544 return throwError(exec, TypeError); 545 545 … … 554 554 JSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 555 555 { 556 if (!thisValue.i sObject(&DateInstance::info))556 if (!thisValue.inherits(&DateInstance::info)) 557 557 return throwError(exec, TypeError); 558 558 … … 571 571 JSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 572 572 { 573 if (!thisValue.i sObject(&DateInstance::info))573 if (!thisValue.inherits(&DateInstance::info)) 574 574 return throwError(exec, TypeError); 575 575 … … 588 588 JSValue JSC_HOST_CALL dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 589 589 { 590 if (!thisValue.i sObject(&DateInstance::info))590 if (!thisValue.inherits(&DateInstance::info)) 591 591 return throwError(exec, TypeError); 592 592 … … 605 605 JSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 606 606 { 607 if (!thisValue.i sObject(&DateInstance::info))607 if (!thisValue.inherits(&DateInstance::info)) 608 608 return throwError(exec, TypeError); 609 609 … … 622 622 JSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 623 623 { 624 if (!thisValue.i sObject(&DateInstance::info))624 if (!thisValue.inherits(&DateInstance::info)) 625 625 return throwError(exec, TypeError); 626 626 … … 639 639 JSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 640 640 { 641 if (!thisValue.i sObject(&DateInstance::info))641 if (!thisValue.inherits(&DateInstance::info)) 642 642 return throwError(exec, TypeError); 643 643 … … 656 656 JSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 657 657 { 658 if (!thisValue.i sObject(&DateInstance::info))658 if (!thisValue.inherits(&DateInstance::info)) 659 659 return throwError(exec, TypeError); 660 660 … … 673 673 JSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 674 674 { 675 if (!thisValue.i sObject(&DateInstance::info))675 if (!thisValue.inherits(&DateInstance::info)) 676 676 return throwError(exec, TypeError); 677 677 … … 690 690 JSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 691 691 { 692 if (!thisValue.i sObject(&DateInstance::info))692 if (!thisValue.inherits(&DateInstance::info)) 693 693 return throwError(exec, TypeError); 694 694 … … 707 707 JSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 708 708 { 709 if (!thisValue.i sObject(&DateInstance::info))709 if (!thisValue.inherits(&DateInstance::info)) 710 710 return throwError(exec, TypeError); 711 711 … … 724 724 JSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 725 725 { 726 if (!thisValue.i sObject(&DateInstance::info))726 if (!thisValue.inherits(&DateInstance::info)) 727 727 return throwError(exec, TypeError); 728 728 … … 741 741 JSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 742 742 { 743 if (!thisValue.i sObject(&DateInstance::info))743 if (!thisValue.inherits(&DateInstance::info)) 744 744 return throwError(exec, TypeError); 745 745 … … 758 758 JSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 759 759 { 760 if (!thisValue.i sObject(&DateInstance::info))760 if (!thisValue.inherits(&DateInstance::info)) 761 761 return throwError(exec, TypeError); 762 762 … … 775 775 JSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 776 776 { 777 if (!thisValue.i sObject(&DateInstance::info))777 if (!thisValue.inherits(&DateInstance::info)) 778 778 return throwError(exec, TypeError); 779 779 … … 792 792 JSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 793 793 { 794 if (!thisValue.i sObject(&DateInstance::info))794 if (!thisValue.inherits(&DateInstance::info)) 795 795 return throwError(exec, TypeError); 796 796 … … 809 809 JSValue JSC_HOST_CALL dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 810 810 { 811 if (!thisValue.i sObject(&DateInstance::info))811 if (!thisValue.inherits(&DateInstance::info)) 812 812 return throwError(exec, TypeError); 813 813 … … 824 824 JSValue JSC_HOST_CALL dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 825 825 { 826 if (!thisValue.i sObject(&DateInstance::info))826 if (!thisValue.inherits(&DateInstance::info)) 827 827 return throwError(exec, TypeError); 828 828 … … 839 839 JSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 840 840 { 841 if (!thisValue.i sObject(&DateInstance::info))841 if (!thisValue.inherits(&DateInstance::info)) 842 842 return throwError(exec, TypeError); 843 843 … … 856 856 JSValue JSC_HOST_CALL dateProtoFuncSetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 857 857 { 858 if (!thisValue.i sObject(&DateInstance::info))858 if (!thisValue.inherits(&DateInstance::info)) 859 859 return throwError(exec, TypeError); 860 860 … … 869 869 static JSValue setNewValueFromTimeArgs(ExecState* exec, JSValue thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC) 870 870 { 871 if (!thisValue.i sObject(&DateInstance::info))871 if (!thisValue.inherits(&DateInstance::info)) 872 872 return throwError(exec, TypeError); 873 873 … … 900 900 static JSValue setNewValueFromDateArgs(ExecState* exec, JSValue thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC) 901 901 { 902 if (!thisValue.i sObject(&DateInstance::info))902 if (!thisValue.inherits(&DateInstance::info)) 903 903 return throwError(exec, TypeError); 904 904 … … 1021 1021 JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 1022 1022 { 1023 if (!thisValue.i sObject(&DateInstance::info))1023 if (!thisValue.inherits(&DateInstance::info)) 1024 1024 return throwError(exec, TypeError); 1025 1025 … … 1063 1063 JSValue JSC_HOST_CALL dateProtoFuncGetYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 1064 1064 { 1065 if (!thisValue.i sObject(&DateInstance::info))1065 if (!thisValue.inherits(&DateInstance::info)) 1066 1066 return throwError(exec, TypeError); 1067 1067 -
trunk/JavaScriptCore/runtime/FunctionPrototype.cpp
r47236 r47288 85 85 JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 86 86 { 87 if (thisValue.i sObject(&JSFunction::info)) {87 if (thisValue.inherits(&JSFunction::info)) { 88 88 JSFunction* function = asFunction(thisValue); 89 89 FunctionBodyNode* body = function->body(); … … 95 95 } 96 96 97 if (thisValue.i sObject(&InternalFunction::info)) {97 if (thisValue.inherits(&InternalFunction::info)) { 98 98 InternalFunction* function = asInternalFunction(thisValue); 99 99 return jsString(exec, "function " + function->name(&exec->globalData()) + "() {\n [native code]\n}"); -
trunk/JavaScriptCore/runtime/JSActivation.cpp
r47022 r47288 157 157 callFrame->setCalleeArguments(arguments); 158 158 } 159 ASSERT(arguments->i sObject(&Arguments::info));159 ASSERT(arguments->inherits(&Arguments::info)); 160 160 161 161 return arguments; -
trunk/JavaScriptCore/runtime/JSCell.h
r47267 r47288 56 56 bool isObject() const; 57 57 virtual bool isGetterSetter() const; 58 virtual bool isObject(const ClassInfo*) const;58 bool inherits(const ClassInfo*) const; 59 59 virtual bool isAPIValueWrapper() const { return false; } 60 60 -
trunk/JavaScriptCore/runtime/JSObject.h
r47267 r47288 83 83 virtual ~JSObject(); 84 84 85 bool inherits(const ClassInfo* classInfo) const { return JSCell::isObject(classInfo); }86 87 85 JSValue prototype() const; 88 86 void setPrototype(JSValue prototype); … … 209 207 210 208 private: 209 // Nobody should ever ask any of these questions on something already known to be a JSObject. 210 using JSCell::isAPIValueWrapper; 211 using JSCell::isGetterSetter; 212 using JSCell::toObject; 213 void getObject(); 214 void getString(); 215 void isObject(); 216 void isString(); 217 #if USE(JSVALUE32) 218 void isNumber(); 219 #endif 220 211 221 ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } 212 222 PropertyStorage propertyStorage() { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } … … 297 307 } 298 308 299 inline bool JSCell::i sObject(const ClassInfo* info) const309 inline bool JSCell::inherits(const ClassInfo* info) const 300 310 { 301 311 for (const ClassInfo* ci = classInfo(); ci; ci = ci->parentClass) { … … 306 316 } 307 317 308 // this method is here to be after the inline declaration of JSCell::i sObject309 inline bool JSValue::i sObject(const ClassInfo* classInfo) const310 { 311 return isCell() && asCell()->i sObject(classInfo);318 // this method is here to be after the inline declaration of JSCell::inherits 319 inline bool JSValue::inherits(const ClassInfo* classInfo) const 320 { 321 return isCell() && asCell()->inherits(classInfo); 312 322 } 313 323 -
trunk/JavaScriptCore/runtime/JSValue.h
r47022 r47288 131 131 bool isGetterSetter() const; 132 132 bool isObject() const; 133 bool i sObject(const ClassInfo*) const;133 bool inherits(const ClassInfo*) const; 134 134 135 135 // Extracting the value. -
trunk/JavaScriptCore/runtime/RegExpConstructor.cpp
r47239 r47288 331 331 JSValue arg1 = args.at(1); 332 332 333 if (arg0.i sObject(&RegExpObject::info)) {333 if (arg0.inherits(&RegExpObject::info)) { 334 334 if (!arg1.isUndefined()) 335 335 return throwError(exec, TypeError, "Cannot supply flags when constructing one RegExp from another."); -
trunk/JavaScriptCore/runtime/RegExpPrototype.cpp
r47239 r47288 60 60 JSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 61 61 { 62 if (!thisValue.i sObject(&RegExpObject::info))62 if (!thisValue.inherits(&RegExpObject::info)) 63 63 return throwError(exec, TypeError); 64 64 return asRegExpObject(thisValue)->test(exec, args); … … 67 67 JSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 68 68 { 69 if (!thisValue.i sObject(&RegExpObject::info))69 if (!thisValue.inherits(&RegExpObject::info)) 70 70 return throwError(exec, TypeError); 71 71 return asRegExpObject(thisValue)->exec(exec, args); … … 74 74 JSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 75 75 { 76 if (!thisValue.i sObject(&RegExpObject::info))76 if (!thisValue.inherits(&RegExpObject::info)) 77 77 return throwError(exec, TypeError); 78 78 … … 81 81 JSValue arg1 = args.at(1); 82 82 83 if (arg0.i sObject(&RegExpObject::info)) {83 if (arg0.inherits(&RegExpObject::info)) { 84 84 if (!arg1.isUndefined()) 85 85 return throwError(exec, TypeError, "Cannot supply flags when constructing one RegExp from another."); … … 101 101 JSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) 102 102 { 103 if (!thisValue.i sObject(&RegExpObject::info)) {104 if (thisValue.i sObject(&RegExpPrototype::info))103 if (!thisValue.inherits(&RegExpObject::info)) { 104 if (thisValue.inherits(&RegExpPrototype::info)) 105 105 return jsNontrivialString(exec, "//"); 106 106 return throwError(exec, TypeError); -
trunk/JavaScriptCore/runtime/ScopeChain.cpp
r44224 r47288 57 57 ScopeChainIterator iter = this->begin(); 58 58 ScopeChainIterator end = this->end(); 59 while (!(*iter)->i sObject(&JSActivation::info)) {59 while (!(*iter)->inherits(&JSActivation::info)) { 60 60 ++iter; 61 61 if (iter == end) -
trunk/JavaScriptCore/runtime/StringPrototype.cpp
r47239 r47288 222 222 replacementString = replacement.toString(exec); 223 223 224 if (pattern.i sObject(&RegExpObject::info)) {224 if (pattern.inherits(&RegExpObject::info)) { 225 225 RegExp* reg = asRegExpObject(pattern)->regExp(); 226 226 bool global = reg->global(); … … 367 367 return thisValue; 368 368 369 if (thisValue.i sObject(&StringObject::info))369 if (thisValue.inherits(&StringObject::info)) 370 370 return asStringObject(thisValue)->internalValue(); 371 371 … … 468 468 RefPtr<RegExp> reg; 469 469 RegExpObject* imp = 0; 470 if (a0.i sObject(&RegExpObject::info))470 if (a0.inherits(&RegExpObject::info)) 471 471 reg = asRegExpObject(a0)->regExp(); 472 472 else { … … 518 518 UString u = s; 519 519 RefPtr<RegExp> reg; 520 if (a0.i sObject(&RegExpObject::info))520 if (a0.inherits(&RegExpObject::info)) 521 521 reg = asRegExpObject(a0)->regExp(); 522 522 else { … … 570 570 int p0 = 0; 571 571 unsigned limit = a1.isUndefined() ? 0xFFFFFFFFU : a1.toUInt32(exec); 572 if (a0.i sObject(&RegExpObject::info)) {572 if (a0.inherits(&RegExpObject::info)) { 573 573 RegExp* reg = asRegExpObject(a0)->regExp(); 574 574 if (s.isEmpty() && reg->match(s, 0) >= 0) {
Note:
See TracChangeset
for help on using the changeset viewer.