Skip to content

Commit b4ff70c

Browse files
Xan Lopezwebkit-commit-queue
authored andcommitted
[JSC] Small cleanup in StackVisitor::readNonInlinedFrame
https://bugs.webkit.org/show_bug.cgi?id=221259 Patch by Xan Lopez <xan@igalia.com> on 2021-02-02 Reviewed by Yusuke Suzuki. isAnyWasmCallee() will never be true if WebAssembly is disabled at compile time, so we can move a good chunk of code inside the USE(WEBASSEMBLY) check. Also move all constant initializations at the beginning of the method, and remove an unnecessary extra variable. * interpreter/StackVisitor.cpp: (JSC::StackVisitor::readNonInlinedFrame): Canonical link: https://commits.webkit.org/233595@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 26ff229 commit b4ff70c

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

Source/JavaScriptCore/ChangeLog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2021-02-02 Xan Lopez <xan@igalia.com>
2+
3+
[JSC] Small cleanup in StackVisitor::readNonInlinedFrame
4+
https://bugs.webkit.org/show_bug.cgi?id=221259
5+
6+
Reviewed by Yusuke Suzuki.
7+
8+
isAnyWasmCallee() will never be true if WebAssembly is disabled at
9+
compile time, so we can move a good chunk of code inside the
10+
USE(WEBASSEMBLY) check. Also move all constant initializations at
11+
the beginning of the method, and remove an unnecessary extra
12+
variable.
13+
14+
* interpreter/StackVisitor.cpp:
15+
(JSC::StackVisitor::readNonInlinedFrame):
16+
117
2021-02-02 BJ Burg <bburg@apple.com>
218

319
Web Inspector: implement the basics for showing/hiding grid overlays

Source/JavaScriptCore/interpreter/StackVisitor.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -161,30 +161,28 @@ void StackVisitor::readNonInlinedFrame(CallFrame* callFrame, CodeOrigin* codeOri
161161
m_frame.m_callerFrame = callFrame->callerFrame(m_frame.m_callerEntryFrame);
162162
m_frame.m_callerIsEntryFrame = m_frame.m_callerEntryFrame != m_frame.m_entryFrame;
163163
m_frame.m_isWasmFrame = false;
164+
m_frame.m_callee = callFrame->callee();
165+
#if ENABLE(DFG_JIT)
166+
m_frame.m_inlineCallFrame = nullptr;
167+
#endif
164168

165-
CalleeBits callee = callFrame->callee();
166-
m_frame.m_callee = callee;
167-
169+
#if ENABLE(WEBASSEMBLY)
168170
if (callFrame->isAnyWasmCallee()) {
169171
m_frame.m_isWasmFrame = true;
170172
m_frame.m_codeBlock = nullptr;
171173
m_frame.m_bytecodeIndex = BytecodeIndex();
172-
#if ENABLE(WEBASSEMBLY)
173-
CalleeBits bits = callFrame->callee();
174-
if (bits.isWasm())
175-
m_frame.m_wasmFunctionIndexOrName = bits.asWasmCallee()->indexOrName();
176-
#endif
177-
} else {
178-
m_frame.m_codeBlock = callFrame->codeBlock();
179-
m_frame.m_bytecodeIndex = !m_frame.codeBlock() ? BytecodeIndex(0)
180-
: codeOrigin ? codeOrigin->bytecodeIndex()
181-
: callFrame->bytecodeIndex();
182174

183-
}
175+
if (m_frame.m_callee.isWasm())
176+
m_frame.m_wasmFunctionIndexOrName = m_frame.m_callee.asWasmCallee()->indexOrName();
184177

185-
#if ENABLE(DFG_JIT)
186-
m_frame.m_inlineCallFrame = nullptr;
178+
return;
179+
}
187180
#endif
181+
m_frame.m_codeBlock = callFrame->codeBlock();
182+
m_frame.m_bytecodeIndex = !m_frame.codeBlock() ? BytecodeIndex(0)
183+
: codeOrigin ? codeOrigin->bytecodeIndex()
184+
: callFrame->bytecodeIndex();
185+
188186
}
189187

190188
#if ENABLE(DFG_JIT)

0 commit comments

Comments
 (0)