Ignore:
Timestamp:
Jul 24, 2013, 9:03:25 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: Structure should have a dump()
https://bugs.webkit.org/show_bug.cgi?id=117859

Reviewed by Geoffrey Garen.

This is pretty cool. Anywhere we previously printed Structure pointers in dumps,
we now print a bunch of other info as well. For example, for an object literal
like "{f:42, g:64, h:24}", when we print the structure we'll now get:

0x107a0af80:[Object, {f:0, g:1, h:2}, NonArray, Proto:0x107a8fff0]

This also changes a bunch of places to use the dump method.

  • bytecode/StructureSet.h:

(JSC::StructureSet::dump):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGStructureAbstractValue.h:

(JSC::DFG::StructureAbstractValue::dump):

  • runtime/JSCJSValue.cpp:

(JSC::JSValue::dump):

  • runtime/Structure.cpp:

(JSC::Structure::dump):
(JSC):

  • runtime/Structure.h:

(Structure):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp

    r153225 r153238  
    217217                out.print(" (unresolved)");
    218218            out.print(": ", impl);
    219         } else if (asCell()->inherits(&Structure::s_info)) {
    220             Structure* structure = jsCast<Structure*>(asCell());
    221             out.print(
    222                 "Structure: ", RawPointer(structure), ": ", structure->classInfo()->className,
    223                 ", ", IndexingTypeDump(structure->indexingTypeIncludingHistory()));
    224         } else {
     219        } else if (asCell()->inherits(&Structure::s_info))
     220            out.print("Structure: ", *jsCast<Structure*>(asCell()));
     221        else {
    225222            out.print("Cell: ", RawPointer(asCell()));
    226223            if (isObject() && asObject(*this)->butterfly())
    227224                out.print("->", RawPointer(asObject(*this)->butterfly()));
    228             out.print(
    229                 " (", RawPointer(asCell()->structure()), ": ", asCell()->structure()->classInfo()->className,
    230                 ", ", IndexingTypeDump(asCell()->structure()->indexingTypeIncludingHistory()), ")");
     225            out.print(" (", *asCell()->structure(), ")");
    231226        }
    232227    } else if (isTrue())
Note: See TracChangeset for help on using the changeset viewer.