| 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 | |
| 1648 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode); | 1643 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode); |
| 1649 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); | 1644 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); |
| 1650 | 1645 |
| 1651 // Tests for the fast common case for property enumeration. | 1646 // Tests for the fast common case for property enumeration. |
| 1652 bool IsSimpleEnum(); | 1647 bool IsSimpleEnum(); |
| 1653 | 1648 |
| 1654 // Do we want to keep the elements in fast case when increasing the | 1649 // Do we want to keep the elements in fast case when increasing the |
| 1655 // capacity? | 1650 // capacity? |
| 1656 bool ShouldConvertToSlowElements(int new_capacity); | 1651 bool ShouldConvertToSlowElements(int new_capacity); |
| 1657 // Returns true if the backing storage for the slow-case elements of | 1652 // 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... |
| 2919 // Remove all entries were key is a number and (from <= key && key < to). | 2914 // Remove all entries were key is a number and (from <= key && key < to). |
| 2920 void RemoveNumberEntries(uint32_t from, uint32_t to); | 2915 void RemoveNumberEntries(uint32_t from, uint32_t to); |
| 2921 | 2916 |
| 2922 // Bit masks. | 2917 // Bit masks. |
| 2923 static const int kRequiresSlowElementsMask = 1; | 2918 static const int kRequiresSlowElementsMask = 1; |
| 2924 static const int kRequiresSlowElementsTagSize = 1; | 2919 static const int kRequiresSlowElementsTagSize = 1; |
| 2925 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; | 2920 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; |
| 2926 }; | 2921 }; |
| 2927 | 2922 |
| 2928 | 2923 |
| 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 MUST_USE_RESULT MaybeObject* AddChecked(JSObject* key, Object* value); | |
| 2949 }; | |
| 2950 | |
| 2951 | |
| 2952 // JSFunctionResultCache caches results of some JSFunction invocation. | 2924 // JSFunctionResultCache caches results of some JSFunction invocation. |
| 2953 // It is a fixed array with fixed structure: | 2925 // It is a fixed array with fixed structure: |
| 2954 // [0]: factory function | 2926 // [0]: factory function |
| 2955 // [1]: finger index | 2927 // [1]: finger index |
| 2956 // [2]: current cache size | 2928 // [2]: current cache size |
| 2957 // [3]: dummy field. | 2929 // [3]: dummy field. |
| 2958 // The rest of array are key/value pairs. | 2930 // The rest of array are key/value pairs. |
| 2959 class JSFunctionResultCache: public FixedArray { | 2931 class JSFunctionResultCache: public FixedArray { |
| 2960 public: | 2932 public: |
| 2961 static const int kFactoryIndex = 0; | 2933 static const int kFactoryIndex = 0; |
| (...skipping 4238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7200 } else { | 7172 } else { |
| 7201 value &= ~(1 << bit_position); | 7173 value &= ~(1 << bit_position); |
| 7202 } | 7174 } |
| 7203 return value; | 7175 return value; |
| 7204 } | 7176 } |
| 7205 }; | 7177 }; |
| 7206 | 7178 |
| 7207 } } // namespace v8::internal | 7179 } } // namespace v8::internal |
| 7208 | 7180 |
| 7209 #endif // V8_OBJECTS_H_ | 7181 #endif // V8_OBJECTS_H_ |
| OLD | NEW |