Ignore:
Timestamp:
Feb 2, 2015, 3:32:00 PM (10 years ago)
Author:
[email protected]
Message:

VirtualRegister should really know how to dump itself
https://bugs.webkit.org/show_bug.cgi?id=141171

Reviewed by Geoffrey Garen.

Gives VirtualRegister a dump() method that pretty-prints the virtual register. The rest of
the patch is all about using this new power.

(JSC::constantName):
(JSC::CodeBlock::registerName):

  • bytecode/CodeBlock.h:

(JSC::missingThisObjectMarker): Deleted.

  • bytecode/VirtualRegister.cpp: Added.

(JSC::VirtualRegister::dump):

  • bytecode/VirtualRegister.h:

(WTF::printInternal): Deleted.

  • dfg/DFGArgumentPosition.h:

(JSC::DFG::ArgumentPosition::dump):

  • dfg/DFGFlushedAt.cpp:

(JSC::DFG::FlushedAt::dump):

  • dfg/DFGGraph.cpp:

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

  • dfg/DFGPutLocalSinkingPhase.cpp:
  • dfg/DFGSSAConversionPhase.cpp:

(JSC::DFG::SSAConversionPhase::run):

  • dfg/DFGValidate.cpp:

(JSC::DFG::Validate::reportValidationContext):

  • dfg/DFGValueSource.cpp:

(JSC::DFG::ValueSource::dump):

  • dfg/DFGVariableEvent.cpp:

(JSC::DFG::VariableEvent::dump):
(JSC::DFG::VariableEvent::dumpSpillInfo):

  • ftl/FTLExitArgumentForOperand.cpp:

(JSC::FTL::ExitArgumentForOperand::dump):

  • ftl/FTLExitValue.cpp:

(JSC::FTL::ExitValue::dumpInContext):

  • profiler/ProfilerBytecodeSequence.cpp:

(JSC::Profiler::BytecodeSequence::BytecodeSequence):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r179478 r179503  
    175175static CString constantName(int k, JSValue value)
    176176{
    177     return toCString(value, "(@k", k - FirstConstantRegisterIndex, ")");
     177    return toCString(value, "(", VirtualRegister(k), ")");
    178178}
    179179
     
    185185CString CodeBlock::registerName(int r) const
    186186{
    187     if (r == missingThisObjectMarker())
    188         return "<null>";
    189 
    190187    if (isConstantRegisterIndex(r))
    191188        return constantName(r, getConstant(r));
    192189
    193     if (operandIsArgument(r)) {
    194         if (!VirtualRegister(r).toArgument())
    195             return "this";
    196         return toCString("arg", VirtualRegister(r).toArgument());
    197     }
    198 
    199     return toCString("loc", VirtualRegister(r).toLocal());
     190    return toCString(VirtualRegister(r));
    200191}
    201192
     
    39473938        if (codeBlock->captureCount() && codeBlock->symbolTable()->isCaptured(operand)) {
    39483939            codeBlock->beginValidationDidFail();
    3949             dataLog("    At bc#", bytecodeOffset, " encountered invalid assignment to captured variable loc", virtualReg.toLocal(), ".\n");
     3940            dataLog("    At bc#", bytecodeOffset, " encountered invalid assignment to captured variable ", virtualReg, ".\n");
    39503941            codeBlock->endValidationDidFail();
    39513942            return;
Note: See TracChangeset for help on using the changeset viewer.