Changeset 155420 in webkit


Ignore:
Timestamp:
Sep 9, 2013 11:09:40 PM (11 years ago)
Author:
msaboff@apple.com
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:
Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r155418 r155420  
     12013-09-09  Michael Saboff  <msaboff@apple.com>
     2
     3        There should be one "invalid" virtual register constant
     4        https://bugs.webkit.org/show_bug.cgi?id=121057
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Unify all references to an invalid virtual register to be the enum InvalidVirtualRegister.
     9        Changed the value of InvalidVirtualRegister to be maximum integer value.
     10
     11        * bytecode/CodeBlock.h:
     12        (JSC::CodeBlock::setArgumentsRegister):
     13        (JSC::CodeBlock::usesArguments):
     14        * bytecode/LazyOperandValueProfile.h:
     15        (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
     16        (JSC::LazyOperandValueProfileKey::operator!):
     17        (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
     18        (JSC::LazyOperandValueProfile::LazyOperandValueProfile):
     19        * bytecode/UnlinkedCodeBlock.cpp:
     20        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
     21        * bytecode/UnlinkedCodeBlock.h:
     22        (JSC::UnlinkedCodeBlock::usesArguments):
     23        (JSC::UnlinkedCodeBlock::usesGlobalObject):
     24        * bytecode/VirtualRegister.h:
     25
    1262013-09-09  Michael Saboff  <msaboff@apple.com>
    227
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r155415 r155420  
    325325    void setArgumentsRegister(int argumentsRegister)
    326326    {
    327         ASSERT(argumentsRegister != -1);
     327        ASSERT(argumentsRegister != (int)InvalidVirtualRegister);
    328328        m_argumentsRegister = argumentsRegister;
    329329        ASSERT(usesArguments());
     
    355355        return activationRegister();
    356356    }
    357     bool usesArguments() const { return m_argumentsRegister != -1; }
     357    bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; }
    358358
    359359    bool needsActivation() const
  • 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    }
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp

    r154498 r155420  
    195195    , m_numParameters(0)
    196196    , m_vm(vm)
    197     , m_argumentsRegister(-1)
    198     , m_globalObjectRegister(-1)
     197    , m_argumentsRegister((int)InvalidVirtualRegister)
     198    , m_globalObjectRegister((int)InvalidVirtualRegister)
    199199    , m_needsFullScopeChain(info.m_needsActivation)
    200200    , m_usesEval(info.m_usesEval)
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

    r154498 r155420  
    3939#include "SpecialPointer.h"
    4040#include "SymbolTable.h"
     41#include "VirtualRegister.h"
    4142
    4243#include <wtf/Compression.h>
     
    258259
    259260    void setArgumentsRegister(int argumentsRegister) { m_argumentsRegister = argumentsRegister; }
    260     bool usesArguments() const { return m_argumentsRegister != -1; }
     261    bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; }
    261262    int argumentsRegister() const { return m_argumentsRegister; }
    262263
    263264
    264     bool usesGlobalObject() const { return m_globalObjectRegister != -1; }
     265    bool usesGlobalObject() const { return m_globalObjectRegister != (int)InvalidVirtualRegister; }
    265266    void setGlobalObjectRegister(int globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; }
    266267    int globalObjectRegister() const { return m_globalObjectRegister; }
  • trunk/Source/JavaScriptCore/bytecode/VirtualRegister.h

    r136096 r155420  
    3434// Type for a virtual register number (spill location).
    3535// Using an enum to make this type-checked at compile time, to avert programmer errors.
    36 enum VirtualRegister { InvalidVirtualRegister = -1 };
     36enum VirtualRegister { InvalidVirtualRegister = 0x7fffffff };
    3737COMPILE_ASSERT(sizeof(VirtualRegister) == sizeof(int), VirtualRegister_is_32bit);
    3838
Note: See TracChangeset for help on using the changeset viewer.