Changeset 234082 in webkit
- Timestamp:
- Jul 21, 2018 6:10:43 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r234075 r234082 1 2018-07-21 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Use Function / ScopedLambda / RecursableLambda instead of std::function 4 https://bugs.webkit.org/show_bug.cgi?id=187472 5 6 Reviewed by Mark Lam. 7 8 std::function allocates memory from standard malloc instead of bmalloc. Instead of 9 using that, we should use WTF::{Function,ScopedLambda,RecursableLambda}. 10 11 This patch attempts to replace std::function with the above WTF function types. 12 If the function's lifetime can be the same to the stack, we can use ScopedLambda, which 13 is really efficient. Otherwise, we should use WTF::Function. 14 For recurring use cases, we can use RecursableLambda. 15 16 * assembler/MacroAssembler.cpp: 17 (JSC::stdFunctionCallback): 18 (JSC::MacroAssembler::probe): 19 * assembler/MacroAssembler.h: 20 * b3/air/AirDisassembler.cpp: 21 (JSC::B3::Air::Disassembler::dump): 22 * b3/air/AirDisassembler.h: 23 * bytecompiler/BytecodeGenerator.cpp: 24 (JSC::BytecodeGenerator::BytecodeGenerator): 25 (JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack): 26 (JSC::BytecodeGenerator::emitEnumeration): 27 * bytecompiler/BytecodeGenerator.h: 28 * bytecompiler/NodesCodegen.cpp: 29 (JSC::ArrayNode::emitBytecode): 30 (JSC::ApplyFunctionCallDotNode::emitBytecode): 31 (JSC::ForOfNode::emitBytecode): 32 * dfg/DFGSpeculativeJIT.cpp: 33 (JSC::DFG::SpeculativeJIT::addSlowPathGeneratorLambda): 34 (JSC::DFG::SpeculativeJIT::compileMathIC): 35 * dfg/DFGSpeculativeJIT.h: 36 * dfg/DFGSpeculativeJIT64.cpp: 37 (JSC::DFG::SpeculativeJIT::compile): 38 * dfg/DFGValidate.cpp: 39 * ftl/FTLCompile.cpp: 40 (JSC::FTL::compile): 41 * heap/HeapSnapshotBuilder.cpp: 42 (JSC::HeapSnapshotBuilder::json): 43 * heap/HeapSnapshotBuilder.h: 44 * interpreter/StackVisitor.cpp: 45 (JSC::StackVisitor::Frame::dump const): 46 * interpreter/StackVisitor.h: 47 * runtime/PromiseDeferredTimer.h: 48 * runtime/VM.cpp: 49 (JSC::VM::whenIdle): 50 (JSC::enableProfilerWithRespectToCount): 51 (JSC::disableProfilerWithRespectToCount): 52 * runtime/VM.h: 53 * runtime/VMEntryScope.cpp: 54 (JSC::VMEntryScope::addDidPopListener): 55 * runtime/VMEntryScope.h: 56 * tools/HeapVerifier.cpp: 57 (JSC::HeapVerifier::verifyCellList): 58 (JSC::HeapVerifier::validateCell): 59 (JSC::HeapVerifier::validateJSCell): 60 * tools/HeapVerifier.h: 61 1 62 2018-07-20 Michael Saboff <msaboff@apple.com> 2 63 -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.cpp
r229969 r234082 54 54 static void stdFunctionCallback(Probe::Context& context) 55 55 { 56 auto func = context.arg<const std::function<void(Probe::Context&)>*>();56 auto func = context.arg<const Function<void(Probe::Context&)>*>(); 57 57 (*func)(context); 58 58 } 59 59 60 void MacroAssembler::probe( std::function<void(Probe::Context&)> func)60 void MacroAssembler::probe(Function<void(Probe::Context&)> func) 61 61 { 62 probe(stdFunctionCallback, new std::function<void(Probe::Context&)>(func));62 probe(stdFunctionCallback, new Function<void(Probe::Context&)>(WTFMove(func))); 63 63 } 64 64 #endif // ENABLE(MASM_PROBE) -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.h
r231290 r234082 1955 1955 void probe(Probe::Function, void* arg); 1956 1956 1957 JS_EXPORT_PRIVATE void probe( std::function<void(Probe::Context&)>);1957 JS_EXPORT_PRIVATE void probe(Function<void(Probe::Context&)>); 1958 1958 1959 1959 // Let's you print from your JIT generated code. -
trunk/Source/JavaScriptCore/b3/air/AirDisassembler.cpp
r230748 r234082 70 70 } 71 71 72 void Disassembler::dump(Code& code, PrintStream& out, LinkBuffer& linkBuffer, const char* airPrefix, const char* asmPrefix, std::function<void(Inst&)>doToEachInst)72 void Disassembler::dump(Code& code, PrintStream& out, LinkBuffer& linkBuffer, const char* airPrefix, const char* asmPrefix, const ScopedLambda<void(Inst&)>& doToEachInst) 73 73 { 74 74 auto dumpAsmRange = [&] (CCallHelpers::Label startLabel, CCallHelpers::Label endLabel) { -
trunk/Source/JavaScriptCore/b3/air/AirDisassembler.h
r213233 r234082 51 51 void addInst(Inst*, CCallHelpers::Label, CCallHelpers::Label); 52 52 53 void dump(Code&, PrintStream&, LinkBuffer&, const char* airPrefix, const char* asmPrefix, std::function<void(Inst&)>doToEachInst);53 void dump(Code&, PrintStream&, LinkBuffer&, const char* airPrefix, const char* asmPrefix, const ScopedLambda<void(Inst&)>& doToEachInst); 54 54 55 55 private: -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r233855 r234082 341 341 functionNode->varDeclarations().markAllVariablesAsCaptured(); 342 342 343 auto captures = [&] (UniquedStringImpl* uid) -> bool {343 auto captures = scopedLambda<bool (UniquedStringImpl*)>([&] (UniquedStringImpl* uid) -> bool { 344 344 if (!shouldCaptureSomeOfTheThings) 345 345 return false; … … 352 352 } 353 353 return functionNode->captures(uid); 354 } ;354 }); 355 355 auto varKind = [&] (UniquedStringImpl* uid) -> VarKind { 356 356 return captures(uid) ? VarKind::Scope : VarKind::Stack; … … 976 976 void BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack( 977 977 FunctionParameters& parameters, bool isSimpleParameterList, FunctionNode* functionNode, SymbolTable* functionSymbolTable, 978 int symbolTableConstantIndex, const std::function<bool (UniquedStringImpl*)>& captures, bool shouldCreateArgumentsVariableInParameterScope)978 int symbolTableConstantIndex, const ScopedLambda<bool (UniquedStringImpl*)>& captures, bool shouldCreateArgumentsVariableInParameterScope) 979 979 { 980 980 Vector<std::pair<Identifier, RefPtr<RegisterID>>> valuesToMoveIntoVars; … … 4290 4290 } 4291 4291 4292 void BytecodeGenerator::emitEnumeration(ThrowableExpressionData* node, ExpressionNode* subjectNode, const std::function<void(BytecodeGenerator&, RegisterID*)>& callBack, ForOfNode* forLoopNode, RegisterID* forLoopSymbolTable)4292 void BytecodeGenerator::emitEnumeration(ThrowableExpressionData* node, ExpressionNode* subjectNode, const ScopedLambda<void(BytecodeGenerator&, RegisterID*)>& callBack, ForOfNode* forLoopNode, RegisterID* forLoopSymbolTable) 4293 4293 { 4294 4294 bool isForAwait = forLoopNode ? forLoopNode->isForAwait() : false; -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r233657 r234082 749 749 RegisterID* valueRegister, RegisterID* getterRegister, RegisterID* setterRegister, unsigned options, const JSTextPosition&); 750 750 751 void emitEnumeration(ThrowableExpressionData* enumerationNode, ExpressionNode* subjectNode, const std::function<void(BytecodeGenerator&, RegisterID*)>& callBack, ForOfNode* = nullptr, RegisterID* forLoopSymbolTable = nullptr);751 void emitEnumeration(ThrowableExpressionData* enumerationNode, ExpressionNode* subjectNode, const ScopedLambda<void(BytecodeGenerator&, RegisterID*)>& callBack, ForOfNode* = nullptr, RegisterID* forLoopSymbolTable = nullptr); 752 752 753 753 RegisterID* emitGetTemplateObject(RegisterID* dst, TaggedTemplateNode*); … … 1110 1110 void initializeParameters(FunctionParameters&); 1111 1111 void initializeVarLexicalEnvironment(int symbolTableConstantIndex, SymbolTable* functionSymbolTable, bool hasCapturedVariables); 1112 void initializeDefaultParameterValuesAndSetupFunctionScopeStack(FunctionParameters&, bool isSimpleParameterList, FunctionNode*, SymbolTable*, int symbolTableConstantIndex, const std::function<bool (UniquedStringImpl*)>& captures, bool shouldCreateArgumentsVariableInParameterScope);1112 void initializeDefaultParameterValuesAndSetupFunctionScopeStack(FunctionParameters&, bool isSimpleParameterList, FunctionNode*, SymbolTable*, int symbolTableConstantIndex, const ScopedLambda<bool (UniquedStringImpl*)>& captures, bool shouldCreateArgumentsVariableInParameterScope); 1113 1113 void initializeArrowFunctionContextScopeIfNeeded(SymbolTable* functionSymbolTable = nullptr, bool canReuseLexicalEnvironment = false); 1114 1114 bool needsDerivedConstructorInArrowFunctionLexicalEnvironment(); -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r233855 r234082 458 458 handleSpread: 459 459 RefPtr<RegisterID> index = generator.emitLoad(generator.newTemporary(), jsNumber(length)); 460 auto spreader = [array, index](BytecodeGenerator& generator, RegisterID* value)460 auto spreader = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([array, index](BytecodeGenerator& generator, RegisterID* value) 461 461 { 462 462 generator.emitDirectPutByVal(array.get(), index.get(), value); 463 463 generator.emitInc(index.get()); 464 } ;464 }); 465 465 for (; n; n = n->next()) { 466 466 if (n->elision()) … … 1456 1456 RefPtr<RegisterID> argumentsRegister = generator.emitLoad(generator.newTemporary(), jsUndefined()); 1457 1457 1458 auto extractor = [&thisRegister, &argumentsRegister, &index](BytecodeGenerator& generator, RegisterID* value)1458 auto extractor = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([&thisRegister, &argumentsRegister, &index](BytecodeGenerator& generator, RegisterID* value) 1459 1459 { 1460 1460 Ref<Label> haveThis = generator.newLabel(); … … 1472 1472 generator.emitLoad(index.get(), jsNumber(2)); 1473 1473 generator.emitLabel(end.get()); 1474 } ;1474 }); 1475 1475 generator.emitEnumeration(this, spread->expression(), extractor); 1476 1476 generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 0, divot(), divotStart(), divotEnd(), DebuggableCall::Yes); … … 3217 3217 RegisterID* forLoopSymbolTable = nullptr; 3218 3218 generator.pushLexicalScope(this, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable); 3219 auto extractor = [this, dst](BytecodeGenerator& generator, RegisterID* value)3219 auto extractor = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([this, dst](BytecodeGenerator& generator, RegisterID* value) 3220 3220 { 3221 3221 if (m_lexpr->isResolveNode()) { … … 3268 3268 generator.emitProfileControlFlow(m_statement->startOffset()); 3269 3269 generator.emitNode(dst, m_statement); 3270 } ;3270 }); 3271 3271 generator.emitEnumeration(this, m_expr, extractor, this, forLoopSymbolTable); 3272 3272 generator.popLexicalScope(this); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r234060 r234082 389 389 } 390 390 391 void SpeculativeJIT::addSlowPathGenerator (std::function<void()>lambda)392 { 393 m_slowPathLambdas.append(SlowPathLambda{ lambda, m_currentNode, static_cast<unsigned>(m_stream->size()) });391 void SpeculativeJIT::addSlowPathGeneratorLambda(Function<void()>&& lambda) 392 { 393 m_slowPathLambdas.append(SlowPathLambda{ WTFMove(lambda), m_currentNode, static_cast<unsigned>(m_stream->size()) }); 394 394 } 395 395 … … 3901 3901 auto done = m_jit.label(); 3902 3902 3903 addSlowPathGenerator ([=, savePlans = WTFMove(savePlans)] () {3903 addSlowPathGeneratorLambda([=, savePlans = WTFMove(savePlans)] () { 3904 3904 addICGenerationState->slowPathJumps.link(&m_jit); 3905 3905 addICGenerationState->slowPathStart = m_jit.label(); … … 4609 4609 auto done = m_jit.label(); 4610 4610 4611 addSlowPathGenerator ([=, savePlans = WTFMove(savePlans)] () {4611 addSlowPathGeneratorLambda([=, savePlans = WTFMove(savePlans)] () { 4612 4612 icGenerationState->slowPathJumps.link(&m_jit); 4613 4613 icGenerationState->slowPathStart = m_jit.label(); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r232461 r234082 357 357 358 358 void addSlowPathGenerator(std::unique_ptr<SlowPathGenerator>); 359 void addSlowPathGenerator (std::function<void()>);359 void addSlowPathGeneratorLambda(Function<void()>&&); 360 360 void runSlowPathGenerators(PCToCodeOriginMapBuilder&); 361 361 … … 1721 1721 Vector<std::unique_ptr<SlowPathGenerator>, 8> m_slowPathGenerators; 1722 1722 struct SlowPathLambda { 1723 std::function<void()> generator;1723 Function<void()> generator; 1724 1724 Node* currentNode; 1725 1725 unsigned streamIndex; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r232461 r234082 4566 4566 unsigned bytecodeIndex = node->origin.semantic.bytecodeIndex; 4567 4567 4568 addSlowPathGenerator ([=]() {4568 addSlowPathGeneratorLambda([=]() { 4569 4569 callTierUp.link(&m_jit); 4570 4570 … … 4618 4618 m_jit.jitCode()->bytecodeIndexToStreamIndex.add(bytecodeIndex, streamIndex); 4619 4619 4620 addSlowPathGenerator ([=]() {4620 addSlowPathGeneratorLambda([=]() { 4621 4621 forceOSREntry.link(&m_jit); 4622 4622 overflowedCounter.link(&m_jit); -
trunk/Source/JavaScriptCore/dfg/DFGValidate.cpp
r232741 r234082 378 378 // Validate clobbered states. 379 379 struct DefLambdaAdaptor { 380 std::function<void(PureValue)> pureValue;381 std::function<void(HeapLocation, LazyNode)> locationAndNode;380 Function<void(PureValue)> pureValue; 381 Function<void(HeapLocation, LazyNode)> locationAndNode; 382 382 383 383 void operator()(PureValue value) const -
trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp
r230748 r234082 49 49 #include "PCToCodeOriginMap.h" 50 50 #include "ScratchRegisterAllocator.h" 51 #include <wtf/ Function.h>51 #include <wtf/RecursableLambda.h> 52 52 53 53 namespace JSC { namespace FTL { … … 216 216 217 217 HashSet<B3::Value*> localPrintedValues; 218 WTF::Function<void(B3::Value*)> printValueRecursive = [&] (B3::Value* value){218 auto printValueRecursive = recursableLambda([&] (auto self, B3::Value* value) -> void { 219 219 if (printedValues.contains(value) || localPrintedValues.contains(value)) 220 220 return; … … 222 222 localPrintedValues.add(value); 223 223 for (unsigned i = 0; i < value->numChildren(); i++) 224 printValueRecursive(value->child(i));224 self(value->child(i)); 225 225 out.print(b3Prefix); 226 226 value->deepDump(state.proc.get(), out); 227 227 out.print("\n"); 228 } ;228 }); 229 229 230 230 printValueRecursive(currentB3Value); … … 232 232 }; 233 233 234 auto forEachInst = [&] (B3::Air::Inst& inst) {234 auto forEachInst = scopedLambda<void(B3::Air::Inst&)>([&] (B3::Air::Inst& inst) { 235 235 printB3Value(inst.origin); 236 } ;236 }); 237 237 238 238 disassembler->dump(state.proc->code(), out, linkBuffer, airPrefix, asmPrefix, forEachInst); -
trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.cpp
r233765 r234082 200 200 } 201 201 202 String HeapSnapshotBuilder::json( std::function<bool (const HeapSnapshotNode&)> allowNodeCallback)202 String HeapSnapshotBuilder::json(Function<bool (const HeapSnapshotNode&)> allowNodeCallback) 203 203 { 204 204 VM& vm = m_profiler.vm(); -
trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.h
r217843 r234082 122 122 123 123 String json(); 124 String json( std::function<bool (const HeapSnapshotNode&)> allowNodeCallback);124 String json(Function<bool (const HeapSnapshotNode&)> allowNodeCallback); 125 125 126 126 private: -
trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp
r233122 r234082 427 427 } 428 428 429 void StackVisitor::Frame::dump(PrintStream& out, Indenter indent, std::function<void(PrintStream&)> prefix) const429 void StackVisitor::Frame::dump(PrintStream& out, Indenter indent, WTF::Function<void(PrintStream&)> prefix) const 430 430 { 431 431 if (!this->callFrame()) { -
trunk/Source/JavaScriptCore/interpreter/StackVisitor.h
r224272 r234082 29 29 #include "VMEntryRecord.h" 30 30 #include "WasmIndexOrName.h" 31 #include < functional>31 #include <wtf/Function.h> 32 32 #include <wtf/Indenter.h> 33 33 #include <wtf/text/WTFString.h> … … 101 101 102 102 void dump(PrintStream&, Indenter = Indenter()) const; 103 void dump(PrintStream&, Indenter, std::function<void(PrintStream&)> prefix) const;103 void dump(PrintStream&, Indenter, WTF::Function<void(PrintStream&)> prefix) const; 104 104 105 105 private: -
trunk/Source/JavaScriptCore/runtime/PromiseDeferredTimer.h
r231194 r234082 53 53 bool cancelPendingPromise(JSPromiseDeferred*); 54 54 55 typedef std::function<void()> Task;55 using Task = Function<void()>; 56 56 void scheduleWorkSoon(JSPromiseDeferred*, Task&&); 57 57 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r233236 r234082 754 754 } 755 755 756 void VM::whenIdle( std::function<void()>callback)756 void VM::whenIdle(Function<void()>&& callback) 757 757 { 758 758 if (!entryScope) { … … 761 761 } 762 762 763 entryScope->addDidPopListener( callback);763 entryScope->addDidPopListener(WTFMove(callback)); 764 764 } 765 765 … … 1024 1024 } 1025 1025 1026 static bool enableProfilerWithRespectToCount(unsigned& counter, std::function<void()> doEnableWork) 1026 template<typename Func> 1027 static bool enableProfilerWithRespectToCount(unsigned& counter, const Func& doEnableWork) 1027 1028 { 1028 1029 bool needsToRecompile = false; … … 1036 1037 } 1037 1038 1038 static bool disableProfilerWithRespectToCount(unsigned& counter, std::function<void()> doDisableWork) 1039 template<typename Func> 1040 static bool disableProfilerWithRespectToCount(unsigned& counter, const Func& doDisableWork) 1039 1041 { 1040 1042 RELEASE_ASSERT(counter > 0); -
trunk/Source/JavaScriptCore/runtime/VM.h
r233236 r234082 797 797 CodeCache* codeCache() { return m_codeCache.get(); } 798 798 799 JS_EXPORT_PRIVATE void whenIdle( std::function<void()>);799 JS_EXPORT_PRIVATE void whenIdle(Function<void()>&&); 800 800 801 801 JS_EXPORT_PRIVATE void deleteAllCode(DeleteAllCodeEffort); -
trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp
r233378 r234082 65 65 } 66 66 67 void VMEntryScope::addDidPopListener( std::function<void ()>listener)67 void VMEntryScope::addDidPopListener(Function<void ()>&& listener) 68 68 { 69 m_didPopListeners.append( listener);69 m_didPopListeners.append(WTFMove(listener)); 70 70 } 71 71 -
trunk/Source/JavaScriptCore/runtime/VMEntryScope.h
r232074 r234082 42 42 JSGlobalObject* globalObject() const { return m_globalObject; } 43 43 44 void addDidPopListener( std::function<void ()>);44 void addDidPopListener(Function<void ()>&&); 45 45 46 46 private: 47 47 VM& m_vm; 48 48 JSGlobalObject* m_globalObject; 49 Vector< std::function<void ()>> m_didPopListeners;49 Vector<Function<void ()>> m_didPopListeners; 50 50 }; 51 51 -
trunk/Source/JavaScriptCore/tools/HeapVerifier.cpp
r233236 r234082 154 154 155 155 bool listNamePrinted = false; 156 auto printHeaderIfNeeded = [&] () {156 auto printHeaderIfNeeded = scopedLambda<void()>([&] () { 157 157 if (listNamePrinted) 158 158 return; … … 162 162 listNamePrinted = true; 163 163 m_didPrintLogs = true; 164 } ;164 }); 165 165 166 166 bool success = true; … … 182 182 bool HeapVerifier::validateCell(HeapCell* cell, VM* expectedVM) 183 183 { 184 auto printNothing = [] () { };184 auto printNothing = scopedLambda<void()>([] () { }); 185 185 186 186 if (cell->isZapped()) { … … 196 196 } 197 197 198 bool HeapVerifier::validateJSCell(VM* expectedVM, JSCell* cell, CellProfile* profile, CellList* list, std::function<void()>printHeaderIfNeeded, const char* prefix)199 { 200 auto printHeaderAndCell = [cell, profile, printHeaderIfNeeded, prefix] () {198 bool HeapVerifier::validateJSCell(VM* expectedVM, JSCell* cell, CellProfile* profile, CellList* list, const ScopedLambda<void()>& printHeaderIfNeeded, const char* prefix) 199 { 200 auto printHeaderAndCell = [cell, profile, &printHeaderIfNeeded, prefix] () { 201 201 printHeaderIfNeeded(); 202 202 dataLog(prefix, "cell ", RawPointer(cell)); -
trunk/Source/JavaScriptCore/tools/HeapVerifier.h
r229309 r234082 29 29 #include "Heap.h" 30 30 #include <wtf/MonotonicTime.h> 31 #include <wtf/ScopedLambda.h> 31 32 #include <wtf/UniqueArray.h> 32 33 … … 100 101 CellList* cellListForGathering(Phase); 101 102 bool verifyCellList(Phase, CellList&); 102 static bool validateJSCell(VM* expectedVM, JSCell*, CellProfile*, CellList*, std::function<void()>printHeaderIfNeeded, const char* prefix = "");103 static bool validateJSCell(VM* expectedVM, JSCell*, CellProfile*, CellList*, const ScopedLambda<void()>& printHeaderIfNeeded, const char* prefix = ""); 103 104 104 105 void printVerificationHeader(); -
trunk/Source/WTF/ChangeLog
r233912 r234082 1 2018-07-21 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Use Function / ScopedLambda / RecursableLambda instead of std::function 4 https://bugs.webkit.org/show_bug.cgi?id=187472 5 6 Reviewed by Mark Lam. 7 8 * wtf/ScopedLambda.h: 9 (WTF::ScopedLambda<ResultType): 10 1 11 2018-07-18 Michael Catanzaro <mcatanzaro@igalia.com> 2 12 -
trunk/Source/WTF/wtf/ScopedLambda.h
r225524 r234082 27 27 #define ScopedLambda_h 28 28 29 #include <wtf/ForbidHeapAllocation.h> 30 29 31 namespace WTF { 30 32 … … 44 46 template<typename ResultType, typename... ArgumentTypes> 45 47 class ScopedLambda<ResultType (ArgumentTypes...)> { 48 WTF_FORBID_HEAP_ALLOCATION; 46 49 public: 47 50 ScopedLambda(ResultType (*impl)(void* arg, ArgumentTypes...) = nullptr, void* arg = nullptr)
Note: See TracChangeset
for help on using the changeset viewer.