Ignore:
Timestamp:
Sep 26, 2016, 12:11:17 PM (9 years ago)
Author:
[email protected]
Message:

Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
https://bugs.webkit.org/show_bug.cgi?id=162521

Reviewed by Saam Barati.

Source/JavaScriptCore:

Also, where possible, if the return type is JSValue, changed the returned value
(on exception) to the empty JSValue (instead of sometimes jsUndefined, jsNull,
or the thrown exception value).

There are a few places where I had to continue to return the previously returned
value (instead of the empty JSValue) in order for tests to pass. This is needed
because there are missing exception checks that will need to be added before I
can change those to return the empty JSValue too. Identifying all the places
where those checks need to be added is beyond the scope of this patch. I will
work on adding missing exception checks in a subsequent patch.

In this patch, there is one missing exception check in replaceUsingRegExpSearch()
that was easily identified, and is necessary so that Interpreter::execute()
functions can return JSValue. I've added this missing check.

This patch has passed the JSC and layout tests.

  • dfg/DFGOperations.cpp:

(JSC::DFG::operationPutByValInternal):

  • inspector/JSInjectedScriptHost.cpp:

(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):

  • inspector/JSJavaScriptCallFrame.cpp:

(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):

  • interpreter/Interpreter.cpp:

(JSC::eval):
(JSC::sizeOfVarargs):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):

  • interpreter/ShadowChicken.cpp:

(JSC::ShadowChicken::functionsOnStack):

  • jit/JITOperations.cpp:

(JSC::getByVal):

  • jsc.cpp:

(WTF::ImpureGetter::getOwnPropertySlot):
(functionRun):
(functionRunString):
(functionLoad):
(functionLoadString):
(functionReadFile):
(functionCheckSyntax):
(functionSetRandomSeed):
(functionLoadModule):
(functionCreateBuiltin):
(functionCheckModuleSyntax):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::getByVal):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • profiler/ProfilerBytecodeSequence.cpp:

(JSC::Profiler::BytecodeSequence::addSequenceProperties):

  • profiler/ProfilerCompilation.cpp:

(JSC::Profiler::Compilation::toJS):

  • profiler/ProfilerDatabase.cpp:

(JSC::Profiler::Database::toJS):

  • profiler/ProfilerOSRExitSite.cpp:

(JSC::Profiler::OSRExitSite::toJS):

  • profiler/ProfilerOriginStack.cpp:

(JSC::Profiler::OriginStack::toJS):

  • runtime/ArrayPrototype.cpp:

(JSC::speciesConstructArray):
(JSC::shift):
(JSC::unshift):
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::slowJoin):
(JSC::fastJoin):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
(JSC::moveElements):
(JSC::arrayProtoPrivateFuncConcatMemcpy):

  • runtime/BooleanConstructor.cpp:

(JSC::constructWithBooleanConstructor):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::opIn):

  • runtime/Completion.cpp:

(JSC::loadAndEvaluateModule):
(JSC::loadModule):

  • runtime/ConsoleObject.cpp:

(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):

  • runtime/DateConstructor.cpp:

(JSC::constructDate):
(JSC::dateParse):

  • runtime/DatePrototype.cpp:

(JSC::dateProtoFuncToPrimitiveSymbol):
(JSC::dateProtoFuncToJSON):

  • runtime/ErrorConstructor.cpp:

(JSC::Interpreter::constructWithErrorConstructor):

  • runtime/ErrorInstance.cpp:

(JSC::ErrorInstance::sanitizedToString):

  • runtime/ErrorPrototype.cpp:

(JSC::errorProtoFuncToString):

  • runtime/ExceptionScope.h:
  • runtime/FunctionConstructor.cpp:

(JSC::constructFunctionSkippingEvalEnabledCheck):

  • runtime/GenericArgumentsInlines.h:

(JSC::GenericArguments<Type>::copyToArguments):

  • runtime/GetterSetter.cpp:

(JSC::callGetter):

  • runtime/HashMapImpl.h:

(JSC::jsMapHash):
(JSC::HashMapImpl::finishCreation):
(JSC::HashMapImpl::findBucket):
(JSC::HashMapImpl::add):
(JSC::HashMapImpl::rehash):

  • runtime/InspectorInstrumentationObject.cpp:

(JSC::inspectorInstrumentationObjectLog):

  • runtime/InternalFunction.cpp:

(JSC::InternalFunction::createSubclassStructure):

  • runtime/IntlCollator.cpp:

(JSC::IntlCollator::initializeCollator):

  • runtime/IntlCollatorConstructor.cpp:

(JSC::constructIntlCollator):
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf):

  • runtime/IntlCollatorPrototype.cpp:

(JSC::IntlCollatorFuncCompare):
(JSC::IntlCollatorPrototypeGetterCompare):

  • runtime/IntlDateTimeFormat.cpp:

(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):

  • runtime/IntlDateTimeFormatConstructor.cpp:

(JSC::constructIntlDateTimeFormat):
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):

  • runtime/IntlDateTimeFormatPrototype.cpp:

(JSC::IntlDateTimeFormatFuncFormatDateTime):
(JSC::IntlDateTimeFormatPrototypeGetterFormat):

  • runtime/IntlNumberFormat.cpp:

(JSC::IntlNumberFormat::initializeNumberFormat):

  • runtime/IntlNumberFormatConstructor.cpp:

(JSC::constructIntlNumberFormat):
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):

  • runtime/IntlNumberFormatPrototype.cpp:

(JSC::IntlNumberFormatFuncFormatNumber):
(JSC::IntlNumberFormatPrototypeGetterFormat):

  • runtime/IntlObject.cpp:

(JSC::intlBooleanOption):
(JSC::intlStringOption):
(JSC::intlNumberOption):
(JSC::canonicalizeLocaleList):
(JSC::supportedLocales):

  • runtime/IntlObjectInlines.h:

(JSC::constructIntlInstanceWithWorkaroundForLegacyIntlConstructor):

  • runtime/IteratorOperations.cpp:

(JSC::iteratorNext):
(JSC::iteratorStep):
(JSC::iteratorClose):
(JSC::iteratorForIterable):

  • runtime/IteratorOperations.h:

(JSC::forEachInIterable):

  • runtime/JSArray.cpp:

(JSC::JSArray::pop):
(JSC::JSArray::copyToArguments):

  • runtime/JSArrayBufferConstructor.cpp:

(JSC::constructArrayBuffer):

  • runtime/JSArrayBufferPrototype.cpp:

(JSC::arrayBufferProtoFuncSlice):

  • runtime/JSArrayInlines.h:

(JSC::getLength):
(JSC::toLength):

  • runtime/JSBoundFunction.cpp:

(JSC::getBoundFunctionStructure):
(JSC::JSBoundFunction::create):

  • runtime/JSCJSValue.cpp:

(JSC::JSValue::putToPrimitive):
(JSC::JSValue::toStringSlowCase):

  • runtime/JSCJSValueInlines.h:

(JSC::toPreferredPrimitiveType):
(JSC::JSValue::getPropertySlot):
(JSC::JSValue::equalSlowCaseInline):

  • runtime/JSDataViewPrototype.cpp:

(JSC::getData):
(JSC::setData):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::setFunctionName):

  • runtime/JSGenericTypedArrayView.h:

(JSC::JSGenericTypedArrayView::setIndex):

  • runtime/JSGenericTypedArrayViewConstructorInlines.h:

(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):

  • runtime/JSGenericTypedArrayViewPrototypeFunctions.h:

(JSC::speciesConstruct):
(JSC::genericTypedArrayViewProtoFuncSet):
(JSC::genericTypedArrayViewProtoFuncCopyWithin):
(JSC::genericTypedArrayViewProtoFuncIncludes):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncJoin):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):

  • runtime/JSGlobalObject.h:

(JSC::constructEmptyArray):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncEval):

  • runtime/JSModuleRecord.cpp:

(JSC::JSModuleRecord::instantiateDeclarations):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::stringify):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):
(JSC::JSONProtoFuncParse):

  • runtime/JSObject.cpp:

(JSC::ordinarySetSlow):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::callToPrimitiveFunction):
(JSC::JSObject::defaultHasInstance):
(JSC::JSObject::getPropertyNames):
(JSC::JSObject::toNumber):
(JSC::JSObject::toString):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::JSObject::getGenericPropertyNames):
(JSC::JSObject::getMethod):

  • runtime/JSObjectInlines.h:

(JSC::createListFromArrayLike):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getNonIndexPropertySlot):

  • runtime/JSPromiseConstructor.cpp:

(JSC::constructPromise):

  • runtime/JSPromiseDeferred.cpp:

(JSC::JSPromiseDeferred::create):

  • runtime/JSPropertyNameEnumerator.h:

(JSC::propertyNameEnumerator):

  • runtime/JSPropertyNameIterator.cpp:

(JSC::JSPropertyNameIterator::create):

  • runtime/JSScope.cpp:

(JSC::isUnscopable):

  • runtime/JSString.cpp:

(JSC::JSString::equalSlowCase):

  • runtime/JSStringJoiner.cpp:

(JSC::JSStringJoiner::join):

  • runtime/LiteralParser.cpp:

(JSC::LiteralParser<CharType>::parse):

  • runtime/MapBase.h:

(JSC::MapBase::finishCreation):

  • runtime/MapConstructor.cpp:

(JSC::constructMap):

  • runtime/MathObject.cpp:

(JSC::mathProtoFuncClz32):
(JSC::mathProtoFuncHypot):
(JSC::mathProtoFuncIMul):

  • runtime/ModuleLoaderPrototype.cpp:

(JSC::moduleLoaderPrototypeParseModule):
(JSC::moduleLoaderPrototypeRequestedModules):
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):

  • runtime/NativeErrorConstructor.cpp:

(JSC::Interpreter::constructWithNativeErrorConstructor):

  • runtime/NumberConstructor.cpp:

(JSC::constructWithNumberConstructor):

  • runtime/ObjectConstructor.cpp:

(JSC::constructObject):
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorSetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptors):
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorGetOwnPropertySymbols):
(JSC::objectConstructorKeys):
(JSC::ownEnumerablePropertyKeys):
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::defineProperties):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
(JSC::objectConstructorIsExtensible):
(JSC::ownPropertyKeys):

  • runtime/ObjectConstructor.h:

(JSC::constructObjectFromPropertyDescriptor):

  • runtime/ObjectPrototype.cpp:

(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncIsPrototypeOf):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
(JSC::objectProtoFuncToLocaleString):
(JSC::objectProtoFuncToString):

  • runtime/Operations.cpp:

(JSC::jsAddSlowCase):

  • runtime/PropertyDescriptor.cpp:

(JSC::PropertyDescriptor::slowGetterSetter):

  • runtime/ProxyConstructor.cpp:

(JSC::makeRevocableProxy):

  • runtime/ProxyObject.cpp:

(JSC::performProxyGet):
(JSC::ProxyObject::performGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::performPut):
(JSC::ProxyObject::putByIndexCommon):
(JSC::performProxyCall):
(JSC::performProxyConstruct):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::performIsExtensible):
(JSC::ProxyObject::performDefineOwnProperty):
(JSC::ProxyObject::performGetOwnPropertyNames):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):

  • runtime/ReflectObject.cpp:

(JSC::reflectObjectConstruct):
(JSC::reflectObjectDefineProperty):
(JSC::reflectObjectGet):
(JSC::reflectObjectGetOwnPropertyDescriptor):
(JSC::reflectObjectIsExtensible):
(JSC::reflectObjectPreventExtensions):
(JSC::reflectObjectSet):
(JSC::reflectObjectSetPrototypeOf):

  • runtime/RegExpConstructor.cpp:

(JSC::toFlags):
(JSC::regExpCreate):
(JSC::constructRegExp):

  • runtime/RegExpConstructor.h:

(JSC::isRegExp):

  • runtime/RegExpObject.cpp:

(JSC::collectMatches):
(JSC::RegExpObject::matchGlobal):

  • runtime/RegExpPrototype.cpp:

(JSC::regExpProtoFuncCompile):
(JSC::flagsString):
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoGetterFlags):
(JSC::regExpProtoFuncSearchFast):
(JSC::regExpProtoFuncSplitFast):

  • runtime/SetConstructor.cpp:

(JSC::constructSet):

  • runtime/StringConstructor.cpp:

(JSC::stringFromCodePoint):
(JSC::constructWithStringConstructor):

  • runtime/StringObject.cpp:

(JSC::StringObject::defineOwnProperty):

  • runtime/StringPrototype.cpp:

(JSC::replaceUsingRegExpSearch):
(JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
(JSC::replaceUsingStringSearch):
(JSC::replace):
(JSC::stringProtoFuncReplaceUsingRegExp):
(JSC::stringProtoFuncReplaceUsingStringSearch):
(JSC::stringProtoFuncCodePointAt):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncSubstring):
(JSC::stringProtoFuncLocaleCompare):
(JSC::toLocaleCase):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::trimString):
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):
(JSC::stringIncludesImpl):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::stringProtoFuncNormalize):

  • runtime/SymbolConstructor.cpp:

(JSC::symbolConstructorFor):

  • runtime/TemplateRegistry.cpp:

(JSC::TemplateRegistry::getTemplateObject):

  • runtime/WeakMapConstructor.cpp:

(JSC::constructWeakMap):

  • runtime/WeakSetConstructor.cpp:

(JSC::constructWeakSet):

  • tools/JSDollarVMPrototype.cpp:

(JSC::functionPrint):

Source/WebCore:

No new tests because this patch is mostly refactoring. The only change in
behavior is that functions that have a JSValue return type will now return the
empty JSValue when an exception is thrown. I tested this behavior by running
the existing JSC and layout tests.

  • bindings/js/ArrayValue.cpp:

(WebCore::ArrayValue::get):

  • bindings/js/IDBBindingUtilities.cpp:

(WebCore::toJS):

  • bindings/js/JSApplePaySessionCustom.cpp:

(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):

  • bindings/js/JSAudioTrackCustom.cpp:

(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):

  • bindings/js/JSBlobCustom.cpp:

(WebCore::constructJSBlob):

  • bindings/js/JSCSSStyleDeclarationCustom.cpp:

(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):

  • bindings/js/JSCommandLineAPIHostCustom.cpp:

(WebCore::getJSListenerFunctions):

  • bindings/js/JSCryptoAlgorithmDictionary.cpp:

(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createAesCbcParams):
(WebCore::createAesKeyGenParams):
(WebCore::createHmacKeyParams):
(WebCore::createRsaKeyGenParams):
(WebCore::createRsaOaepParams):

  • bindings/js/JSCryptoKeySerializationJWK.cpp:

(WebCore::getStringFromJSON):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):

  • bindings/js/JSCustomElementInterface.cpp:

(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):

  • bindings/js/JSCustomElementRegistryCustom.cpp:

(WebCore::getCustomElementCallback):
(WebCore::JSCustomElementRegistry::define):
(WebCore::whenDefinedPromise):

  • bindings/js/JSDOMBinding.cpp:

(WebCore::valueToUSVString):
(WebCore::hasIteratorMethod):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt32EnforceRange):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):

  • bindings/js/JSDOMBinding.h:

(WebCore::toJSSequence):
(WebCore::toJS):
(WebCore::jsFrozenArray):

  • bindings/js/JSDOMPromise.cpp:

(WebCore::rejectPromiseWithExceptionIfAny):

  • bindings/js/JSDOMStringMapCustom.cpp:

(WebCore::JSDOMStringMap::putDelegate):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::setLocation):
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):

  • bindings/js/JSDataCueCustom.cpp:

(WebCore::constructJSDataCue):

  • bindings/js/JSDeviceMotionEventCustom.cpp:

(WebCore::readAccelerationArgument):
(WebCore::readRotationRateArgument):
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):

  • bindings/js/JSDictionary.cpp:

(WebCore::JSDictionary::tryGetProperty):
(WebCore::JSDictionary::convertValue):

  • bindings/js/JSDictionary.h:

(WebCore::JSDictionary::tryGetPropertyAndResult):

  • bindings/js/JSDocumentCustom.cpp:

(WebCore::JSDocument::getCSSCanvasContext):

  • bindings/js/JSFileCustom.cpp:

(WebCore::constructJSFile):

  • bindings/js/JSGeolocationCustom.cpp:

(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):

  • bindings/js/JSHTMLAllCollectionCustom.cpp:

(WebCore::callHTMLAllCollection):

  • bindings/js/JSHTMLCanvasElementCustom.cpp:

(WebCore::JSHTMLCanvasElement::getContext):

  • bindings/js/JSHTMLElementCustom.cpp:

(WebCore::constructJSHTMLElement):

  • bindings/js/JSHistoryCustom.cpp:

(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):

  • bindings/js/JSIDBDatabaseCustom.cpp:

(WebCore::JSIDBDatabase::createObjectStore):

  • bindings/js/JSMessageEventCustom.cpp:

(WebCore::handleInitMessageEvent):

  • bindings/js/JSMessagePortCustom.cpp:

(WebCore::fillMessagePortArray):

  • bindings/js/JSMessagePortCustom.h:

(WebCore::handlePostMessage):

  • bindings/js/JSMockContentFilterSettingsCustom.cpp:

(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):

  • bindings/js/JSNodeFilterCustom.cpp:

(WebCore::JSNodeFilter::acceptNode):

  • bindings/js/JSNodeOrString.cpp:

(WebCore::toNodeOrStringVector):

  • bindings/js/JSSQLTransactionCustom.cpp:

(WebCore::JSSQLTransaction::executeSql):

  • bindings/js/JSSVGLengthCustom.cpp:

(WebCore::JSSVGLength::convertToSpecifiedUnits):

  • bindings/js/JSStorageCustom.cpp:

(WebCore::JSStorage::getOwnPropertyNames):

  • bindings/js/JSTextTrackCustom.cpp:

(WebCore::JSTextTrack::setLanguage):

  • bindings/js/JSVideoTrackCustom.cpp:

(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):

  • bindings/js/JSWebGL2RenderingContextCustom.cpp:

(WebCore::JSWebGL2RenderingContext::getIndexedParameter):

  • bindings/js/JSWebGLRenderingContextBaseCustom.cpp:

(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getExtension):
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContextBase::getParameter):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::toVector):
(WebCore::dataFunctionf):
(WebCore::dataFunctionMatrix):

  • bindings/js/JSWebKitSubtleCryptoCustom.cpp:

(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::importKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::exportKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):

  • bindings/js/JSWorkerCustom.cpp:

(WebCore::constructJSWorker):

  • bindings/js/JSWorkerGlobalScopeCustom.cpp:

(WebCore::JSWorkerGlobalScope::importScripts):
(WebCore::JSWorkerGlobalScope::setTimeout):
(WebCore::JSWorkerGlobalScope::setInterval):

  • bindings/js/ReadableStreamDefaultController.cpp:

(WebCore::ReadableStreamDefaultController::invoke):

  • bindings/js/ScheduledAction.cpp:

(WebCore::ScheduledAction::create):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateDictionaryImplementationContent):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):

  • html/HTMLMediaElement.cpp:

(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r206379 r206386  
     12016-09-26  Mark Lam  <[email protected]>
     2
     3        Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
     4        https://bugs.webkit.org/show_bug.cgi?id=162521
     5
     6        Reviewed by Saam Barati.
     7
     8        Also, where possible, if the return type is JSValue, changed the returned value
     9        (on exception) to the empty JSValue (instead of sometimes jsUndefined, jsNull,
     10        or the thrown exception value).
     11
     12        There are a few places where I had to continue to return the previously returned
     13        value (instead of the empty JSValue) in order for tests to pass.  This is needed
     14        because there are missing exception checks that will need to be added before I
     15        can change those to return the empty JSValue too.  Identifying all the places
     16        where those checks need to be added is beyond the scope of this patch.  I will
     17        work on adding missing exception checks in a subsequent patch.
     18
     19        In this patch, there is one missing exception check in replaceUsingRegExpSearch()
     20        that was easily identified, and is necessary so that Interpreter::execute()
     21        functions can return JSValue.  I've added this missing check.
     22
     23        This patch has passed the JSC and layout tests.
     24
     25        * dfg/DFGOperations.cpp:
     26        (JSC::DFG::operationPutByValInternal):
     27        * inspector/JSInjectedScriptHost.cpp:
     28        (Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
     29        (Inspector::JSInjectedScriptHost::getInternalProperties):
     30        (Inspector::JSInjectedScriptHost::weakMapEntries):
     31        (Inspector::JSInjectedScriptHost::weakSetEntries):
     32        (Inspector::JSInjectedScriptHost::iteratorEntries):
     33        * inspector/JSJavaScriptCallFrame.cpp:
     34        (Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
     35        * interpreter/Interpreter.cpp:
     36        (JSC::eval):
     37        (JSC::sizeOfVarargs):
     38        (JSC::Interpreter::execute):
     39        (JSC::Interpreter::executeCall):
     40        (JSC::Interpreter::executeConstruct):
     41        * interpreter/ShadowChicken.cpp:
     42        (JSC::ShadowChicken::functionsOnStack):
     43        * jit/JITOperations.cpp:
     44        (JSC::getByVal):
     45        * jsc.cpp:
     46        (WTF::ImpureGetter::getOwnPropertySlot):
     47        (functionRun):
     48        (functionRunString):
     49        (functionLoad):
     50        (functionLoadString):
     51        (functionReadFile):
     52        (functionCheckSyntax):
     53        (functionSetRandomSeed):
     54        (functionLoadModule):
     55        (functionCreateBuiltin):
     56        (functionCheckModuleSyntax):
     57        * llint/LLIntSlowPaths.cpp:
     58        (JSC::LLInt::getByVal):
     59        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     60        * profiler/ProfilerBytecodeSequence.cpp:
     61        (JSC::Profiler::BytecodeSequence::addSequenceProperties):
     62        * profiler/ProfilerCompilation.cpp:
     63        (JSC::Profiler::Compilation::toJS):
     64        * profiler/ProfilerDatabase.cpp:
     65        (JSC::Profiler::Database::toJS):
     66        * profiler/ProfilerOSRExitSite.cpp:
     67        (JSC::Profiler::OSRExitSite::toJS):
     68        * profiler/ProfilerOriginStack.cpp:
     69        (JSC::Profiler::OriginStack::toJS):
     70        * runtime/ArrayPrototype.cpp:
     71        (JSC::speciesConstructArray):
     72        (JSC::shift):
     73        (JSC::unshift):
     74        (JSC::arrayProtoFuncToString):
     75        (JSC::arrayProtoFuncToLocaleString):
     76        (JSC::slowJoin):
     77        (JSC::fastJoin):
     78        (JSC::arrayProtoFuncJoin):
     79        (JSC::arrayProtoFuncPop):
     80        (JSC::arrayProtoFuncPush):
     81        (JSC::arrayProtoFuncReverse):
     82        (JSC::arrayProtoFuncShift):
     83        (JSC::arrayProtoFuncSlice):
     84        (JSC::arrayProtoFuncSplice):
     85        (JSC::arrayProtoFuncUnShift):
     86        (JSC::arrayProtoFuncIndexOf):
     87        (JSC::arrayProtoFuncLastIndexOf):
     88        (JSC::moveElements):
     89        (JSC::arrayProtoPrivateFuncConcatMemcpy):
     90        * runtime/BooleanConstructor.cpp:
     91        (JSC::constructWithBooleanConstructor):
     92        * runtime/CommonSlowPaths.h:
     93        (JSC::CommonSlowPaths::opIn):
     94        * runtime/Completion.cpp:
     95        (JSC::loadAndEvaluateModule):
     96        (JSC::loadModule):
     97        * runtime/ConsoleObject.cpp:
     98        (JSC::consoleProtoFuncAssert):
     99        (JSC::consoleProtoFuncProfile):
     100        (JSC::consoleProtoFuncProfileEnd):
     101        (JSC::consoleProtoFuncTakeHeapSnapshot):
     102        (JSC::consoleProtoFuncTime):
     103        (JSC::consoleProtoFuncTimeEnd):
     104        * runtime/DateConstructor.cpp:
     105        (JSC::constructDate):
     106        (JSC::dateParse):
     107        * runtime/DatePrototype.cpp:
     108        (JSC::dateProtoFuncToPrimitiveSymbol):
     109        (JSC::dateProtoFuncToJSON):
     110        * runtime/ErrorConstructor.cpp:
     111        (JSC::Interpreter::constructWithErrorConstructor):
     112        * runtime/ErrorInstance.cpp:
     113        (JSC::ErrorInstance::sanitizedToString):
     114        * runtime/ErrorPrototype.cpp:
     115        (JSC::errorProtoFuncToString):
     116        * runtime/ExceptionScope.h:
     117        * runtime/FunctionConstructor.cpp:
     118        (JSC::constructFunctionSkippingEvalEnabledCheck):
     119        * runtime/GenericArgumentsInlines.h:
     120        (JSC::GenericArguments<Type>::copyToArguments):
     121        * runtime/GetterSetter.cpp:
     122        (JSC::callGetter):
     123        * runtime/HashMapImpl.h:
     124        (JSC::jsMapHash):
     125        (JSC::HashMapImpl::finishCreation):
     126        (JSC::HashMapImpl::findBucket):
     127        (JSC::HashMapImpl::add):
     128        (JSC::HashMapImpl::rehash):
     129        * runtime/InspectorInstrumentationObject.cpp:
     130        (JSC::inspectorInstrumentationObjectLog):
     131        * runtime/InternalFunction.cpp:
     132        (JSC::InternalFunction::createSubclassStructure):
     133        * runtime/IntlCollator.cpp:
     134        (JSC::IntlCollator::initializeCollator):
     135        * runtime/IntlCollatorConstructor.cpp:
     136        (JSC::constructIntlCollator):
     137        (JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
     138        * runtime/IntlCollatorPrototype.cpp:
     139        (JSC::IntlCollatorFuncCompare):
     140        (JSC::IntlCollatorPrototypeGetterCompare):
     141        * runtime/IntlDateTimeFormat.cpp:
     142        (JSC::toDateTimeOptionsAnyDate):
     143        (JSC::IntlDateTimeFormat::initializeDateTimeFormat):
     144        * runtime/IntlDateTimeFormatConstructor.cpp:
     145        (JSC::constructIntlDateTimeFormat):
     146        (JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
     147        * runtime/IntlDateTimeFormatPrototype.cpp:
     148        (JSC::IntlDateTimeFormatFuncFormatDateTime):
     149        (JSC::IntlDateTimeFormatPrototypeGetterFormat):
     150        * runtime/IntlNumberFormat.cpp:
     151        (JSC::IntlNumberFormat::initializeNumberFormat):
     152        * runtime/IntlNumberFormatConstructor.cpp:
     153        (JSC::constructIntlNumberFormat):
     154        (JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
     155        * runtime/IntlNumberFormatPrototype.cpp:
     156        (JSC::IntlNumberFormatFuncFormatNumber):
     157        (JSC::IntlNumberFormatPrototypeGetterFormat):
     158        * runtime/IntlObject.cpp:
     159        (JSC::intlBooleanOption):
     160        (JSC::intlStringOption):
     161        (JSC::intlNumberOption):
     162        (JSC::canonicalizeLocaleList):
     163        (JSC::supportedLocales):
     164        * runtime/IntlObjectInlines.h:
     165        (JSC::constructIntlInstanceWithWorkaroundForLegacyIntlConstructor):
     166        * runtime/IteratorOperations.cpp:
     167        (JSC::iteratorNext):
     168        (JSC::iteratorStep):
     169        (JSC::iteratorClose):
     170        (JSC::iteratorForIterable):
     171        * runtime/IteratorOperations.h:
     172        (JSC::forEachInIterable):
     173        * runtime/JSArray.cpp:
     174        (JSC::JSArray::pop):
     175        (JSC::JSArray::copyToArguments):
     176        * runtime/JSArrayBufferConstructor.cpp:
     177        (JSC::constructArrayBuffer):
     178        * runtime/JSArrayBufferPrototype.cpp:
     179        (JSC::arrayBufferProtoFuncSlice):
     180        * runtime/JSArrayInlines.h:
     181        (JSC::getLength):
     182        (JSC::toLength):
     183        * runtime/JSBoundFunction.cpp:
     184        (JSC::getBoundFunctionStructure):
     185        (JSC::JSBoundFunction::create):
     186        * runtime/JSCJSValue.cpp:
     187        (JSC::JSValue::putToPrimitive):
     188        (JSC::JSValue::toStringSlowCase):
     189        * runtime/JSCJSValueInlines.h:
     190        (JSC::toPreferredPrimitiveType):
     191        (JSC::JSValue::getPropertySlot):
     192        (JSC::JSValue::equalSlowCaseInline):
     193        * runtime/JSDataViewPrototype.cpp:
     194        (JSC::getData):
     195        (JSC::setData):
     196        * runtime/JSFunction.cpp:
     197        (JSC::JSFunction::setFunctionName):
     198        * runtime/JSGenericTypedArrayView.h:
     199        (JSC::JSGenericTypedArrayView::setIndex):
     200        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
     201        (JSC::constructGenericTypedArrayViewFromIterator):
     202        (JSC::constructGenericTypedArrayViewWithArguments):
     203        (JSC::constructGenericTypedArrayView):
     204        * runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
     205        (JSC::speciesConstruct):
     206        (JSC::genericTypedArrayViewProtoFuncSet):
     207        (JSC::genericTypedArrayViewProtoFuncCopyWithin):
     208        (JSC::genericTypedArrayViewProtoFuncIncludes):
     209        (JSC::genericTypedArrayViewProtoFuncIndexOf):
     210        (JSC::genericTypedArrayViewProtoFuncJoin):
     211        (JSC::genericTypedArrayViewProtoFuncLastIndexOf):
     212        (JSC::genericTypedArrayViewProtoFuncSlice):
     213        (JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
     214        * runtime/JSGlobalObject.h:
     215        (JSC::constructEmptyArray):
     216        (JSC::constructArray):
     217        (JSC::constructArrayNegativeIndexed):
     218        * runtime/JSGlobalObjectFunctions.cpp:
     219        (JSC::globalFuncEval):
     220        * runtime/JSModuleRecord.cpp:
     221        (JSC::JSModuleRecord::instantiateDeclarations):
     222        * runtime/JSONObject.cpp:
     223        (JSC::Stringifier::stringify):
     224        (JSC::Stringifier::toJSON):
     225        (JSC::Stringifier::appendStringifiedValue):
     226        (JSC::Stringifier::Holder::appendNextProperty):
     227        (JSC::Walker::walk):
     228        (JSC::JSONProtoFuncParse):
     229        * runtime/JSObject.cpp:
     230        (JSC::ordinarySetSlow):
     231        (JSC::JSObject::setPrototypeWithCycleCheck):
     232        (JSC::callToPrimitiveFunction):
     233        (JSC::JSObject::defaultHasInstance):
     234        (JSC::JSObject::getPropertyNames):
     235        (JSC::JSObject::toNumber):
     236        (JSC::JSObject::toString):
     237        (JSC::JSObject::defineOwnNonIndexProperty):
     238        (JSC::JSObject::getGenericPropertyNames):
     239        (JSC::JSObject::getMethod):
     240        * runtime/JSObjectInlines.h:
     241        (JSC::createListFromArrayLike):
     242        (JSC::JSObject::getPropertySlot):
     243        (JSC::JSObject::getNonIndexPropertySlot):
     244        * runtime/JSPromiseConstructor.cpp:
     245        (JSC::constructPromise):
     246        * runtime/JSPromiseDeferred.cpp:
     247        (JSC::JSPromiseDeferred::create):
     248        * runtime/JSPropertyNameEnumerator.h:
     249        (JSC::propertyNameEnumerator):
     250        * runtime/JSPropertyNameIterator.cpp:
     251        (JSC::JSPropertyNameIterator::create):
     252        * runtime/JSScope.cpp:
     253        (JSC::isUnscopable):
     254        * runtime/JSString.cpp:
     255        (JSC::JSString::equalSlowCase):
     256        * runtime/JSStringJoiner.cpp:
     257        (JSC::JSStringJoiner::join):
     258        * runtime/LiteralParser.cpp:
     259        (JSC::LiteralParser<CharType>::parse):
     260        * runtime/MapBase.h:
     261        (JSC::MapBase::finishCreation):
     262        * runtime/MapConstructor.cpp:
     263        (JSC::constructMap):
     264        * runtime/MathObject.cpp:
     265        (JSC::mathProtoFuncClz32):
     266        (JSC::mathProtoFuncHypot):
     267        (JSC::mathProtoFuncIMul):
     268        * runtime/ModuleLoaderPrototype.cpp:
     269        (JSC::moduleLoaderPrototypeParseModule):
     270        (JSC::moduleLoaderPrototypeRequestedModules):
     271        (JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
     272        * runtime/NativeErrorConstructor.cpp:
     273        (JSC::Interpreter::constructWithNativeErrorConstructor):
     274        * runtime/NumberConstructor.cpp:
     275        (JSC::constructWithNumberConstructor):
     276        * runtime/ObjectConstructor.cpp:
     277        (JSC::constructObject):
     278        (JSC::objectConstructorGetPrototypeOf):
     279        (JSC::objectConstructorSetPrototypeOf):
     280        (JSC::objectConstructorGetOwnPropertyDescriptor):
     281        (JSC::objectConstructorGetOwnPropertyDescriptors):
     282        (JSC::objectConstructorGetOwnPropertyNames):
     283        (JSC::objectConstructorGetOwnPropertySymbols):
     284        (JSC::objectConstructorKeys):
     285        (JSC::ownEnumerablePropertyKeys):
     286        (JSC::toPropertyDescriptor):
     287        (JSC::objectConstructorDefineProperty):
     288        (JSC::defineProperties):
     289        (JSC::objectConstructorSeal):
     290        (JSC::objectConstructorFreeze):
     291        (JSC::objectConstructorIsSealed):
     292        (JSC::objectConstructorIsFrozen):
     293        (JSC::objectConstructorIsExtensible):
     294        (JSC::ownPropertyKeys):
     295        * runtime/ObjectConstructor.h:
     296        (JSC::constructObjectFromPropertyDescriptor):
     297        * runtime/ObjectPrototype.cpp:
     298        (JSC::objectProtoFuncHasOwnProperty):
     299        (JSC::objectProtoFuncIsPrototypeOf):
     300        (JSC::objectProtoFuncDefineGetter):
     301        (JSC::objectProtoFuncDefineSetter):
     302        (JSC::objectProtoFuncLookupGetter):
     303        (JSC::objectProtoFuncLookupSetter):
     304        (JSC::objectProtoFuncPropertyIsEnumerable):
     305        (JSC::objectProtoFuncToLocaleString):
     306        (JSC::objectProtoFuncToString):
     307        * runtime/Operations.cpp:
     308        (JSC::jsAddSlowCase):
     309        * runtime/PropertyDescriptor.cpp:
     310        (JSC::PropertyDescriptor::slowGetterSetter):
     311        * runtime/ProxyConstructor.cpp:
     312        (JSC::makeRevocableProxy):
     313        * runtime/ProxyObject.cpp:
     314        (JSC::performProxyGet):
     315        (JSC::ProxyObject::performGet):
     316        (JSC::ProxyObject::performInternalMethodGetOwnProperty):
     317        (JSC::ProxyObject::performHasProperty):
     318        (JSC::ProxyObject::performPut):
     319        (JSC::ProxyObject::putByIndexCommon):
     320        (JSC::performProxyCall):
     321        (JSC::performProxyConstruct):
     322        (JSC::ProxyObject::performDelete):
     323        (JSC::ProxyObject::performPreventExtensions):
     324        (JSC::ProxyObject::performIsExtensible):
     325        (JSC::ProxyObject::performDefineOwnProperty):
     326        (JSC::ProxyObject::performGetOwnPropertyNames):
     327        (JSC::ProxyObject::performSetPrototype):
     328        (JSC::ProxyObject::performGetPrototype):
     329        * runtime/ReflectObject.cpp:
     330        (JSC::reflectObjectConstruct):
     331        (JSC::reflectObjectDefineProperty):
     332        (JSC::reflectObjectGet):
     333        (JSC::reflectObjectGetOwnPropertyDescriptor):
     334        (JSC::reflectObjectIsExtensible):
     335        (JSC::reflectObjectPreventExtensions):
     336        (JSC::reflectObjectSet):
     337        (JSC::reflectObjectSetPrototypeOf):
     338        * runtime/RegExpConstructor.cpp:
     339        (JSC::toFlags):
     340        (JSC::regExpCreate):
     341        (JSC::constructRegExp):
     342        * runtime/RegExpConstructor.h:
     343        (JSC::isRegExp):
     344        * runtime/RegExpObject.cpp:
     345        (JSC::collectMatches):
     346        (JSC::RegExpObject::matchGlobal):
     347        * runtime/RegExpPrototype.cpp:
     348        (JSC::regExpProtoFuncCompile):
     349        (JSC::flagsString):
     350        (JSC::regExpProtoFuncToString):
     351        (JSC::regExpProtoGetterFlags):
     352        (JSC::regExpProtoFuncSearchFast):
     353        (JSC::regExpProtoFuncSplitFast):
     354        * runtime/SetConstructor.cpp:
     355        (JSC::constructSet):
     356        * runtime/StringConstructor.cpp:
     357        (JSC::stringFromCodePoint):
     358        (JSC::constructWithStringConstructor):
     359        * runtime/StringObject.cpp:
     360        (JSC::StringObject::defineOwnProperty):
     361        * runtime/StringPrototype.cpp:
     362        (JSC::replaceUsingRegExpSearch):
     363        (JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
     364        (JSC::replaceUsingStringSearch):
     365        (JSC::replace):
     366        (JSC::stringProtoFuncReplaceUsingRegExp):
     367        (JSC::stringProtoFuncReplaceUsingStringSearch):
     368        (JSC::stringProtoFuncCodePointAt):
     369        (JSC::stringProtoFuncSlice):
     370        (JSC::stringProtoFuncSplitFast):
     371        (JSC::stringProtoFuncSubstr):
     372        (JSC::stringProtoFuncSubstring):
     373        (JSC::stringProtoFuncLocaleCompare):
     374        (JSC::toLocaleCase):
     375        (JSC::stringProtoFuncBig):
     376        (JSC::stringProtoFuncSmall):
     377        (JSC::stringProtoFuncBlink):
     378        (JSC::stringProtoFuncBold):
     379        (JSC::stringProtoFuncFixed):
     380        (JSC::stringProtoFuncItalics):
     381        (JSC::stringProtoFuncStrike):
     382        (JSC::stringProtoFuncSub):
     383        (JSC::stringProtoFuncSup):
     384        (JSC::stringProtoFuncFontcolor):
     385        (JSC::stringProtoFuncFontsize):
     386        (JSC::stringProtoFuncAnchor):
     387        (JSC::stringProtoFuncLink):
     388        (JSC::trimString):
     389        (JSC::stringProtoFuncStartsWith):
     390        (JSC::stringProtoFuncEndsWith):
     391        (JSC::stringIncludesImpl):
     392        (JSC::stringProtoFuncIncludes):
     393        (JSC::builtinStringIncludesInternal):
     394        (JSC::stringProtoFuncNormalize):
     395        * runtime/SymbolConstructor.cpp:
     396        (JSC::symbolConstructorFor):
     397        * runtime/TemplateRegistry.cpp:
     398        (JSC::TemplateRegistry::getTemplateObject):
     399        * runtime/WeakMapConstructor.cpp:
     400        (JSC::constructWeakMap):
     401        * runtime/WeakSetConstructor.cpp:
     402        (JSC::constructWeakSet):
     403        * tools/JSDollarVMPrototype.cpp:
     404        (JSC::functionPrint):
     405
    14062016-09-26  Don Olmstead  <[email protected]>
    2407
Note: See TracChangeset for help on using the changeset viewer.