Changeset 180711 in webkit
- Timestamp:
- Feb 26, 2015, 4:55:19 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
bytecompiler/BytecodeGenerator.cpp (modified) (3 diffs)
-
bytecompiler/BytecodeGenerator.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r180703 r180711 1 2015-02-26 Filip Pizlo <fpizlo@apple.com> 2 3 The bool returning form of BytecodeGenerator::addVar() can be removed 4 https://bugs.webkit.org/show_bug.cgi?id=142064 5 6 Reviewed by Mark Lam. 7 8 It's easier to implement addVar() when you don't have to return whether it's a new 9 variable or not. 10 11 * bytecompiler/BytecodeGenerator.cpp: 12 (JSC::BytecodeGenerator::addVar): 13 * bytecompiler/BytecodeGenerator.h: 14 (JSC::BytecodeGenerator::addVar): Deleted. 15 1 16 2015-02-26 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r180595 r180711 124 124 } 125 125 126 boolBytecodeGenerator::addVar(127 const Identifier& ident, ConstantMode constantMode, WatchMode watchMode , RegisterID*& r0)126 RegisterID* BytecodeGenerator::addVar( 127 const Identifier& ident, ConstantMode constantMode, WatchMode watchMode) 128 128 { 129 129 ASSERT(static_cast<size_t>(m_codeBlock->m_numVars) == m_calleeRegisters.size()); … … 134 134 SymbolTable::Map::AddResult result = symbolTable().add(locker, ident.impl(), newEntry); 135 135 136 if (!result.isNewEntry) { 137 r0 = ®isterFor(result.iterator->value.getIndex()); 138 return false; 139 } 136 if (!result.isNewEntry) 137 return ®isterFor(result.iterator->value.getIndex()); 140 138 141 139 if (watchMode == IsWatchable) { … … 145 143 } 146 144 147 r0 = addVar();148 149 145 ASSERT(watchMode == NotWatchable || static_cast<size_t>(m_codeBlock->m_numVars) == m_watchableVariables.size()); 150 146 151 return true;147 return addVar(); 152 148 } 153 149 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r180595 r180711 614 614 // Adds a var slot and maps it to the name ident in symbolTable(). 615 615 enum WatchMode { IsWatchable, NotWatchable }; 616 RegisterID* addVar(const Identifier& ident, ConstantMode constantMode, WatchMode watchMode) 617 { 618 RegisterID* local; 619 addVar(ident, constantMode, watchMode, local); 620 return local; 621 } 622 623 // Ditto. Returns true if a new RegisterID was added, false if a pre-existing RegisterID was re-used. 624 bool addVar(const Identifier&, ConstantMode, WatchMode, RegisterID*&); 625 616 RegisterID* addVar(const Identifier&, ConstantMode, WatchMode); 617 626 618 // Adds an anonymous var slot. To give this slot a name, add it to symbolTable(). 627 619 RegisterID* addVar()
Note:
See TracChangeset
for help on using the changeset viewer.