Changeset 197136 in webkit for trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h
- Timestamp:
- Feb 25, 2016, 2:58:23 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h
r194175 r197136 31 31 namespace JSC { 32 32 33 ALWAYS_INLINE bool JSObject::canPerformFastPutInline(ExecState* exec, VM& vm, PropertyName propertyName) 34 { 35 if (UNLIKELY(propertyName == exec->propertyNames().underscoreProto)) 36 return false; 37 38 // Check if there are any setters or getters in the prototype chain 39 JSValue prototype; 40 JSObject* obj = this; 41 while (true) { 42 if (obj->structure(vm)->hasReadOnlyOrGetterSetterPropertiesExcludingProto() || obj->type() == ProxyObjectType) 43 return false; 44 45 prototype = obj->prototype(); 46 if (prototype.isNull()) 47 return true; 48 49 obj = asObject(prototype); 50 } 51 52 ASSERT_NOT_REACHED(); 53 } 54 33 55 // ECMA 8.6.2.2 34 56 ALWAYS_INLINE void JSObject::putInline(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) … … 45 67 return; 46 68 } 47 48 // Check if there are any setters or getters in the prototype chain49 JSValue prototype;50 if (propertyName != exec->propertyNames().underscoreProto) {51 for (JSObject* obj = thisObject; !obj->structure(vm)->hasReadOnlyOrGetterSetterPropertiesExcludingProto(); obj = asObject(prototype)) {52 prototype = obj->prototype();53 if (prototype.isNull()) {54 ASSERT(!thisObject->structure(vm)->prototypeChainMayInterceptStoreTo(exec->vm(), propertyName));55 if (!thisObject->putDirectInternal<PutModePut>(vm, propertyName, value, 0, slot)56 && slot.isStrictMode())57 throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError));58 return;59 }60 }61 }62 69 63 thisObject->putInlineSlow(exec, propertyName, value, slot); 70 if (thisObject->canPerformFastPutInline(exec, vm, propertyName)) { 71 ASSERT(!thisObject->structure(vm)->prototypeChainMayInterceptStoreTo(exec->vm(), propertyName)); 72 if (!thisObject->putDirectInternal<PutModePut>(vm, propertyName, value, 0, slot) 73 && slot.isStrictMode()) 74 throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError)); 75 } else 76 thisObject->putInlineSlow(exec, propertyName, value, slot); 64 77 } 65 78
Note:
See TracChangeset
for help on using the changeset viewer.