Changeset 155420 in webkit
- Timestamp:
- Sep 9, 2013 11:09:40 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r155418 r155420 1 2013-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 1 26 2013-09-09 Michael Saboff <msaboff@apple.com> 2 27 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r155415 r155420 325 325 void setArgumentsRegister(int argumentsRegister) 326 326 { 327 ASSERT(argumentsRegister != -1);327 ASSERT(argumentsRegister != (int)InvalidVirtualRegister); 328 328 m_argumentsRegister = argumentsRegister; 329 329 ASSERT(usesArguments()); … … 355 355 return activationRegister(); 356 356 } 357 bool usesArguments() const { return m_argumentsRegister != -1; }357 bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; } 358 358 359 359 bool needsActivation() const -
trunk/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h
r153170 r155420 33 33 #include "ConcurrentJITLock.h" 34 34 #include "ValueProfile.h" 35 #include "VirtualRegister.h" 35 36 #include <wtf/HashMap.h> 36 37 #include <wtf/Noncopyable.h> … … 46 47 LazyOperandValueProfileKey() 47 48 : m_bytecodeOffset(0) // 0 = empty value 48 , m_operand( -1) // not a valid operand index in our current scheme49 , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme 49 50 { 50 51 } … … 52 53 LazyOperandValueProfileKey(WTF::HashTableDeletedValueType) 53 54 : m_bytecodeOffset(1) // 1 = deleted value 54 , m_operand( -1) // not a valid operand index in our current scheme55 , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme 55 56 { 56 57 } … … 60 61 , m_operand(operand) 61 62 { 62 ASSERT(operand != -1);63 ASSERT(operand != InvalidVirtualRegister); 63 64 } 64 65 65 66 bool operator!() const 66 67 { 67 return m_operand == -1;68 return m_operand == InvalidVirtualRegister; 68 69 } 69 70 … … 92 93 bool isHashTableDeletedValue() const 93 94 { 94 return m_operand == -1&& m_bytecodeOffset;95 return m_operand == InvalidVirtualRegister && m_bytecodeOffset; 95 96 } 96 97 private: … … 129 130 LazyOperandValueProfile() 130 131 : MinimalValueProfile() 131 , m_operand( -1)132 , m_operand(InvalidVirtualRegister) 132 133 { 133 134 } -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
r154498 r155420 195 195 , m_numParameters(0) 196 196 , m_vm(vm) 197 , m_argumentsRegister( -1)198 , m_globalObjectRegister( -1)197 , m_argumentsRegister((int)InvalidVirtualRegister) 198 , m_globalObjectRegister((int)InvalidVirtualRegister) 199 199 , m_needsFullScopeChain(info.m_needsActivation) 200 200 , m_usesEval(info.m_usesEval) -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r154498 r155420 39 39 #include "SpecialPointer.h" 40 40 #include "SymbolTable.h" 41 #include "VirtualRegister.h" 41 42 42 43 #include <wtf/Compression.h> … … 258 259 259 260 void setArgumentsRegister(int argumentsRegister) { m_argumentsRegister = argumentsRegister; } 260 bool usesArguments() const { return m_argumentsRegister != -1; }261 bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; } 261 262 int argumentsRegister() const { return m_argumentsRegister; } 262 263 263 264 264 bool usesGlobalObject() const { return m_globalObjectRegister != -1; }265 bool usesGlobalObject() const { return m_globalObjectRegister != (int)InvalidVirtualRegister; } 265 266 void setGlobalObjectRegister(int globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; } 266 267 int globalObjectRegister() const { return m_globalObjectRegister; } -
trunk/Source/JavaScriptCore/bytecode/VirtualRegister.h
r136096 r155420 34 34 // Type for a virtual register number (spill location). 35 35 // Using an enum to make this type-checked at compile time, to avert programmer errors. 36 enum VirtualRegister { InvalidVirtualRegister = -1};36 enum VirtualRegister { InvalidVirtualRegister = 0x7fffffff }; 37 37 COMPILE_ASSERT(sizeof(VirtualRegister) == sizeof(int), VirtualRegister_is_32bit); 38 38
Note: See TracChangeset
for help on using the changeset viewer.