Changeset 38291 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Nov 10, 2008, 9:55:50 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-10 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Make CTI::getConstant() a member function of CodeBlock instead.

  • VM/CTI.cpp: (JSC::CTI::emitGetArg): (JSC::CTI::emitGetPutArg): (JSC::CTI::getConstantImmediateNumericArg): (JSC::CTI::printOpcodeOperandTypes): (JSC::CTI::privateCompileMainPass):
  • VM/CTI.h:
  • VM/CodeBlock.h: (JSC::CodeBlock::getConstant):
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r38290 r38291  
     12008-11-10  Cameron Zwarich  <[email protected]>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Make CTI::getConstant() a member function of CodeBlock instead.
     6
     7        * VM/CTI.cpp:
     8        (JSC::CTI::emitGetArg):
     9        (JSC::CTI::emitGetPutArg):
     10        (JSC::CTI::getConstantImmediateNumericArg):
     11        (JSC::CTI::printOpcodeOperandTypes):
     12        (JSC::CTI::privateCompileMainPass):
     13        * VM/CTI.h:
     14        * VM/CodeBlock.h:
     15        (JSC::CodeBlock::getConstant):
     16
    1172008-11-10  Cameron Zwarich  <[email protected]>
    218
  • trunk/JavaScriptCore/VM/CTI.cpp

    r38290 r38291  
    169169#endif
    170170
    171 ALWAYS_INLINE JSValue* CTI::getConstant(int src)
    172 {
    173     return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].getJSValue();
    174 }
    175 
    176171inline uintptr_t CTI::asInteger(JSValue* value)
    177172{
     
    184179    // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
    185180    if (m_codeBlock->isConstantRegisterIndex(src)) {
    186         JSValue* js = getConstant(src);
     181        JSValue* js = m_codeBlock->getConstant(src);
    187182        m_jit.movl_i32r(asInteger(js), dst);
    188183    } else
     
    194189{
    195190    if (m_codeBlock->isConstantRegisterIndex(src)) {
    196         JSValue* js = getConstant(src);
     191        JSValue* js = m_codeBlock->getConstant(src);
    197192        m_jit.movl_i32m(asInteger(js), offset + sizeof(void*), X86::esp);
    198193    } else {
     
    216211{
    217212    if (m_codeBlock->isConstantRegisterIndex(src)) {
    218         JSValue* js = getConstant(src);
     213        JSValue* js = m_codeBlock->getConstant(src);
    219214        return JSImmediate::isNumber(js) ? js : noValue();
    220215    }
     
    275270    char which1 = '*';
    276271    if (m_codeBlock->isConstantRegisterIndex(src1)) {
    277         JSValue* js = getConstant(src1);
     272        JSValue* js = m_codeBlock->getConstant(src1);
    278273        which1 =
    279274            JSImmediate::isImmediate(js) ?
     
    289284    char which2 = '*';
    290285    if (m_codeBlock->isConstantRegisterIndex(src2)) {
    291         JSValue* js = getConstant(src2);
     286        JSValue* js = m_codeBlock->getConstant(src2);
    292287        which2 =
    293288            JSImmediate::isImmediate(js) ?
     
    10061001            unsigned src = instruction[i + 2].u.operand;
    10071002            if (m_codeBlock->isConstantRegisterIndex(src))
    1008                 m_jit.movl_i32r(asInteger(getConstant(src)), X86::eax);
     1003                m_jit.movl_i32r(asInteger(m_codeBlock->getConstant(src)), X86::eax);
    10091004            else
    10101005                emitGetArg(src, X86::eax);
  • trunk/JavaScriptCore/VM/CTI.h

    r38286 r38291  
    353353        static uintptr_t asInteger(JSValue*);
    354354
    355         JSValue* getConstant(int src);
    356 
    357355        void privateCompileMainPass();
    358356        void privateCompileLinkPass();
  • trunk/JavaScriptCore/VM/CodeBlock.h

    r38290 r38291  
    296296        }
    297297
     298        ALWAYS_INLINE JSValue* getConstant(int index)
     299        {
     300            return constantRegisters[index - numVars].getJSValue();
     301        }
     302
    298303#if !defined(NDEBUG) || ENABLE_OPCODE_SAMPLING
    299304        void dump(ExecState*) const;
Note: See TracChangeset for help on using the changeset viewer.