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/bytecode/ValueRecovery.h

    r155575 r155820  
    3636namespace JSC {
    3737
     38struct DumpContext;
     39
    3840// Describes how to recover a given bytecode virtual register at a given
    3941// code point.
     
    275277    }
    276278   
    277     void dump(PrintStream& out) const
     279    void dumpInContext(PrintStream& out, DumpContext* context) const
    278280    {
    279281        switch (technique()) {
    280282        case AlreadyInJSStack:
    281283            out.printf("-");
    282             break;
     284            return;
    283285        case AlreadyInJSStackAsUnboxedInt32:
    284286            out.printf("(int32)");
    285             break;
     287            return;
    286288        case AlreadyInJSStackAsUnboxedCell:
    287289            out.printf("(cell)");
    288             break;
     290            return;
    289291        case AlreadyInJSStackAsUnboxedBoolean:
    290292            out.printf("(bool)");
    291             break;
     293            return;
    292294        case AlreadyInJSStackAsUnboxedDouble:
    293295            out.printf("(double)");
    294             break;
     296            return;
    295297        case InGPR:
    296298            out.printf("%%r%d", gpr());
    297             break;
     299            return;
    298300        case UnboxedInt32InGPR:
    299301            out.printf("int32(%%r%d)", gpr());
    300             break;
     302            return;
    301303        case UnboxedBooleanInGPR:
    302304            out.printf("bool(%%r%d)", gpr());
    303             break;
     305            return;
    304306        case UInt32InGPR:
    305307            out.printf("uint32(%%r%d)", gpr());
    306             break;
     308            return;
    307309        case InFPR:
    308310            out.printf("%%fr%d", fpr());
    309             break;
     311            return;
    310312#if USE(JSVALUE32_64)
    311313        case InPair:
    312314            out.printf("pair(%%r%d, %%r%d)", tagGPR(), payloadGPR());
    313             break;
     315            return;
    314316#endif
    315317        case DisplacedInJSStack:
    316318            out.printf("*%d", virtualRegister());
    317             break;
     319            return;
    318320        case Int32DisplacedInJSStack:
    319321            out.printf("*int32(%d)", virtualRegister());
    320             break;
     322            return;
    321323        case DoubleDisplacedInJSStack:
    322324            out.printf("*double(%d)", virtualRegister());
    323             break;
     325            return;
    324326        case CellDisplacedInJSStack:
    325327            out.printf("*cell(%d)", virtualRegister());
    326             break;
     328            return;
    327329        case BooleanDisplacedInJSStack:
    328330            out.printf("*bool(%d)", virtualRegister());
    329             break;
     331            return;
    330332        case ArgumentsThatWereNotCreated:
    331333            out.printf("arguments");
    332             break;
     334            return;
    333335        case Constant:
    334             out.print("[", constant(), "]");
    335             break;
     336            out.print("[", inContext(constant(), context), "]");
     337            return;
    336338        case DontKnow:
    337339            out.printf("!");
    338             break;
    339         default:
    340             out.printf("?%d", technique());
    341             break;
     340            return;
    342341        }
     342        RELEASE_ASSERT_NOT_REACHED();
     343    }
     344   
     345    void dump(PrintStream& out) const
     346    {
     347        dumpInContext(out, 0);
    343348    }
    344349   
Note: See TracChangeset for help on using the changeset viewer.