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


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

Legend:

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