Changeset 262161 in webkit
- Timestamp:
- May 26, 2020 2:32:50 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r262147 r262161 1 2020-05-26 Mark Lam <mark.lam@apple.com> 2 3 SamplingProfiler::takeSample() should not assume that ENABLE(WEBASSEMBLY) means Wasm is enabled. 4 https://bugs.webkit.org/show_bug.cgi?id=212382 5 6 Reviewed by Saam Barati. 7 8 Wasm can still be disabled at runtime with JSC options. Fixing this will allow 9 sampling profiler tests to run with JSC_useJIT=0 without crashing. 10 11 * runtime/SamplingProfiler.cpp: 12 (JSC::FrameWalker::FrameWalker): 13 (JSC::FrameWalker::recordJITFrame): 14 (JSC::CFrameWalker::CFrameWalker): 15 (JSC::SamplingProfiler::takeSample): 16 1 17 2020-05-26 Keith Rollin <krollin@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp
r261895 r262161 1 1 /* 2 * Copyright (C) 2016-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2016-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 43 43 #include "WasmCallee.h" 44 44 #include "WasmCalleeRegistry.h" 45 #include "WasmCapabilities.h" 45 46 #include <wtf/FilePrintStream.h> 46 47 #include <wtf/HashSet.h> … … 74 75 class FrameWalker { 75 76 public: 76 FrameWalker(VM& vm, CallFrame* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker, const AbstractLocker& wasmCalleeLocker)77 FrameWalker(VM& vm, CallFrame* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker, const Optional<LockHolder>& wasmCalleeLocker) 77 78 : m_vm(vm) 78 79 , m_callFrame(callFrame) … … 122 123 stackTrace[m_depth] = UnprocessedStackFrame(codeBlock, unsafeCallee, callSiteIndex); 123 124 #if ENABLE(WEBASSEMBLY) 124 if ( unsafeCallee.isWasm()) {125 if (Wasm::isSupported() && unsafeCallee.isWasm()) { 125 126 auto* wasmCallee = unsafeCallee.asWasmCallee(); 126 if (Wasm::CalleeRegistry::singleton().isValidCallee( m_wasmCalleeLocker, wasmCallee)) {127 if (Wasm::CalleeRegistry::singleton().isValidCallee(*m_wasmCalleeLocker, wasmCallee)) { 127 128 // At this point, Wasm::Callee would be dying (ref count is 0), but its fields are still live. 128 129 // And we can safely copy Wasm::IndexOrName even when any lock is held by suspended threads. … … 200 201 const AbstractLocker& m_codeBlockSetLocker; 201 202 const AbstractLocker& m_machineThreadsLocker; 202 const AbstractLocker& m_wasmCalleeLocker;203 const Optional<LockHolder>& m_wasmCalleeLocker; 203 204 bool m_bailingOut { false }; 204 205 size_t m_depth { 0 }; … … 209 210 typedef FrameWalker Base; 210 211 211 CFrameWalker(VM& vm, void* machineFrame, CallFrame* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker, const AbstractLocker& wasmCalleeLocker)212 CFrameWalker(VM& vm, void* machineFrame, CallFrame* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker, const Optional<LockHolder>& wasmCalleeLocker) 212 213 : Base(vm, callFrame, codeBlockSetLocker, machineThreadsLocker, wasmCalleeLocker) 213 214 , m_machineFrame(machineFrame) … … 352 353 auto codeBlockSetLocker = holdLock(m_vm.heap.codeBlockSet().getLock()); 353 354 auto executableAllocatorLocker = holdLock(ExecutableAllocator::singleton().getLock()); 355 Optional<LockHolder> wasmCalleesLocker; 354 356 #if ENABLE(WEBASSEMBLY) 355 auto wasmCalleesLocker = holdLock(Wasm::CalleeRegistry::singleton().getLock()); 356 #else 357 LockHolder wasmCalleesLocker(NoLockingNecessary); 357 if (Wasm::isSupported()) 358 wasmCalleesLocker = holdLock(Wasm::CalleeRegistry::singleton().getLock()); 358 359 #endif 359 360
Note: See TracChangeset
for help on using the changeset viewer.