Changeset 57019 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Apr 2, 2010, 1:15:53 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSCell.cpp
r52731 r57019 164 164 } 165 165 166 UString JSCell::toThisString(ExecState* exec) const167 {168 return toThisObject(exec)->toString(exec);169 }170 171 JSString* JSCell::toThisJSString(ExecState* exec)172 {173 return jsString(exec, toThisString(exec));174 }175 176 166 const ClassInfo* JSCell::classInfo() const 177 167 { -
trunk/JavaScriptCore/runtime/JSCell.h
r54022 r57019 108 108 109 109 virtual JSObject* toThisObject(ExecState*) const; 110 virtual UString toThisString(ExecState*) const;111 virtual JSString* toThisJSString(ExecState*);112 110 virtual JSValue getJSNumber(); 113 111 void* vptr() { return *reinterpret_cast<void**>(this); } … … 302 300 } 303 301 304 inline UString JSValue::toThisString(ExecState* exec) const305 {306 return isCell() ? asCell()->toThisString(exec) : toString(exec);307 }308 309 302 inline JSValue JSValue::getJSNumber() 310 303 { -
trunk/JavaScriptCore/runtime/JSNumberCell.cpp
r47622 r57019 58 58 } 59 59 60 UString JSNumberCell::toThisString(ExecState*) const61 {62 return UString::from(m_value);63 }64 65 60 JSObject* JSNumberCell::toObject(ExecState* exec) const 66 61 { -
trunk/JavaScriptCore/runtime/JSNumberCell.h
r54050 r57019 63 63 virtual JSObject* toObject(ExecState*) const; 64 64 65 virtual UString toThisString(ExecState*) const;66 65 virtual JSObject* toThisObject(ExecState*) const; 67 66 virtual JSValue getJSNumber(); -
trunk/JavaScriptCore/runtime/JSObject.h
r55521 r57019 36 36 #include "Structure.h" 37 37 #include "JSGlobalData.h" 38 #include "JSString.h" 38 39 #include <wtf/StdLibExtras.h> 39 40 … … 710 711 } 711 712 713 // --- JSValue inlines ---------------------------- 714 715 ALWAYS_INLINE UString JSValue::toThisString(ExecState* exec) const 716 { 717 return isString() ? static_cast<JSString*>(asCell())->value(exec) : toThisObject(exec)->toString(exec); 718 } 719 720 inline JSString* JSValue::toThisJSString(ExecState* exec) const 721 { 722 return isString() ? static_cast<JSString*>(asCell()) : jsString(exec, toThisObject(exec)->toString(exec)); 723 } 724 712 725 } // namespace JSC 713 726 -
trunk/JavaScriptCore/runtime/JSString.cpp
r56021 r57019 144 144 } 145 145 146 UString JSString::toThisString(ExecState* exec) const147 {148 return value(exec);149 }150 151 JSString* JSString::toThisJSString(ExecState*)152 {153 return this;154 }155 156 146 inline StringObject* StringObject::create(ExecState* exec, JSString* string) 157 147 { -
trunk/JavaScriptCore/runtime/JSString.h
r56021 r57019 298 298 299 299 virtual JSObject* toThisObject(ExecState*) const; 300 virtual UString toThisString(ExecState*) const;301 virtual JSString* toThisJSString(ExecState*);302 300 303 301 // Actually getPropertySlot, not getOwnPropertySlot (see JSCell). … … 485 483 486 484 // --- JSValue inlines ---------------------------- 487 488 inline JSString* JSValue::toThisJSString(ExecState* exec)489 {490 return isCell() ? asCell()->toThisJSString(exec) : jsString(exec, toString(exec));491 }492 485 493 486 inline UString JSValue::toString(ExecState* exec) const -
trunk/JavaScriptCore/runtime/JSValue.h
r52731 r57019 189 189 JSObject* toThisObject(ExecState*) const; 190 190 UString toThisString(ExecState*) const; 191 JSString* toThisJSString(ExecState*) ;191 JSString* toThisJSString(ExecState*) const; 192 192 193 193 static bool equal(ExecState* exec, JSValue v1, JSValue v2); -
trunk/JavaScriptCore/runtime/JSZombie.h
r51625 r57019 61 61 virtual bool deleteProperty(ExecState*, unsigned) { ASSERT_NOT_REACHED(); return false; } 62 62 virtual JSObject* toThisObject(ExecState*) const { ASSERT_NOT_REACHED(); return 0; } 63 virtual UString toThisString(ExecState*) const { ASSERT_NOT_REACHED(); return ""; }64 virtual JSString* toThisJSString(ExecState*) { ASSERT_NOT_REACHED(); return 0; }65 63 virtual JSValue getJSNumber() { ASSERT_NOT_REACHED(); return jsNull(); } 66 64 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&) { ASSERT_NOT_REACHED(); return false; }
Note:
See TracChangeset
for help on using the changeset viewer.