WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
what I'm thinking so far
blah.patch (text/plain), 21.70 KB, created by
Filip Pizlo
on 2015-10-08 14:59:17 PDT
(
hide
)
Description:
what I'm thinking so far
Filename:
MIME Type:
Creator:
Filip Pizlo
Created:
2015-10-08 14:59:17 PDT
Size:
21.70 KB
patch
obsolete
>Index: Source/JavaScriptCore/ftl/FTLLazySlowPathCall.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLLazySlowPathCall.cpp (revision 0) >+++ Source/JavaScriptCore/ftl/FTLLazySlowPathCall.cpp (working copy) >@@ -0,0 +1,67 @@ >+/* >+ * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "FTLLazySlowPathCall.h" >+ >+#include "FTLSlowPathCall.h" >+ >+namespace JSC { namespace FTL { >+ >+LazySlowPathCall::LazySlowPathCall( >+ CodeLocationLabel patchpoint, CodeLocationLabel exceptionTarget, const RegisterSet& usedRegisters) >+ : m_patchpoint(patchpoint) >+ , m_exceptionTarget(exceptionTarget) >+ , m_usedRegisters(usedRegisters) >+{ >+} >+ >+LazySlowPathCall::~LazySlowPathCall() >+{ >+} >+ >+void LazySlowPathCall::generate(CodeBlock* codeBlock) >+{ >+ RELEASE_ASSERT(!m_stub); >+ >+ VM& vm = *codeBlock->vm(); >+ >+ CCallHelpers jit(&vm, codeBlock); >+ CCallHelpers::JumpList exceptionJumps; >+ generateCall(jit, m_exceptionTarget ? &exceptionJumps : nullptr); >+ CCallHelpers::Jump done = jit.jump(); >+ >+ LinkBuffer linkBuffer(vm, jit, codeBlock, JITCompilationMustSucceed); >+ linkBuffer.link(done, m_patchpoint.labelAtOffset(MacroAssembler::maxJumpReplacementSize())); >+ if (exceptionTarget) >+ linkBuffer.link(exceptionJumps, m_exceptionTarget); >+ m_stub = FINALIZE_CODE_FOR(codeBlock, linkBuffer, ("Lazy slow path call stub")); >+ >+ MacroAssembler::replaceWithJump(m_patchpoint, CodeLocationLabel(m_stub.code())); >+} >+ >+} } // namespace JSC::FTL >+ >+ >Index: Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h >=================================================================== >--- Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h (revision 0) >+++ Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h (working copy) >@@ -0,0 +1,101 @@ >+/* >+ * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef FTLLazySlowPathCall_h >+#define FTLLazySlowPathCall_h >+ >+#include "CodeBlock.h" >+#include "CodeLocation.h" >+#include "FTLSlowPathCall.h" >+#include "GPRInfo.h" >+#include "MacroAssemblerCodeRef.h" >+#include "RegisterSet.h" >+ >+namespace JSC { namespace FTL { >+ >+class LazySlowPathCall { >+ WTF_MAKE_NONCOPYABLE(LazySlowPathCall); >+ WTF_MAKE_FAST_ALLOCATED; >+public: >+ LazySlowPathCall( >+ CodeLocationLabel patchpoint, CodeLocationLabel exceptionTarget, const RegisterSet& usedRegisters); >+ >+ virtual ~LazySlowPathCall(); >+ >+ const RegisterSet& usedRegisters() const { return m_usedRegisters; } >+ >+ SlowPathCall generate(CodeBlock*); >+ >+protected: >+ virtual void generateCall(CCallHelpers&, CCallHelpers::JumpList* exceptionJumps) = 0; >+ >+private: >+ CodeLocationLabel m_patchpoint; >+ CodeLocationLabel m_exceptionTarget; >+ RegisterSet m_usedRegisters; >+ MacroAssemblerCodeRef m_stub; >+}; >+ >+template<typename ResultType, typename... ArgumentTypes> >+class LazySlowPathCallImpl : public LazySlowPathCall { >+public: >+ LazySlowPathCallImpl( >+ CodeLocationLabel patchpoint, CodeLocationLabel exceptionTarget, const RegisterSet& usedRegisters, >+ FunctionPtr function, ResultType result, ArgumentTypes... arguments) >+ : LazySlowPathCall(patchpoint, exceptionTarget, usedRegisters) >+ , m_function(function) >+ , m_result(result) >+ , m_arguments(arguments) >+ { >+ } >+ >+protected: >+ SlowPathCall generateCall(CCallHelpers& jit, CCallHelpers::JumpList* exceptionJumps) override >+ { >+ return tupleApply( >+ callOperationImpl, >+ std::tuple_cat( >+ std::make_tuple(usedRegisters(), jit, exceptionJumps, m_function, m_result), >+ m_arguments)); >+ } >+ >+private: >+ ResultType m_result; >+ std::tuple<ArgumentTypes...> m_arguments; >+}; >+ >+template<typename ResultType, typename... ArgumentTypes> >+std::unique_ptr<LazySlowPathCall> makeLazySlowPathCall( >+ CodeLocationlabel patchpoint, CodeLocationLabel exceptionTarget, const RegisterSet& usedRegisters, >+ FunctionPtr function, ResultType result, ArgumentTypes... arguments) >+{ >+ return std::make_unique<LazySlowPathCallImpl<ResultType, ArgumentTypes...>>( >+ patchpoint, exceptionTarget, usedRegisters, function, result, arguments...); >+} >+ >+} } // namespace JSC::FTL >+ >+#endif // FTLLazySlowPathCall_h >+ >Index: Source/JavaScriptCore/ftl/FTLSlowPathCall.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLSlowPathCall.cpp (revision 190735) >+++ Source/JavaScriptCore/ftl/FTLSlowPathCall.cpp (working copy) >@@ -35,131 +35,96 @@ > > namespace JSC { namespace FTL { > >-namespace { >- > // This code relies on us being 64-bit. FTL is currently always 64-bit. > static const size_t wordSize = 8; > >-// This will be an RAII thingy that will set up the necessary stack sizes and offsets and such. >-class CallContext { >-public: >- CallContext( >- State& state, const RegisterSet& usedRegisters, CCallHelpers& jit, >- unsigned numArgs, GPRReg returnRegister) >- : m_state(state) >- , m_usedRegisters(usedRegisters) >- , m_jit(jit) >- , m_numArgs(numArgs) >- , m_returnRegister(returnRegister) >- { >- // We don't care that you're using callee-save, stack, or hardware registers. >- m_usedRegisters.exclude(RegisterSet::stackRegisters()); >- m_usedRegisters.exclude(RegisterSet::reservedHardwareRegisters()); >- m_usedRegisters.exclude(RegisterSet::calleeSaveRegisters()); >- >- // The return register doesn't need to be saved. >- if (m_returnRegister != InvalidGPRReg) >- m_usedRegisters.clear(m_returnRegister); >- >- size_t stackBytesNeededForReturnAddress = wordSize; >- >- m_offsetToSavingArea = >- (std::max(m_numArgs, NUMBER_OF_ARGUMENT_REGISTERS) - NUMBER_OF_ARGUMENT_REGISTERS) * wordSize; >- >- for (unsigned i = std::min(NUMBER_OF_ARGUMENT_REGISTERS, numArgs); i--;) >- m_argumentRegisters.set(GPRInfo::toArgumentRegister(i)); >- m_callingConventionRegisters.merge(m_argumentRegisters); >- if (returnRegister != InvalidGPRReg) >- m_callingConventionRegisters.set(GPRInfo::returnValueGPR); >- m_callingConventionRegisters.filter(m_usedRegisters); >- >- unsigned numberOfCallingConventionRegisters = >- m_callingConventionRegisters.numberOfSetRegisters(); >- >- size_t offsetToThunkSavingArea = >- m_offsetToSavingArea + >- numberOfCallingConventionRegisters * wordSize; >- >- m_stackBytesNeeded = >- offsetToThunkSavingArea + >- stackBytesNeededForReturnAddress + >- (m_usedRegisters.numberOfSetRegisters() - numberOfCallingConventionRegisters) * wordSize; >- >- m_stackBytesNeeded = (m_stackBytesNeeded + stackAlignmentBytes() - 1) & ~(stackAlignmentBytes() - 1); >- >- m_jit.subPtr(CCallHelpers::TrustedImm32(m_stackBytesNeeded), CCallHelpers::stackPointerRegister); >- >- m_thunkSaveSet = m_usedRegisters; >- >- // This relies on all calling convention registers also being temp registers. >- unsigned stackIndex = 0; >- for (unsigned i = GPRInfo::numberOfRegisters; i--;) { >- GPRReg reg = GPRInfo::toRegister(i); >- if (!m_callingConventionRegisters.get(reg)) >- continue; >- m_jit.storePtr(reg, CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + (stackIndex++) * wordSize)); >- m_thunkSaveSet.clear(reg); >- } >+SlowPathCallContext::SlowPathCallContext( >+ RegisterSet usedRegisters, CCallHelpers& jit, unsigned numArgs, GPRReg returnRegister) >+ : m_jit(jit) >+ , m_numArgs(numArgs) >+ , m_returnRegister(returnRegister) >+{ >+ // We don't care that you're using callee-save, stack, or hardware registers. >+ usedRegisters.exclude(RegisterSet::stackRegisters()); >+ usedRegisters.exclude(RegisterSet::reservedHardwareRegisters()); >+ usedRegisters.exclude(RegisterSet::calleeSaveRegisters()); > >- m_offset = offsetToThunkSavingArea; >- } >- >- ~CallContext() >- { >- if (m_returnRegister != InvalidGPRReg) >- m_jit.move(GPRInfo::returnValueGPR, m_returnRegister); >- >- unsigned stackIndex = 0; >- for (unsigned i = GPRInfo::numberOfRegisters; i--;) { >- GPRReg reg = GPRInfo::toRegister(i); >- if (!m_callingConventionRegisters.get(reg)) >- continue; >- m_jit.loadPtr(CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + (stackIndex++) * wordSize), reg); >- } >+ // The return register doesn't need to be saved. >+ if (m_returnRegister != InvalidGPRReg) >+ usedRegisters.clear(m_returnRegister); > >- m_jit.addPtr(CCallHelpers::TrustedImm32(m_stackBytesNeeded), CCallHelpers::stackPointerRegister); >- } >- >- RegisterSet usedRegisters() const >- { >- return m_thunkSaveSet; >- } >- >- ptrdiff_t offset() const >- { >- return m_offset; >+ size_t stackBytesNeededForReturnAddress = wordSize; >+ >+ m_offsetToSavingArea = >+ (std::max(m_numArgs, NUMBER_OF_ARGUMENT_REGISTERS) - NUMBER_OF_ARGUMENT_REGISTERS) * wordSize; >+ >+ for (unsigned i = std::min(NUMBER_OF_ARGUMENT_REGISTERS, numArgs); i--;) >+ m_argumentRegisters.set(GPRInfo::toArgumentRegister(i)); >+ m_callingConventionRegisters.merge(m_argumentRegisters); >+ if (returnRegister != InvalidGPRReg) >+ m_callingConventionRegisters.set(GPRInfo::returnValueGPR); >+ m_callingConventionRegisters.filter(usedRegisters); >+ >+ unsigned numberOfCallingConventionRegisters = >+ m_callingConventionRegisters.numberOfSetRegisters(); >+ >+ size_t offsetToThunkSavingArea = >+ m_offsetToSavingArea + >+ numberOfCallingConventionRegisters * wordSize; >+ >+ m_stackBytesNeeded = >+ offsetToThunkSavingArea + >+ stackBytesNeededForReturnAddress + >+ (usedRegisters.numberOfSetRegisters() - numberOfCallingConventionRegisters) * wordSize; >+ >+ m_stackBytesNeeded = (m_stackBytesNeeded + stackAlignmentBytes() - 1) & ~(stackAlignmentBytes() - 1); >+ >+ m_jit.subPtr(CCallHelpers::TrustedImm32(m_stackBytesNeeded), CCallHelpers::stackPointerRegister); >+ >+ m_thunkSaveSet = usedRegisters; >+ >+ // This relies on all calling convention registers also being temp registers. >+ unsigned stackIndex = 0; >+ for (unsigned i = GPRInfo::numberOfRegisters; i--;) { >+ GPRReg reg = GPRInfo::toRegister(i); >+ if (!m_callingConventionRegisters.get(reg)) >+ continue; >+ m_jit.storePtr(reg, CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + (stackIndex++) * wordSize)); >+ m_thunkSaveSet.clear(reg); > } >+ >+ m_offset = offsetToThunkSavingArea; >+} > >- SlowPathCallKey keyWithTarget(void* callTarget) const >- { >- return SlowPathCallKey(usedRegisters(), callTarget, m_argumentRegisters, offset()); >- } >+SlowPathCallContext::~SlowPathCallContext() >+{ >+ if (m_returnRegister != InvalidGPRReg) >+ m_jit.move(GPRInfo::returnValueGPR, m_returnRegister); > >- MacroAssembler::Call makeCall(void* callTarget, MacroAssembler::JumpList* exceptionTarget) >- { >- MacroAssembler::Call result = m_jit.call(); >- m_state.finalizer->slowPathCalls.append(SlowPathCall( >- result, keyWithTarget(callTarget))); >- if (exceptionTarget) >- exceptionTarget->append(m_jit.emitExceptionCheck()); >- return result; >+ unsigned stackIndex = 0; >+ for (unsigned i = GPRInfo::numberOfRegisters; i--;) { >+ GPRReg reg = GPRInfo::toRegister(i); >+ if (!m_callingConventionRegisters.get(reg)) >+ continue; >+ m_jit.loadPtr(CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + (stackIndex++) * wordSize), reg); > } > >-private: >- State& m_state; >- RegisterSet m_usedRegisters; >- RegisterSet m_argumentRegisters; >- RegisterSet m_callingConventionRegisters; >- CCallHelpers& m_jit; >- unsigned m_numArgs; >- GPRReg m_returnRegister; >- size_t m_offsetToSavingArea; >- size_t m_stackBytesNeeded; >- RegisterSet m_thunkSaveSet; >- ptrdiff_t m_offset; >-}; >+ m_jit.addPtr(CCallHelpers::TrustedImm32(m_stackBytesNeeded), CCallHelpers::stackPointerRegister); >+} > >-} // anonymous namespace >+SlowPathCallKey SlowPathCallContext::keyWithTarget(void* callTarget) const >+{ >+ return SlowPathCallKey(m_thunkSaveSet, callTarget, m_argumentRegisters, m_offset); >+} >+ >+SlowPathCall SlowPathCallContext::makeCall(void* callTarget, MacroAssembler::JumpList* exceptionTarget) >+{ >+ MacroAssembler::Call call = m_jit.call(); >+ SlowPathCall result(call, keyWithTarget(callTarget)); >+ if (exceptionTarget) >+ exceptionTarget->append(m_jit.emitExceptionCheck()); >+ return result; >+} > > void storeCodeOrigin(State& state, CCallHelpers& jit, CodeOrigin codeOrigin) > { >@@ -173,17 +138,20 @@ void storeCodeOrigin(State& state, CCall > CCallHelpers::tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount))); > } > >+void registerSlowPathCall(State& state, SlowPathCall call) >+{ >+ state.finalizer->slowPathCalls.append(call); >+} >+ > MacroAssembler::Call callOperation( > State& state, const RegisterSet& usedRegisters, CCallHelpers& jit, > CodeOrigin codeOrigin, MacroAssembler::JumpList* exceptionTarget, > J_JITOperation_ESsiCI operation, GPRReg result, StructureStubInfo* stubInfo, > GPRReg object, const UniquedStringImpl* uid) > { >- storeCodeOrigin(state, jit, codeOrigin); >- CallContext context(state, usedRegisters, jit, 4, result); >- jit.setupArgumentsWithExecState( >+ return callOperation( >+ state, usedRegisters, jit, codeOrigin, exceptionTarget, FunctionPtr(operation), result, > CCallHelpers::TrustedImmPtr(stubInfo), object, CCallHelpers::TrustedImmPtr(uid)); >- return context.makeCall(bitwise_cast<void*>(operation), exceptionTarget); > } > > MacroAssembler::Call callOperation( >@@ -192,12 +160,9 @@ MacroAssembler::Call callOperation( > J_JITOperation_ESsiJI operation, GPRReg result, StructureStubInfo* stubInfo, > GPRReg object, UniquedStringImpl* uid) > { >- storeCodeOrigin(state, jit, codeOrigin); >- CallContext context(state, usedRegisters, jit, 4, result); >- jit.setupArgumentsWithExecState( >- CCallHelpers::TrustedImmPtr(stubInfo), object, >- CCallHelpers::TrustedImmPtr(uid)); >- return context.makeCall(bitwise_cast<void*>(operation), exceptionTarget); >+ return callOperation( >+ state, usedRegisters, jit, codeOrigin, exceptionTarget, FunctionPtr(operation), result, >+ CCallHelpers::TrustedImmPtr(stubInfo), object, CCallHelpers::TrustedImmPtr(uid)); > } > > MacroAssembler::Call callOperation( >@@ -206,12 +171,9 @@ MacroAssembler::Call callOperation( > V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg value, > GPRReg object, UniquedStringImpl* uid) > { >- storeCodeOrigin(state, jit, codeOrigin); >- CallContext context(state, usedRegisters, jit, 5, InvalidGPRReg); >- jit.setupArgumentsWithExecState( >- CCallHelpers::TrustedImmPtr(stubInfo), value, object, >- CCallHelpers::TrustedImmPtr(uid)); >- return context.makeCall(bitwise_cast<void*>(operation), exceptionTarget); >+ return callOperation( >+ state, usedRegisters, jit, codeOrigin, exceptionTarget, FunctionPtr(operation), InvalidGPRReg, >+ CCallHelpers::TrustedImmPtr(stubInfo), value, object, CCallHelpers::TrustedImmPtr(uid)); > } > > } } // namespace JSC::FTL >Index: Source/JavaScriptCore/ftl/FTLSlowPathCall.h >=================================================================== >--- Source/JavaScriptCore/ftl/FTLSlowPathCall.h (revision 190735) >+++ Source/JavaScriptCore/ftl/FTLSlowPathCall.h (working copy) >@@ -55,7 +55,51 @@ private: > SlowPathCallKey m_key; > }; > >+// This will be an RAII thingy that will set up the necessary stack sizes and offsets and such. >+class SlowPathCallContext { >+public: >+ SlowPathCallContext(RegisterSet usedRegisters, CCallHelpers&, unsigned numArgs, GPRReg returnRegister); >+ ~SlowPathCallContext(); >+ >+ SlowPathCall makeCall(void* callTarget, MacroAssembler::JumpList* exceptionTarget); >+ >+private: >+ SlowPathCallKey keyWithTarget(void* callTarget) const; >+ >+ RegisterSet m_argumentRegisters; >+ RegisterSet m_callingConventionRegisters; >+ CCallHelpers& m_jit; >+ unsigned m_numArgs; >+ GPRReg m_returnRegister; >+ size_t m_offsetToSavingArea; >+ size_t m_stackBytesNeeded; >+ RegisterSet m_thunkSaveSet; >+ ptrdiff_t m_offset; >+}; >+ >+template<typename... ArgumentTypes> >+SlowPathCall callOperationImpl( >+ const RegisterSet& usedRegisters, CCallHelpers& jit, CCallHelpers::JumpList* exceptionTarget, >+ FunctionPtr function, GPRReg result, ArgumentTypes... arguments) >+{ >+ SlowPathCallContext context(usedRegisters, jit, sizeof...(ArgumentTypes) + 1, result); >+ jit.setupArgumentsWithExecState(arguments...); >+ return context.makeCall(function.value(), exceptionTarget); >+} >+ > void storeCodeOrigin(State&, CCallHelpers&, CodeOrigin); >+void registerSlowPathCall(State&, SlowPathCall); >+ >+template<typename... ArgumentTypes> >+MacroAssembler::Call callOperation( >+ State& state, const RegisterSet& usedRegisters, CCallHelpers& jit, CodeOrigin codeOrigin, >+ CCallHelpers::JumpList* exceptionTarget, FunctionPtr function, GPRReg result, ArgumentTypes... arguments) >+{ >+ storeCodeOrigin(state, jit, codeOrigin); >+ SlowPathCall call = callOperationImpl(usedRegisters, jit, exceptionTarget, function, result, arguments...); >+ registerSlowPathCall(state, call); >+ return call.call(); >+} > > MacroAssembler::Call callOperation( > State&, const RegisterSet&, CCallHelpers&, CodeOrigin, CCallHelpers::JumpList*, >Index: Source/WTF/wtf/StdLibExtras.h >=================================================================== >--- Source/WTF/wtf/StdLibExtras.h (revision 190735) >+++ Source/WTF/wtf/StdLibExtras.h (working copy) >@@ -287,6 +287,30 @@ inline void insertIntoBoundedVector(Vect > // https://bugs.webkit.org/show_bug.cgi?id=131815 > WTF_EXPORT_PRIVATE bool isCompilationThread(); > >+template<unsigned index> >+struct TupleApplicator { >+ template<typename Functor, typename... TupleTypes, typename... ArgTypes> >+ void apply(const Functor& functor, const std::tuple<TupleTypes...>& tuple, ArgTypes... argTypes) >+ { >+ TupleApplicator<index - 1>::apply(functor, tuple, argTypes..., std::get<sizeof...(TupleTypes) - index>(tuple)); >+ } >+}; >+ >+template<> >+struct TupleApplicator<0> { >+ template<typename Functor, typename... TupleTypes, typename... ArgTypes> >+ void apply(const Functor& functor, const std::tuple<TupleTypes...>&, ArgTypes... argTypes) >+ { >+ functor(argTypes...); >+ } >+}; >+ >+template<typename Functor, typename... TupleTypes> >+void tupleApply(const Functor& functor, const std::tuple<TupleTypes...>& tuple) >+{ >+ TupleApplicator<sizeof...(TupleTypes)>::apply(functor, tuple); >+} >+ > } // namespace WTF > > // This version of placement new omits a 0 check. >@@ -392,6 +416,7 @@ using WTF::tryBinarySearch; > using WTF::approximateBinarySearch; > using WTF::bitwise_cast; > using WTF::safeCast; >+using WTF::tupleApply; > > #if COMPILER_SUPPORTS(CXX_USER_LITERALS) > // We normally don't want to bring in entire std namespaces, but literals are an exception.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 149936
:
262717
|
262735
|
262741
|
262786
|
262792
|
262832
|
262833
|
262841
|
262843
|
262844