|
Lines 852-884
PropertyTable* Structure::copyPropertyTa
Source/JavaScriptCore/runtime/Structure.cpp_sec1
|
| 852 |
|
852 |
|
| 853 |
PropertyOffset Structure::getConcurrently(StringImpl* uid, unsigned& attributes) |
853 |
PropertyOffset Structure::getConcurrently(StringImpl* uid, unsigned& attributes) |
| 854 |
{ |
854 |
{ |
| 855 |
Vector<Structure*, 8> structures; |
855 |
PropertyOffset result = invalidOffset; |
| 856 |
Structure* structure; |
|
|
| 857 |
PropertyTable* table; |
| 858 |
|
| 859 |
findStructuresAndMapForMaterialization(structures, structure, table); |
| 860 |
|
| 861 |
if (table) { |
| 862 |
PropertyMapEntry* entry = table->get(uid); |
| 863 |
if (entry) { |
| 864 |
attributes = entry->attributes; |
| 865 |
PropertyOffset result = entry->offset; |
| 866 |
structure->m_lock.unlock(); |
| 867 |
return result; |
| 868 |
} |
| 869 |
structure->m_lock.unlock(); |
| 870 |
} |
| 871 |
|
856 |
|
| 872 |
for (unsigned i = structures.size(); i--;) { |
857 |
forEachPropertyConcurrently( |
| 873 |
structure = structures[i]; |
858 |
[&] (const PropertyMapEntry& candidate) -> bool { |
| 874 |
if (structure->m_nameInPrevious.get() != uid) |
859 |
if (candidate.key != uid) |
| 875 |
continue; |
860 |
return true; |
| 876 |
|
861 |
|
| 877 |
attributes = structure->attributesInPrevious(); |
862 |
result = candidate.offset; |
| 878 |
return structure->m_offset; |
863 |
attributes = candidate.attributes; |
| 879 |
} |
864 |
return false; |
|
|
865 |
}); |
| 880 |
|
866 |
|
| 881 |
return invalidOffset; |
867 |
return result; |
|
|
868 |
} |
| 869 |
|
| 870 |
Vector<PropertyMapEntry> Structure::getPropertiesConcurrently() |
| 871 |
{ |
| 872 |
Vector<PropertyMapEntry> result; |
| 873 |
|
| 874 |
forEachPropertyConcurrently( |
| 875 |
[&] (const PropertyMapEntry& entry) -> bool { |
| 876 |
result.append(entry); |
| 877 |
return true; |
| 878 |
}); |
| 879 |
|
| 880 |
return result; |
| 882 |
} |
881 |
} |
| 883 |
|
882 |
|
| 884 |
PropertyOffset Structure::add(VM& vm, PropertyName propertyName, unsigned attributes) |
883 |
PropertyOffset Structure::add(VM& vm, PropertyName propertyName, unsigned attributes) |
|
Lines 1110-1139
void Structure::dump(PrintStream& out) c
Source/JavaScriptCore/runtime/Structure.cpp_sec2
|
| 1110 |
{ |
1109 |
{ |
| 1111 |
out.print(RawPointer(this), ":[", classInfo()->className, ", {"); |
1110 |
out.print(RawPointer(this), ":[", classInfo()->className, ", {"); |
| 1112 |
|
1111 |
|
| 1113 |
Vector<Structure*, 8> structures; |
|
|
| 1114 |
Structure* structure; |
| 1115 |
PropertyTable* table; |
| 1116 |
|
| 1117 |
const_cast<Structure*>(this)->findStructuresAndMapForMaterialization( |
| 1118 |
structures, structure, table); |
| 1119 |
|
| 1120 |
CommaPrinter comma; |
1112 |
CommaPrinter comma; |
| 1121 |
|
1113 |
|
| 1122 |
if (table) { |
1114 |
const_cast<Structure*>(this)->forEachPropertyConcurrently( |
| 1123 |
PropertyTable::iterator iter = table->begin(); |
1115 |
[&] (const PropertyMapEntry& entry) -> bool { |
| 1124 |
PropertyTable::iterator end = table->end(); |
1116 |
out.print(comma, entry.key, ":", static_cast<int>(entry.offset)); |
| 1125 |
for (; iter != end; ++iter) |
1117 |
return true; |
| 1126 |
out.print(comma, iter->key, ":", static_cast<int>(iter->offset)); |
1118 |
}); |
| 1127 |
|
|
|
| 1128 |
structure->m_lock.unlock(); |
| 1129 |
} |
| 1130 |
|
| 1131 |
for (unsigned i = structures.size(); i--;) { |
| 1132 |
Structure* structure = structures[i]; |
| 1133 |
if (!structure->m_nameInPrevious) |
| 1134 |
continue; |
| 1135 |
out.print(comma, structure->m_nameInPrevious.get(), ":", static_cast<int>(structure->m_offset)); |
| 1136 |
} |
| 1137 |
|
1119 |
|
| 1138 |
out.print("}, ", IndexingTypeDump(indexingType())); |
1120 |
out.print("}, ", IndexingTypeDump(indexingType())); |
| 1139 |
|
1121 |
|