Changeset 249052 in webkit


Ignore:
Timestamp:
Aug 23, 2019 10:21:19 AM (5 years ago)
Author:
mark.lam@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r249036 r249052  
     12019-08-22  Mark Lam  <mark.lam@apple.com>
     2
     3        VirtualRegister::dump() can use more informative CallFrame header slot names.
     4        https://bugs.webkit.org/show_bug.cgi?id=201062
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        For example, it currently dumps head3 instead of callee.  This patch changes the
     9        dump as follows (for 64-bit addressing):
     10            head0 => callerFrame
     11            head1 => returnPC
     12            head2 => codeBlock
     13            head3 => callee
     14            head4 => argumentCount
     15
     16        Now, one might be wondering when would bytecode ever access callerFrame and
     17        returnPC?  The answer is never.  However, I don't think its the role of the
     18        dumper to catch a bug where these header slots are being used.  The dumper's role
     19        is to clearly report them so that we can see that these unexpected values are
     20        being used.
     21
     22        * bytecode/VirtualRegister.cpp:
     23        (JSC::VirtualRegister::dump const):
     24
    1252019-08-22  Andy Estes  <aestes@apple.com>
    226
  • trunk/Source/JavaScriptCore/bytecode/VirtualRegister.cpp

    r237547 r249052  
    11/*
    2  * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3939   
    4040    if (isHeader()) {
    41         out.print("head", m_virtualRegister);
     41        if (m_virtualRegister == CallFrameSlot::codeBlock)
     42            out.print("codeBlock");
     43        else if (m_virtualRegister == CallFrameSlot::callee)
     44            out.print("callee");
     45        else if (m_virtualRegister == CallFrameSlot::argumentCount)
     46            out.print("argumentCount");
     47#if CPU(ADDRESS64)
     48        else if (!m_virtualRegister)
     49            out.print("callerFrame");
     50        else if (m_virtualRegister == 1)
     51            out.print("returnPC");
     52#else
     53        else if (!m_virtualRegister)
     54            out.print("callerFrameAndReturnPC");
     55#endif
    4256        return;
    4357    }
Note: See TracChangeset for help on using the changeset viewer.