Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Omit template parameter for SetForScope<> variables
https://bugs.webkit.org/show_bug.cgi?id=237258

Reviewed by Darin Adler.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitNode):
* debugger/Debugger.cpp:
(JSC::Debugger::dispatchFunctionToObservers):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::setLocalOrTmp):
(JSC::DFG::ByteCodeParser::setArgument):
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements):
(JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseAsyncFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parseFunctionExpression):
(JSC::Parser<LexerType>::parseAsyncFunctionExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):

Source/WebCore:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeJavaScriptURL):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeCompoundSelector):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementQueue::invokeAll):
* dom/Document.cpp:
(WebCore::Document::updateRenderTree):
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
(WebCore::Document::destroyRenderTree):
(WebCore::Document::hitTest):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
* dom/Traversal.cpp:
(WebCore::NodeIteratorBase::acceptNode):
* editing/Editor.cpp:
(WebCore::Editor::cut):
(WebCore::Editor::copy):
(WebCore::Editor::copyFont):
(WebCore::Editor::paste):
(WebCore::Editor::pasteAsPlainText):
(WebCore::Editor::pasteAsQuotation):
(WebCore::Editor::pasteFont):
* history/BackForwardCache.cpp:
(WebCore::BackForwardCache::pruneToSizeNow):
(WebCore::BackForwardCache::removeAllItemsForPage):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::reset):
(WebCore::HTMLFormElement::constructEntryList):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::scheduleLoad):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::scan):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::resolveCustomStyle):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::scheduleLoad):
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::handleProvisionalLoadFailure):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
* page/Chrome.cpp:
(WebCore::Chrome::runModal const):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::suspendForBackForwardCache):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* page/EventSource.cpp:
(WebCore::EventSource::doExplicitLoadCancellation):
* page/FrameView.cpp:
(WebCore::FrameView::applyRecursivelyWithVisibleRect):
(WebCore::FrameView::updateEmbeddedObjects):
(WebCore::FrameView::autoSizeIfEnabled):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
(WebCore::FrameViewLayoutContext::runAsynchronousTasks):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeaders):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tryToBeginDragAtPoint):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
* platform/PreviewConverter.cpp:
(WebCore::PreviewConverter::iterateClients):
(WebCore::PreviewConverter::replayToClient):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
* platform/graphics/mac/WebLayer.mm:
(-[WebSimpleLayer renderInContext:]):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::TextureMapperLayer::paintWithIntermediateSurface):
(WebCore::TextureMapperLayer::paintRecursive):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileLayer renderInContext:]):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushMappingsToAncestor):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeVisibleRectInContainer const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::layout):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyCustomProperty):
(WebCore::Style::Builder::applyCascadeProperty):
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateWithMatchElementRuleSets):
* style/StyleScope.cpp:
(WebCore::Style::Scope::createDocumentResolver):
(WebCore::Style::Scope::createOrFindSharedShadowTreeResolver):
(WebCore::Style::Scope::updateResolver):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::addAnimatedPath):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::evaluateScriptIfNecessary):

Source/WebKit:

* NetworkProcess/storage/QuotaManager.cpp:
(WebKit::QuotaManager::handleRequests):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(createEncodedObject):
(decodeObject):
* UIProcess/API/glib/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::filterKeyEvent):
* UIProcess/API/glib/WebKitWebView.cpp:
(WebKitWebViewClient::frameDisplayed):
* UIProcess/API/gtk/InputMethodFilterGtk.cpp:
(WebKit::InputMethodFilter::filterKeyEvent):
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTextTouchBar):
* UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::open):
(WebKit::WebInspectorUIProxy::closeFrontendPageAndWindow):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
* UIProcess/_WKWebViewPrintFormatter.mm:
(-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]):
* UIProcess/gtk/ClipboardGtk3.cpp:
(WebKit::Clipboard::write):
* UIProcess/gtk/WebDateTimePickerGtk.cpp:
(WebKit::WebDateTimePickerGtk::update):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView unsuppressSoftwareKeyboardUsingLastAutocorrectionContextIfNeeded]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
(-[WKContentView _elementDidBlur]):
* UIProcess/ios/forms/WKDateTimeInputControl.mm:
(-[WKDateTimePicker handleDatePickerPresentationDismissal]):
(-[WKDateTimePicker removeDatePickerPresentation]):
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::destroyPlugin):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::purgeBackingStores):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRendering):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopLoadingDueToProcessSwap):
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::restoreSessionInternal):
(WebKit::WebPage::dispatchTouchEvent):
(WebKit::WebPage::setInitialFocus):
(WebKit::WebPage::setActivityState):
(WebKit::WebPage::insertTextAsync):
(WebKit::WebPage::createAppHighlightInSelectedRange):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::requestDragStart):
(WebKit::WebPage::requestAdditionalItemsForDragSession):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::focusTextInputContextAndPlaceCaret):
* WebProcess/WebPage/wc/DrawingAreaWC.cpp:
(WebKit::DrawingAreaWC::updateRendering):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prepareToSuspend):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView updateTextTouchBar]):
* WebView/WebViewData.mm:
(WebViewLayerFlushScheduler::layerFlushCallback):

Source/WTF:

* wtf/RefCounter.h:
(WTF::RefCounter<T>::Count::deref):

Tools:

* TestWebKitAPI/Tests/WTF/SetForScope.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKInspectorDelegate.mm:
(TEST):
* TestWebKitAPI/mac/TestFontOptions.mm:
(-[TestFontOptions setShadowWidth:]):
(-[TestFontOptions setShadowHeight:]):
(-[TestFontOptions setShadowBlurRadius:]):
(-[TestFontOptions setHasShadow:]):
(-[TestFontOptions setForegroundColor:]):
(-[TestFontOptions setBackgroundColor:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::reattachPageToWebProcess):


Canonical link: https://commits.webkit.org/247853@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Feb 28, 2022
1 parent b38bcd3 commit c115a0e
Show file tree
Hide file tree
Showing 100 changed files with 500 additions and 194 deletions.
32 changes: 32 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,35 @@
2022-02-27 Chris Dumez <cdumez@apple.com>

Omit template parameter for SetForScope<> variables
https://bugs.webkit.org/show_bug.cgi?id=237258

Reviewed by Darin Adler.

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitNode):
* debugger/Debugger.cpp:
(JSC::Debugger::dispatchFunctionToObservers):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::setLocalOrTmp):
(JSC::DFG::ByteCodeParser::setArgument):
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements):
(JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseAsyncFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parseFunctionExpression):
(JSC::Parser<LexerType>::parseAsyncFunctionExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):

2022-02-26 Basuke Suzuki <basuke.suzuki@sony.com>

Remove UNUSED warnings for non-Cocoa platform after r290449
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Expand Up @@ -468,7 +468,7 @@ namespace JSC {

void emitNode(RegisterID* dst, StatementNode* n)
{
SetForScope<bool> tailPositionPoisoner(m_inTailPosition, false);
SetForScope tailPositionPoisoner(m_inTailPosition, false);
return emitNodeInTailPosition(dst, n);
}

Expand Down Expand Up @@ -502,7 +502,7 @@ namespace JSC {

RegisterID* emitNode(RegisterID* dst, ExpressionNode* n)
{
SetForScope<bool> tailPositionPoisoner(m_inTailPosition, false);
SetForScope tailPositionPoisoner(m_inTailPosition, false);
return emitNodeInTailPosition(dst, n);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/debugger/Debugger.cpp
Expand Up @@ -272,7 +272,7 @@ void Debugger::dispatchFunctionToObservers(Function<void(Observer&)> func)
if (!canDispatchFunctionToObservers())
return;

SetForScope<bool> change(m_dispatchingFunctionToObservers, true);
SetForScope change(m_dispatchingFunctionToObservers, true);

for (auto* observer : copyToVector(m_observers))
func(*observer);
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Expand Up @@ -474,7 +474,7 @@ class ByteCodeParser {
Node* setLocalOrTmp(const CodeOrigin& semanticOrigin, Operand operand, Node* value, SetMode setMode = NormalSet)
{
ASSERT(operand.isTmp() || operand.isLocal());
SetForScope<CodeOrigin> originChange(m_currentSemanticOrigin, semanticOrigin);
SetForScope originChange(m_currentSemanticOrigin, semanticOrigin);

if (operand.isTmp() && static_cast<unsigned>(operand.value()) >= m_numTmps) {
if (inlineCallFrame())
Expand Down Expand Up @@ -532,7 +532,7 @@ class ByteCodeParser {
}
Node* setArgument(const CodeOrigin& semanticOrigin, Operand operand, Node* value, SetMode setMode = NormalSet)
{
SetForScope<CodeOrigin> originChange(m_currentSemanticOrigin, semanticOrigin);
SetForScope originChange(m_currentSemanticOrigin, semanticOrigin);

VirtualRegister reg = operand.virtualRegister();
unsigned argument = reg.toArgument();
Expand Down
Expand Up @@ -113,7 +113,7 @@ void BackendDispatcher::dispatch(const String& message)
{
// In case this is a re-entrant call from a nested run loop, we don't want to lose
// the outer request's id just because the inner request is bogus.
SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, std::nullopt);
SetForScope scopedRequestId(m_currentRequestId, std::nullopt);

auto parsedMessage = JSON::Value::parseJSON(message);
if (!parsedMessage) {
Expand Down Expand Up @@ -148,7 +148,7 @@ void BackendDispatcher::dispatch(const String& message)

{
// We could be called re-entrantly from a nested run loop, so restore the previous id.
SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, requestId);
SetForScope scopedRequestId(m_currentRequestId, requestId);

auto methodValue = messageObject->getValue("method"_s);
if (!methodValue) {
Expand Down
48 changes: 24 additions & 24 deletions Source/JavaScriptCore/parser/Parser.cpp
Expand Up @@ -199,7 +199,7 @@ class Scope::MaybeParseAsGeneratorForScope {
struct DepthManager : private SetForScope<int> {
public:
DepthManager(int* depth)
: SetForScope<int>(*depth, *depth)
: SetForScope(*depth, *depth)
{
}
};
Expand Down Expand Up @@ -234,7 +234,7 @@ Expected<typename Parser<LexerType>::ParseInnerResult, String> Parser<LexerType>
scope->lexicalVariables().addPrivateNamesFrom(parentScopePrivateNames);
}

SetForScope<FunctionParsePhase> functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Body);
SetForScope functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Body);

FunctionParameters* parameters = nullptr;
bool isArrowFunctionBodyExpression = parseMode == SourceParseMode::AsyncArrowFunctionBodyMode && !match(OPENBRACE);
Expand Down Expand Up @@ -583,7 +583,7 @@ template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseAsyncFun
info.startLine = tokenLine();

SourceParseMode parseMode = getAsynFunctionBodyParseMode(sourceParseMode());
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
{
AutoPopScopeRef asyncFunctionBodyScope(this, pushScope());
asyncFunctionBodyScope->setSourceParseMode(sourceParseMode());
Expand Down Expand Up @@ -634,7 +634,7 @@ template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseAsyncGen
info.startLine = tokenLine();

SourceParseMode parseMode = SourceParseMode::AsyncGeneratorBodyMode;
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
{
AutoPopScopeRef asyncFunctionBodyScope(this, pushScope());
asyncFunctionBodyScope->setSourceParseMode(sourceParseMode());
Expand Down Expand Up @@ -2155,7 +2155,7 @@ template <class TreeBuilder> TreeFunctionBody Parser<LexerType>::parseFunctionBo
TreeBuilder& context, SyntaxChecker& syntaxChecker, const JSTokenLocation& startLocation, int startColumn, int functionKeywordStart, int functionNameStart, int parametersStart,
ConstructorKind constructorKind, SuperBinding superBinding, FunctionBodyType bodyType, unsigned parameterCount)
{
SetForScope<bool> overrideParsingClassFieldInitializer(m_parserState.isParsingClassFieldInitializer, bodyType == StandardFunctionBodyBlock ? false : m_parserState.isParsingClassFieldInitializer);
SetForScope overrideParsingClassFieldInitializer(m_parserState.isParsingClassFieldInitializer, bodyType == StandardFunctionBodyBlock ? false : m_parserState.isParsingClassFieldInitializer);
bool isArrowFunctionBodyExpression = bodyType == ArrowFunctionBodyExpression;
if (!isArrowFunctionBodyExpression) {
next();
Expand Down Expand Up @@ -2263,7 +2263,7 @@ template <typename LexerType> template <class TreeBuilder, class FunctionInfoTyp
auto mode = sourceParseMode();
RELEASE_ASSERT(!(SourceParseModeSet(SourceParseMode::ProgramMode, SourceParseMode::ModuleAnalyzeMode, SourceParseMode::ModuleEvaluateMode).contains(mode)));
TreeFormalParameterList parameterList = context.createFormalParameterList();
SetForScope<FunctionParsePhase> functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Parameters);
SetForScope functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Parameters);

if (UNLIKELY((SourceParseModeSet(SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode).contains(mode)))) {
if (!matchSpecIdentifier() && !match(OPENPAREN)) {
Expand Down Expand Up @@ -2375,7 +2375,7 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
functionScope->setSourceParseMode(mode);
functionScope->setExpectedSuperBinding(expectedSuperBinding);
functionScope->setConstructorKind(constructorKind);
SetForScope<FunctionParsePhase> functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Body);
SetForScope functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Body);
int functionNameStart = m_token.m_location.startOffset;
const Identifier* lastFunctionName = m_parserState.lastFunctionName;
m_parserState.lastFunctionName = nullptr;
Expand Down Expand Up @@ -2478,7 +2478,7 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
// Parse formal parameters with [+Yield] parameterization, in order to ban YieldExpressions
// in ArrowFormalParameters, per ES6 #sec-arrow-function-definitions-static-semantics-early-errors.
Scope::MaybeParseAsGeneratorForScope parseAsGenerator(functionScope, parentScope->isGenerator());
SetForScope<bool> overrideAllowAwait(m_parserState.allowAwait, !parentScope->isAsyncFunction() && !isAsyncFunctionParseMode(mode));
SetForScope overrideAllowAwait(m_parserState.allowAwait, !parentScope->isAsyncFunction() && !isAsyncFunctionParseMode(mode));
parseFunctionParameters(syntaxChecker, functionInfo);
propagateError();
}
Expand Down Expand Up @@ -2552,7 +2552,7 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
if (loadCachedFunction())
return true;
{
SetForScope<bool> overrideAllowAwait(m_parserState.allowAwait, !isAsyncFunctionParseMode(mode));
SetForScope overrideAllowAwait(m_parserState.allowAwait, !isAsyncFunctionParseMode(mode));
parseFunctionParameters(syntaxChecker, functionInfo);
propagateError();
}
Expand Down Expand Up @@ -2719,7 +2719,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDecla
next();
parseMode = SourceParseMode::GeneratorWrapperFunctionMode;
}
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);

ParserFunctionInfo<TreeBuilder> functionInfo;
FunctionNameRequirements requirements = FunctionNameRequirements::Named;
Expand Down Expand Up @@ -2779,7 +2779,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseAsyncFunction
SourceParseMode parseMode = SourceParseMode::AsyncFunctionMode;
if (consume(TIMES))
parseMode = SourceParseMode::AsyncGeneratorWrapperFunctionMode;
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);

FunctionNameRequirements requirements = FunctionNameRequirements::Named;
if (declarationDefaultContext == DeclarationDefaultContext::ExportDefault) {
Expand Down Expand Up @@ -3110,7 +3110,7 @@ template <class TreeBuilder> TreeClassExpression Parser<LexerType>::parseClass(T

TreeExpression initializer = 0;
if (consume(EQUAL)) {
SetForScope<bool> overrideParsingClassFieldInitializer(m_parserState.isParsingClassFieldInitializer, true);
SetForScope overrideParsingClassFieldInitializer(m_parserState.isParsingClassFieldInitializer, true);
classScope->setExpectedSuperBinding(SuperBinding::Needed);
initializer = parseAssignmentExpression(context);
classScope->setExpectedSuperBinding(SuperBinding::NotNeeded);
Expand All @@ -3130,7 +3130,7 @@ template <class TreeBuilder> TreeClassExpression Parser<LexerType>::parseClass(T
"Cannot declare ", stringArticleForFunctionMode(parseMode), stringForFunctionMode(parseMode), " named 'constructor'");

methodInfo.name = isConstructor ? info.className : ident;
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, FunctionDefinitionType::Method)), "Cannot parse this method");

TreeExpression method = context.createMethodDefinition(methodLocation, methodInfo);
Expand Down Expand Up @@ -4437,7 +4437,7 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB
}

if (match(OPENPAREN)) {
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
auto method = parsePropertyMethod(context, ident);
propagateError();
return context.createProperty(ident, method, PropertyNode::Constant, SuperBinding::Needed, InferName::Allowed, ClassElementTag::No);
Expand Down Expand Up @@ -4477,7 +4477,7 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB
next();

if (match(OPENPAREN)) {
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
const Identifier& ident = m_parserArena.identifierArena().makeNumericIdentifier(const_cast<VM&>(m_vm), propertyName);
auto method = parsePropertyMethod(context, &ident);
propagateError();
Expand All @@ -4496,7 +4496,7 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB
next();

if (match(OPENPAREN)) {
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
auto method = parsePropertyMethod(context, ident);
propagateError();
return context.createProperty(ident, method, PropertyNode::Constant, SuperBinding::Needed, InferName::Allowed, ClassElementTag::No);
Expand All @@ -4516,7 +4516,7 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB
handleProductionOrFail(CLOSEBRACKET, "]", "end", "computed property name");

if (match(OPENPAREN)) {
SetForScope<SourceParseMode> innerParseMode(m_parseMode, parseMode);
SetForScope innerParseMode(m_parseMode, parseMode);
auto method = parsePropertyMethod(context, &m_vm.propertyNames->nullIdentifier);
propagateError();
return context.createProperty(propertyName, method, static_cast<PropertyNode::Type>(PropertyNode::Constant | PropertyNode::Computed), SuperBinding::Needed, ClassElementTag::No);
Expand Down Expand Up @@ -4597,19 +4597,19 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseGetterSetter(T
ParserFunctionInfo<TreeBuilder> info;
if (type & PropertyNode::Getter) {
failIfFalse(match(OPENPAREN), "Expected a parameter list for getter definition");
SetForScope<SourceParseMode> innerParseMode(m_parseMode, SourceParseMode::GetterMode);
SetForScope innerParseMode(m_parseMode, SourceParseMode::GetterMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, false, constructorKind, SuperBinding::Needed, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), "Cannot parse getter definition");
} else if (type & PropertyNode::Setter) {
failIfFalse(match(OPENPAREN), "Expected a parameter list for setter definition");
SetForScope<SourceParseMode> innerParseMode(m_parseMode, SourceParseMode::SetterMode);
SetForScope innerParseMode(m_parseMode, SourceParseMode::SetterMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, false, constructorKind, SuperBinding::Needed, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), "Cannot parse setter definition");
} else if (type & PropertyNode::PrivateSetter) {
failIfFalse(match(OPENPAREN), "Expected a parameter list for private setter definition");
SetForScope<SourceParseMode> innerParseMode(m_parseMode, SourceParseMode::SetterMode);
SetForScope innerParseMode(m_parseMode, SourceParseMode::SetterMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, false, constructorKind, SuperBinding::Needed, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), "Cannot parse private setter definition");
} else if (type & PropertyNode::PrivateGetter) {
failIfFalse(match(OPENPAREN), "Expected a parameter list for private getter definition");
SetForScope<SourceParseMode> innerParseMode(m_parseMode, SourceParseMode::GetterMode);
SetForScope innerParseMode(m_parseMode, SourceParseMode::GetterMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, false, constructorKind, SuperBinding::Needed, getterOrSetterStartOffset, info, FunctionDefinitionType::Method)), "Cannot parse private getter definition");
}

Expand Down Expand Up @@ -4790,7 +4790,7 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseFunctionExpr
SourceParseMode parseMode = SourceParseMode::NormalFunctionMode;
if (consume(TIMES))
parseMode = SourceParseMode::GeneratorWrapperFunctionMode;
SetForScope<SourceParseMode> setInnerParseMode(m_parseMode, parseMode);
SetForScope setInnerParseMode(m_parseMode, parseMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::None, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, functionInfo, FunctionDefinitionType::Expression)), "Cannot parse function expression");
return context.createFunctionExpr(location, functionInfo);
}
Expand All @@ -4806,7 +4806,7 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseAsyncFunctio

if (consume(TIMES))
parseMode = SourceParseMode::AsyncGeneratorWrapperFunctionMode;
SetForScope<SourceParseMode> setInnerParseMode(m_parseMode, parseMode);
SetForScope setInnerParseMode(m_parseMode, parseMode);

ParserFunctionInfo<TreeBuilder> functionInfo;
functionInfo.name = &m_vm.propertyNames->nullIdentifier;
Expand Down Expand Up @@ -5383,7 +5383,7 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseArrowFunctio
ParserFunctionInfo<TreeBuilder> info;
info.name = &m_vm.propertyNames->nullIdentifier;

SetForScope<SourceParseMode> innerParseMode(m_parseMode, isAsync ? SourceParseMode::AsyncArrowFunctionMode : SourceParseMode::ArrowFunctionMode);
SetForScope innerParseMode(m_parseMode, isAsync ? SourceParseMode::AsyncArrowFunctionMode : SourceParseMode::ArrowFunctionMode);
failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, FunctionDefinitionType::Expression)), "Cannot parse arrow function expression");

return context.createArrowFunctionExpr(location, info);
Expand Down
10 changes: 10 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,13 @@
2022-02-27 Chris Dumez <cdumez@apple.com>

Omit template parameter for SetForScope<> variables
https://bugs.webkit.org/show_bug.cgi?id=237258

Reviewed by Darin Adler.

* wtf/RefCounter.h:
(WTF::RefCounter<T>::Count::deref):

2022-02-26 Chris Dumez <cdumez@apple.com>

Drop Ref<>'s operator==() as it is a bit ambiguous / confusing
Expand Down
2 changes: 1 addition & 1 deletion Source/WTF/wtf/RefCounter.h
Expand Up @@ -99,7 +99,7 @@ inline void RefCounter<T>::Count::deref()
--m_value;

if (m_refCounter && m_refCounter->m_valueDidChange) {
SetForScope<bool> inCallback(m_inValueDidChange, true);
SetForScope inCallback(m_inValueDidChange, true);
m_refCounter->m_valueDidChange(RefCounterEvent::Decrement);
}

Expand Down

0 comments on commit c115a0e

Please sign in to comment.