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

Side by Side Diff: src/objects.h

Issue 8372064: Fix setting array length to be ES5 conform. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Daniel Clifford. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 // Replace the elements' backing store with fast elements of the given 1728 // Replace the elements' backing store with fast elements of the given
1729 // capacity. Update the length for JSArrays. Returns the new backing 1729 // capacity. Update the length for JSArrays. Returns the new backing
1730 // store. 1730 // store.
1731 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength( 1731 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(
1732 int capacity, 1732 int capacity,
1733 int length, 1733 int length,
1734 SetFastElementsCapacityMode set_capacity_mode); 1734 SetFastElementsCapacityMode set_capacity_mode);
1735 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength( 1735 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength(
1736 int capacity, 1736 int capacity,
1737 int length); 1737 int length);
1738 MUST_USE_RESULT MaybeObject* SetSlowElements(Object* length);
1739 1738
1740 // Lookup interceptors are used for handling properties controlled by host 1739 // Lookup interceptors are used for handling properties controlled by host
1741 // objects. 1740 // objects.
1742 inline bool HasNamedInterceptor(); 1741 inline bool HasNamedInterceptor();
1743 inline bool HasIndexedInterceptor(); 1742 inline bool HasIndexedInterceptor();
1744 1743
1745 // Support functions for v8 api (needed for correct interceptor behavior). 1744 // Support functions for v8 api (needed for correct interceptor behavior).
1746 bool HasRealNamedProperty(String* key); 1745 bool HasRealNamedProperty(String* key);
1747 bool HasRealElementProperty(uint32_t index); 1746 bool HasRealElementProperty(uint32_t index);
1748 bool HasRealNamedCallbackProperty(String* key); 1747 bool HasRealNamedCallbackProperty(String* key);
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 // kRequiresSlowElementsLimit or set_requires_slow_elements() has been called 2979 // kRequiresSlowElementsLimit or set_requires_slow_elements() has been called
2981 // when defining a getter or setter with a number key. 2980 // when defining a getter or setter with a number key.
2982 inline bool requires_slow_elements(); 2981 inline bool requires_slow_elements();
2983 inline void set_requires_slow_elements(); 2982 inline void set_requires_slow_elements();
2984 2983
2985 // Get the value of the max number key that has been added to this 2984 // Get the value of the max number key that has been added to this
2986 // dictionary. max_number_key can only be called if 2985 // dictionary. max_number_key can only be called if
2987 // requires_slow_elements returns false. 2986 // requires_slow_elements returns false.
2988 inline uint32_t max_number_key(); 2987 inline uint32_t max_number_key();
2989 2988
2990 // Remove all entries were key is a number and (from <= key && key < to).
2991 void RemoveNumberEntries(uint32_t from, uint32_t to);
2992
2993 // Bit masks. 2989 // Bit masks.
2994 static const int kRequiresSlowElementsMask = 1; 2990 static const int kRequiresSlowElementsMask = 1;
2995 static const int kRequiresSlowElementsTagSize = 1; 2991 static const int kRequiresSlowElementsTagSize = 1;
2996 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; 2992 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1;
2997 }; 2993 };
2998 2994
2999 2995
3000 template <int entrysize> 2996 template <int entrysize>
3001 class ObjectHashTableShape { 2997 class ObjectHashTableShape {
3002 public: 2998 public:
(...skipping 4803 matching lines...) Expand 10 before | Expand all | Expand 10 after
7806 } else { 7802 } else {
7807 value &= ~(1 << bit_position); 7803 value &= ~(1 << bit_position);
7808 } 7804 }
7809 return value; 7805 return value;
7810 } 7806 }
7811 }; 7807 };
7812 7808
7813 } } // namespace v8::internal 7809 } } // namespace v8::internal
7814 7810
7815 #endif // V8_OBJECTS_H_ 7811 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698