diff options
| author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
|---|---|---|
| committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
| commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
| tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/bytecode/VirtualRegister.h | |
| parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
| download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz | |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/bytecode/VirtualRegister.h')
| -rw-r--r-- | Source/JavaScriptCore/bytecode/VirtualRegister.h | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/Source/JavaScriptCore/bytecode/VirtualRegister.h b/Source/JavaScriptCore/bytecode/VirtualRegister.h index 613088ef6..c63aee85f 100644 --- a/Source/JavaScriptCore/bytecode/VirtualRegister.h +++ b/Source/JavaScriptCore/bytecode/VirtualRegister.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2015 Apple Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,6 +28,7 @@ #include "CallFrame.h" +#include <wtf/Platform.h> #include <wtf/PrintStream.h> namespace JSC { @@ -59,47 +60,14 @@ public: bool isValid() const { return (m_virtualRegister != s_invalidVirtualRegister); } bool isLocal() const { return operandIsLocal(m_virtualRegister); } bool isArgument() const { return operandIsArgument(m_virtualRegister); } - bool isHeader() const { return m_virtualRegister >= 0 && m_virtualRegister < JSStack::ThisArgument; } bool isConstant() const { return m_virtualRegister >= s_firstConstantRegisterIndex; } int toLocal() const { ASSERT(isLocal()); return operandToLocal(m_virtualRegister); } int toArgument() const { ASSERT(isArgument()); return operandToArgument(m_virtualRegister); } int toConstantIndex() const { ASSERT(isConstant()); return m_virtualRegister - s_firstConstantRegisterIndex; } int offset() const { return m_virtualRegister; } - int offsetInBytes() const { return m_virtualRegister * sizeof(Register); } - - bool operator==(VirtualRegister other) const { return m_virtualRegister == other.m_virtualRegister; } - bool operator!=(VirtualRegister other) const { return m_virtualRegister != other.m_virtualRegister; } - bool operator<(VirtualRegister other) const { return m_virtualRegister < other.m_virtualRegister; } - bool operator>(VirtualRegister other) const { return m_virtualRegister > other.m_virtualRegister; } - bool operator<=(VirtualRegister other) const { return m_virtualRegister <= other.m_virtualRegister; } - bool operator>=(VirtualRegister other) const { return m_virtualRegister >= other.m_virtualRegister; } - - VirtualRegister operator+(int value) const - { - return VirtualRegister(offset() + value); - } - VirtualRegister operator-(int value) const - { - return VirtualRegister(offset() - value); - } - VirtualRegister operator+(VirtualRegister value) const - { - return VirtualRegister(offset() + value.offset()); - } - VirtualRegister operator-(VirtualRegister value) const - { - return VirtualRegister(offset() - value.offset()); - } - VirtualRegister& operator+=(int value) - { - return *this = *this + value; - } - VirtualRegister& operator-=(int value) - { - return *this = *this - value; - } - - void dump(PrintStream& out) const; + + bool operator==(const VirtualRegister other) const { return m_virtualRegister == other.m_virtualRegister; } + bool operator!=(const VirtualRegister other) const { return m_virtualRegister != other.m_virtualRegister; } private: static const int s_invalidVirtualRegister = 0x3fffffff; @@ -127,4 +95,13 @@ inline VirtualRegister virtualRegisterForArgument(int argument, int offset = 0) } // namespace JSC +namespace WTF { + +inline void printInternal(PrintStream& out, JSC::VirtualRegister value) +{ + out.print(value.offset()); +} + +} // namespace WTF + #endif // VirtualRegister_h |
