Changeset 94942 in webkit


Ignore:
Timestamp:
Sep 11, 2011 8:42:39 PM (13 years ago)
Author:
fpizlo@apple.com
Message:

DFGNode.h has macros that indicate the enabling of a feature, but
they do not use the ENABLE() idiom.
https://bugs.webkit.org/show_bug.cgi?id=67907

Reviewed by Oliver Hunt.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::stronglyPredict):
(JSC::DFG::ByteCodeParser::parse):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::predictArgumentTypes):

  • dfg/DFGJITCodeGenerator.cpp:
  • dfg/DFGJITCodeGenerator.h:
  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::fillInt32ToInteger):
(JSC::DFG::JITCompiler::jumpFromSpeculativeToNonSpeculative):
(JSC::DFG::JITCompiler::compileBody):
(JSC::DFG::JITCompiler::link):

  • dfg/DFGJITCompiler.h:
  • dfg/DFGNode.h:
  • dfg/DFGNonSpeculativeJIT.cpp:

(JSC::DFG::NonSpeculativeJIT::compile):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPropagator.cpp:

(JSC::DFG::Propagator::fixpoint):
(JSC::DFG::Propagator::propagateNode):
(JSC::DFG::Propagator::propagateForward):
(JSC::DFG::Propagator::propagateBackward):
(JSC::DFG::propagate):

  • dfg/DFGScoreBoard.h:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

Location:
trunk/Source/JavaScriptCore
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r94939 r94942  
     12011-09-11  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFGNode.h has macros that indicate the enabling of a feature, but
     4        they do not use the ENABLE() idiom.
     5        https://bugs.webkit.org/show_bug.cgi?id=67907
     6
     7        Reviewed by Oliver Hunt.
     8
     9        * dfg/DFGByteCodeParser.cpp:
     10        (JSC::DFG::ByteCodeParser::stronglyPredict):
     11        (JSC::DFG::ByteCodeParser::parse):
     12        * dfg/DFGGraph.cpp:
     13        (JSC::DFG::Graph::predictArgumentTypes):
     14        * dfg/DFGJITCodeGenerator.cpp:
     15        * dfg/DFGJITCodeGenerator.h:
     16        * dfg/DFGJITCompiler.cpp:
     17        (JSC::DFG::JITCompiler::fillInt32ToInteger):
     18        (JSC::DFG::JITCompiler::jumpFromSpeculativeToNonSpeculative):
     19        (JSC::DFG::JITCompiler::compileBody):
     20        (JSC::DFG::JITCompiler::link):
     21        * dfg/DFGJITCompiler.h:
     22        * dfg/DFGNode.h:
     23        * dfg/DFGNonSpeculativeJIT.cpp:
     24        (JSC::DFG::NonSpeculativeJIT::compile):
     25        * dfg/DFGOperations.cpp:
     26        * dfg/DFGOperations.h:
     27        * dfg/DFGPropagator.cpp:
     28        (JSC::DFG::Propagator::fixpoint):
     29        (JSC::DFG::Propagator::propagateNode):
     30        (JSC::DFG::Propagator::propagateForward):
     31        (JSC::DFG::Propagator::propagateBackward):
     32        (JSC::DFG::propagate):
     33        * dfg/DFGScoreBoard.h:
     34        * dfg/DFGSpeculativeJIT.cpp:
     35        (JSC::DFG::SpeculativeJIT::compile):
     36        * dfg/DFGSpeculativeJIT.h:
     37        (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
     38        * jit/JIT.cpp:
     39        (JSC::JIT::privateCompile):
     40
    1412011-09-11  Fumitoshi Ukai  <ukai@chromium.org>
    242
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r94802 r94942  
    476476        ValueProfile* profile = m_profiledBlock->valueProfileForBytecodeOffset(bytecodeIndex);
    477477        ASSERT(profile);
    478 #if DFG_DEBUG_VERBOSE
     478#if ENABLE(DFG_DEBUG_VERBOSE)
    479479        printf("Dynamic profile [%u, %u]: ", nodeIndex, bytecodeIndex);
    480480        profile->dump(stdout);
     
    482482#endif
    483483        m_graph[nodeIndex].predict(makePrediction(*m_globalData, *profile), StrongPrediction);
    484 #if DFG_DEBUG_VERBOSE
     484#if ENABLE(DFG_DEBUG_VERBOSE)
    485485        printf("    Prediction: %s\n", predictionToString(m_graph[nodeIndex].getPrediction()));
    486486#endif
     
    13761376    allocateVirtualRegisters();
    13771377
    1378 #if DFG_DEBUG_VERBOSE
     1378#if ENABLE(DFG_DEBUG_VERBOSE)
    13791379    m_graph.dump(m_codeBlock);
    13801380#endif
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r94629 r94942  
    219219            continue;
    220220       
    221 #if DFG_DEBUG_VERBOSE
     221#if ENABLE(DFG_DEBUG_VERBOSE)
    222222        printf("Argument profile [%lu]: ", arg);
    223223        profile->dump(stdout);
     
    227227        m_predictions.predictArgument(arg, makePrediction(globalData, *profile) & ~PredictionTagMask, StrongPrediction);
    228228       
    229 #if DFG_DEBUG_VERBOSE
     229#if ENABLE(DFG_DEBUG_VERBOSE)
    230230        printf("    Prediction: %s\n", predictionToString(m_predictions.getArgumentPrediction(arg)));
    231231#endif
  • trunk/Source/JavaScriptCore/dfg/DFGJITCodeGenerator.cpp

    r94914 r94942  
    12091209
    12101210
    1211 #if DFG_CONSISTENCY_CHECK
     1211#if ENABLE(DFG_CONSISTENCY_CHECK)
    12121212void JITCodeGenerator::checkConsistency()
    12131213{
  • trunk/Source/JavaScriptCore/dfg/DFGJITCodeGenerator.h

    r94914 r94942  
    928928#endif
    929929
    930 #if DFG_CONSISTENCY_CHECK
     930#if ENABLE(DFG_CONSISTENCY_CHECK)
    931931    void checkConsistency();
    932932#else
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r94920 r94942  
    6969        move(MacroAssembler::Imm32(valueOfInt32Constant(nodeIndex)), gpr);
    7070    } else {
    71 #if DFG_JIT_ASSERT
     71#if ENABLE(DFG_JIT_ASSERT)
    7272        // Redundant load, just so we can check the tag!
    7373        loadPtr(addressFor(node.virtualRegister()), gpr);
     
    483483    check.m_check.link(this);
    484484
    485 #if DFG_DEBUG_VERBOSE
     485#if ENABLE(DFG_DEBUG_VERBOSE)
    486486    fprintf(stderr, "Speculation failure for Node @%d at JIT offset 0x%x\n", (int)check.m_nodeIndex, debugOffset());
    487487#endif
    488 #if DFG_JIT_BREAK_ON_SPECULATION_FAILURE
     488#if ENABLE(DFG_JIT_BREAK_ON_SPECULATION_FAILURE)
    489489    breakpoint();
    490490#endif
    491491   
    492 #if DFG_VERBOSE_SPECULATION_FAILURE
     492#if ENABLE(DFG_VERBOSE_SPECULATION_FAILURE)
    493493    SpeculationFailureDebugInfo* debugInfo = new SpeculationFailureDebugInfo;
    494494    debugInfo->codeBlock = m_codeBlock;
     
    827827    // non-speculative path's requirements).
    828828
    829 #if DFG_JIT_BREAK_ON_EVERY_FUNCTION
     829#if ENABLE(DFG_JIT_BREAK_ON_EVERY_FUNCTION)
    830830    // Handy debug tool!
    831831    breakpoint();
     
    835835    Label speculativePathBegin = label();
    836836    SpeculativeJIT speculative(*this);
    837 #if !DFG_DEBUG_LOCAL_DISBALE_SPECULATIVE
     837#if !ENABLE(DFG_DEBUG_LOCAL_DISBALE_SPECULATIVE)
    838838    bool compiledSpeculative = speculative.compile();
    839839#else
     
    893893{
    894894    // Link the code, populate data in CodeBlock data structures.
    895 #if DFG_DEBUG_VERBOSE
     895#if ENABLE(DFG_DEBUG_VERBOSE)
    896896    fprintf(stderr, "JIT code for %p start at [%p, %p)\n", m_codeBlock, linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize());
    897897#endif
     
    10251025}
    10261026
    1027 #if DFG_JIT_ASSERT
     1027#if ENABLE(DFG_JIT_ASSERT)
    10281028void JITCompiler::jitAssertIsInt32(GPRReg gpr)
    10291029{
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r94688 r94942  
    5959#endif
    6060
    61 #if DFG_VERBOSE_SPECULATION_FAILURE
     61#if ENABLE(DFG_VERBOSE_SPECULATION_FAILURE)
    6262struct SpeculationFailureDebugInfo {
    6363    CodeBlock* codeBlock;
     
    259259
    260260    // These methods JIT generate dynamic, debug-only checks - akin to ASSERTs.
    261 #if DFG_JIT_ASSERT
     261#if ENABLE(DFG_JIT_ASSERT)
    262262    void jitAssertIsInt32(GPRReg);
    263263    void jitAssertIsJSInt32(GPRReg);
  • trunk/Source/JavaScriptCore/dfg/DFGNode.h

    r94629 r94942  
    2828
    2929// Emit various logging information for debugging, including dumping the dataflow graphs.
    30 #define DFG_DEBUG_VERBOSE 0
     30#define ENABLE_DFG_DEBUG_VERBOSE 0
    3131// Enable generation of dynamic checks into the instruction stream.
    3232#if !ASSERT_DISABLED
    33 #define DFG_JIT_ASSERT 1
     33#define ENABLE_DFG_JIT_ASSERT 1
    3434#else
    35 #define DFG_JIT_ASSERT 0
     35#define ENABLE_DFG_JIT_ASSERT 0
    3636#endif
    3737// Consistency check contents compiler data structures.
    38 #define DFG_CONSISTENCY_CHECK 0
     38#define ENBALE_DFG_CONSISTENCY_CHECK 0
    3939// Emit a breakpoint into the head of every generated function, to aid debugging in GDB.
    40 #define DFG_JIT_BREAK_ON_EVERY_FUNCTION 0
     40#define ENABLE_DFG_JIT_BREAK_ON_EVERY_FUNCTION 0
    4141// Emit a breakpoint into the head of every generated node, to aid debugging in GDB.
    42 #define DFG_JIT_BREAK_ON_EVERY_BLOCK 0
     42#define ENABLE_DFG_JIT_BREAK_ON_EVERY_BLOCK 0
    4343// Emit a breakpoint into the head of every generated node, to aid debugging in GDB.
    44 #define DFG_JIT_BREAK_ON_EVERY_NODE 0
     44#define ENABLE_DFG_JIT_BREAK_ON_EVERY_NODE 0
    4545// Emit a breakpoint into the speculation failure code.
    46 #define DFG_JIT_BREAK_ON_SPECULATION_FAILURE 0
     46#define ENABLE_DFG_JIT_BREAK_ON_SPECULATION_FAILURE 0
    4747// Log every speculation failure.
    48 #define DFG_VERBOSE_SPECULATION_FAILURE 0
     48#define ENABLE_DFG_VERBOSE_SPECULATION_FAILURE 0
    4949// Disable the DFG JIT without having to touch Platform.h!
    5050#define DFG_DEBUG_LOCAL_DISBALE 0
     
    5252#define DFG_DEBUG_LOCAL_DISBALE_SPECULATIVE 0
    5353// Generate stats on how successful we were in making use of the DFG jit, and remaining on the hot path.
    54 #define DFG_SUCCESS_STATS 0
     54#define ENABLE_DFG_SUCCESS_STATS 0
    5555
    5656
  • trunk/Source/JavaScriptCore/dfg/DFGNonSpeculativeJIT.cpp

    r94688 r94942  
    10871087        ASSERT(GPRInfo::returnValueGPR != GPRInfo::callFrameRegister);
    10881088
    1089 #if DFG_SUCCESS_STATS
     1089#if ENABLE(DFG_SUCCESS_STATS)
    10901090        static SamplingCounter counter("NonSpeculativeJIT");
    10911091        m_jit.emitCount(counter);
     
    12531253    m_blockHeads[m_block] = m_jit.label();
    12541254
    1255 #if DFG_JIT_BREAK_ON_EVERY_BLOCK
     1255#if ENABLE(DFG_JIT_BREAK_ON_EVERY_BLOCK)
    12561256    m_jit.breakpoint();
    12571257#endif
     
    12621262            continue;
    12631263
    1264 #if DFG_DEBUG_VERBOSE
     1264#if ENABLE(DFG_DEBUG_VERBOSE)
    12651265        fprintf(stderr, "NonSpeculativeJIT generating Node @%d at code offset 0x%x   ", (int)m_compileIndex, m_jit.debugOffset());
    12661266#endif
    1267 #if DFG_JIT_BREAK_ON_EVERY_NODE
     1267#if ENABLE(DFG_JIT_BREAK_ON_EVERY_NODE)
    12681268        m_jit.breakpoint();
    12691269#endif
     
    12711271        checkConsistency();
    12721272        compile(checkIterator, node);
    1273 #if DFG_DEBUG_VERBOSE
     1273#if ENABLE(DFG_DEBUG_VERBOSE)
    12741274        if (node.hasResult())
    12751275            fprintf(stderr, "-> %s\n", dataFormatToString(m_generationInfo[node.virtualRegister()].registerFormat()));
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r94629 r94942  
    679679}
    680680
    681 #if DFG_VERBOSE_SPECULATION_FAILURE
     681#if ENABLE(DFG_VERBOSE_SPECULATION_FAILURE)
    682682void debugOperationPrintSpeculationFailure(ExecState*, void* debugInfoRaw)
    683683{
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r94629 r94942  
    116116RegisterSizedBoolean dfgConvertJSValueToBoolean(ExecState*, EncodedJSValue);
    117117
    118 #if DFG_VERBOSE_SPECULATION_FAILURE
     118#if ENABLE(DFG_VERBOSE_SPECULATION_FAILURE)
    119119void debugOperationPrintSpeculationFailure(ExecState*, void*);
    120120#endif
  • trunk/Source/JavaScriptCore/dfg/DFGPropagator.cpp

    r94629 r94942  
    6767    void fixpoint()
    6868    {
    69 #if DFG_DEBUG_VERBOSE
     69#if ENABLE(DFG_DEBUG_VERBOSE)
    7070        m_count = 0;
    7171#endif
     
    121121        NodeType op = node.op;
    122122
    123 #if DFG_DEBUG_VERBOSE
     123#if ENABLE(DFG_DEBUG_VERBOSE)
    124124        printf("   %s[%u]: ", Graph::opName(op), m_compileIndex);
    125125#endif
     
    306306        }
    307307
    308 #if DFG_DEBUG_VERBOSE
     308#if ENABLE(DFG_DEBUG_VERBOSE)
    309309        printf("expect(%s) use(%s) %s\n", predictionToString(m_predictions[m_compileIndex]), predictionToString(m_uses[m_compileIndex]), changed ? "CHANGED" : "");
    310310#endif
     
    315315    void propagateForward()
    316316    {
    317 #if DFG_DEBUG_VERBOSE
     317#if ENABLE(DFG_DEBUG_VERBOSE)
    318318        printf("Propagating forward [%u]\n", ++m_count);
    319319#endif
     
    324324    void propagateBackward()
    325325    {
    326 #if DFG_DEBUG_VERBOSE
     326#if ENABLE(DFG_DEBUG_VERBOSE)
    327327        printf("Propagating backward [%u]\n", ++m_count);
    328328#endif
     
    343343    PredictionTracker m_variableUses;
    344344
    345 #if DFG_DEBUG_VERBOSE
     345#if ENABLE(DFG_DEBUG_VERBOSE)
    346346    unsigned m_count;
    347347#endif
     
    359359    propagator.fixpoint();
    360360   
    361 #if DFG_DEBUG_VERBOSE
     361#if ENABLE(DFG_DEBUG_VERBOSE)
    362362    graph.dump(codeBlock);
    363363#endif
  • trunk/Source/JavaScriptCore/dfg/DFGScoreBoard.h

    r85249 r94942  
    4949    }
    5050
    51 #if DFG_CONSISTENCY_CHECK
     51#if ENABLE(DFG_CONSISTENCY_CHECK)
    5252    ~ScoreBoard()
    5353    {
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r94914 r94942  
    11431143        ASSERT(GPRInfo::returnValueGPR != GPRInfo::callFrameRegister);
    11441144
    1145 #if DFG_SUCCESS_STATS
     1145#if ENABLE(DFG_SUCCESS_STATS)
    11461146        static SamplingCounter counter("SpeculativeJIT");
    11471147        m_jit.emitCount(counter);
     
    13801380    ASSERT(m_compileIndex == block.begin);
    13811381    m_blockHeads[m_block] = m_jit.label();
    1382 #if DFG_JIT_BREAK_ON_EVERY_BLOCK
     1382#if ENABLE(DFG_JIT_BREAK_ON_EVERY_BLOCK)
    13831383    m_jit.breakpoint();
    13841384#endif
     
    13891389            continue;
    13901390       
    1391 #if DFG_DEBUG_VERBOSE
     1391#if ENABLE(DFG_DEBUG_VERBOSE)
    13921392        fprintf(stderr, "SpeculativeJIT generating Node @%d at JIT offset 0x%x   ", (int)m_compileIndex, m_jit.debugOffset());
    13931393#endif
    1394 #if DFG_JIT_BREAK_ON_EVERY_NODE
     1394#if ENABLE(DFG_JIT_BREAK_ON_EVERY_NODE)
    13951395        m_jit.breakpoint();
    13961396#endif
     
    14051405            return;
    14061406        }
    1407 #if DFG_DEBUG_VERBOSE
     1407#if ENABLE(DFG_DEBUG_VERBOSE)
    14081408        if (node.hasResult())
    14091409            fprintf(stderr, "-> %s\n", dataFormatToString(m_generationInfo[node.virtualRegister()].registerFormat()));
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r94914 r94942  
    218218    void terminateSpeculativeExecution()
    219219    {
    220 #if DFG_DEBUG_VERBOSE
     220#if ENABLE(DFG_DEBUG_VERBOSE)
    221221        fprintf(stderr, "SpeculativeJIT was terminated.\n");
    222222#endif
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r94920 r94942  
    522522    Jump registerFileCheck;
    523523    if (m_codeBlock->codeType() == FunctionCode) {
    524 #if DFG_SUCCESS_STATS
     524#if ENABLE(DFG_SUCCESS_STATS)
    525525        static SamplingCounter counter("orignalJIT");
    526526        emitCount(counter);
Note: See TracChangeset for help on using the changeset viewer.