Changeset 38046 in webkit for trunk/JavaScriptCore/runtime/StructureID.cpp
- Timestamp:
- Oct 31, 2008, 12:53:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/StructureID.cpp
r38016 r38046 29 29 #include "JSObject.h" 30 30 #include "PropertyNameArray.h" 31 #include "StructureIDChain.h" 31 32 #include "identifier.h" 32 33 #include "lookup.h" … … 893 894 #endif // DO_PROPERTYMAP_CONSTENCY_CHECK 894 895 895 // StructureIDChain896 897 StructureIDChain::StructureIDChain(StructureID* structureID)898 {899 size_t size = 1;900 901 StructureID* tmp = structureID;902 while (!tmp->storedPrototype()->isNull()) {903 ++size;904 tmp = asCell(tmp->storedPrototype())->structureID();905 }906 907 m_vector.set(new RefPtr<StructureID>[size + 1]);908 909 size_t i;910 for (i = 0; i < size - 1; ++i) {911 m_vector[i] = structureID;912 structureID = asObject(structureID->storedPrototype())->structureID();913 }914 m_vector[i] = structureID;915 m_vector[i + 1] = 0;916 }917 918 bool structureIDChainsAreEqual(StructureIDChain* chainA, StructureIDChain* chainB)919 {920 if (!chainA || !chainB)921 return false;922 923 RefPtr<StructureID>* a = chainA->head();924 RefPtr<StructureID>* b = chainB->head();925 while (1) {926 if (*a != *b)927 return false;928 if (!*a)929 return true;930 a++;931 b++;932 }933 }934 935 896 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.