Changeset 104338 in webkit


Ignore:
Timestamp:
Jan 6, 2012 2:15:31 PM (12 years ago)
Author:
msaboff@apple.com
Message:

Default HashTraits for Opcode don't work for Opcode = 0
https://bugs.webkit.org/show_bug.cgi?id=75595

Reviewed by Oliver Hunt.

Removed the populating of the m_opcodeIDTable table in the
case where the OpcodeID and Opcode are the same (m_enabled is false).
Instead we just cast the one type to the other.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::initialize):
(JSC::Interpreter::isOpcode):

  • interpreter/Interpreter.h:

(JSC::Interpreter::getOpcodeID):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r104333 r104338  
     12012-01-05  Michael Saboff  <msaboff@apple.com>
     2
     3        Default HashTraits for Opcode don't work for Opcode = 0
     4        https://bugs.webkit.org/show_bug.cgi?id=75595
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Removed the populating of the m_opcodeIDTable table in the
     9        case where the OpcodeID and Opcode are the same (m_enabled is false).
     10        Instead we just cast the one type to the other.
     11
     12        * interpreter/Interpreter.cpp:
     13        (JSC::Interpreter::initialize):
     14        (JSC::Interpreter::isOpcode):
     15        * interpreter/Interpreter.h:
     16        (JSC::Interpreter::getOpcodeID):
     17
    1182012-01-06  Sam Weinig  <sam@webkit.org>
    219
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r103292 r104338  
    557557            Opcode opcode = bitwise_cast<void*>(static_cast<uintptr_t>(i));
    558558            m_opcodeTable[i] = opcode;
    559             m_opcodeIDTable.add(opcode, static_cast<OpcodeID>(i));
    560559        }
    561560    } else {
     
    670669{
    671670#if ENABLE(COMPUTED_GOTO_INTERPRETER)
     671    if (!m_enabled)
     672        return opcode >= 0 && static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode)) <= op_end;
    672673    return opcode != HashTraits<Opcode>::emptyValue()
    673674        && !HashTraits<Opcode>::isDeletedValue(opcode)
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r103292 r104338  
    115115#if ENABLE(COMPUTED_GOTO_INTERPRETER)
    116116            ASSERT(isOpcode(opcode));
    117             if (!m_enabled) {
    118                 OpcodeID result = static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode));
    119                 ASSERT(result == m_opcodeIDTable.get(opcode));
    120                 return result;
    121             }
     117            if (!m_enabled)
     118                return static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode));
     119
    122120            return m_opcodeIDTable.get(opcode);
    123121#else
Note: See TracChangeset for help on using the changeset viewer.