Title: [249052] trunk/Source/_javascript_Core
Revision
249052
Author
mark....@apple.com
Date
2019-08-23 10:21:19 -0700 (Fri, 23 Aug 2019)

Log Message

VirtualRegister::dump() can use more informative CallFrame header slot names.
https://bugs.webkit.org/show_bug.cgi?id=201062

Reviewed by Tadeu Zagallo.

For example, it currently dumps head3 instead of callee.  This patch changes the
dump as follows (for 64-bit addressing):
    head0 => callerFrame
    head1 => returnPC
    head2 => codeBlock
    head3 => callee
    head4 => argumentCount

Now, one might be wondering when would bytecode ever access callerFrame and
returnPC?  The answer is never.  However, I don't think its the role of the
dumper to catch a bug where these header slots are being used.  The dumper's role
is to clearly report them so that we can see that these unexpected values are
being used.

* bytecode/VirtualRegister.cpp:
(JSC::VirtualRegister::dump const):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (249051 => 249052)


--- trunk/Source/_javascript_Core/ChangeLog	2019-08-23 17:15:42 UTC (rev 249051)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-08-23 17:21:19 UTC (rev 249052)
@@ -1,3 +1,27 @@
+2019-08-22  Mark Lam  <mark....@apple.com>
+
+        VirtualRegister::dump() can use more informative CallFrame header slot names.
+        https://bugs.webkit.org/show_bug.cgi?id=201062
+
+        Reviewed by Tadeu Zagallo.
+
+        For example, it currently dumps head3 instead of callee.  This patch changes the
+        dump as follows (for 64-bit addressing):
+            head0 => callerFrame
+            head1 => returnPC
+            head2 => codeBlock
+            head3 => callee
+            head4 => argumentCount
+
+        Now, one might be wondering when would bytecode ever access callerFrame and
+        returnPC?  The answer is never.  However, I don't think its the role of the
+        dumper to catch a bug where these header slots are being used.  The dumper's role
+        is to clearly report them so that we can see that these unexpected values are
+        being used.
+
+        * bytecode/VirtualRegister.cpp:
+        (JSC::VirtualRegister::dump const):
+
 2019-08-22  Andy Estes  <aes...@apple.com>
 
         [watchOS] Disable Content Filtering in the simulator build

Modified: trunk/Source/_javascript_Core/bytecode/VirtualRegister.cpp (249051 => 249052)


--- trunk/Source/_javascript_Core/bytecode/VirtualRegister.cpp	2019-08-23 17:15:42 UTC (rev 249051)
+++ trunk/Source/_javascript_Core/bytecode/VirtualRegister.cpp	2019-08-23 17:21:19 UTC (rev 249052)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,7 +38,21 @@
     }
     
     if (isHeader()) {
-        out.print("head", m_virtualRegister);
+        if (m_virtualRegister == CallFrameSlot::codeBlock)
+            out.print("codeBlock");
+        else if (m_virtualRegister == CallFrameSlot::callee)
+            out.print("callee");
+        else if (m_virtualRegister == CallFrameSlot::argumentCount)
+            out.print("argumentCount");
+#if CPU(ADDRESS64)
+        else if (!m_virtualRegister)
+            out.print("callerFrame");
+        else if (m_virtualRegister == 1)
+            out.print("returnPC");
+#else
+        else if (!m_virtualRegister)
+            out.print("callerFrameAndReturnPC");
+#endif
         return;
     }
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to