Title: [272219] trunk/Source/_javascript_Core
Revision
272219
Author
[email protected]
Date
2021-02-02 10:20:19 -0800 (Tue, 02 Feb 2021)

Log Message

[JSC] Small cleanup in StackVisitor::readNonInlinedFrame
https://bugs.webkit.org/show_bug.cgi?id=221259

Patch by Xan Lopez <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (272218 => 272219)


--- trunk/Source/_javascript_Core/ChangeLog	2021-02-02 18:13:59 UTC (rev 272218)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-02-02 18:20:19 UTC (rev 272219)
@@ -1,3 +1,19 @@
+2021-02-02  Xan Lopez  <[email protected]>
+
+        [JSC] Small cleanup in StackVisitor::readNonInlinedFrame
+        https://bugs.webkit.org/show_bug.cgi?id=221259
+
+        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):
+
 2021-02-02  BJ Burg  <[email protected]>
 
         Web Inspector: implement the basics for showing/hiding grid overlays

Modified: trunk/Source/_javascript_Core/interpreter/StackVisitor.cpp (272218 => 272219)


--- trunk/Source/_javascript_Core/interpreter/StackVisitor.cpp	2021-02-02 18:13:59 UTC (rev 272218)
+++ trunk/Source/_javascript_Core/interpreter/StackVisitor.cpp	2021-02-02 18:20:19 UTC (rev 272219)
@@ -161,30 +161,28 @@
     m_frame.m_callerFrame = callFrame->callerFrame(m_frame.m_callerEntryFrame);
     m_frame.m_callerIsEntryFrame = m_frame.m_callerEntryFrame != m_frame.m_entryFrame;
     m_frame.m_isWasmFrame = false;
+    m_frame.m_callee = callFrame->callee();
+#if ENABLE(DFG_JIT)
+    m_frame.m_inlineCallFrame = nullptr;
+#endif
 
-    CalleeBits callee = callFrame->callee();
-    m_frame.m_callee = callee;
-
+#if ENABLE(WEBASSEMBLY)
     if (callFrame->isAnyWasmCallee()) {
         m_frame.m_isWasmFrame = true;
         m_frame.m_codeBlock = nullptr;
         m_frame.m_bytecodeIndex = BytecodeIndex();
-#if ENABLE(WEBASSEMBLY)
-        CalleeBits bits = callFrame->callee();
-        if (bits.isWasm())
-            m_frame.m_wasmFunctionIndexOrName = bits.asWasmCallee()->indexOrName();
-#endif
-    } else {
-        m_frame.m_codeBlock = callFrame->codeBlock();
-        m_frame.m_bytecodeIndex = !m_frame.codeBlock() ? BytecodeIndex(0)
-            : codeOrigin ? codeOrigin->bytecodeIndex()
-            : callFrame->bytecodeIndex();
 
+        if (m_frame.m_callee.isWasm())
+            m_frame.m_wasmFunctionIndexOrName = m_frame.m_callee.asWasmCallee()->indexOrName();
+
+        return;
     }
+#endif
+    m_frame.m_codeBlock = callFrame->codeBlock();
+    m_frame.m_bytecodeIndex = !m_frame.codeBlock() ? BytecodeIndex(0)
+        : codeOrigin ? codeOrigin->bytecodeIndex()
+        : callFrame->bytecodeIndex();
 
-#if ENABLE(DFG_JIT)
-    m_frame.m_inlineCallFrame = nullptr;
-#endif
 }
 
 #if ENABLE(DFG_JIT)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to