Changeset 37684 in webkit for trunk/JavaScriptCore/kjs/JSObject.cpp
- Timestamp:
- Oct 18, 2008, 6:52:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSObject.cpp
r37681 r37684 73 73 unsigned storageSize = m_structureID->propertyMap().storageSize(); 74 74 for (unsigned i = 0; i < storageSize; ++i) { 75 JSValue *v = m_propertyStorage[i];75 JSValuePtr v = m_propertyStorage[i]; 76 76 if (!v->marked()) 77 77 v->mark(); … … 100 100 101 101 // ECMA 8.6.2.2 102 void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValue *value, PutPropertySlot& slot)102 void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot) 103 103 { 104 104 ASSERT(value); … … 125 125 126 126 // Check if there are any setters or getters in the prototype chain 127 JSValue *prototype;127 JSValuePtr prototype; 128 128 for (JSObject* obj = this; !obj->structureID()->hasGetterSetterProperties(); obj = asObject(prototype)) { 129 129 prototype = obj->prototype(); … … 139 139 140 140 for (JSObject* obj = this; ; obj = asObject(prototype)) { 141 if (JSValue *gs = obj->getDirect(propertyName)) {141 if (JSValuePtr gs = obj->getDirect(propertyName)) { 142 142 if (gs->isGetterSetter()) { 143 143 JSObject* setterFunc = asGetterSetter(gs)->setter(); … … 169 169 } 170 170 171 void JSObject::put(ExecState* exec, unsigned propertyName, JSValue *value)171 void JSObject::put(ExecState* exec, unsigned propertyName, JSValuePtr value) 172 172 { 173 173 PutPropertySlot slot; … … 175 175 } 176 176 177 void JSObject::putWithAttributes(ExecState*, const Identifier& propertyName, JSValue *value, unsigned attributes)177 void JSObject::putWithAttributes(ExecState*, const Identifier& propertyName, JSValuePtr value, unsigned attributes) 178 178 { 179 179 putDirect(propertyName, value, attributes); 180 180 } 181 181 182 void JSObject::putWithAttributes(ExecState* exec, unsigned propertyName, JSValue *value, unsigned attributes)182 void JSObject::putWithAttributes(ExecState* exec, unsigned propertyName, JSValuePtr value, unsigned attributes) 183 183 { 184 184 putWithAttributes(exec, Identifier::from(exec, propertyName), value, attributes); … … 228 228 } 229 229 230 static ALWAYS_INLINE JSValue *callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName)231 { 232 JSValue *function = object->get(exec, propertyName);230 static ALWAYS_INLINE JSValuePtr callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName) 231 { 232 JSValuePtr function = object->get(exec, propertyName); 233 233 CallData callData; 234 234 CallType callType = function->getCallData(callData); … … 241 241 return exec->exception(); 242 242 243 JSValue *result = call(exec, function, callType, callData, const_cast<JSObject*>(object), exec->emptyList());243 JSValuePtr result = call(exec, function, callType, callData, const_cast<JSObject*>(object), exec->emptyList()); 244 244 ASSERT(!result->isGetterSetter()); 245 245 if (exec->hadException()) … … 250 250 } 251 251 252 bool JSObject::getPrimitiveNumber(ExecState* exec, double& number, JSValue *& result)252 bool JSObject::getPrimitiveNumber(ExecState* exec, double& number, JSValuePtr& result) 253 253 { 254 254 result = defaultValue(exec, PreferNumber); … … 258 258 259 259 // ECMA 8.6.2.6 260 JSValue *JSObject::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const260 JSValuePtr JSObject::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const 261 261 { 262 262 // Must call toString first for Date objects. 263 263 if ((hint == PreferString) || (hint != PreferNumber && prototype() == exec->lexicalGlobalObject()->datePrototype())) { 264 if (JSValue *value = callDefaultValueFunction(exec, this, exec->propertyNames().toString))264 if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().toString)) 265 265 return value; 266 if (JSValue *value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf))266 if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf)) 267 267 return value; 268 268 } else { 269 if (JSValue *value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf))269 if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf)) 270 270 return value; 271 if (JSValue *value = callDefaultValueFunction(exec, this, exec->propertyNames().toString))271 if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().toString)) 272 272 return value; 273 273 } … … 291 291 void JSObject::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunction) 292 292 { 293 JSValue *object = getDirect(propertyName);293 JSValuePtr object = getDirect(propertyName); 294 294 if (object && object->isGetterSetter()) { 295 295 ASSERT(m_structureID->hasGetterSetterProperties()); … … 318 318 void JSObject::defineSetter(ExecState* exec, const Identifier& propertyName, JSObject* setterFunction) 319 319 { 320 JSValue *object = getDirect(propertyName);320 JSValuePtr object = getDirect(propertyName); 321 321 if (object && object->isGetterSetter()) { 322 322 ASSERT(m_structureID->hasGetterSetterProperties()); … … 343 343 } 344 344 345 JSValue *JSObject::lookupGetter(ExecState*, const Identifier& propertyName)345 JSValuePtr JSObject::lookupGetter(ExecState*, const Identifier& propertyName) 346 346 { 347 347 JSObject* object = this; 348 348 while (true) { 349 JSValue *value = object->getDirect(propertyName);349 JSValuePtr value = object->getDirect(propertyName); 350 350 if (value) { 351 351 if (!value->isGetterSetter()) … … 363 363 } 364 364 365 JSValue *JSObject::lookupSetter(ExecState*, const Identifier& propertyName)365 JSValuePtr JSObject::lookupSetter(ExecState*, const Identifier& propertyName) 366 366 { 367 367 JSObject* object = this; 368 368 while (true) { 369 JSValue *value = object->getDirect(propertyName);369 JSValuePtr value = object->getDirect(propertyName); 370 370 if (value) { 371 371 if (!value->isGetterSetter()) … … 383 383 } 384 384 385 bool JSObject::hasInstance(ExecState* exec, JSValue * value, JSValue*proto)385 bool JSObject::hasInstance(ExecState* exec, JSValuePtr value, JSValuePtr proto) 386 386 { 387 387 if (!proto->isObject()) { … … 436 436 double JSObject::toNumber(ExecState* exec) const 437 437 { 438 JSValue *primitive = toPrimitive(exec, PreferNumber);438 JSValuePtr primitive = toPrimitive(exec, PreferNumber); 439 439 if (exec->hadException()) // should be picked up soon in nodes.cpp 440 440 return 0.0; … … 444 444 UString JSObject::toString(ExecState* exec) const 445 445 { 446 JSValue *primitive = toPrimitive(exec, PreferString);446 JSValuePtr primitive = toPrimitive(exec, PreferString); 447 447 if (exec->hadException()) 448 448 return ""; … … 494 494 } 495 495 496 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue ** location)496 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValuePtr* location) 497 497 { 498 498 if (JSObject* getterFunction = asGetterSetter(*location)->getter())
Note:
See TracChangeset
for help on using the changeset viewer.