Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (155419 => 155420)
--- trunk/Source/_javascript_Core/ChangeLog 2013-09-10 06:07:40 UTC (rev 155419)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-09-10 06:09:40 UTC (rev 155420)
@@ -1,5 +1,30 @@
2013-09-09 Michael Saboff <[email protected]>
+ 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:
+
+2013-09-09 Michael Saboff <[email protected]>
+
Change virtual register function arguments from unsigned to int
https://bugs.webkit.org/show_bug.cgi?id=121055
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (155419 => 155420)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2013-09-10 06:07:40 UTC (rev 155419)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2013-09-10 06:09:40 UTC (rev 155420)
@@ -324,7 +324,7 @@
void setArgumentsRegister(int argumentsRegister)
{
- ASSERT(argumentsRegister != -1);
+ ASSERT(argumentsRegister != (int)InvalidVirtualRegister);
m_argumentsRegister = argumentsRegister;
ASSERT(usesArguments());
}
@@ -354,7 +354,7 @@
return InvalidVirtualRegister;
return activationRegister();
}
- bool usesArguments() const { return m_argumentsRegister != -1; }
+ bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; }
bool needsActivation() const
{
Modified: trunk/Source/_javascript_Core/bytecode/LazyOperandValueProfile.h (155419 => 155420)
--- trunk/Source/_javascript_Core/bytecode/LazyOperandValueProfile.h 2013-09-10 06:07:40 UTC (rev 155419)
+++ trunk/Source/_javascript_Core/bytecode/LazyOperandValueProfile.h 2013-09-10 06:09:40 UTC (rev 155420)
@@ -32,6 +32,7 @@
#include "ConcurrentJITLock.h"
#include "ValueProfile.h"
+#include "VirtualRegister.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
@@ -45,13 +46,13 @@
public:
LazyOperandValueProfileKey()
: m_bytecodeOffset(0) // 0 = empty value
- , m_operand(-1) // not a valid operand index in our current scheme
+ , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme
{
}
LazyOperandValueProfileKey(WTF::HashTableDeletedValueType)
: m_bytecodeOffset(1) // 1 = deleted value
- , m_operand(-1) // not a valid operand index in our current scheme
+ , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme
{
}
@@ -59,12 +60,12 @@
: m_bytecodeOffset(bytecodeOffset)
, m_operand(operand)
{
- ASSERT(operand != -1);
+ ASSERT(operand != InvalidVirtualRegister);
}
bool operator!() const
{
- return m_operand == -1;
+ return m_operand == InvalidVirtualRegister;
}
bool operator==(const LazyOperandValueProfileKey& other) const
@@ -91,7 +92,7 @@
bool isHashTableDeletedValue() const
{
- return m_operand == -1 && m_bytecodeOffset;
+ return m_operand == InvalidVirtualRegister && m_bytecodeOffset;
}
private:
unsigned m_bytecodeOffset;
@@ -128,7 +129,7 @@
struct LazyOperandValueProfile : public MinimalValueProfile {
LazyOperandValueProfile()
: MinimalValueProfile()
- , m_operand(-1)
+ , m_operand(InvalidVirtualRegister)
{
}
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp (155419 => 155420)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp 2013-09-10 06:07:40 UTC (rev 155419)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp 2013-09-10 06:09:40 UTC (rev 155420)
@@ -194,8 +194,8 @@
, m_numCalleeRegisters(0)
, m_numParameters(0)
, m_vm(vm)
- , m_argumentsRegister(-1)
- , m_globalObjectRegister(-1)
+ , m_argumentsRegister((int)InvalidVirtualRegister)
+ , m_globalObjectRegister((int)InvalidVirtualRegister)
, m_needsFullScopeChain(info.m_needsActivation)
, m_usesEval(info.m_usesEval)
, m_isNumericCompareFunction(false)
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (155419 => 155420)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2013-09-10 06:07:40 UTC (rev 155419)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2013-09-10 06:09:40 UTC (rev 155420)
@@ -38,6 +38,7 @@
#include "RegExp.h"
#include "SpecialPointer.h"
#include "SymbolTable.h"
+#include "VirtualRegister.h"
#include <wtf/Compression.h>
#include <wtf/RefCountedArray.h>
@@ -257,11 +258,11 @@
void setActivationRegister(int activationRegister) { m_activationRegister = activationRegister; }
void setArgumentsRegister(int argumentsRegister) { m_argumentsRegister = argumentsRegister; }
- bool usesArguments() const { return m_argumentsRegister != -1; }
+ bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; }
int argumentsRegister() const { return m_argumentsRegister; }
- bool usesGlobalObject() const { return m_globalObjectRegister != -1; }
+ bool usesGlobalObject() const { return m_globalObjectRegister != (int)InvalidVirtualRegister; }
void setGlobalObjectRegister(int globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; }
int globalObjectRegister() const { return m_globalObjectRegister; }
Modified: trunk/Source/_javascript_Core/bytecode/VirtualRegister.h (155419 => 155420)
--- trunk/Source/_javascript_Core/bytecode/VirtualRegister.h 2013-09-10 06:07:40 UTC (rev 155419)
+++ trunk/Source/_javascript_Core/bytecode/VirtualRegister.h 2013-09-10 06:09:40 UTC (rev 155420)
@@ -33,7 +33,7 @@
// Type for a virtual register number (spill location).
// Using an enum to make this type-checked at compile time, to avert programmer errors.
-enum VirtualRegister { InvalidVirtualRegister = -1 };
+enum VirtualRegister { InvalidVirtualRegister = 0x7fffffff };
COMPILE_ASSERT(sizeof(VirtualRegister) == sizeof(int), VirtualRegister_is_32bit);
} // namespace JSC