Ignore:
Timestamp:
Sep 9, 2013, 11:09:40 PM (12 years ago)
Author:
[email protected]
Message:

There should be one "invalid" virtual register constant
https://bugs.webkit.org/show_bug.cgi?id=121057

Reviewed by Filip Pizlo.

Unify all references to an invalid virtual register to be the enum InvalidVirtualRegister.
Changed the value of InvalidVirtualRegister to be maximum integer value.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::setArgumentsRegister):
(JSC::CodeBlock::usesArguments):

  • bytecode/LazyOperandValueProfile.h:

(JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
(JSC::LazyOperandValueProfileKey::operator!):
(JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
(JSC::LazyOperandValueProfile::LazyOperandValueProfile):

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::usesArguments):
(JSC::UnlinkedCodeBlock::usesGlobalObject):

  • bytecode/VirtualRegister.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h

    r153170 r155420  
    3333#include "ConcurrentJITLock.h"
    3434#include "ValueProfile.h"
     35#include "VirtualRegister.h"
    3536#include <wtf/HashMap.h>
    3637#include <wtf/Noncopyable.h>
     
    4647    LazyOperandValueProfileKey()
    4748        : m_bytecodeOffset(0) // 0 = empty value
    48         , m_operand(-1) // not a valid operand index in our current scheme
     49        , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme
    4950    {
    5051    }
     
    5253    LazyOperandValueProfileKey(WTF::HashTableDeletedValueType)
    5354        : m_bytecodeOffset(1) // 1 = deleted value
    54         , m_operand(-1) // not a valid operand index in our current scheme
     55        , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme
    5556    {
    5657    }
     
    6061        , m_operand(operand)
    6162    {
    62         ASSERT(operand != -1);
     63        ASSERT(operand != InvalidVirtualRegister);
    6364    }
    6465   
    6566    bool operator!() const
    6667    {
    67         return m_operand == -1;
     68        return m_operand == InvalidVirtualRegister;
    6869    }
    6970   
     
    9293    bool isHashTableDeletedValue() const
    9394    {
    94         return m_operand == -1 && m_bytecodeOffset;
     95        return m_operand == InvalidVirtualRegister && m_bytecodeOffset;
    9596    }
    9697private:
     
    129130    LazyOperandValueProfile()
    130131        : MinimalValueProfile()
    131         , m_operand(-1)
     132        , m_operand(InvalidVirtualRegister)
    132133    {
    133134    }
Note: See TracChangeset for help on using the changeset viewer.