Ignore:
Timestamp:
Jul 10, 2010, 6:14:47 PM (15 years ago)
Author:
[email protected]
Message:

2010-07-10 Oliver Hunt <[email protected]>

Reviewed by Maciej Stachowiak.

HAVE_COMPUTED_GOTO is dependent on the interpreter being enabled
https://bugs.webkit.org/show_bug.cgi?id=42039

Separate the existence of computed goto support in the compiler
from whether or not we are using the interpreter. All the current
HAVE(COMPUTED_GOTO) guards are for the interpreter, but I'd like
the option of using it elsewhere. The interpreter now uses
ENABLE(COMPUTED_GOTO_INTERPRETER)

  • bytecode/Instruction.h: (JSC::Instruction::Instruction):
  • bytecode/Opcode.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::isOpcode): (JSC::Interpreter::privateExecute):
  • interpreter/Interpreter.h: (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID):
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r62896 r63056  
    385385    , m_reentryDepth(0)
    386386{
    387 #if HAVE(COMPUTED_GOTO)
     387#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    388388    privateExecute(InitializeAndReturn, 0, 0, 0);
    389389
    390390    for (int i = 0; i < numOpcodeIDs; ++i)
    391391        m_opcodeIDTable.add(m_opcodeTable[i], static_cast<OpcodeID>(i));
    392 #endif // HAVE(COMPUTED_GOTO)
     392#endif // ENABLE(COMPUTED_GOTO_INTERPRETER)
    393393
    394394#if ENABLE(OPCODE_SAMPLING)
     
    498498bool Interpreter::isOpcode(Opcode opcode)
    499499{
    500 #if HAVE(COMPUTED_GOTO)
     500#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    501501    return opcode != HashTraits<Opcode>::emptyValue()
    502502        && !HashTraits<Opcode>::isDeletedValue(opcode)
     
    13861386    // here because our labels are only in scope inside this function.
    13871387    if (UNLIKELY(flag == InitializeAndReturn)) {
    1388         #if HAVE(COMPUTED_GOTO)
     1388        #if ENABLE(COMPUTED_GOTO_INTERPRETER)
    13891389            #define LIST_OPCODE_LABEL(id, length) &&id,
    13901390                static Opcode labels[] = { FOR_EACH_OPCODE_ID(LIST_OPCODE_LABEL) };
     
    13921392                    m_opcodeTable[i] = labels[i];
    13931393            #undef LIST_OPCODE_LABEL
    1394         #endif // HAVE(COMPUTED_GOTO)
     1394        #endif // ENABLE(COMPUTED_GOTO_INTERPRETER)
    13951395        return JSValue();
    13961396    }
     
    14481448#endif
    14491449
    1450 #if HAVE(COMPUTED_GOTO)
     1450#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    14511451    #define NEXT_INSTRUCTION() SAMPLE(codeBlock, vPC); goto *vPC->u.opcode
    14521452#if ENABLE(OPCODE_STATS)
     
    24802480        NEXT_INSTRUCTION();
    24812481    }
    2482 #if HAVE(COMPUTED_GOTO)
     2482#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    24832483    goto *(&&skip_id_getter_proto);
    24842484#endif
     
    25222522        NEXT_INSTRUCTION();
    25232523    }
    2524 #if HAVE(COMPUTED_GOTO)
     2524#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    25252525    skip_id_getter_proto:
    25262526#endif
    2527 #if HAVE(COMPUTED_GOTO)
     2527#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    25282528    goto *(&&skip_id_custom_proto);
    25292529#endif
     
    25642564        NEXT_INSTRUCTION();
    25652565    }
    2566 #if HAVE(COMPUTED_GOTO)
     2566#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    25672567    skip_id_custom_proto:
    25682568#endif
     
    26552655        NEXT_INSTRUCTION();
    26562656    }
    2657 #if HAVE(COMPUTED_GOTO)
     2657#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    26582658    goto *(&&skip_id_getter_self);
    26592659#endif
     
    26952695        NEXT_INSTRUCTION();
    26962696    }
    2697 #if HAVE(COMPUTED_GOTO)
     2697#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    26982698    skip_id_getter_self:
    26992699#endif
    2700 #if HAVE(COMPUTED_GOTO)
     2700#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    27012701    goto *(&&skip_id_custom_self);
    27022702#endif
     
    27322732        NEXT_INSTRUCTION();
    27332733    }
    2734 #if HAVE(COMPUTED_GOTO)
     2734#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    27352735skip_id_custom_self:
    27362736#endif
     
    27552755        NEXT_INSTRUCTION();
    27562756    }
    2757 #if HAVE(COMPUTED_GOTO)
     2757#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    27582758    goto *(&&skip_id_getter_chain);
    27592759#endif
     
    28072807        NEXT_INSTRUCTION();
    28082808    }
    2809 #if HAVE(COMPUTED_GOTO)
     2809#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    28102810    skip_id_getter_chain:
    28112811#endif
    2812 #if HAVE(COMPUTED_GOTO)
     2812#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    28132813    goto *(&&skip_id_custom_chain);
    28142814#endif
     
    28592859        NEXT_INSTRUCTION();
    28602860    }
    2861 #if HAVE(COMPUTED_GOTO)
     2861#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    28622862    skip_id_custom_chain:
    28632863#endif
     
    43764376        NEXT_INSTRUCTION();
    43774377    }
    4378 #if HAVE(COMPUTED_GOTO)
     4378#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    43794379    // Appease GCC
    43804380    goto *(&&skip_new_scope);
     
    43924392        NEXT_INSTRUCTION();
    43934393    }
    4394 #if HAVE(COMPUTED_GOTO)
     4394#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    43954395    skip_new_scope:
    43964396#endif
     
    46064606    }
    46074607    }
    4608 #if !HAVE(COMPUTED_GOTO)
     4608#if !ENABLE(COMPUTED_GOTO_INTERPRETER)
    46094609    } // iterator loop ends
    46104610#endif
Note: See TracChangeset for help on using the changeset viewer.