Ignore:
Timestamp:
Jul 24, 2013, 8:58:38 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: Landing the initial FTL logic in a single commit to avoid spurious
broken builds.

File:
1 edited

Legend:

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

    r153116 r153121  
    5050#include "DFGValidate.h"
    5151#include "DFGVirtualRegisterAllocationPhase.h"
     52#include "FTLCapabilities.h"
     53#include "FTLCompile.h"
     54#include "FTLLowerDFGToLLVM.h"
     55#include "FTLState.h"
    5256#include "Operations.h"
    5357#include "Options.h"
     
    6064{
    6165    return numCompilations;
     66}
     67
     68static void dumpAndVerifyGraph(Graph& graph, const char* text)
     69{
     70    GraphDumpMode modeForFinalValidate = DumpGraph;
     71    if (verboseCompilationEnabled()) {
     72        dataLog(text, "\n");
     73        graph.dump();
     74        modeForFinalValidate = DontDumpGraph;
     75    }
     76    if (validationEnabled())
     77        validate(graph, modeForFinalValidate);
    6278}
    6379
     
    146162    performCPSRethreading(dfg);
    147163    performDCE(dfg);
     164
     165#if ENABLE(FTL_JIT)
     166    if (Options::useExperimentalFTL()
     167        && compileMode == CompileFunction
     168        && FTL::canCompile(dfg)) {
     169       
     170        dumpAndVerifyGraph(dfg, "Graph just before FTL lowering:");
     171       
     172        // FIXME: Support OSR entry.
     173        // https://bugs.webkit.org/show_bug.cgi?id=113625
     174       
     175        FTL::State state(dfg);
     176        FTL::lowerDFGToLLVM(state);
     177        FTL::compile(state, jitCode, *jitCodeWithArityCheck);
     178       
     179        // FIXME: Need to add support for the case where JIT memory allocation failed.
     180        // https://bugs.webkit.org/show_bug.cgi?id=113620
     181       
     182        return true;
     183    }
     184#endif // ENABLE(FTL_JIT)
     185   
    148186    performVirtualRegisterAllocation(dfg);
    149 
    150     GraphDumpMode modeForFinalValidate = DumpGraph;
    151     if (verboseCompilationEnabled()) {
    152         dataLogF("Graph after optimization:\n");
    153         dfg.dump();
    154         modeForFinalValidate = DontDumpGraph;
    155     }
    156     if (validationEnabled())
    157         validate(dfg, modeForFinalValidate);
    158    
     187    dumpAndVerifyGraph(dfg, "Graph after optimization:");
     188
    159189    JITCompiler dataFlowJIT(dfg);
    160190    bool result;
Note: See TracChangeset for help on using the changeset viewer.