Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Unified Diff: src/objects.h

Issue 92123: Fix Issue 326. Handle sorting of non-array objects correctly. (Closed)
Patch Set: Simplified fixed-array collation loop. Added more tests for dictionary. Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/array.js ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index db3c4498a3b92072250b5243476ac7d0b4698d0a..583625ef75af15191f88e7d39d34b90271548de2 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1178,6 +1178,14 @@ class JSObject: public HeapObject {
inline bool HasFastElements();
inline Dictionary* element_dictionary(); // Gets slow elements.
+ // Collects elements starting at index 0.
+ // Undefined values are placed after non-un defined values.
+ // Returns the number of non-undefined values.
+ Object* PrepareElementsForSort(uint32_t limit);
+ // As PrepareElementsForSort, but only on objects where elements is
+ // a dictionary, and it will stay a dictionary.
+ Object* PrepareSlowElementsForSort(uint32_t limit);
+
Object* SetProperty(String* key,
Object* value,
PropertyAttributes attributes);
@@ -2005,7 +2013,6 @@ class Dictionary: public DictionaryBase {
void RemoveNumberEntries(uint32_t from, uint32_t to);
// Sorting support
- Object* RemoveHoles();
void CopyValuesTo(FixedArray* elements);
// Casting.
@@ -3876,9 +3883,6 @@ class JSArray: public JSObject {
// Set the content of the array to the content of storage.
inline void SetContent(FixedArray* storage);
- // Support for sorting
- Object* RemoveHoles();
-
// Casting.
static inline JSArray* cast(Object* obj);
« no previous file with comments | « src/array.js ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698