Changeset 38291 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


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):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.