Changeset 221849 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Sep 10, 2017, 11:23:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r221822 r221849 536 536 PropertyName constructor(vm.propertyNames->constructor); 537 537 if (object->getPropertySlot(exec, constructor, slot)) { 538 EXCEPTION_ASSERT(!scope.exception()); 538 539 if (slot.isValue()) { 539 540 JSValue constructorValue = slot.getValue(exec, constructor); … … 550 551 } 551 552 } 552 ASSERT(!scope.exception() || prototypeFunctionName.isNull());553 EXCEPTION_ASSERT(!scope.exception() || prototypeFunctionName.isNull()); 553 554 if (UNLIKELY(scope.exception())) 554 555 scope.clearException(); … … 659 660 ProxyObject* proxy = jsCast<ProxyObject*>(current); 660 661 PutPropertySlot slot(receiver, shouldThrow); 662 scope.release(); 661 663 return proxy->ProxyObject::put(proxy, exec, propertyName, value, slot); 662 664 } … … 717 719 718 720 // 9.1.9.1-4-d-iv Return ? Receiver.[[DefineOwnProperty]](P, valueDesc). 721 scope.release(); 719 722 return receiverObject->methodTable(vm)->defineOwnProperty(receiverObject, exec, propertyName, valueDescriptor, shouldThrow); 720 723 } … … 722 725 // 9.1.9.1-4-e Else Receiver does not currently have a property P, 723 726 // 9.1.9.1-4-e-i Return ? CreateDataProperty(Receiver, P, V). 727 scope.release(); 724 728 return receiverObject->methodTable(vm)->defineOwnProperty(receiverObject, exec, propertyName, PropertyDescriptor(value, None), shouldThrow); 725 729 } … … 741 745 CallData callData; 742 746 CallType callType = setterObject->methodTable(vm)->getCallData(setterObject, callData); 747 scope.release(); 743 748 call(exec, setterObject, callType, callData, receiver, args); 744 749 … … 773 778 if (gs.isGetterSetter()) { 774 779 bool result = callSetter(exec, slot.thisValue(), gs, value, slot.isStrictMode() ? StrictMode : NotStrictMode); 780 RETURN_IF_EXCEPTION(scope, false); 775 781 if (!structure()->isDictionary()) 776 782 slot.setCacheableSetter(obj, offset); … … 793 799 if (!obj->staticPropertiesReified()) { 794 800 if (obj->classInfo(vm)->hasStaticSetterOrReadonlyProperties()) { 795 if (auto entry = obj->findPropertyHashEntry(vm, propertyName)) 801 if (auto entry = obj->findPropertyHashEntry(vm, propertyName)) { 802 scope.release(); 796 803 return putEntry(exec, entry->table->classForThis, entry->value, obj, this, propertyName, value, slot); 804 } 797 805 } 798 806 } … … 802 810 // https://bugs.webkit.org/show_bug.cgi?id=155012 803 811 ProxyObject* proxy = jsCast<ProxyObject*>(obj); 812 scope.release(); 804 813 return proxy->ProxyObject::put(proxy, exec, propertyName, value, slot); 805 814 } … … 1948 1957 if (hint == PreferString) { 1949 1958 value = callToPrimitiveFunction(exec, this, vm.propertyNames->toString, hint); 1950 ASSERT(!scope.exception() || scope.exception() == value.asCell());1959 EXCEPTION_ASSERT(!scope.exception() || scope.exception() == value.asCell()); 1951 1960 if (value) 1952 1961 return value; 1953 1962 value = callToPrimitiveFunction(exec, this, vm.propertyNames->valueOf, hint); 1954 ASSERT(!scope.exception() || scope.exception() == value.asCell());1963 EXCEPTION_ASSERT(!scope.exception() || scope.exception() == value.asCell()); 1955 1964 if (value) 1956 1965 return value; 1957 1966 } else { 1958 1967 value = callToPrimitiveFunction(exec, this, vm.propertyNames->valueOf, hint); 1959 ASSERT(!scope.exception() || scope.exception() == value.asCell());1968 EXCEPTION_ASSERT(!scope.exception() || scope.exception() == value.asCell()); 1960 1969 if (value) 1961 1970 return value; 1962 1971 value = callToPrimitiveFunction(exec, this, vm.propertyNames->toString, hint); 1963 ASSERT(!scope.exception() || scope.exception() == value.asCell());1972 EXCEPTION_ASSERT(!scope.exception() || scope.exception() == value.asCell()); 1964 1973 if (value) 1965 1974 return value; … … 1986 1995 return value; 1987 1996 1997 scope.release(); 1988 1998 return this->methodTable(vm)->defaultValue(this, exec, preferredType); 1989 1999 } … … 2047 2057 JSValue prototype = get(exec, vm.propertyNames->prototype); 2048 2058 RETURN_IF_EXCEPTION(scope, false); 2059 scope.release(); 2049 2060 return defaultHasInstance(exec, value, prototype); 2050 2061 } 2051 if (info.implementsHasInstance()) 2062 if (info.implementsHasInstance()) { 2063 scope.release(); 2052 2064 return methodTable(vm)->customHasInstance(this, exec, value); 2065 } 2053 2066 throwException(exec, scope, createInvalidInstanceofParameterErrorNotFunction(exec, this)); 2054 2067 return false; … … 2062 2075 RETURN_IF_EXCEPTION(scope, false); 2063 2076 2077 scope.release(); 2064 2078 return hasInstance(exec, value, hasInstanceValue); 2065 2079 } … … 2114 2128 while(1) { 2115 2129 if (prototype->structure(vm)->typeInfo().overridesGetPropertyNames()) { 2130 scope.release(); 2116 2131 prototype->methodTable(vm)->getPropertyNames(prototype, exec, propertyNames, mode); 2117 break;2132 return; 2118 2133 } 2119 2134 prototype->methodTable(vm)->getOwnPropertyNames(prototype, exec, propertyNames, mode); … … 2222 2237 JSValue primitive = toPrimitive(exec, PreferNumber); 2223 2238 RETURN_IF_EXCEPTION(scope, 0.0); // should be picked up soon in Nodes.cpp 2239 scope.release(); 2224 2240 return primitive.toNumber(exec); 2225 2241 } … … 2389 2405 if (!descriptor.attributes() && descriptor.value() && canDoFastPutDirectIndex(this)) { 2390 2406 ASSERT(!descriptor.isAccessorDescriptor()); 2407 scope.release(); 2391 2408 return putDirectIndex(exec, index, descriptor.value(), 0, throwException ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 2392 2409 } … … 2440 2457 PropertyDescriptor current; 2441 2458 entryInMap->get(current); 2442 if (descriptor.isEmpty() || descriptor.equalTo(exec, current)) 2459 bool isEmptyOrEqual = descriptor.isEmpty() || descriptor.equalTo(exec, current); 2460 RETURN_IF_EXCEPTION(scope, false); 2461 if (isEmptyOrEqual) 2443 2462 return true; 2444 2463 … … 2575 2594 SparseArrayValueMap* map = allocateSparseIndexMap(vm); 2576 2595 bool result = map->putEntry(exec, this, i, value, false); 2596 RETURN_IF_EXCEPTION(scope, false); 2577 2597 ASSERT(i >= arrayStorage()->length()); 2578 2598 arrayStorage()->setLength(i + 1); … … 2648 2668 // We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value. 2649 2669 map = allocateSparseIndexMap(vm); 2670 scope.release(); 2650 2671 return map->putEntry(exec, this, i, value, shouldThrow); 2651 2672 } … … 2664 2685 // We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails. 2665 2686 unsigned numValuesInArray = storage->m_numValuesInVector + map->size(); 2666 if (map->sparseMode() || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(vm, length)) 2687 if (map->sparseMode() || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(vm, length)) { 2688 scope.release(); 2667 2689 return map->putEntry(exec, this, i, value, shouldThrow); 2690 } 2668 2691 2669 2692 // Reread m_storage after increaseVectorLength, update m_numValuesInVector. … … 2784 2807 // We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value. 2785 2808 map = allocateSparseIndexMap(vm); 2809 scope.release(); 2786 2810 return map->putDirect(exec, this, i, value, attributes, mode); 2787 2811 } … … 2804 2828 // We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails. 2805 2829 unsigned numValuesInArray = storage->m_numValuesInVector + map->size(); 2806 if (map->sparseMode() || attributes || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(vm, length)) 2830 if (map->sparseMode() || attributes || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(vm, length)) { 2831 scope.release(); 2807 2832 return map->putDirect(exec, this, i, value, attributes, mode); 2833 } 2808 2834 2809 2835 // Reread m_storage after increaseVectorLength, update m_numValuesInVector. … … 3352 3378 return true; 3353 3379 // Step 4. 3354 if (current.equalTo(exec, descriptor)) 3380 bool isEqual = current.equalTo(exec, descriptor); 3381 RETURN_IF_EXCEPTION(scope, false); 3382 if (isEqual) 3355 3383 return true; 3356 3384 … … 3369 3397 if (!current.attributesEqual(descriptor) && object) { 3370 3398 object->methodTable(vm)->deleteProperty(object, exec, propertyName); 3399 RETURN_IF_EXCEPTION(scope, false); 3371 3400 return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current); 3372 3401 } … … 3384 3413 3385 3414 object->methodTable(vm)->deleteProperty(object, exec, propertyName); 3415 RETURN_IF_EXCEPTION(scope, false); 3386 3416 return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current); 3387 3417 } … … 3403 3433 return true; 3404 3434 object->methodTable(vm)->deleteProperty(object, exec, propertyName); 3435 RETURN_IF_EXCEPTION(scope, false); 3405 3436 return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current); 3406 3437 } … … 3448 3479 return true; 3449 3480 object->methodTable(vm)->deleteProperty(object, exec, propertyName); 3481 RETURN_IF_EXCEPTION(scope, false); 3450 3482 unsigned attrs = descriptor.attributesOverridingCurrent(current); 3451 3483 object->putDirectAccessor(exec, propertyName, getterSetter, attrs | Accessor); … … 3467 3499 bool isExtensible = this->isExtensible(exec); 3468 3500 RETURN_IF_EXCEPTION(throwScope, false); 3501 throwScope.release(); 3469 3502 return validateAndApplyPropertyDescriptor(exec, this, propertyName, isExtensible, descriptor, isCurrentDefined, current, throwException); 3470 3503 } … … 3595 3628 while (true) { 3596 3629 if (prototype->structure(vm)->typeInfo().overridesGetPropertyNames()) { 3630 scope.release(); 3597 3631 prototype->methodTable(vm)->getPropertyNames(prototype, exec, propertyNames, mode); 3598 break;3632 return; 3599 3633 } 3600 3634 prototype->methodTable(vm)->getOwnPropertyNames(prototype, exec, propertyNames, mode);
Note:
See TracChangeset
for help on using the changeset viewer.