Changeset 239788 in webkit


Ignore:
Timestamp:
Jan 9, 2019, 3:03:23 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

Restore bytecode dumper's ability to dump jump target as offset#(->targetBytecodeIndex#).
https://bugs.webkit.org/show_bug.cgi?id=193300

Reviewed by Saam Barati.

For example, instead of:

[ 95] jtrue loc11, 9

We can now again (as before the bytecode format rewrite) have:

[ 95] jtrue loc11, 9(->104)

  • bytecode/BytecodeDumper.cpp:

(JSC::BytecodeDumper<Block>::printLocationAndOp):

  • bytecode/BytecodeDumper.h:

(JSC::BytecodeDumper::dumpValue):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r239787 r239788  
     12019-01-09  Mark Lam  <mark.lam@apple.com>
     2
     3        Restore bytecode dumper's ability to dump jump target as offset#(->targetBytecodeIndex#).
     4        https://bugs.webkit.org/show_bug.cgi?id=193300
     5
     6        Reviewed by Saam Barati.
     7
     8        For example, instead of:
     9            [  95] jtrue              loc11, 9
     10        We can now again (as before the bytecode format rewrite) have:
     11            [  95] jtrue              loc11, 9(->104)
     12
     13        * bytecode/BytecodeDumper.cpp:
     14        (JSC::BytecodeDumper<Block>::printLocationAndOp):
     15        * bytecode/BytecodeDumper.h:
     16        (JSC::BytecodeDumper::dumpValue):
     17
    1182019-01-09  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/bytecode/BytecodeDumper.cpp

    r237547 r239788  
    8080void BytecodeDumper<Block>::printLocationAndOp(InstructionStream::Offset location, const char* op)
    8181{
     82    m_currentLocation = location;
    8283    m_out.printf("[%4u] %-18s ", location, op);
    8384}
  • trunk/Source/JavaScriptCore/bytecode/BytecodeDumper.h

    r237933 r239788  
    5454
    5555    void dumpValue(VirtualRegister reg) { m_out.printf("%s", registerName(reg.offset()).data()); }
    56     void dumpValue(BoundLabel label) { m_out.print(label.target()); }
     56    void dumpValue(BoundLabel label)
     57    {
     58        InstructionStream::Offset targetOffset = label.target() + m_currentLocation;
     59        m_out.print(label.target(), "(->", targetOffset, ")");
     60    }
    5761    template<typename T>
    5862    void dumpValue(T v) { m_out.print(v); }
     
    8488    Block* m_block;
    8589    PrintStream& m_out;
     90    InstructionStream::Offset m_currentLocation { 0 };
    8691};
    8792
Note: See TracChangeset for help on using the changeset viewer.