OLD | NEW |
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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 // Has/Get/SetHiddenPropertiesObject methods don't allow the holder to be | 1633 // Has/Get/SetHiddenPropertiesObject methods don't allow the holder to be |
1634 // a JSGlobalProxy. Use BypassGlobalProxy method above to get to the real | 1634 // a JSGlobalProxy. Use BypassGlobalProxy method above to get to the real |
1635 // holder. | 1635 // holder. |
1636 // | 1636 // |
1637 // These accessors do not touch interceptors or accessors. | 1637 // These accessors do not touch interceptors or accessors. |
1638 inline bool HasHiddenPropertiesObject(); | 1638 inline bool HasHiddenPropertiesObject(); |
1639 inline Object* GetHiddenPropertiesObject(); | 1639 inline Object* GetHiddenPropertiesObject(); |
1640 MUST_USE_RESULT inline MaybeObject* SetHiddenPropertiesObject( | 1640 MUST_USE_RESULT inline MaybeObject* SetHiddenPropertiesObject( |
1641 Object* hidden_obj); | 1641 Object* hidden_obj); |
1642 | 1642 |
| 1643 MUST_USE_RESULT MaybeObject* GetHiddenProperties(bool create_if_needed); |
| 1644 |
| 1645 // Retrieves a permanent object identity hash code. |
| 1646 MUST_USE_RESULT MaybeObject* GetIdentityHash(); |
| 1647 |
1643 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode); | 1648 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode); |
1644 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); | 1649 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); |
1645 | 1650 |
1646 // Tests for the fast common case for property enumeration. | 1651 // Tests for the fast common case for property enumeration. |
1647 bool IsSimpleEnum(); | 1652 bool IsSimpleEnum(); |
1648 | 1653 |
1649 // Do we want to keep the elements in fast case when increasing the | 1654 // Do we want to keep the elements in fast case when increasing the |
1650 // capacity? | 1655 // capacity? |
1651 bool ShouldConvertToSlowElements(int new_capacity); | 1656 bool ShouldConvertToSlowElements(int new_capacity); |
1652 // Returns true if the backing storage for the slow-case elements of | 1657 // Returns true if the backing storage for the slow-case elements of |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2914 // Remove all entries were key is a number and (from <= key && key < to). | 2919 // Remove all entries were key is a number and (from <= key && key < to). |
2915 void RemoveNumberEntries(uint32_t from, uint32_t to); | 2920 void RemoveNumberEntries(uint32_t from, uint32_t to); |
2916 | 2921 |
2917 // Bit masks. | 2922 // Bit masks. |
2918 static const int kRequiresSlowElementsMask = 1; | 2923 static const int kRequiresSlowElementsMask = 1; |
2919 static const int kRequiresSlowElementsTagSize = 1; | 2924 static const int kRequiresSlowElementsTagSize = 1; |
2920 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; | 2925 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; |
2921 }; | 2926 }; |
2922 | 2927 |
2923 | 2928 |
| 2929 class ObjectDictionaryShape { |
| 2930 public: |
| 2931 static inline bool IsMatch(JSObject* key, Object* other); |
| 2932 static inline uint32_t Hash(JSObject* key); |
| 2933 static inline uint32_t HashForObject(JSObject* key, Object* object); |
| 2934 MUST_USE_RESULT static inline MaybeObject* AsObject(JSObject* key); |
| 2935 static const int kPrefixSize = 2; |
| 2936 static const int kEntrySize = 3; |
| 2937 static const bool kIsEnumerable = false; |
| 2938 }; |
| 2939 |
| 2940 |
| 2941 class ObjectDictionary: public Dictionary<ObjectDictionaryShape, JSObject*> { |
| 2942 public: |
| 2943 static inline ObjectDictionary* cast(Object* obj) { |
| 2944 ASSERT(obj->IsDictionary()); |
| 2945 return reinterpret_cast<ObjectDictionary*>(obj); |
| 2946 } |
| 2947 }; |
| 2948 |
| 2949 |
2924 // JSFunctionResultCache caches results of some JSFunction invocation. | 2950 // JSFunctionResultCache caches results of some JSFunction invocation. |
2925 // It is a fixed array with fixed structure: | 2951 // It is a fixed array with fixed structure: |
2926 // [0]: factory function | 2952 // [0]: factory function |
2927 // [1]: finger index | 2953 // [1]: finger index |
2928 // [2]: current cache size | 2954 // [2]: current cache size |
2929 // [3]: dummy field. | 2955 // [3]: dummy field. |
2930 // The rest of array are key/value pairs. | 2956 // The rest of array are key/value pairs. |
2931 class JSFunctionResultCache: public FixedArray { | 2957 class JSFunctionResultCache: public FixedArray { |
2932 public: | 2958 public: |
2933 static const int kFactoryIndex = 0; | 2959 static const int kFactoryIndex = 0; |
(...skipping 4238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7172 } else { | 7198 } else { |
7173 value &= ~(1 << bit_position); | 7199 value &= ~(1 << bit_position); |
7174 } | 7200 } |
7175 return value; | 7201 return value; |
7176 } | 7202 } |
7177 }; | 7203 }; |
7178 | 7204 |
7179 } } // namespace v8::internal | 7205 } } // namespace v8::internal |
7180 | 7206 |
7181 #endif // V8_OBJECTS_H_ | 7207 #endif // V8_OBJECTS_H_ |
OLD | NEW |