Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (213656 => 213657)
--- trunk/Source/_javascript_Core/ChangeLog 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-03-09 21:05:41 UTC (rev 213657)
@@ -1,3 +1,41 @@
+2017-03-09 Mark Lam <[email protected]>
+
+ Use const AbstractLocker& (instead of const LockHolder&) in more places.
+ https://bugs.webkit.org/show_bug.cgi?id=169424
+
+ Reviewed by Filip Pizlo.
+
+ * heap/CodeBlockSet.cpp:
+ (JSC::CodeBlockSet::promoteYoungCodeBlocks):
+ * heap/CodeBlockSet.h:
+ * heap/CodeBlockSetInlines.h:
+ (JSC::CodeBlockSet::mark):
+ * heap/ConservativeRoots.cpp:
+ (JSC::CompositeMarkHook::CompositeMarkHook):
+ * heap/MachineStackMarker.cpp:
+ (JSC::MachineThreads::tryCopyOtherThreadStacks):
+ * heap/MachineStackMarker.h:
+ * profiler/ProfilerDatabase.cpp:
+ (JSC::Profiler::Database::ensureBytecodesFor):
+ * profiler/ProfilerDatabase.h:
+ * runtime/SamplingProfiler.cpp:
+ (JSC::FrameWalker::FrameWalker):
+ (JSC::CFrameWalker::CFrameWalker):
+ (JSC::SamplingProfiler::createThreadIfNecessary):
+ (JSC::SamplingProfiler::takeSample):
+ (JSC::SamplingProfiler::start):
+ (JSC::SamplingProfiler::pause):
+ (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread):
+ (JSC::SamplingProfiler::clearData):
+ (JSC::SamplingProfiler::releaseStackTraces):
+ * runtime/SamplingProfiler.h:
+ (JSC::SamplingProfiler::setStopWatch):
+ * wasm/WasmMemory.cpp:
+ (JSC::Wasm::availableFastMemories):
+ (JSC::Wasm::activeFastMemories):
+ (JSC::Wasm::viewActiveFastMemories):
+ * wasm/WasmMemory.h:
+
2017-03-09 Saam Barati <[email protected]>
WebAssembly: Make the Unity AngryBots demo run
Modified: trunk/Source/_javascript_Core/heap/CodeBlockSet.cpp (213656 => 213657)
--- trunk/Source/_javascript_Core/heap/CodeBlockSet.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/heap/CodeBlockSet.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -47,7 +47,7 @@
ASSERT_UNUSED(isNewEntry, isNewEntry);
}
-void CodeBlockSet::promoteYoungCodeBlocks(const LockHolder&)
+void CodeBlockSet::promoteYoungCodeBlocks(const AbstractLocker&)
{
ASSERT(m_lock.isLocked());
m_oldCodeBlocks.add(m_newCodeBlocks.begin(), m_newCodeBlocks.end());
Modified: trunk/Source/_javascript_Core/heap/CodeBlockSet.h (213656 => 213657)
--- trunk/Source/_javascript_Core/heap/CodeBlockSet.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/heap/CodeBlockSet.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -62,9 +62,9 @@
// Mark a pointer that may be a CodeBlock that belongs to the set of DFG
// blocks. This is defined in CodeBlock.h.
private:
- void mark(const LockHolder&, CodeBlock* candidateCodeBlock);
+ void mark(const AbstractLocker&, CodeBlock* candidateCodeBlock);
public:
- void mark(const LockHolder&, void* candidateCodeBlock);
+ void mark(const AbstractLocker&, void* candidateCodeBlock);
// Delete all code blocks that are only referenced by this set (i.e. owned
// by this set), and that have not been marked.
@@ -86,7 +86,7 @@
void dump(PrintStream&) const;
private:
- void promoteYoungCodeBlocks(const LockHolder&);
+ void promoteYoungCodeBlocks(const AbstractLocker&);
HashSet<CodeBlock*> m_oldCodeBlocks;
HashSet<CodeBlock*> m_newCodeBlocks;
Modified: trunk/Source/_javascript_Core/heap/CodeBlockSetInlines.h (213656 => 213657)
--- trunk/Source/_javascript_Core/heap/CodeBlockSetInlines.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/heap/CodeBlockSetInlines.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -33,7 +33,7 @@
namespace JSC {
-inline void CodeBlockSet::mark(const LockHolder& locker, void* candidateCodeBlock)
+inline void CodeBlockSet::mark(const AbstractLocker& locker, void* candidateCodeBlock)
{
ASSERT(m_lock.isLocked());
// We have to check for 0 and -1 because those are used by the HashMap as markers.
@@ -52,7 +52,7 @@
mark(locker, codeBlock);
}
-inline void CodeBlockSet::mark(const LockHolder&, CodeBlock* codeBlock)
+inline void CodeBlockSet::mark(const AbstractLocker&, CodeBlock* codeBlock)
{
if (!codeBlock)
return;
Modified: trunk/Source/_javascript_Core/heap/ConservativeRoots.cpp (213656 => 213657)
--- trunk/Source/_javascript_Core/heap/ConservativeRoots.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/heap/ConservativeRoots.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -117,7 +117,7 @@
class CompositeMarkHook {
public:
- CompositeMarkHook(JITStubRoutineSet& stubRoutines, CodeBlockSet& codeBlocks, const LockHolder& locker)
+ CompositeMarkHook(JITStubRoutineSet& stubRoutines, CodeBlockSet& codeBlocks, const AbstractLocker& locker)
: m_stubRoutines(stubRoutines)
, m_codeBlocks(codeBlocks)
, m_codeBlocksLocker(locker)
@@ -133,7 +133,7 @@
private:
JITStubRoutineSet& m_stubRoutines;
CodeBlockSet& m_codeBlocks;
- const LockHolder& m_codeBlocksLocker;
+ const AbstractLocker& m_codeBlocksLocker;
};
void ConservativeRoots::add(
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (213656 => 213657)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -928,7 +928,7 @@
thread->freeRegisters(registers);
}
-bool MachineThreads::tryCopyOtherThreadStacks(LockHolder&, void* buffer, size_t capacity, size_t* size)
+bool MachineThreads::tryCopyOtherThreadStacks(const AbstractLocker&, void* buffer, size_t capacity, size_t* size)
{
// Prevent two VMs from suspending each other's threads at the same time,
// which can cause deadlock: <rdar://problem/20300842>.
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.h (213656 => 213657)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -142,7 +142,7 @@
void gatherFromCurrentThread(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, CurrentThreadState&);
void tryCopyOtherThreadStack(Thread*, void*, size_t capacity, size_t*);
- bool tryCopyOtherThreadStacks(LockHolder&, void*, size_t capacity, size_t*);
+ bool tryCopyOtherThreadStacks(const AbstractLocker&, void*, size_t capacity, size_t*);
static void THREAD_SPECIFIC_CALL removeThread(void*);
Modified: trunk/Source/_javascript_Core/profiler/ProfilerDatabase.cpp (213656 => 213657)
--- trunk/Source/_javascript_Core/profiler/ProfilerDatabase.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/profiler/ProfilerDatabase.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -62,7 +62,7 @@
return ensureBytecodesFor(locker, codeBlock);
}
-Bytecodes* Database::ensureBytecodesFor(const LockHolder&, CodeBlock* codeBlock)
+Bytecodes* Database::ensureBytecodesFor(const AbstractLocker&, CodeBlock* codeBlock)
{
codeBlock = codeBlock->baselineAlternative();
Modified: trunk/Source/_javascript_Core/profiler/ProfilerDatabase.h (213656 => 213657)
--- trunk/Source/_javascript_Core/profiler/ProfilerDatabase.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/profiler/ProfilerDatabase.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -72,7 +72,7 @@
JS_EXPORT_PRIVATE void logEvent(CodeBlock* codeBlock, const char* summary, const CString& detail);
private:
- Bytecodes* ensureBytecodesFor(const LockHolder&, CodeBlock*);
+ Bytecodes* ensureBytecodesFor(const AbstractLocker&, CodeBlock*);
void addDatabaseToAtExit();
void removeDatabaseFromAtExit();
Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (213656 => 213657)
--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -81,7 +81,7 @@
class FrameWalker {
public:
- FrameWalker(VM& vm, ExecState* callFrame, const LockHolder& codeBlockSetLocker, const LockHolder& machineThreadsLocker)
+ FrameWalker(VM& vm, ExecState* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker)
: m_vm(vm)
, m_callFrame(callFrame)
, m_vmEntryFrame(vm.topVMEntryFrame)
@@ -190,8 +190,8 @@
VM& m_vm;
ExecState* m_callFrame;
VMEntryFrame* m_vmEntryFrame;
- const LockHolder& m_codeBlockSetLocker;
- const LockHolder& m_machineThreadsLocker;
+ const AbstractLocker& m_codeBlockSetLocker;
+ const AbstractLocker& m_machineThreadsLocker;
bool m_bailingOut { false };
size_t m_depth { 0 };
};
@@ -200,7 +200,7 @@
public:
typedef FrameWalker Base;
- CFrameWalker(VM& vm, void* machineFrame, ExecState* callFrame, const LockHolder& codeBlockSetLocker, const LockHolder& machineThreadsLocker)
+ CFrameWalker(VM& vm, void* machineFrame, ExecState* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker)
: Base(vm, callFrame, codeBlockSetLocker, machineThreadsLocker)
, m_machineFrame(machineFrame)
{
@@ -296,7 +296,7 @@
{
}
-void SamplingProfiler::createThreadIfNecessary(const LockHolder&)
+void SamplingProfiler::createThreadIfNecessary(const AbstractLocker&)
{
ASSERT(m_lock.isLocked());
@@ -334,7 +334,7 @@
}
}
-void SamplingProfiler::takeSample(const LockHolder&, std::chrono::microseconds& stackTraceProcessingTime)
+void SamplingProfiler::takeSample(const AbstractLocker&, std::chrono::microseconds& stackTraceProcessingTime)
{
ASSERT(m_lock.isLocked());
if (m_vm.entryScope) {
@@ -659,7 +659,7 @@
start(locker);
}
-void SamplingProfiler::start(const LockHolder& locker)
+void SamplingProfiler::start(const AbstractLocker& locker)
{
ASSERT(m_lock.isLocked());
m_isPaused = false;
@@ -666,7 +666,7 @@
createThreadIfNecessary(locker);
}
-void SamplingProfiler::pause(const LockHolder&)
+void SamplingProfiler::pause(const AbstractLocker&)
{
ASSERT(m_lock.isLocked());
m_isPaused = true;
@@ -673,7 +673,7 @@
reportStats();
}
-void SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread(const LockHolder&)
+void SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread(const AbstractLocker&)
{
ASSERT(m_lock.isLocked());
m_jscExecutionThread = m_vm.heap.machineThreads().machineThreadForCurrentThread();
@@ -700,7 +700,7 @@
createThreadIfNecessary(locker);
}
-void SamplingProfiler::clearData(const LockHolder&)
+void SamplingProfiler::clearData(const AbstractLocker&)
{
ASSERT(m_lock.isLocked());
m_stackTraces.clear();
@@ -858,7 +858,7 @@
return url;
}
-Vector<SamplingProfiler::StackTrace> SamplingProfiler::releaseStackTraces(const LockHolder& locker)
+Vector<SamplingProfiler::StackTrace> SamplingProfiler::releaseStackTraces(const AbstractLocker& locker)
{
ASSERT(m_lock.isLocked());
{
Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.h (213656 => 213657)
--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -166,15 +166,15 @@
Lock& getLock() { return m_lock; }
void setTimingInterval(std::chrono::microseconds interval) { m_timingInterval = interval; }
JS_EXPORT_PRIVATE void start();
- void start(const LockHolder&);
- Vector<StackTrace> releaseStackTraces(const LockHolder&);
+ void start(const AbstractLocker&);
+ Vector<StackTrace> releaseStackTraces(const AbstractLocker&);
JS_EXPORT_PRIVATE String stackTracesAsJSON();
JS_EXPORT_PRIVATE void noticeCurrentThreadAsJSCExecutionThread();
- void noticeCurrentThreadAsJSCExecutionThread(const LockHolder&);
+ void noticeCurrentThreadAsJSCExecutionThread(const AbstractLocker&);
void processUnverifiedStackTraces(); // You should call this only after acquiring the lock.
- void setStopWatch(const LockHolder&, Ref<Stopwatch>&& stopwatch) { m_stopwatch = WTFMove(stopwatch); }
- void pause(const LockHolder&);
- void clearData(const LockHolder&);
+ void setStopWatch(const AbstractLocker&, Ref<Stopwatch>&& stopwatch) { m_stopwatch = WTFMove(stopwatch); }
+ void pause(const AbstractLocker&);
+ void clearData(const AbstractLocker&);
// Used for debugging in the JSC shell/DRT.
void registerForReportAtExit();
@@ -185,9 +185,9 @@
JS_EXPORT_PRIVATE void reportTopBytecodes(PrintStream&);
private:
- void createThreadIfNecessary(const LockHolder&);
+ void createThreadIfNecessary(const AbstractLocker&);
void timerLoop();
- void takeSample(const LockHolder&, std::chrono::microseconds& stackTraceProcessingTime);
+ void takeSample(const AbstractLocker&, std::chrono::microseconds& stackTraceProcessingTime);
VM& m_vm;
RefPtr<Stopwatch> m_stopwatch;
Modified: trunk/Source/_javascript_Core/wasm/WasmMemory.cpp (213656 => 213657)
--- trunk/Source/_javascript_Core/wasm/WasmMemory.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/wasm/WasmMemory.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -68,19 +68,19 @@
static const unsigned maxFastMemories = 4;
static unsigned allocatedFastMemories { 0 };
StaticLock memoryLock;
-inline Deque<void*, maxFastMemories>& availableFastMemories(const LockHolder&)
+inline Deque<void*, maxFastMemories>& availableFastMemories(const AbstractLocker&)
{
static NeverDestroyed<Deque<void*, maxFastMemories>> availableFastMemories;
return availableFastMemories;
}
-inline HashSet<void*>& activeFastMemories(const LockHolder&)
+inline HashSet<void*>& activeFastMemories(const AbstractLocker&)
{
static NeverDestroyed<HashSet<void*>> activeFastMemories;
return activeFastMemories;
}
-const HashSet<void*>& viewActiveFastMemories(const LockHolder& locker)
+const HashSet<void*>& viewActiveFastMemories(const AbstractLocker& locker)
{
return activeFastMemories(locker);
}
Modified: trunk/Source/_javascript_Core/wasm/WasmMemory.h (213656 => 213657)
--- trunk/Source/_javascript_Core/wasm/WasmMemory.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/_javascript_Core/wasm/WasmMemory.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -98,7 +98,7 @@
const size_t fastMemoryMappedBytes = (static_cast<size_t>(std::numeric_limits<uint32_t>::max()) + 1) * 2; // pointer max + offset max. This is all we need since a load straddling readable memory will trap.
extern StaticLock memoryLock;
-const HashSet<void*>& viewActiveFastMemories(const LockHolder&);
+const HashSet<void*>& viewActiveFastMemories(const AbstractLocker&);
} } // namespace JSC::Wasm
Modified: trunk/Source/WTF/ChangeLog (213656 => 213657)
--- trunk/Source/WTF/ChangeLog 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/WTF/ChangeLog 2017-03-09 21:05:41 UTC (rev 213657)
@@ -1,5 +1,17 @@
2017-03-09 Mark Lam <[email protected]>
+ Use const AbstractLocker& (instead of const LockHolder&) in more places.
+ https://bugs.webkit.org/show_bug.cgi?id=169424
+
+ Reviewed by Filip Pizlo.
+
+ * wtf/RunLoop.h:
+ * wtf/generic/RunLoopGeneric.cpp:
+ (WTF::RunLoop::wakeUp):
+ (WTF::RunLoop::schedule):
+
+2017-03-09 Mark Lam <[email protected]>
+
Make the VM Traps mechanism non-polling for the DFG and FTL.
https://bugs.webkit.org/show_bug.cgi?id=168920
<rdar://problem/30738588>
Modified: trunk/Source/WTF/wtf/RunLoop.h (213656 => 213657)
--- trunk/Source/WTF/wtf/RunLoop.h 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/WTF/wtf/RunLoop.h 2017-03-09 21:05:41 UTC (rev 213657)
@@ -167,8 +167,8 @@
GRefPtr<GSource> m_source;
#elif USE(GENERIC_EVENT_LOOP)
void schedule(RefPtr<TimerBase::ScheduledTask>&&);
- void schedule(const LockHolder&, RefPtr<TimerBase::ScheduledTask>&&);
- void wakeUp(const LockHolder&);
+ void schedule(const AbstractLocker&, RefPtr<TimerBase::ScheduledTask>&&);
+ void wakeUp(const AbstractLocker&);
void scheduleAndWakeUp(RefPtr<TimerBase::ScheduledTask>);
enum class RunMode {
Modified: trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp (213656 => 213657)
--- trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp 2017-03-09 20:47:10 UTC (rev 213656)
+++ trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp 2017-03-09 21:05:41 UTC (rev 213657)
@@ -206,7 +206,7 @@
}
}
-void RunLoop::wakeUp(const LockHolder&)
+void RunLoop::wakeUp(const AbstractLocker&)
{
m_pendingTasks = true;
m_readyToRun.notifyOne();
@@ -218,7 +218,7 @@
wakeUp(locker);
}
-void RunLoop::schedule(const LockHolder&, RefPtr<TimerBase::ScheduledTask>&& task)
+void RunLoop::schedule(const AbstractLocker&, RefPtr<TimerBase::ScheduledTask>&& task)
{
m_schedules.append(WTFMove(task));
std::push_heap(m_schedules.begin(), m_schedules.end(), TimerBase::ScheduledTask::EarliestSchedule());