Changeset 65104 in webkit for trunk/JavaScriptCore/bytecompiler
- Timestamp:
- Aug 10, 2010, 5:16:38 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/bytecompiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r64790 r65104 166 166 int index = m_calleeRegisters.size(); 167 167 SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0); 168 pair<SymbolTable::iterator, bool> result = symbolTable().add(ident. ustring().rep(), newEntry);168 pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry); 169 169 170 170 if (!result.second) { … … 181 181 int index = m_nextGlobalIndex; 182 182 SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0); 183 pair<SymbolTable::iterator, bool> result = symbolTable().add(ident. ustring().rep(), newEntry);183 pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry); 184 184 185 185 if (!result.second) … … 351 351 FunctionBodyNode* function = functionStack[i]; 352 352 const Identifier& ident = function->ident(); 353 m_functions.add(ident. ustring().rep());353 m_functions.add(ident.impl()); 354 354 emitNewFunction(addVar(ident, false), function); 355 355 } … … 438 438 { 439 439 // Parameters overwrite var declarations, but not function declarations. 440 UString::Rep* rep = ident.ustring().rep();440 StringImpl* rep = ident.impl(); 441 441 if (!m_functions.contains(rep)) { 442 442 symbolTable().set(rep, parameterIndex); … … 458 458 return 0; 459 459 460 SymbolTableEntry entry = symbolTable().get(ident. ustring().rep());460 SymbolTableEntry entry = symbolTable().get(ident.impl()); 461 461 if (entry.isNull()) 462 462 return 0; … … 476 476 return false; 477 477 478 SymbolTableEntry entry = symbolTable().get(ident. ustring().rep());478 SymbolTableEntry entry = symbolTable().get(ident.impl()); 479 479 if (entry.isNull()) 480 480 return false; … … 490 490 ASSERT(willResolveToArguments(propertyNames().arguments)); 491 491 492 SymbolTableEntry entry = symbolTable().get(propertyNames().arguments. ustring().rep());492 SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.impl()); 493 493 ASSERT(!entry.isNull()); 494 494 return ®isterFor(entry.getIndex()); … … 500 500 return 0; 501 501 502 SymbolTableEntry entry = symbolTable().get(ident. ustring().rep());502 SymbolTableEntry entry = symbolTable().get(ident.impl()); 503 503 if (entry.isNull()) 504 504 return 0; … … 512 512 return true; 513 513 514 return shouldOptimizeLocals() && symbolTable().contains(ident. ustring().rep());514 return shouldOptimizeLocals() && symbolTable().contains(ident.impl()); 515 515 } 516 516 517 517 bool BytecodeGenerator::isLocalConstant(const Identifier& ident) 518 518 { 519 return symbolTable().get(ident. ustring().rep()).isReadOnly();519 return symbolTable().get(ident.impl()).isReadOnly(); 520 520 } 521 521 … … 830 830 unsigned BytecodeGenerator::addConstant(const Identifier& ident) 831 831 { 832 UString::Rep* rep = ident.ustring().rep();832 StringImpl* rep = ident.impl(); 833 833 pair<IdentifierMap::iterator, bool> result = m_identifierMap.add(rep, m_codeBlock->numberOfIdentifiers()); 834 834 if (result.second) // new entry … … 1002 1002 RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, const Identifier& identifier) 1003 1003 { 1004 JSString*& stringInMap = m_stringMap.add(identifier. ustring().rep(), 0).first->second;1004 JSString*& stringInMap = m_stringMap.add(identifier.impl(), 0).first->second; 1005 1005 if (!stringInMap) 1006 1006 stringInMap = jsOwnedString(globalData(), identifier.ustring()); … … 1040 1040 break; 1041 1041 JSVariableObject* currentVariableObject = static_cast<JSVariableObject*>(currentScope); 1042 SymbolTableEntry entry = currentVariableObject->symbolTable().get(property. ustring().rep());1042 SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.impl()); 1043 1043 1044 1044 // Found the property … … 1975 1975 UNUSED_PARAM(max); 1976 1976 ASSERT(node->isString()); 1977 UString::Rep* clause = static_cast<StringNode*>(node)->value().ustring().rep();1977 StringImpl* clause = static_cast<StringNode*>(node)->value().impl(); 1978 1978 ASSERT(clause->length() == 1); 1979 1979 … … 2005 2005 2006 2006 ASSERT(nodes[i]->isString()); 2007 UString::Rep* clause = static_cast<StringNode*>(nodes[i])->value().ustring().rep();2007 StringImpl* clause = static_cast<StringNode*>(nodes[i])->value().impl(); 2008 2008 OffsetLocation location; 2009 2009 location.branchOffset = labels[i]->bind(switchAddress, switchAddress + 3); -
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r64790 r65104 437 437 }; 438 438 439 typedef HashMap<RefPtr< UString::Rep>, int, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap;439 typedef HashMap<RefPtr<StringImpl>, int, IdentifierRepHash, HashTraits<RefPtr<StringImpl> >, IdentifierMapIndexHashTraits> IdentifierMap; 440 440 typedef HashMap<double, JSValue> NumberMap; 441 typedef HashMap< UString::Rep*, JSString*, IdentifierRepHash> IdentifierStringMap;441 typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap; 442 442 443 443 RegisterID* emitCall(OpcodeID, RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset); … … 525 525 // Some of these objects keep pointers to one another. They are arranged 526 526 // to ensure a sane destruction order that avoids references to freed memory. 527 HashSet<RefPtr< UString::Rep>, IdentifierRepHash> m_functions;527 HashSet<RefPtr<StringImpl>, IdentifierRepHash> m_functions; 528 528 RegisterID m_ignoredResultRegister; 529 529 RegisterID m_thisRegister; -
trunk/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r63515 r65104 1749 1749 const UString& value = static_cast<StringNode*>(clauseExpression)->value().ustring(); 1750 1750 if (singleCharacterSwitch &= value.size() == 1) { 1751 int32_t intVal = value. rep()->characters()[0];1751 int32_t intVal = value.impl()->characters()[0]; 1752 1752 if (intVal < min_num) 1753 1753 min_num = intVal;
Note:
See TracChangeset
for help on using the changeset viewer.