Skip to content

Commit f057e7b

Browse files
committed
Clean up ScopedLambda API for modern C++
https://bugs.webkit.org/show_bug.cgi?id=322406 rdar://185695582 Reviewed by Yusuke Suzuki. ScopedLambda required every caller to name the function signature at the call site by wrapping the lambda in a scopedLambda<Sig>() call. This is because ScopedLambda could only be constructed from a raw (void*, Args...) thunk. Give ScopedLambda a converting constructor from any invocable, so a callee declared as taking a const ScopedLambda<Sig>& can simply be passed a lambda. The parameter is marked LIFETIME_BOUND so that clang diagnoses the cases where that does not hold: binding a temporary lambda to a named ScopedLambda, returning one, or initializing a member from one are all caught by -Wdangling, -Wreturn-stack-address, and -Wdangling-field respectively. Convert every caller to pass its lambda directly, which additionally drops a needless copy of the functor at the sites that were wrapping an already-live reference. This left scopedLambda(), ScopedLambdaFunctor, scopedLambdaRef() and ScopedLambdaRefFunctor with no users, so I removed them. The new constructor does what scopedLambdaRef() did and also accepts functors whose call operator is not const, which scopedLambdaRef() could not. The last user of the owning form was LazyFireDetail, which stored a non-const ScopedLambda& and so forced its callers to keep one in a variable. I made it a template constrained on ConstInvocable<void(PrintStream&)> that owns its functor instead, which is both simpler at its two call sites and removes the borrowed reference altogether. opcode_generator.rb now emits forEachArgCustom(functor) directly. Export ConstInvocable from StdLibExtras.h alongside Invocable so it can be named unqualified, and drop the WTF:: qualification in DFGForAllKills.h accordingly. Test: Tools/TestWebKitAPI/Tests/WTF/ScopedLambda.cpp Canonical link: https://commits.webkit.org/319727@main
1 parent 03a07e4 commit f057e7b

37 files changed

Lines changed: 213 additions & 295 deletions

‎Source/JavaScriptCore/SaferCPPExpectations/ForwardDeclCheckerExpectations‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ftl/FTLFormattedValue.h
1616
ftl/FTLState.h
1717
heap/AbstractSlotVisitor.h
1818
heap/Heap.h
19-
heap/HeapInlines.h
19+
[ macOS ] heap/HeapInlines.h
2020
heap/HeapProfiler.h
2121
heap/HeapSnapshotBuilder.h
2222
heap/SlotVisitor.h

‎Source/JavaScriptCore/b3/air/opcode_generator.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def endArchs(outp, archs)
786786
outp.puts "case Opcode::#{opcode.name}:"
787787
end
788788
}
789-
outp.puts "forEachArgCustom(scopedLambdaRef<EachArgCallback>(functor));"
789+
outp.puts "forEachArgCustom(functor);"
790790
outp.puts "return;"
791791
outp.puts "default:"
792792
outp.puts "forEachArgSimple(functor);"

‎Source/JavaScriptCore/bytecode/BytecodeUseDef.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ void computeUsesForBytecodeIndex(Block* codeBlock, const JSInstruction* instruct
4242
if (opcodeID != op_enter && codeBlock->wasCompiledWithDebuggingOpcodes() && codeBlock->scopeRegister().isValid())
4343
functor(codeBlock->scopeRegister());
4444

45-
computeUsesForBytecodeIndexImpl(instruction, checkpoint, scopedLambda<void(VirtualRegister)>(functor));
45+
computeUsesForBytecodeIndexImpl(instruction, checkpoint, functor);
4646
}
4747

4848
template<typename Block, typename Functor>
4949
void computeDefsForBytecodeIndex(Block* codeBlock, const JSInstruction* instruction, Checkpoint checkpoint, const Functor& functor)
5050
{
51-
computeDefsForBytecodeIndexImpl(codeBlock->numVars(), instruction, checkpoint, scopedLambda<void(VirtualRegister)>(functor));
51+
computeDefsForBytecodeIndexImpl(codeBlock->numVars(), instruction, checkpoint, functor);
5252
}
5353

5454
#undef CALL_FUNCTOR

‎Source/JavaScriptCore/bytecode/Watchpoint.h‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct ArrayBufferViewWatchpointAdaptor;
4545
class VM;
4646

4747
class FireDetail {
48-
void* operator new(size_t) = delete;
48+
WTF_FORBID_HEAP_ALLOCATION;
4949

5050
public:
5151
virtual ~FireDetail() = default;
@@ -69,17 +69,18 @@ class JS_EXPORT_PRIVATE StringFireDetail final : public FireDetail {
6969
const char* m_string;
7070
};
7171

72+
template<ConstInvocable<void(PrintStream&)> Functor>
7273
class LazyFireDetail final : public FireDetail {
7374
public:
74-
LazyFireDetail(ScopedLambda<void(PrintStream&)>& lambda)
75-
: m_lambda(lambda)
75+
LazyFireDetail(Functor functor)
76+
: m_functor(WTF::move(functor))
7677
{
7778
}
7879

79-
void dump(PrintStream& out) const final { m_lambda(out); }
80+
void dump(PrintStream& out) const final { m_functor(out); }
8081

8182
private:
82-
ScopedLambda<void(PrintStream&)>& m_lambda;
83+
Functor m_functor;
8384
};
8485

8586
class WatchpointSet;

‎Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
530530
if (shouldCaptureAllOfTheThings)
531531
functionNode->varDeclarations().markAllVariablesAsCaptured();
532532

533-
auto captures = scopedLambda<bool (UniquedStringImpl*)>([&] (UniquedStringImpl* uid) -> bool {
533+
auto captures = [&] (UniquedStringImpl* uid) -> bool {
534534
if (!shouldCaptureSomeOfTheThings)
535535
return false;
536536
if (m_needsArguments && uid == propertyNames().arguments.impl()) {
@@ -541,7 +541,7 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
541541
return true;
542542
}
543543
return functionNode->captures(uid);
544-
});
544+
};
545545
auto varKind = [&] (UniquedStringImpl* uid) -> VarKind {
546546
return captures(uid) ? VarKind::Scope : VarKind::Stack;
547547
};
@@ -4974,12 +4974,12 @@ void BytecodeGenerator::emitEnumeration(ThrowableExpressionData* node, Expressio
49744974
emitLabel(loopStart.get());
49754975
emitLoopHint();
49764976

4977-
emitTryWithFinallyThatDoesNotShadowException(finallyContext, scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
4977+
emitTryWithFinallyThatDoesNotShadowException(finallyContext, [&](BytecodeGenerator& generator) {
49784978
callBack(generator, value.get());
49794979
generator.emitJump(*scope->continueTarget());
4980-
}), scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
4980+
}, [&](BytecodeGenerator& generator) {
49814981
generator.emitIteratorGenericClose(iterator.get(), node, EmitAwait::Yes);
4982-
}));
4982+
});
49834983

49844984
emitLabel(*scope->continueTarget());
49854985
RELEASE_ASSERT(forLoopNode->isForOfNode());
@@ -5058,12 +5058,12 @@ void BytecodeGenerator::emitEnumeration(ThrowableExpressionData* node, Expressio
50585058
emitJumpIfTrue(done.get(), loopDone.get());
50595059
}
50605060

5061-
emitTryWithFinallyThatDoesNotShadowException(finallyContext, scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5061+
emitTryWithFinallyThatDoesNotShadowException(finallyContext, [&](BytecodeGenerator& generator) {
50625062
callBack(generator, value.get());
50635063
generator.emitJump(loopStart.get());
5064-
}), scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5064+
}, [&](BytecodeGenerator& generator) {
50655065
generator.emitIteratorGenericClose(iterator.get(), node);
5066-
}));
5066+
});
50675067

50685068
bool breakLabelIsBound = scope->breakTargetMayBeBound();
50695069
if (breakLabelIsBound)

‎Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,11 @@ RegisterID* ArrayNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds
528528

529529
handleSpread:
530530
RefPtr<RegisterID> index = generator.emitLoad(generator.newTemporary(), jsNumber(length));
531-
auto spreader = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([array, index](BytecodeGenerator& generator, RegisterID* value)
531+
auto spreader = [array, index](BytecodeGenerator& generator, RegisterID* value)
532532
{
533533
generator.emitDirectPutByVal(array.get(), index.get(), value);
534534
generator.emitInc(index.get());
535-
});
535+
};
536536
for (; n; n = n->next()) {
537537
if (n->elision())
538538
generator.emitBinaryOp<OpAdd>(index.get(), index.get(), generator.emitLoad(nullptr, jsNumber(n->elision())), OperandTypes(ResultType::numberTypeIsInt32(), ResultType::numberTypeIsInt32()));
@@ -2115,14 +2115,14 @@ RegisterID* BytecodeIntrinsicNode::emit_intrinsic_ifAbruptCloseIterator(Bytecode
21152115
ASSERT(!node->m_next);
21162116

21172117
Ref<Label> end = generator.newLabel();
2118-
auto emitSecondArgumentNode = scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
2118+
auto emitSecondArgumentNode = [&](BytecodeGenerator& generator) {
21192119
generator.emitNode(node);
21202120
generator.emitJump(end.get());
2121-
});
2121+
};
21222122

2123-
auto emitIteratorClose = scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
2123+
auto emitIteratorClose = [&](BytecodeGenerator& generator) {
21242124
generator.emitIteratorGenericClose(iterator.get(), this);
2125-
});
2125+
};
21262126

21272127
generator.emitTryWithFinallyThatDoesNotShadowException(emitSecondArgumentNode, emitIteratorClose);
21282128
generator.emitLabel(end.get());
@@ -2440,7 +2440,7 @@ RegisterID* ApplyFunctionCallDotNode::emitBytecode(BytecodeGenerator& generator,
24402440
RefPtr<RegisterID> thisRegister = generator.emitLoad(generator.newTemporary(), jsUndefined());
24412441
RefPtr<RegisterID> argumentsRegister = generator.emitLoad(generator.newTemporary(), jsUndefined());
24422442

2443-
auto extractor = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([&thisRegister, &argumentsRegister, &index](BytecodeGenerator& generator, RegisterID* value)
2443+
auto extractor = [&thisRegister, &argumentsRegister, &index](BytecodeGenerator& generator, RegisterID* value)
24442444
{
24452445
Ref<Label> haveThis = generator.newLabel();
24462446
Ref<Label> end = generator.newLabel();
@@ -2453,7 +2453,7 @@ RegisterID* ApplyFunctionCallDotNode::emitBytecode(BytecodeGenerator& generator,
24532453
generator.move(argumentsRegister.get(), value);
24542454
generator.emitLoad(index.get(), jsNumber(2));
24552455
generator.emitLabel(end.get());
2456-
});
2456+
};
24572457
generator.emitEnumeration(this, spread->expression(), extractor);
24582458
generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 0, divot(), divotStart(), divotEnd(), DebuggableCall::Yes);
24592459
} else if (m_args->m_listNode->m_next) {
@@ -4149,9 +4149,9 @@ void BlockNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
41494149
generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested);
41504150

41514151
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
4152-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
4152+
[&](BytecodeGenerator& generator) {
41534153
m_statements->emitBytecode(generator, dst);
4154-
})
4154+
}
41554155
);
41564156

41574157
generator.popLexicalScope(this);
@@ -4365,7 +4365,7 @@ void ForNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
43654365
generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable);
43664366

43674367
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
4368-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
4368+
[&](BytecodeGenerator& generator) {
43694369
Ref<LabelScope> scope = generator.newLabelScope(LabelScope::Loop);
43704370

43714371
if (m_expr1) {
@@ -4395,7 +4395,7 @@ void ForNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
43954395
generator.emitJump(topOfLoop.get());
43964396

43974397
generator.emitLabel(scope->breakTarget());
4398-
})
4398+
}
43994399
);
44004400

44014401
generator.popLexicalScope(this);
@@ -4588,7 +4588,7 @@ void ForOfNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
45884588
generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable);
45894589
bool isUsingDeclaration = hasUsingDeclaration();
45904590
bool isAwaitUsingDeclaration = hasAwaitUsingDeclaration();
4591-
auto extractor = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([this, dst, isUsingDeclaration, isAwaitUsingDeclaration](BytecodeGenerator& generator, RegisterID* value)
4591+
auto extractor = [this, dst, isUsingDeclaration, isAwaitUsingDeclaration](BytecodeGenerator& generator, RegisterID* value)
45924592
{
45934593
auto emitBody = [&](BytecodeGenerator& generator) {
45944594
if (m_lexpr->isResolveNode()) {
@@ -4638,11 +4638,11 @@ void ForOfNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
46384638
};
46394639

46404640
generator.emitBodyWithUsingIfNeeded(isUsingDeclaration ? 1 : 0, isAwaitUsingDeclaration,
4641-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
4641+
[&](BytecodeGenerator& generator) {
46424642
emitBody(generator);
4643-
})
4643+
}
46444644
);
4645-
});
4645+
};
46464646
generator.emitEnumeration(this, m_expr, extractor, this, forLoopSymbolTable);
46474647
generator.popLexicalScope(this);
46484648
generator.emitProfileControlFlow(m_statement->endOffset() + (m_statement->isBlock() ? 1 : 0));
@@ -4928,9 +4928,9 @@ void SwitchNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
49284928
generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::DoNotOptimize, BytecodeGenerator::NestedScopeType::IsNested);
49294929

49304930
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
4931-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
4931+
[&](BytecodeGenerator& generator) {
49324932
m_block->emitBytecodeForBlock(generator, r0.get(), dst);
4933-
})
4933+
}
49344934
);
49354935

49364936
generator.popLexicalScope(this);
@@ -5124,9 +5124,9 @@ static void emitProgramNodeBytecode(BytecodeGenerator& generator, ScopeNode& sco
51245124
generator.emitProfileControlFlow(scopeNode.startStartOffset());
51255125

51265126
generator.emitBodyWithUsingIfNeeded(scopeNode.usingDeclarationCount(), scopeNode.hasAwaitUsingDeclaration(),
5127-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5127+
[&](BytecodeGenerator& generator) {
51285128
scopeNode.emitStatementsBytecode(generator, dstRegister.get());
5129-
})
5129+
}
51305130
);
51315131

51325132
generator.emitDebugHook(DidExecuteProgram, JSTextPosition(scopeNode.lastLine(), scopeNode.startOffset(), scopeNode.lineStartOffset()));
@@ -5157,9 +5157,9 @@ void EvalNode::emitBytecode(BytecodeGenerator& generator, RegisterID*)
51575157
generator.emitLoad(dstRegister.get(), jsUndefined());
51585158

51595159
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
5160-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5160+
[&](BytecodeGenerator& generator) {
51615161
emitStatementsBytecode(generator, dstRegister.get());
5162-
})
5162+
}
51635163
);
51645164

51655165
generator.emitDebugHook(DidExecuteProgram, JSTextPosition(lastLine(), startOffset(), lineStartOffset()));
@@ -5283,9 +5283,9 @@ void FunctionNode::emitBytecode(BytecodeGenerator& generator, RegisterID*)
52835283
Ref<Label> tryStartLabel = generator.newEmittedLabel();
52845284
TryData* tryData = generator.pushTry(tryStartLabel.get(), catchLabel.get(), HandlerType::Finally);
52855285
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
5286-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5286+
[&](BytecodeGenerator& generator) {
52875287
emitStatementsBytecode(generator, generator.ignoredResult());
5288-
})
5288+
}
52895289
);
52905290
generator.emitJump(finallyLabel.get());
52915291
Ref<Label> tryEndLabel = generator.newEmittedLabel();
@@ -5453,9 +5453,9 @@ void FunctionNode::emitBytecode(BytecodeGenerator& generator, RegisterID*)
54535453
case SourceParseMode::AsyncArrowFunctionBodyMode:
54545454
case SourceParseMode::AsyncFunctionBodyMode: {
54555455
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
5456-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5456+
[&](BytecodeGenerator& generator) {
54575457
emitStatementsBytecode(generator, generator.ignoredResult());
5458-
})
5458+
}
54595459
);
54605460

54615461
generator.emitReturn(generator.emitLoad(nullptr, jsUndefined()));
@@ -5464,9 +5464,9 @@ void FunctionNode::emitBytecode(BytecodeGenerator& generator, RegisterID*)
54645464

54655465
default: {
54665466
generator.emitBodyWithUsingIfNeeded(usingDeclarationCount(), hasAwaitUsingDeclaration(),
5467-
scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5467+
[&](BytecodeGenerator& generator) {
54685468
emitStatementsBytecode(generator, generator.ignoredResult());
5469-
})
5469+
}
54705470
);
54715471

54725472
StatementNode* singleStatement = this->singleStatement();
@@ -5844,7 +5844,7 @@ void ArrayPatternNode::bindValue(BytecodeGenerator& generator, RegisterID* rhs)
58445844

58455845
RefPtr<RegisterID> done = generator.newTemporary();
58465846

5847-
auto emitBindValue = scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5847+
auto emitBindValue = [&](BytecodeGenerator& generator) {
58485848
for (size_t i = 0; i < this->m_targetPatterns.size(); i++) {
58495849
const auto& class="pl-c1">this->m_targetPatterns[i];
58505850

@@ -5930,14 +5930,14 @@ void ArrayPatternNode::bindValue(BytecodeGenerator& generator, RegisterID* rhs)
59305930
}
59315931
}
59325932
}
5933-
});
5933+
};
59345934

5935-
auto emitIteratorClose = scopedLambda<void(BytecodeGenerator&)>([&](BytecodeGenerator& generator) {
5935+
auto emitIteratorClose = [&](BytecodeGenerator& generator) {
59365936
Ref<Label> iteratorClosed = generator.newLabel();
59375937
generator.emitJumpIfTrue(done.get(), iteratorClosed.get());
59385938
generator.emitIteratorGenericClose(iterator.get(), this);
59395939
generator.emitLabel(iteratorClosed.get());
5940-
});
5940+
};
59415941

59425942
if (bindValueOrDefaultValueCanThrow) {
59435943
generator.emitLoad(done.get(), jsBoolean(false));

‎Source/JavaScriptCore/dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ void AdaptiveInferredPropertyValueWatchpoint::handleFire(VM&, const FireDetail&
5353
{
5454
dataLogLnIf(DFG::shouldDumpDisassembly(), "Firing watchpoint ", RawPointer(this), " (", key(), ") on ", *m_codeBlock);
5555

56-
57-
auto lambda = scopedLambda<void(PrintStream&)>([&](PrintStream& out) {
56+
LazyFireDetail lazyDetail([&](PrintStream& out) {
5857
out.print("Adaptation of ", key(), " failed: ", detail);
5958
});
60-
LazyFireDetail lazyDetail(lambda);
6159
m_codeBlock->jettison(Profiler::JettisonDueToUnprofiledWatchpoint, CountReoptimization, &lazyDetail);
6260
}
6361

‎Source/JavaScriptCore/dfg/DFGAdaptiveStructureWatchpoint.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ void AdaptiveStructureWatchpoint::fireInternal(VM& vm, const FireDetail& detail)
7676

7777
dataLogLnIf(DFG::shouldDumpDisassembly(), "Firing watchpoint ", RawPointer(this), " (", m_key, ") on ", *m_codeBlock);
7878

79-
auto lambda = scopedLambda<void(PrintStream&)>([&](PrintStream& out) {
79+
LazyFireDetail lazyDetail([&](PrintStream& out) {
8080
out.print("Adaptation of ", m_key, " failed: ", detail);
8181
});
82-
LazyFireDetail lazyDetail(lambda);
8382
m_codeBlock->jettison(Profiler::JettisonDueToUnprofiledWatchpoint, CountReoptimization, &lazyDetail);
8483
}
8584

‎Source/JavaScriptCore/dfg/DFGForAllKills.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ constexpr bool verbose = false;
4747
// This tells you those things that die on the boundary between nodeBefore and nodeAfter. It is
4848
// conservative in the sense that it might resort to telling you some things that are still live at
4949
// nodeAfter.
50-
template<WTF::ConstInvocable<void(Operand)> Functor>
50+
template<ConstInvocable<void(Operand)> Functor>
5151
void forAllKilledOperands(Graph& graph, Node* nodeBefore, Node* nodeAfter, const Functor& functor)
5252
{
5353
CodeOrigin before = nodeBefore->origin.forExit;
@@ -125,7 +125,7 @@ void forAllKilledOperands(Graph& graph, Node* nodeBefore, Node* nodeAfter, const
125125
}
126126

127127
// Tells you all of the nodes that would no longer be live across the node at this nodeIndex.
128-
template<WTF::ConstInvocable<void(Node*)> Functor>
128+
template<ConstInvocable<void(Node*)> Functor>
129129
void forAllKilledNodesAtNodeIndex(
130130
Graph& graph, AvailabilityMap& availabilityMap, BasicBlock* block, unsigned nodeIndex,
131131
const Functor& functor)
@@ -173,7 +173,7 @@ void forAllKilledNodesAtNodeIndex(
173173
// Tells you all of the places to start searching from in a basic block. Gives you the node index at which
174174
// the value is either no longer live. This pretends that nodes are dead at the end of the block, so that
175175
// you can use this to do per-basic-block analyses.
176-
template<WTF::ConstInvocable<void(unsigned, Node*)> Functor>
176+
template<ConstInvocable<void(unsigned, Node*)> Functor>
177177
void forAllKillsInBlock(
178178
Graph& graph, const CombinedLiveness& combinedLiveness, BasicBlock* block,
179179
const Functor& functor)

0 commit comments

Comments
 (0)