Changeset 38219 in webkit for trunk/JavaScriptCore/bytecompiler
- Timestamp:
- Nov 7, 2008, 1:22:41 AM (17 years ago)
- Location:
- trunk/JavaScriptCore/bytecompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/CodeGenerator.cpp
r38196 r38219 166 166 bool CodeGenerator::addGlobalVar(const Identifier& ident, bool isConstant, RegisterID*& r0) 167 167 { 168 int index = m_nextGlobal ;168 int index = m_nextGlobalIndex; 169 169 SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0); 170 170 pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry); … … 173 173 index = result.first->second.getIndex(); 174 174 else { 175 --m_nextGlobal ;175 --m_nextGlobalIndex; 176 176 m_globals.append(index + m_globalVarStorageOffset); 177 177 } … … 187 187 return; 188 188 189 m_nextConstant = m_calleeRegisters.size();189 m_nextConstantIndex = m_calleeRegisters.size(); 190 190 191 191 for (size_t i = 0; i < count; ++i) … … 205 205 , m_dynamicScopeDepth(0) 206 206 , m_codeType(GlobalCode) 207 , m_nextGlobal (-1)207 , m_nextGlobalIndex(-1) 208 208 , m_globalData(&scopeChain.globalObject()->globalExec()->globalData()) 209 209 , m_lastOpcodeID(op_end) … … 237 237 if (canOptimizeNewGlobals) { 238 238 // Shift new symbols so they get stored prior to existing symbols. 239 m_nextGlobal -= symbolTable->size();239 m_nextGlobalIndex -= symbolTable->size(); 240 240 241 241 for (size_t i = 0; i < functionStack.size(); ++i) { … … 322 322 const Identifier* parameters = functionBody->parameters(); 323 323 size_t parameterCount = functionBody->parameterCount(); 324 m_nextParameter = -RegisterFile::CallFrameHeaderSize - parameterCount - 1;324 m_nextParameterIndex = -RegisterFile::CallFrameHeaderSize - parameterCount - 1; 325 325 m_parameters.resize(1 + parameterCount); // reserve space for "this" 326 326 327 327 // Add "this" as a parameter 328 m_thisRegister.setIndex(m_nextParameter );329 ++m_nextParameter ;328 m_thisRegister.setIndex(m_nextParameterIndex); 329 ++m_nextParameterIndex; 330 330 ++m_codeBlock->numParameters; 331 331 … … 371 371 UString::Rep* rep = ident.ustring().rep(); 372 372 if (!m_functions.contains(rep)) { 373 symbolTable().set(rep, m_nextParameter );374 RegisterID& parameter = registerFor(m_nextParameter );375 parameter.setIndex(m_nextParameter );373 symbolTable().set(rep, m_nextParameterIndex); 374 RegisterID& parameter = registerFor(m_nextParameterIndex); 375 parameter.setIndex(m_nextParameterIndex); 376 376 result = ¶meter; 377 377 } … … 379 379 // To maintain the calling convention, we have to allocate unique space for 380 380 // each parameter, even if the parameter doesn't make it into the symbol table. 381 ++m_nextParameter ;381 ++m_nextParameterIndex; 382 382 ++m_codeBlock->numParameters; 383 383 return result; … … 684 684 RegisterID* CodeGenerator::addConstant(JSValue* v) 685 685 { 686 pair<JSValueMap::iterator, bool> result = m_jsValueMap.add(v, m_nextConstant );686 pair<JSValueMap::iterator, bool> result = m_jsValueMap.add(v, m_nextConstantIndex); 687 687 if (result.second) { 688 RegisterID& constant = m_calleeRegisters[m_nextConstant ];688 RegisterID& constant = m_calleeRegisters[m_nextConstantIndex]; 689 689 690 ++m_nextConstant ;690 ++m_nextConstantIndex; 691 691 692 692 m_codeBlock->constantRegisters.append(v); -
trunk/JavaScriptCore/bytecompiler/CodeGenerator.h
r38205 r38219 426 426 Vector<SwitchInfo> m_switchContextStack; 427 427 428 int m_nextGlobal ;429 int m_nextParameter ;430 int m_nextConstant ;428 int m_nextGlobalIndex; 429 int m_nextParameterIndex; 430 int m_nextConstantIndex; 431 431 432 432 int m_globalVarStorageOffset;
Note:
See TracChangeset
for help on using the changeset viewer.