Changeset 63056 in webkit for trunk/JavaScriptCore


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:
Location:
trunk/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r63055 r63056  
     12010-07-10  Oliver Hunt  <[email protected]>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        HAVE_COMPUTED_GOTO is dependent on the interpreter being enabled
     6        https://bugs.webkit.org/show_bug.cgi?id=42039
     7
     8        Separate the existence of computed goto support in the compiler
     9        from whether or not we are using the interpreter.  All the current
     10        HAVE(COMPUTED_GOTO) guards are for the interpreter, but I'd like
     11        the option of using it elsewhere.  The interpreter now uses
     12        ENABLE(COMPUTED_GOTO_INTERPRETER)
     13
     14        * bytecode/Instruction.h:
     15        (JSC::Instruction::Instruction):
     16        * bytecode/Opcode.h:
     17        * interpreter/Interpreter.cpp:
     18        (JSC::Interpreter::Interpreter):
     19        (JSC::Interpreter::isOpcode):
     20        (JSC::Interpreter::privateExecute):
     21        * interpreter/Interpreter.h:
     22        (JSC::Interpreter::getOpcode):
     23        (JSC::Interpreter::getOpcodeID):
     24        * wtf/Platform.h:
     25
    1262010-07-10  Oliver Hunt  <[email protected]>
    227
  • trunk/JavaScriptCore/bytecode/Instruction.h

    r55564 r63056  
    126126        Instruction(Opcode opcode)
    127127        {
    128 #if !HAVE(COMPUTED_GOTO)
     128#if !ENABLE(COMPUTED_GOTO_INTERPRETER)
    129129            // We have to initialize one of the pointer members to ensure that
    130130            // the entire struct is initialized, when opcode is not a pointer.
  • trunk/JavaScriptCore/bytecode/Opcode.h

    r62896 r63056  
    211211    #undef VERIFY_OPCODE_ID
    212212
    213 #if HAVE(COMPUTED_GOTO)
     213#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    214214#if COMPILER(RVCT) || COMPILER(INTEL)
    215215    typedef void* Opcode;
  • 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
  • trunk/JavaScriptCore/interpreter/Interpreter.h

    r62612 r63056  
    7676        Opcode getOpcode(OpcodeID id)
    7777        {
    78             #if HAVE(COMPUTED_GOTO)
     78            #if ENABLE(COMPUTED_GOTO_INTERPRETER)
    7979                return m_opcodeTable[id];
    8080            #else
     
    8585        OpcodeID getOpcodeID(Opcode opcode)
    8686        {
    87             #if HAVE(COMPUTED_GOTO)
     87            #if ENABLE(COMPUTED_GOTO_INTERPRETER)
    8888                ASSERT(isOpcode(opcode));
    8989                return m_opcodeIDTable.get(opcode);
     
    160160        RegisterFile m_registerFile;
    161161       
    162 #if HAVE(COMPUTED_GOTO)
     162#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    163163        Opcode m_opcodeTable[numOpcodeIDs]; // Maps OpcodeID => Opcode for compiling
    164164        HashMap<Opcode, OpcodeID> m_opcodeIDTable; // Maps Opcode => OpcodeID for decompiling
  • trunk/JavaScriptCore/wtf/Platform.h

    r63023 r63056  
    10211021#endif
    10221022
    1023 #if COMPILER(GCC) && ENABLE(INTERPRETER)
     1023#if COMPILER(GCC)
    10241024#define HAVE_COMPUTED_GOTO 1
     1025#endif
     1026
     1027#if HAVE(COMPUTED_GOTO) && ENABLE(INTERPRETER)
     1028#define ENABLE_COMPUTED_GOTO_INTERPRETER 1
    10251029#endif
    10261030
Note: See TracChangeset for help on using the changeset viewer.