Changeset 10744 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 5, 2005, 1:05:44 AM (20 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 added
- 5 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r10728 r10744 1 2005-10-05 Maciej Stachowiak <[email protected]> 2 3 Reviewed by Eric. 4 5 - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore 6 7 Also fixed some bugs with for..in enumeration while I was at it. object 8 properties now come before prototype properties and duplicates 9 between object and prototype are listed only once. 10 11 * JavaScriptCore.xcodeproj/project.pbxproj: 12 * kjs/IdentifierSequencedSet.cpp: Added. 13 (KJS::IdentifierSequencedSet::IdentifierSequencedSet): 14 (KJS::IdentifierSequencedSet::deallocateVector): 15 (KJS::IdentifierSequencedSet::~IdentifierSequencedSet): 16 (KJS::IdentifierSequencedSet::insert): 17 * kjs/IdentifierSequencedSet.h: Added. 18 (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator): 19 (KJS::IdentifierSequencedSetIterator::operator*): 20 (KJS::IdentifierSequencedSetIterator::operator->): 21 (KJS::IdentifierSequencedSetIterator::operator++): 22 (KJS::IdentifierSequencedSetIterator::operator==): 23 (KJS::IdentifierSequencedSetIterator::operator!=): 24 (KJS::IdentifierSequencedSet::begin): 25 (KJS::IdentifierSequencedSet::end): 26 (KJS::IdentifierSequencedSet::size): 27 * kjs/array_instance.h: 28 * kjs/array_object.cpp: 29 (ArrayInstanceImp::getPropertyNames): 30 (ArrayInstanceImp::setLength): 31 (ArrayInstanceImp::pushUndefinedObjectsToEnd): 32 * kjs/nodes.cpp: 33 (ForInNode::execute): 34 * kjs/nodes.h: 35 * kjs/object.cpp: 36 (KJS::ObjectImp::getPropertyNames): 37 * kjs/object.h: 38 * kjs/property_map.cpp: 39 (KJS::PropertyMap::getEnumerablePropertyNames): 40 (KJS::PropertyMap::getSparseArrayPropertyNames): 41 * kjs/property_map.h: 42 * kjs/protect.h: 43 * kjs/protected_reference.h: Removed. 44 * kjs/reference.cpp: Removed. 45 * kjs/reference.h: Removed. 46 * kjs/reference_list.cpp: Removed. 47 * kjs/reference_list.h: Removed. 48 * kjs/ustring.h: 49 (KJS::UString::impl): 50 * kxmlcore/HashSet.h: 51 1 52 2005-10-04 Eric Seidel <[email protected]> 2 53 -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r10701 r10744 33 33 37B800F008EBB65B0035B474 /* HashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92E08EA173A00F7300B /* HashTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 34 34 37B800F108EBB65C0035B474 /* HashTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92F08EA173A00F7300B /* HashTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; 35 6512E62B08F3BA8B004A15B6 /* IdentifierSequencedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 36 6512E63608F3BADE004A15B6 /* IdentifierSequencedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */; }; 35 37 65162EEB08E6A1FE007556CD /* SharedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65162EEA08E6A1FE007556CD /* SharedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 36 38 65162F0208E6A2D0007556CD /* SharedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65162EEA08E6A1FE007556CD /* SharedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 37 652C107F08DA7B1E0020887D /* protected_reference.h in Headers */ = {isa = PBXBuildFile; fileRef = 652C107E08DA7B1E0020887D /* protected_reference.h */; };38 39 6541BD7208E80A17002CBEE7 /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6E08E80A17002CBEE7 /* TCPageMap.h */; }; 39 40 6541BD7308E80A17002CBEE7 /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */; }; … … 45 46 65621E6F089E85D300760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; }; 46 47 65621E70089E85D300760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; }; 48 65D6D61D08F2676800958B28 /* IdentifierSequencedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */; }; 49 65D6D61E08F2676800958B28 /* IdentifierSequencedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 47 50 65D7D19C08F10B5B0015ABD8 /* FastMallocInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D7D19B08F10B5B0015ABD8 /* FastMallocInternal.h */; }; 48 51 65DFC93008EA173A00F7300B /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92A08EA173A00F7300B /* HashFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 93 96 932F5B610822A1C700736975 /* JavaScriptCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */; }; 94 97 932F5B620822A1C700736975 /* simple_number.h in Headers */ = {isa = PBXBuildFile; fileRef = F50888B6030BB74C012A967E /* simple_number.h */; settings = {ATTRIBUTES = (Private, ); }; }; 95 932F5B630822A1C700736975 /* reference_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F54F0800030CD22001B5C2EB /* reference_list.h */; settings = {ATTRIBUTES = (Private, ); }; };96 932F5B640822A1C700736975 /* reference.h in Headers */ = {isa = PBXBuildFile; fileRef = F5341391030CEEB1018BE7F3 /* reference.h */; settings = {ATTRIBUTES = (Private, ); }; };97 98 932F5B650822A1C700736975 /* completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* completion.h */; settings = {ATTRIBUTES = (Private, ); }; }; 98 99 932F5B660822A1C700736975 /* identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A349A038AE7C6008635CE /* identifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 159 160 932F5BA90822A1C700736975 /* value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8870255597D01FF60F7 /* value.cpp */; }; 160 161 932F5BAB0822A1C700736975 /* nodes2string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5FFE656026B47A6018635CA /* nodes2string.cpp */; }; 161 932F5BAC0822A1C700736975 /* reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341390030CEEB1018BE7F3 /* reference.cpp */; settings = {ATTRIBUTES = (Private, ); }; };162 932F5BAD0822A1C700736975 /* reference_list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341394030CF5F8018BE7F3 /* reference_list.cpp */; settings = {ATTRIBUTES = (Private, ); }; };163 162 932F5BAE0822A1C700736975 /* identifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A349D038AE80F008635CE /* identifier.cpp */; }; 164 163 932F5BAF0822A1C700736975 /* scope_chain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9374D3A8038D9D74008635CE /* scope_chain.cpp */; }; … … 249 248 A85D8211087B2822006A9172 /* JavaScriptCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */; }; 250 249 A85D8212087B2822006A9172 /* simple_number.h in Headers */ = {isa = PBXBuildFile; fileRef = F50888B6030BB74C012A967E /* simple_number.h */; settings = {ATTRIBUTES = (Private, ); }; }; 251 A85D8213087B2822006A9172 /* reference_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F54F0800030CD22001B5C2EB /* reference_list.h */; settings = {ATTRIBUTES = (Private, ); }; };252 A85D8214087B2822006A9172 /* reference.h in Headers */ = {isa = PBXBuildFile; fileRef = F5341391030CEEB1018BE7F3 /* reference.h */; settings = {ATTRIBUTES = (Private, ); }; };253 250 A85D8215087B2822006A9172 /* completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* completion.h */; settings = {ATTRIBUTES = (Private, ); }; }; 254 251 A85D8216087B2822006A9172 /* identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A349A038AE7C6008635CE /* identifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 317 314 A85D8259087B2822006A9172 /* value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8870255597D01FF60F7 /* value.cpp */; }; 318 315 A85D825A087B2822006A9172 /* nodes2string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5FFE656026B47A6018635CA /* nodes2string.cpp */; }; 319 A85D825B087B2822006A9172 /* reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341390030CEEB1018BE7F3 /* reference.cpp */; settings = {ATTRIBUTES = (Private, ); }; };320 A85D825C087B2822006A9172 /* reference_list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341394030CF5F8018BE7F3 /* reference_list.cpp */; settings = {ATTRIBUTES = (Private, ); }; };321 316 A85D825D087B2822006A9172 /* identifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A349D038AE80F008635CE /* identifier.cpp */; }; 322 317 A85D825E087B2822006A9172 /* scope_chain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9374D3A8038D9D74008635CE /* scope_chain.cpp */; }; … … 363 358 A883C7F508EA12860051473E /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */; }; 364 359 A883C7F608EA12860051473E /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */; }; 365 A883C7F708EA12A20051473E /* protected_reference.h in Headers */ = {isa = PBXBuildFile; fileRef = 652C107E08DA7B1E0020887D /* protected_reference.h */; };366 360 A8BC0DFC08D43D6D00379918 /* ucptable.c in Headers */ = {isa = PBXBuildFile; fileRef = 93E26C0D08B1520900F85226 /* ucptable.c */; }; 367 361 /* End PBXBuildFile section */ … … 503 497 651F6412039D5B5F0078395C /* dtoa.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dtoa.cpp; sourceTree = "<group>"; }; 504 498 651F6413039D5B5F0078395C /* dtoa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dtoa.h; sourceTree = "<group>"; }; 505 652C107E08DA7B1E0020887D /* protected_reference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protected_reference.h; sourceTree = "<group>"; };506 499 6541720E039E08B90058BFEB /* dftables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dftables.c; path = pcre/dftables.c; sourceTree = "<group>"; }; 507 500 6541720F039E08B90058BFEB /* pcre.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pcre.h; path = pcre/pcre.h; sourceTree = "<group>"; }; … … 517 510 65621E6C089E859700760F35 /* property_slot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = property_slot.h; sourceTree = "<group>"; }; 518 511 65C02FBB0637462A003E7EE6 /* protect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protect.h; sourceTree = "<group>"; }; 512 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IdentifierSequencedSet.cpp; sourceTree = "<group>"; }; 513 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IdentifierSequencedSet.h; sourceTree = "<group>"; }; 519 514 65D7D19B08F10B5B0015ABD8 /* FastMallocInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FastMallocInternal.h; sourceTree = "<group>"; }; 520 515 65DFC92A08EA173A00F7300B /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = "<group>"; }; … … 573 568 A85D8288087B2822006A9172 /* JavaScriptCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 574 569 F50888B6030BB74C012A967E /* simple_number.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = simple_number.h; sourceTree = "<group>"; }; 575 F5341390030CEEB1018BE7F3 /* reference.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reference.cpp; sourceTree = "<group>"; };576 F5341391030CEEB1018BE7F3 /* reference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reference.h; sourceTree = "<group>"; };577 F5341394030CF5F8018BE7F3 /* reference_list.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reference_list.cpp; sourceTree = "<group>"; };578 F54F0800030CD22001B5C2EB /* reference_list.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reference_list.h; sourceTree = "<group>"; };579 570 F5BB2BC5030F772101FCFE1D /* completion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = completion.h; sourceTree = "<group>"; }; 580 571 F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JavaScriptCorePrefix.h; path = ../JavaScriptCorePrefix.h; sourceTree = "<group>"; }; … … 715 706 isa = PBXGroup; 716 707 children = ( 708 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */, 709 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */, 717 710 65621E6B089E859700760F35 /* property_slot.cpp */, 718 711 65621E6C089E859700760F35 /* property_slot.h */, 719 712 938772E5038BFE19008635CE /* array_instance.h */, 720 713 650B68D80639033F009D42DE /* protected_values.cpp */, 721 652C107E08DA7B1E0020887D /* protected_reference.h */,722 714 650B68D90639033F009D42DE /* protected_values.h */, 723 715 F692A84E0255597D01FF60F7 /* array_object.h */, … … 766 758 F692A8790255597D01FF60F7 /* property_map.cpp */, 767 759 65C02FBB0637462A003E7EE6 /* protect.h */, 768 F5341390030CEEB1018BE7F3 /* reference.cpp */,769 F5341391030CEEB1018BE7F3 /* reference.h */,770 F54F0800030CD22001B5C2EB /* reference_list.h */,771 F5341394030CF5F8018BE7F3 /* reference_list.cpp */,772 760 F692A87B0255597D01FF60F7 /* regexp_object.cpp */, 773 761 F692A87C0255597D01FF60F7 /* regexp_object.h */, … … 972 960 932F5B610822A1C700736975 /* JavaScriptCorePrefix.h in Headers */, 973 961 932F5B620822A1C700736975 /* simple_number.h in Headers */, 974 932F5B630822A1C700736975 /* reference_list.h in Headers */,975 932F5B640822A1C700736975 /* reference.h in Headers */,976 962 932F5B650822A1C700736975 /* completion.h in Headers */, 977 963 932F5B660822A1C700736975 /* identifier.h in Headers */, … … 1020 1006 93E26C1308B1523D00F85226 /* ucptable.c in Headers */, 1021 1007 93E26CCF08B2921900F85226 /* softlinking.h in Headers */, 1022 652C107F08DA7B1E0020887D /* protected_reference.h in Headers */,1023 1008 65162EEB08E6A1FE007556CD /* SharedPtr.h in Headers */, 1024 1009 65E217BD08E7EECC0023E5F6 /* Assertions.h in Headers */, … … 1034 1019 6557E8F808EA5D4D0049CDFC /* HashMapPtrSpec.h in Headers */, 1035 1020 65D7D19C08F10B5B0015ABD8 /* FastMallocInternal.h in Headers */, 1021 65D6D61E08F2676800958B28 /* IdentifierSequencedSet.h in Headers */, 1036 1022 ); 1037 1023 runOnlyForDeploymentPostprocessing = 0; … … 1069 1055 A85D8211087B2822006A9172 /* JavaScriptCorePrefix.h in Headers */, 1070 1056 A85D8212087B2822006A9172 /* simple_number.h in Headers */, 1071 A85D8213087B2822006A9172 /* reference_list.h in Headers */,1072 A85D8214087B2822006A9172 /* reference.h in Headers */,1073 1057 A85D8215087B2822006A9172 /* completion.h in Headers */, 1074 1058 A85D8216087B2822006A9172 /* identifier.h in Headers */, … … 1123 1107 A883C7F408EA12860051473E /* TCSpinLock.h in Headers */, 1124 1108 A883C7F608EA12860051473E /* TCSystemAlloc.h in Headers */, 1125 A883C7F708EA12A20051473E /* protected_reference.h in Headers */,1126 1109 37B800EB08EBB6520035B474 /* HashFunctions.h in Headers */, 1127 1110 37B800EC08EBB6540035B474 /* HashMap.h in Headers */, … … 1130 1113 37B800F008EBB65B0035B474 /* HashTable.h in Headers */, 1131 1114 37B800F108EBB65C0035B474 /* HashTraits.h in Headers */, 1115 6512E62B08F3BA8B004A15B6 /* IdentifierSequencedSet.h in Headers */, 1132 1116 ); 1133 1117 runOnlyForDeploymentPostprocessing = 0; … … 1642 1626 932F5BA90822A1C700736975 /* value.cpp in Sources */, 1643 1627 932F5BAB0822A1C700736975 /* nodes2string.cpp in Sources */, 1644 932F5BAC0822A1C700736975 /* reference.cpp in Sources */,1645 932F5BAD0822A1C700736975 /* reference_list.cpp in Sources */,1646 1628 932F5BAE0822A1C700736975 /* identifier.cpp in Sources */, 1647 1629 932F5BAF0822A1C700736975 /* scope_chain.cpp in Sources */, … … 1690 1672 6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */, 1691 1673 65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */, 1674 65D6D61D08F2676800958B28 /* IdentifierSequencedSet.cpp in Sources */, 1692 1675 ); 1693 1676 runOnlyForDeploymentPostprocessing = 0; … … 1739 1722 A85D8259087B2822006A9172 /* value.cpp in Sources */, 1740 1723 A85D825A087B2822006A9172 /* nodes2string.cpp in Sources */, 1741 A85D825B087B2822006A9172 /* reference.cpp in Sources */,1742 A85D825C087B2822006A9172 /* reference_list.cpp in Sources */,1743 1724 A85D825D087B2822006A9172 /* identifier.cpp in Sources */, 1744 1725 A85D825E087B2822006A9172 /* scope_chain.cpp in Sources */, … … 1787 1768 A883C7F508EA12860051473E /* TCSystemAlloc.cpp in Sources */, 1788 1769 37B800EF08EBB65B0035B474 /* HashTable.cpp in Sources */, 1770 6512E63608F3BADE004A15B6 /* IdentifierSequencedSet.cpp in Sources */, 1789 1771 ); 1790 1772 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/kjs/array_instance.h
r10084 r10744 40 40 virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName); 41 41 virtual bool deleteProperty(ExecState *exec, unsigned propertyName); 42 virtual ReferenceList propList(ExecState *exec, bool recursive);42 virtual void getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames); 43 43 44 44 virtual void mark(); -
trunk/JavaScriptCore/kjs/array_object.cpp
r10701 r10744 29 29 #include "object.h" 30 30 #include "operations.h" 31 #include "reference_list.h"32 31 #include "types.h" 33 32 #include "value.h" 33 #include "IdentifierSequencedSet.h" 34 34 35 35 #include "array_object.lut.h" … … 186 186 } 187 187 188 ReferenceList ArrayInstanceImp::propList(ExecState *exec, bool recursive) 189 { 190 ReferenceList properties = ObjectImp::propList(exec,recursive); 191 188 void ArrayInstanceImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames) 189 { 192 190 // avoid fetching this every time through the loop 193 191 ValueImp *undefined = jsUndefined(); … … 195 193 for (unsigned i = 0; i < storageLength; ++i) { 196 194 ValueImp *imp = storage[i]; 197 if (imp && imp != undefined) {198 propert ies.append(Reference(this,i));199 200 } 201 return properties;195 if (imp && imp != undefined) 196 propertyNames.insert(Identifier::from(i)); 197 } 198 199 ObjectImp::getPropertyNames(exec, propertyNames); 202 200 } 203 201 … … 231 229 232 230 if (newLength < length) { 233 ReferenceList sparseProperties; 234 235 _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, this); 236 237 ReferenceListIterator it = sparseProperties.begin(); 238 while (it != sparseProperties.end()) { 239 Reference ref = it++; 231 IdentifierSequencedSet sparseProperties; 232 233 _prop.getSparseArrayPropertyNames(sparseProperties); 234 235 IdentifierSequencedSetIterator end = sparseProperties.end(); 236 237 for (IdentifierSequencedSetIterator it = sparseProperties.begin(); it != end; ++it) { 238 Identifier name = *it; 240 239 bool ok; 241 unsigned index = ref.getPropertyName(exec).toArrayIndex(&ok); 242 if (ok && index > newLength) { 243 ref.deleteValue(exec); 244 } 240 unsigned index = name.toArrayIndex(&ok); 241 if (ok && index > newLength) 242 deleteProperty(exec, name); 245 243 } 246 244 } … … 349 347 } 350 348 351 ReferenceList sparseProperties;352 _prop. addSparseArrayPropertiesToReferenceList(sparseProperties, this);353 unsigned newLength = o + sparseProperties. length();354 355 if (newLength > storageLength) {349 IdentifierSequencedSet sparseProperties; 350 _prop.getSparseArrayPropertyNames(sparseProperties); 351 unsigned newLength = o + sparseProperties.size(); 352 353 if (newLength > storageLength) 356 354 resizeStorage(newLength); 357 } 358 359 ReferenceListIterator it = sparseProperties.begin(); 360 while (it != sparseProperties.end()) { 361 Reference ref = it++; 362 storage[o] = ref.getValue(exec); 363 ObjectImp::deleteProperty(exec, ref.getPropertyName(exec)); 355 356 IdentifierSequencedSetIterator end = sparseProperties.end(); 357 for (IdentifierSequencedSetIterator it = sparseProperties.begin(); it != end; ++it) { 358 Identifier name = *it; 359 storage[o] = get(exec, name); 360 ObjectImp::deleteProperty(exec, name); 364 361 o++; 365 362 } -
trunk/JavaScriptCore/kjs/nodes.cpp
r10701 r10744 44 44 #include "operations.h" 45 45 #include "ustring.h" 46 #include " reference_list.h"46 #include "IdentifierSequencedSet.h" 47 47 48 48 using namespace KJS; … … 1781 1781 ObjectImp *v; 1782 1782 Completion c; 1783 ReferenceList propList;1783 IdentifierSequencedSet propertyNames; 1784 1784 1785 1785 if (varDecl) { … … 1800 1800 KJS_CHECKEXCEPTION 1801 1801 v = e->toObject(exec); 1802 propList = v->propList(exec); 1803 1804 ReferenceListIterator propIt = propList.begin(); 1805 1806 while (propIt != propList.end()) { 1807 Identifier name = propIt->getPropertyName(exec); 1808 if (!v->hasProperty(exec, name)) { 1809 propIt++; 1802 v->getPropertyNames(exec, propertyNames); 1803 1804 IdentifierSequencedSetIterator end = propertyNames.end(); 1805 for (IdentifierSequencedSetIterator it = propertyNames.begin(); it != end; ++it) { 1806 const Identifier &name = *it; 1807 if (!v->hasProperty(exec, name)) 1810 1808 continue; 1811 }1812 1809 1813 1810 ValueImp *str = jsString(name.ustring()); … … 1871 1868 } 1872 1869 } 1873 1874 propIt++;1875 1870 } 1876 1871 -
trunk/JavaScriptCore/kjs/nodes.h
r10701 r10744 35 35 class PropertyNode; 36 36 class PropertyValueNode; 37 class Reference;38 37 class RegExp; 39 38 class SourceElementsNode; -
trunk/JavaScriptCore/kjs/object.cpp
r10728 r10744 29 29 #include "interpreter.h" 30 30 #include "lookup.h" 31 #include " reference_list.h"31 #include "IdentifierSequencedSet.h" 32 32 33 33 #include <assert.h> … … 375 375 } 376 376 377 ReferenceList ObjectImp::propList(ExecState *exec, bool recursive) 378 { 379 ReferenceList list; 380 if (_proto->isObject() && recursive) 381 list = static_cast<ObjectImp*>(_proto)->propList(exec,recursive); 382 383 _prop.addEnumerablesToReferenceList(list, this); 377 void ObjectImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet &propertyNames) 378 { 379 _prop.getEnumerablePropertyNames(propertyNames); 384 380 385 381 // Add properties from the static hashtable of properties … … 390 386 const HashEntry *e = info->propHashTable->entries; 391 387 for (int i = 0; i < size; ++i, ++e) { 392 if ( e->s && !(e->attr & DontEnum))393 list.append(Reference(this, e->s)); /// ######### check for duplicates with the propertymap388 if (e->s && !(e->attr & DontEnum)) 389 propertyNames.insert(e->s); 394 390 } 395 391 } … … 397 393 } 398 394 399 return list; 395 if (_proto->isObject()) 396 static_cast<ObjectImp*>(_proto)->getPropertyNames(exec, propertyNames); 400 397 } 401 398 -
trunk/JavaScriptCore/kjs/object.h
r10207 r10744 48 48 class HashEntry; 49 49 class ListImp; 50 class IdentifierSequencedSet; 50 51 51 52 // ECMA 262-3 8.6.1 … … 423 424 * 424 425 * @param exec The current execution state 425 * @param recursive Whether or not properties in the object's prototype 426 * chain should be 427 * included in the list. 428 * @return A List of References to properties of the object. 426 * @param propertyNames A list of property names to be filled in by this call 429 427 **/ 430 virtual ReferenceList propList(ExecState *exec, bool recursive = true);428 virtual void getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames); 431 429 432 430 /** -
trunk/JavaScriptCore/kjs/property_map.cpp
r10701 r10744 26 26 #include "object.h" 27 27 #include "protect.h" 28 #include " reference_list.h"28 #include "IdentifierSequencedSet.h" 29 29 30 30 #include <algorithm> … … 75 75 76 76 // lastIndexUsed is an ever-increasing index used to identify the order items 77 // were inserted into the property map. It's vital that addEnumerablesToReferenceList77 // were inserted into the property map. It's vital that getEnumerablePropertyNames 78 78 // return the properties in the order they were added for compatibility with other 79 79 // browsers' JavaScript implementations. … … 567 567 } 568 568 569 void PropertyMap:: addEnumerablesToReferenceList(ReferenceList &list, ObjectImp *base) const569 void PropertyMap::getEnumerablePropertyNames(IdentifierSequencedSet& propertyNames) const 570 570 { 571 571 if (!_table) { … … 573 573 UString::Rep *key = _singleEntry.key; 574 574 if (key && !(_singleEntry.attributes & DontEnum)) 575 list.append(Reference(base, Identifier(key)));575 propertyNames.insert(Identifier(key)); 576 576 #endif 577 577 return; … … 599 599 qsort(sortedEnumerables, p - sortedEnumerables, sizeof(sortedEnumerables[0]), comparePropertyMapEntryIndices); 600 600 601 // Put the keys of the sorted entries into the referencelist.601 // Put the keys of the sorted entries into the list. 602 602 Entry **q = sortedEnumerables; 603 while (q != p) 604 list.append(Reference(base, Identifier((*q++)->key))); 603 while (q != p) { 604 propertyNames.insert(Identifier(q[0]->key)); 605 ++q; 606 } 605 607 606 608 // Deallocate the buffer. … … 609 611 } 610 612 611 void PropertyMap:: addSparseArrayPropertiesToReferenceList(ReferenceList &list, ObjectImp *base) const613 void PropertyMap::getSparseArrayPropertyNames(IdentifierSequencedSet& propertyNames) const 612 614 { 613 615 if (!_table) { … … 619 621 k.toUInt32(&fitsInUInt32); 620 622 if (fitsInUInt32) 621 list.append(Reference(base, Identifier(key)));623 propertyNames.insert(Identifier(key)); 622 624 } 623 625 #endif … … 634 636 k.toUInt32(&fitsInUInt32); 635 637 if (fitsInUInt32) 636 list.append(Reference(base, Identifier(key)));638 propertyNames.insert(Identifier(key)); 637 639 } 638 640 } -
trunk/JavaScriptCore/kjs/property_map.h
r10180 r10744 28 28 namespace KJS { 29 29 30 class IdentifierSequencedSet; 30 31 class ObjectImp; 31 class ReferenceList;32 32 class ValueImp; 33 33 … … 82 82 83 83 void mark() const; 84 void addEnumerablesToReferenceList(ReferenceList &, ObjectImp *) const;85 void addSparseArrayPropertiesToReferenceList(ReferenceList &, ObjectImp *) const;84 void getEnumerablePropertyNames(IdentifierSequencedSet&) const; 85 void getSparseArrayPropertyNames(IdentifierSequencedSet&) const; 86 86 87 87 void save(SavedProperties &) const; -
trunk/JavaScriptCore/kjs/protect.h
r10563 r10744 25 25 #define _KJS_PROTECT_H_ 26 26 27 #include "reference.h"28 27 #include "value.h" 29 28 #include "protected_values.h" -
trunk/JavaScriptCore/kjs/ustring.h
r10701 r10744 241 241 242 242 public: 243 typedef Rep Impl; 244 243 245 /** 244 246 * Constructs a null string. … … 462 464 static void globalClear(); 463 465 #endif 466 467 Impl *impl() const { return rep; } 464 468 private: 465 469 UString(Rep *r) { attach(r); } -
trunk/JavaScriptCore/kxmlcore/HashSet.h
r10653 r10744 26 26 #include "HashTable.h" 27 27 #include "HashTraits.h" 28 #include " hashfunctions.h"28 #include "HashFunctions.h" 29 29 30 30 namespace KXMLCore {
Note:
See TracChangeset
for help on using the changeset viewer.