Ignore:
Timestamp:
Sep 15, 2013, 11:53:23 AM (12 years ago)
Author:
[email protected]
Message:

Deoptimize deoptimization: make DFGOSRExitCompiler64.cpp more hackable
https://bugs.webkit.org/show_bug.cgi?id=121374

Reviewed by Geoffrey Garen.

This reduces the size of DFGOSRExitCompiler64.cpp by almost 50%, and makes it
super easy to add new recovery kinds. For recoveries that involve reboxing, it
allows you to keep most of the code common between the on-stack and in-reg
cases: they all get funneled through the "load from scratch buffer, convert,
and then store to stack" logic.

This opens up a bunch of possibilities. It'll make adding Int48 much easier,
and it probably will come in handy as we do various DFG stack layout changes in
support of the FTL.

  • bytecode/ValueRecovery.h:

(JSC::ValueRecovery::dumpInContext):
(JSC::ValueRecovery::dump):

  • dfg/DFGOSRExitCompiler.cpp:

(JSC::DFG::shortOperandsDump):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp

    r153200 r155820  
    3434#include "DFGOSRExitPreparation.h"
    3535#include "LinkBuffer.h"
     36#include "OperandsInlines.h"
    3637#include "Operations.h"
    3738#include "RepatchBuffer.h"
     
    3940
    4041namespace JSC { namespace DFG {
     42
     43static CString shortOperandsDump(const Operands<ValueRecovery>& operands)
     44{
     45    DumpContext context;
     46    StringPrintStream out;
     47    out.print(inContext(operands, &context));
     48    return out.toCString();
     49}
    4150
    4251extern "C" {
     
    102111            shouldShowDisassembly(),
    103112            patchBuffer,
    104             ("DFG OSR exit #%u (%s, %s) from %s",
     113            ("DFG OSR exit #%u (%s, %s) from %s, with operands = %s",
    105114                exitIndex, toCString(exit.m_codeOrigin).data(),
    106                 exitKindToString(exit.m_kind), toCString(*codeBlock).data()));
     115                exitKindToString(exit.m_kind), toCString(*codeBlock).data(),
     116                shortOperandsDump(operands).data()));
    107117    }
    108118   
Note: See TracChangeset for help on using the changeset viewer.