Changeset 221849 in webkit for trunk/Source/JavaScriptCore/jit/JITOperations.cpp
- Timestamp:
- Sep 10, 2017, 11:23:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r221832 r221849 354 354 Identifier ident = Identifier::fromUid(vm, key); 355 355 LOG_IC((ICEvent::OperationIn, base->classInfo(*vm), ident)); 356 scope.release(); 356 357 return JSValue::encode(jsBoolean(asObject(base)->hasProperty(exec, ident))); 357 358 } … … 554 555 if (baseValue.isObject()) { 555 556 JSObject* object = asObject(baseValue); 556 if (object->canSetIndexQuickly(i)) 557 if (object->canSetIndexQuickly(i)) { 557 558 object->setIndexQuickly(vm, i, value); 558 else { 559 // FIXME: This will make us think that in-bounds typed array accesses are actually 560 // out-of-bounds. 561 // https://bugs.webkit.org/show_bug.cgi?id=149886 562 byValInfo->arrayProfile->setOutOfBounds(); 563 object->methodTable(vm)->putByIndex(object, callFrame, i, value, callFrame->codeBlock()->isStrictMode()); 559 return; 564 560 } 565 } else 566 baseValue.putByIndex(callFrame, i, value, callFrame->codeBlock()->isStrictMode()); 561 562 // FIXME: This will make us think that in-bounds typed array accesses are actually 563 // out-of-bounds. 564 // https://bugs.webkit.org/show_bug.cgi?id=149886 565 byValInfo->arrayProfile->setOutOfBounds(); 566 scope.release(); 567 object->methodTable(vm)->putByIndex(object, callFrame, i, value, callFrame->codeBlock()->isStrictMode()); 568 return; 569 } 570 571 scope.release(); 572 baseValue.putByIndex(callFrame, i, value, callFrame->codeBlock()->isStrictMode()); 567 573 return; 568 574 } … … 604 610 } 605 611 612 scope.release(); 606 613 baseObject->putDirectIndex(callFrame, index, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 607 614 return; … … 613 620 if (subscriptAsDouble == subscriptAsUInt32 && isIndex(subscriptAsUInt32)) { 614 621 byValInfo->tookSlowPath = true; 622 scope.release(); 615 623 baseObject->putDirectIndex(callFrame, subscriptAsUInt32, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 616 624 return; … … 624 632 if (std::optional<uint32_t> index = parseIndex(property)) { 625 633 byValInfo->tookSlowPath = true; 634 scope.release(); 626 635 baseObject->putDirectIndex(callFrame, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 627 636 return; … … 958 967 CodeBlock** codeBlockSlot = execCallee->addressOfCodeBlock(); 959 968 JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, callee, scope, kind, *codeBlockSlot); 960 ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error));969 EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error)); 961 970 if (error) { 962 971 return encodeResult( … … 1017 1026 1018 1027 JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, callee, scope, kind, codeBlock); 1019 ASSERT_UNUSED(throwScope, throwScope.exception() == reinterpret_cast<Exception*>(error));1028 EXCEPTION_ASSERT_UNUSED(throwScope, throwScope.exception() == reinterpret_cast<Exception*>(error)); 1020 1029 if (error) 1021 1030 return; … … 1044 1053 JSValue calleeAsValue = execCallee->guaranteedJSValueCallee(); 1045 1054 calleeAsFunctionCell = getJSFunction(calleeAsValue); 1046 if (UNLIKELY(!calleeAsFunctionCell)) 1055 if (UNLIKELY(!calleeAsFunctionCell)) { 1056 throwScope.release(); 1047 1057 return handleHostCall(execCallee, calleeAsValue, callLinkInfo); 1058 } 1048 1059 1049 1060 JSFunction* function = jsCast<JSFunction*>(calleeAsFunctionCell); … … 1062 1073 CodeBlock** codeBlockSlot = execCallee->addressOfCodeBlock(); 1063 1074 JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, function, scope, kind, *codeBlockSlot); 1064 ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error));1075 EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error)); 1065 1076 if (error) { 1066 1077 return encodeResult( … … 1594 1605 RETURN_IF_EXCEPTION(scope, void()); 1595 1606 1607 scope.release(); 1596 1608 if (accessorType == AccessorType::Getter) 1597 1609 base->putGetter(exec, propertyKey, accessor, attribute); … … 1761 1773 if (asString(baseValue)->canGetIndex(i)) { 1762 1774 ctiPatchCallByReturnAddress(returnAddress, FunctionPtr(operationGetByValString)); 1775 scope.release(); 1763 1776 return asString(baseValue)->getIndex(exec, i); 1764 1777 } … … 1777 1790 } 1778 1791 1792 scope.release(); 1779 1793 return baseValue.get(exec, i); 1780 1794 } … … 1789 1803 byValInfo->tookSlowPath = true; 1790 1804 1805 scope.release(); 1791 1806 return baseValue.get(exec, property); 1792 1807 } … … 1980 1995 if (LIKELY(subscript.isUInt32())) { 1981 1996 uint32_t i = subscript.asUInt32(); 1982 if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i)) 1983 result = asString(baseValue)->getIndex(exec, i); 1984 else { 1985 result = baseValue.get(exec, i); 1986 if (!isJSString(baseValue)) { 1987 ASSERT(exec->bytecodeOffset()); 1988 ctiPatchCallByReturnAddress(ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(byValInfo->stubRoutine ? operationGetByValGeneric : operationGetByValOptimize)); 1989 } 1997 if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i)) { 1998 scope.release(); 1999 return JSValue::encode(asString(baseValue)->getIndex(exec, i)); 2000 } 2001 result = baseValue.get(exec, i); 2002 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2003 if (!isJSString(baseValue)) { 2004 ASSERT(exec->bytecodeOffset()); 2005 ctiPatchCallByReturnAddress(ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(byValInfo->stubRoutine ? operationGetByValGeneric : operationGetByValOptimize)); 1990 2006 } 1991 2007 } else { … … 1994 2010 auto property = subscript.toPropertyKey(exec); 1995 2011 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2012 scope.release(); 1996 2013 result = baseValue.get(exec, property); 1997 2014 } … … 2012 2029 2013 2030 JSObject* baseObj = JSValue::decode(encodedBase).toObject(exec); 2031 RETURN_IF_EXCEPTION(scope, false); 2014 2032 if (!baseObj) 2015 2033 return false; 2016 2034 bool couldDelete = baseObj->methodTable(vm)->deleteProperty(baseObj, exec, Identifier::fromUid(&vm, uid)); 2035 RETURN_IF_EXCEPTION(scope, false); 2017 2036 if (!couldDelete && exec->codeBlock()->isStrictMode()) 2018 2037 throwTypeError(exec, scope, ASCIILiteral(UnableToDeletePropertyError)); … … 2032 2051 2033 2052 JSObject* baseObj = JSValue::decode(encodedBase).toObject(exec); 2053 RETURN_IF_EXCEPTION(scope, false); 2034 2054 JSValue key = JSValue::decode(encodedKey); 2035 2055 if (!baseObj) … … 2041 2061 couldDelete = baseObj->methodTable(vm)->deletePropertyByIndex(baseObj, exec, index); 2042 2062 else { 2043 RETURN_IF_EXCEPTION(scope, false);2044 2063 Identifier property = key.toPropertyKey(exec); 2045 2064 RETURN_IF_EXCEPTION(scope, false); 2046 2065 couldDelete = baseObj->methodTable(vm)->deleteProperty(baseObj, exec, property); 2047 2066 } 2067 RETURN_IF_EXCEPTION(scope, false); 2048 2068 if (!couldDelete && exec->codeBlock()->isStrictMode()) 2049 2069 throwTypeError(exec, scope, ASCIILiteral(UnableToDeletePropertyError)); … … 2198 2218 ASSERT(getPutInfo.resolveType() != ModuleVar); 2199 2219 2220 throwScope.release(); 2200 2221 return JSValue::encode(scope->getPropertySlot(exec, ident, [&] (bool found, PropertySlot& slot) -> JSValue { 2201 2222 if (!found) { … … 2249 2270 2250 2271 bool hasProperty = scope->hasProperty(exec, ident); 2272 EXCEPTION_ASSERT(!throwScope.exception() || !hasProperty); 2251 2273 if (hasProperty 2252 2274 && scope->isGlobalLexicalEnvironment() … … 2521 2543 double a = op1.toNumber(exec); 2522 2544 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2545 scope.release(); 2523 2546 double b = op2.toNumber(exec); 2524 2547 return JSValue::encode(jsNumber(a * b)); … … 2622 2645 JSValue operand = JSValue::decode(encodedOperand); 2623 2646 double number = operand.toNumber(exec); 2624 if (UNLIKELY(scope.exception())) 2625 return JSValue::encode(JSValue()); 2647 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2626 2648 return JSValue::encode(jsNumber(-number)); 2627 2649 } … … 2636 2658 arithProfile.observeLHS(operand); 2637 2659 double number = operand.toNumber(exec); 2638 if (UNLIKELY(scope.exception())) 2639 return JSValue::encode(JSValue()); 2660 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2640 2661 2641 2662 JSValue result = jsNumber(-number); … … 2673 2694 2674 2695 double number = operand.toNumber(exec); 2675 if (UNLIKELY(scope.exception())) 2676 return JSValue::encode(JSValue()); 2696 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2677 2697 JSValue result = jsNumber(-number); 2678 2698 arithProfile->observeResult(result); … … 2697 2717 2698 2718 double number = operand.toNumber(exec); 2699 if (UNLIKELY(scope.exception())) 2700 return JSValue::encode(JSValue()); 2719 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2701 2720 return JSValue::encode(jsNumber(-number)); 2702 2721 } … … 2710 2729 double a = op1.toNumber(exec); 2711 2730 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2731 scope.release(); 2712 2732 double b = op2.toNumber(exec); 2713 2733 return JSValue::encode(jsNumber(a - b));
Note:
See TracChangeset
for help on using the changeset viewer.