Changeset 38229 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Nov 7, 2008, 12:41:47 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoff Garen.

Bug 22129: Move CTI::isConstant() to CodeBlock
<https://bugs.webkit.org/show_bug.cgi?id=22129>

  • 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::isConstant):
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r38228 r38229  
     12008-11-07  Cameron Zwarich  <[email protected]>
     2
     3        Reviewed by Geoff Garen.
     4
     5        Bug 22129: Move CTI::isConstant() to CodeBlock
     6        <https://bugs.webkit.org/show_bug.cgi?id=22129>
     7
     8        * VM/CTI.cpp:
     9        (JSC::CTI::emitGetArg):
     10        (JSC::CTI::emitGetPutArg):
     11        (JSC::CTI::getConstantImmediateNumericArg):
     12        (JSC::CTI::printOpcodeOperandTypes):
     13        (JSC::CTI::privateCompileMainPass):
     14        * VM/CTI.h:
     15        * VM/CodeBlock.h:
     16        (JSC::CodeBlock::isConstant):
     17
    1182008-11-07  Alp Toker  <[email protected]>
    219
  • trunk/JavaScriptCore/VM/CTI.cpp

    r38209 r38229  
    169169#endif
    170170
    171 ALWAYS_INLINE bool CTI::isConstant(int src)
    172 {
    173     return src >= m_codeBlock->numVars && src < m_codeBlock->numVars + m_codeBlock->numConstants;
    174 }
    175 
    176171ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src)
    177172{
     
    188183{
    189184    // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
    190     if (isConstant(src)) {
     185    if (m_codeBlock->isConstant(src)) {
    191186        JSValue* js = getConstant(m_callFrame, src);
    192187        m_jit.movl_i32r(asInteger(js), dst);
     
    198193ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, X86Assembler::RegisterID scratch)
    199194{
    200     if (isConstant(src)) {
     195    if (m_codeBlock->isConstant(src)) {
    201196        JSValue* js = getConstant(m_callFrame, src);
    202197        m_jit.movl_i32m(asInteger(js), offset + sizeof(void*), X86::esp);
     
    220215ALWAYS_INLINE JSValue* CTI::getConstantImmediateNumericArg(unsigned src)
    221216{
    222     if (isConstant(src)) {
     217    if (m_codeBlock->isConstant(src)) {
    223218        JSValue* js = getConstant(m_callFrame, src);
    224219        return JSImmediate::isNumber(js) ? js : noValue();
     
    279274{
    280275    char which1 = '*';
    281     if (isConstant(src1)) {
     276    if (m_codeBlock->isConstant(src1)) {
    282277        JSValue* js = getConstant(m_callFrame, src1);
    283278        which1 =
     
    293288    }
    294289    char which2 = '*';
    295     if (isConstant(src2)) {
     290    if (m_codeBlock->isConstant(src2)) {
    296291        JSValue* js = getConstant(m_callFrame, src2);
    297292        which2 =
     
    10071002        case op_mov: {
    10081003            unsigned src = instruction[i + 2].u.operand;
    1009             if (isConstant(src))
     1004            if (m_codeBlock->isConstant(src))
    10101005                m_jit.movl_i32r(asInteger(getConstant(m_callFrame, src)), X86::eax);
    10111006            else
  • trunk/JavaScriptCore/VM/CTI.h

    r38209 r38229  
    358358        static uintptr_t asInteger(JSValue*);
    359359
    360         bool isConstant(int src);
    361360        JSValue* getConstant(CallFrame*, int src);
    362361
  • trunk/JavaScriptCore/VM/CodeBlock.h

    r38205 r38229  
    290290        }
    291291
     292        ALWAYS_INLINE bool isConstant(int index)
     293        {
     294            return index >= numVars && index < numVars + numConstants;
     295        }
     296
    292297#if !defined(NDEBUG) || ENABLE_OPCODE_SAMPLING
    293298        void dump(ExecState*) const;
Note: See TracChangeset for help on using the changeset viewer.