OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 | 248 |
249 | 249 |
250 // NormalizedMapSharingMode is used to specify whether a map may be shared | 250 // NormalizedMapSharingMode is used to specify whether a map may be shared |
251 // by different objects with normalized properties. | 251 // by different objects with normalized properties. |
252 enum NormalizedMapSharingMode { | 252 enum NormalizedMapSharingMode { |
253 UNIQUE_NORMALIZED_MAP, | 253 UNIQUE_NORMALIZED_MAP, |
254 SHARED_NORMALIZED_MAP | 254 SHARED_NORMALIZED_MAP |
255 }; | 255 }; |
256 | 256 |
257 | 257 |
258 // Indicates whether a get method should implicitly create the object looked up. | |
259 enum CreationFlag { | |
260 ALLOW_CREATION, | |
261 OMIT_CREATION | |
262 }; | |
263 | |
264 | |
265 // Indicates whether transitions can be added to a source map or not. | 258 // Indicates whether transitions can be added to a source map or not. |
266 enum TransitionFlag { | 259 enum TransitionFlag { |
267 INSERT_TRANSITION, | 260 INSERT_TRANSITION, |
268 OMIT_TRANSITION | 261 OMIT_TRANSITION |
269 }; | 262 }; |
270 | 263 |
271 | 264 |
272 enum DebugExtraICState { | 265 enum DebugExtraICState { |
273 DEBUG_BREAK, | 266 DEBUG_BREAK, |
274 DEBUG_PREPARE_STEP_IN | 267 DEBUG_PREPARE_STEP_IN |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1502 uint32_t index); | 1495 uint32_t index); |
1503 // For use when we know that no exception can be thrown. | 1496 // For use when we know that no exception can be thrown. |
1504 inline Object* GetElementNoExceptionThrown(Isolate* isolate, uint32_t index); | 1497 inline Object* GetElementNoExceptionThrown(Isolate* isolate, uint32_t index); |
1505 MUST_USE_RESULT MaybeObject* GetElementWithReceiver(Isolate* isolate, | 1498 MUST_USE_RESULT MaybeObject* GetElementWithReceiver(Isolate* isolate, |
1506 Object* receiver, | 1499 Object* receiver, |
1507 uint32_t index); | 1500 uint32_t index); |
1508 | 1501 |
1509 // Return the object's prototype (might be Heap::null_value()). | 1502 // Return the object's prototype (might be Heap::null_value()). |
1510 Object* GetPrototype(Isolate* isolate); | 1503 Object* GetPrototype(Isolate* isolate); |
1511 | 1504 |
1505 // Returns the permanent hash code associated with this object. May return | |
1506 // undefined if not yet created. | |
1507 MUST_USE_RESULT Object* GetHash(); | |
Michael Starzinger
2013/11/04 17:58:58
nit: I think we can drop the MUST_USE_RESULT here,
rafaelw
2013/11/05 09:56:54
Done.
| |
1508 | |
1512 // Returns the permanent hash code associated with this object depending on | 1509 // Returns the permanent hash code associated with this object depending on |
1513 // the actual object type. Might return a failure in case no hash was | 1510 // the actual object type. May create and store a hash code if needed and none |
1514 // created yet or GC was caused by creation. | 1511 // exists. |
1515 MUST_USE_RESULT MaybeObject* GetHash(CreationFlag flag); | 1512 // TODO(rafaelw): Remove isolate parameter when objects.cc is fully |
1513 // handlified. | |
1514 static Handle<Object> GetOrCreateHash(Handle<Object> object, | |
1515 Isolate* isolate); | |
1516 | 1516 |
1517 // Checks whether this object has the same value as the given one. This | 1517 // Checks whether this object has the same value as the given one. This |
1518 // function is implemented according to ES5, section 9.12 and can be used | 1518 // function is implemented according to ES5, section 9.12 and can be used |
1519 // to implement the Harmony "egal" function. | 1519 // to implement the Harmony "egal" function. |
1520 bool SameValue(Object* other); | 1520 bool SameValue(Object* other); |
1521 | 1521 |
1522 // Tries to convert an object to an array index. Returns true and sets | 1522 // Tries to convert an object to an array index. Returns true and sets |
1523 // the output parameter if it succeeds. | 1523 // the output parameter if it succeeds. |
1524 inline bool ToArrayIndex(uint32_t* index); | 1524 inline bool ToArrayIndex(uint32_t* index); |
1525 | 1525 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1996 inline PropertyAttributes GetElementAttribute(uint32_t index); | 1996 inline PropertyAttributes GetElementAttribute(uint32_t index); |
1997 inline PropertyAttributes GetLocalElementAttribute(uint32_t index); | 1997 inline PropertyAttributes GetLocalElementAttribute(uint32_t index); |
1998 | 1998 |
1999 // Return the object's prototype (might be Heap::null_value()). | 1999 // Return the object's prototype (might be Heap::null_value()). |
2000 inline Object* GetPrototype(); | 2000 inline Object* GetPrototype(); |
2001 | 2001 |
2002 // Return the constructor function (may be Heap::null_value()). | 2002 // Return the constructor function (may be Heap::null_value()). |
2003 inline Object* GetConstructor(); | 2003 inline Object* GetConstructor(); |
2004 | 2004 |
2005 // Retrieves a permanent object identity hash code. The undefined value might | 2005 // Retrieves a permanent object identity hash code. The undefined value might |
2006 // be returned in case no hash was created yet and OMIT_CREATION was used. | 2006 // be returned in case no hash was created yet. |
2007 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 2007 inline MUST_USE_RESULT Object* GetIdentityHash(); |
Michael Starzinger
2013/11/04 17:58:58
nit: Likewise.
rafaelw
2013/11/05 09:56:54
Done.
| |
2008 | |
2009 // Retrieves a permanent object identity hash code. May create and store a | |
2010 // hash code if needed and none exists. | |
2011 inline static Handle<Object> GetOrCreateIdentityHash( | |
2012 Handle<JSReceiver> object); | |
2008 | 2013 |
2009 // Lookup a property. If found, the result is valid and has | 2014 // Lookup a property. If found, the result is valid and has |
2010 // detailed information. | 2015 // detailed information. |
2011 void LocalLookup(Name* name, LookupResult* result, | 2016 void LocalLookup(Name* name, LookupResult* result, |
2012 bool search_hidden_prototypes = false); | 2017 bool search_hidden_prototypes = false); |
2013 void Lookup(Name* name, LookupResult* result); | 2018 void Lookup(Name* name, LookupResult* result); |
2014 | 2019 |
2015 protected: | 2020 protected: |
2016 Smi* GenerateIdentityHash(); | 2021 Smi* GenerateIdentityHash(); |
2017 | 2022 |
(...skipping 11 matching lines...) Expand all Loading... | |
2029 LookupResult* result, | 2034 LookupResult* result, |
2030 Handle<Name> key, | 2035 Handle<Name> key, |
2031 Handle<Object> value, | 2036 Handle<Object> value, |
2032 PropertyAttributes attributes, | 2037 PropertyAttributes attributes, |
2033 StrictModeFlag strict_mode, | 2038 StrictModeFlag strict_mode, |
2034 StoreFromKeyed store_from_keyed); | 2039 StoreFromKeyed store_from_keyed); |
2035 | 2040 |
2036 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); | 2041 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); |
2037 }; | 2042 }; |
2038 | 2043 |
2044 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. | |
2045 class ObjectHashTable; | |
2046 | |
2039 // The JSObject describes real heap allocated JavaScript objects with | 2047 // The JSObject describes real heap allocated JavaScript objects with |
2040 // properties. | 2048 // properties. |
2041 // Note that the map of JSObject changes during execution to enable inline | 2049 // Note that the map of JSObject changes during execution to enable inline |
2042 // caching. | 2050 // caching. |
2043 class JSObject: public JSReceiver { | 2051 class JSObject: public JSReceiver { |
2044 public: | 2052 public: |
2045 // [properties]: Backing storage for properties. | 2053 // [properties]: Backing storage for properties. |
2046 // properties is a FixedArray in the fast case and a Dictionary in the | 2054 // properties is a FixedArray in the fast case and a Dictionary in the |
2047 // slow case. | 2055 // slow case. |
2048 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. | 2056 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2280 // | 2288 // |
2281 // Hidden properties are not local properties of the object itself. | 2289 // Hidden properties are not local properties of the object itself. |
2282 // Instead they are stored in an auxiliary structure kept as a local | 2290 // Instead they are stored in an auxiliary structure kept as a local |
2283 // property with a special name Heap::hidden_string(). But if the | 2291 // property with a special name Heap::hidden_string(). But if the |
2284 // receiver is a JSGlobalProxy then the auxiliary object is a property | 2292 // receiver is a JSGlobalProxy then the auxiliary object is a property |
2285 // of its prototype, and if it's a detached proxy, then you can't have | 2293 // of its prototype, and if it's a detached proxy, then you can't have |
2286 // hidden properties. | 2294 // hidden properties. |
2287 | 2295 |
2288 // Sets a hidden property on this object. Returns this object if successful, | 2296 // Sets a hidden property on this object. Returns this object if successful, |
2289 // undefined if called on a detached proxy. | 2297 // undefined if called on a detached proxy. |
2290 static Handle<Object> SetHiddenProperty(Handle<JSObject> obj, | 2298 static Handle<Object> SetHiddenProperty(Handle<JSObject> object, |
2291 Handle<Name> key, | 2299 Handle<Name> key, |
2292 Handle<Object> value); | 2300 Handle<Object> value); |
2293 // Returns a failure if a GC is required. | |
2294 MUST_USE_RESULT MaybeObject* SetHiddenProperty(Name* key, Object* value); | |
2295 // Gets the value of a hidden property with the given key. Returns the hole | 2301 // Gets the value of a hidden property with the given key. Returns the hole |
2296 // if the property doesn't exist (or if called on a detached proxy), | 2302 // if the property doesn't exist (or if called on a detached proxy), |
2297 // otherwise returns the value set for the key. | 2303 // otherwise returns the value set for the key. |
2298 Object* GetHiddenProperty(Name* key); | 2304 Object* GetHiddenProperty(Name* key); |
2299 // Deletes a hidden property. Deleting a non-existing property is | 2305 // Deletes a hidden property. Deleting a non-existing property is |
2300 // considered successful. | 2306 // considered successful. |
2301 static void DeleteHiddenProperty(Handle<JSObject> object, | 2307 static void DeleteHiddenProperty(Handle<JSObject> object, |
2302 Handle<Name> key); | 2308 Handle<Name> key); |
2303 // Returns true if the object has a property with the hidden string as name. | 2309 // Returns true if the object has a property with the hidden string as name. |
2304 bool HasHiddenProperties(); | 2310 bool HasHiddenProperties(); |
2305 | 2311 |
2306 static int GetIdentityHash(Handle<JSObject> object); | 2312 static int GetIdentityHash(Handle<JSObject> object); |
2307 static void SetIdentityHash(Handle<JSObject> object, Smi* hash); | 2313 static void SetIdentityHash(Handle<JSObject> object, Handle<Smi> hash); |
2308 | 2314 |
2309 inline void ValidateElements(); | 2315 inline void ValidateElements(); |
2310 | 2316 |
2311 // Makes sure that this object can contain HeapObject as elements. | 2317 // Makes sure that this object can contain HeapObject as elements. |
2312 static inline void EnsureCanContainHeapObjectElements(Handle<JSObject> obj); | 2318 static inline void EnsureCanContainHeapObjectElements(Handle<JSObject> obj); |
2313 | 2319 |
2314 // Makes sure that this object can contain the specified elements. | 2320 // Makes sure that this object can contain the specified elements. |
2315 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( | 2321 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( |
2316 Object** elements, | 2322 Object** elements, |
2317 uint32_t count, | 2323 uint32_t count, |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2851 v8::AccessControl access_control); | 2857 v8::AccessControl access_control); |
2852 | 2858 |
2853 // Try to define a single accessor paying attention to map transitions. | 2859 // Try to define a single accessor paying attention to map transitions. |
2854 // Returns false if this was not possible and we have to use the slow case. | 2860 // Returns false if this was not possible and we have to use the slow case. |
2855 static bool DefineFastAccessor(Handle<JSObject> object, | 2861 static bool DefineFastAccessor(Handle<JSObject> object, |
2856 Handle<Name> name, | 2862 Handle<Name> name, |
2857 AccessorComponent component, | 2863 AccessorComponent component, |
2858 Handle<Object> accessor, | 2864 Handle<Object> accessor, |
2859 PropertyAttributes attributes); | 2865 PropertyAttributes attributes); |
2860 | 2866 |
2861 enum InitializeHiddenProperties { | |
2862 CREATE_NEW_IF_ABSENT, | |
2863 ONLY_RETURN_INLINE_VALUE | |
2864 }; | |
2865 | 2867 |
2866 // If create_if_absent is true, return the hash table backing store | 2868 // Return the hash table backing store or the inline stored identity hash, |
2867 // for hidden properties. If there is no backing store, allocate one. | 2869 // whatever is found. |
2868 // If create_if_absent is false, return the hash table backing store | 2870 MUST_USE_RESULT Object* GetHiddenPropertiesHashTable(); |
2869 // or the inline stored identity hash, whatever is found. | 2871 |
2870 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable( | 2872 // Return the hash table backing store for hidden properties. If there is no |
2871 InitializeHiddenProperties init_option); | 2873 // backing store, allocate one. |
2874 static Handle<ObjectHashTable> GetOrCreateHiddenPropertiesHashtable( | |
2875 Handle<JSObject> object); | |
2876 | |
2872 // Set the hidden property backing store to either a hash table or | 2877 // Set the hidden property backing store to either a hash table or |
2873 // the inline-stored identity hash. | 2878 // the inline-stored identity hash. |
2874 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable( | 2879 static Handle<Object> SetHiddenPropertiesHashTable( |
2875 Object* value); | 2880 Handle<JSObject> object, |
2881 Handle<Object> value); | |
2876 | 2882 |
2877 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 2883 MUST_USE_RESULT Object* GetIdentityHash(); |
2884 | |
2885 static Handle<Object> GetOrCreateIdentityHash(Handle<JSObject> object); | |
2878 | 2886 |
2879 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); | 2887 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); |
2880 }; | 2888 }; |
2881 | 2889 |
2882 | 2890 |
2883 // Common superclass for FixedArrays that allow implementations to share | 2891 // Common superclass for FixedArrays that allow implementations to share |
2884 // common accessors and some code paths. | 2892 // common accessors and some code paths. |
2885 class FixedArrayBase: public HeapObject { | 2893 class FixedArrayBase: public HeapObject { |
2886 public: | 2894 public: |
2887 // [length]: length of the array. | 2895 // [length]: length of the array. |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3477 static uint32_t HashForObject(Key key, Object* object) { return 0; } | 3485 static uint32_t HashForObject(Key key, Object* object) { return 0; } |
3478 static uint32_t SeededHashForObject(Key key, uint32_t seed, Object* object) { | 3486 static uint32_t SeededHashForObject(Key key, uint32_t seed, Object* object) { |
3479 ASSERT(UsesSeed); | 3487 ASSERT(UsesSeed); |
3480 return HashForObject(key, object); | 3488 return HashForObject(key, object); |
3481 } | 3489 } |
3482 }; | 3490 }; |
3483 | 3491 |
3484 template<typename Shape, typename Key> | 3492 template<typename Shape, typename Key> |
3485 class HashTable: public FixedArray { | 3493 class HashTable: public FixedArray { |
3486 public: | 3494 public: |
3487 enum MinimumCapacity { | |
3488 USE_DEFAULT_MINIMUM_CAPACITY, | |
3489 USE_CUSTOM_MINIMUM_CAPACITY | |
3490 }; | |
3491 | |
3492 // Wrapper methods | 3495 // Wrapper methods |
3493 inline uint32_t Hash(Key key) { | 3496 inline uint32_t Hash(Key key) { |
3494 if (Shape::UsesSeed) { | 3497 if (Shape::UsesSeed) { |
3495 return Shape::SeededHash(key, | 3498 return Shape::SeededHash(key, |
3496 GetHeap()->HashSeed()); | 3499 GetHeap()->HashSeed()); |
3497 } else { | 3500 } else { |
3498 return Shape::Hash(key); | 3501 return Shape::Hash(key); |
3499 } | 3502 } |
3500 } | 3503 } |
3501 | 3504 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3592 (FixedArray::kMaxLength - kElementsStartOffset) / kEntrySize; | 3595 (FixedArray::kMaxLength - kElementsStartOffset) / kEntrySize; |
3593 | 3596 |
3594 // Find entry for key otherwise return kNotFound. | 3597 // Find entry for key otherwise return kNotFound. |
3595 inline int FindEntry(Key key); | 3598 inline int FindEntry(Key key); |
3596 int FindEntry(Isolate* isolate, Key key); | 3599 int FindEntry(Isolate* isolate, Key key); |
3597 | 3600 |
3598 // Rehashes the table in-place. | 3601 // Rehashes the table in-place. |
3599 void Rehash(Key key); | 3602 void Rehash(Key key); |
3600 | 3603 |
3601 protected: | 3604 protected: |
3605 friend class ObjectHashSet; | |
3606 friend class ObjectHashTable; | |
3607 | |
3602 // Find the entry at which to insert element with the given key that | 3608 // Find the entry at which to insert element with the given key that |
3603 // has the given hash value. | 3609 // has the given hash value. |
3604 uint32_t FindInsertionEntry(uint32_t hash); | 3610 uint32_t FindInsertionEntry(uint32_t hash); |
3605 | 3611 |
3606 // Returns the index for an entry (of the key) | 3612 // Returns the index for an entry (of the key) |
3607 static inline int EntryToIndex(int entry) { | 3613 static inline int EntryToIndex(int entry) { |
3608 return (entry * kEntrySize) + kElementsStartIndex; | 3614 return (entry * kEntrySize) + kElementsStartIndex; |
3609 } | 3615 } |
3610 | 3616 |
3611 // Update the number of elements in the hash table. | 3617 // Update the number of elements in the hash table. |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4055 class ObjectHashSet: public HashTable<ObjectHashTableShape<1>, Object*> { | 4061 class ObjectHashSet: public HashTable<ObjectHashTableShape<1>, Object*> { |
4056 public: | 4062 public: |
4057 static inline ObjectHashSet* cast(Object* obj) { | 4063 static inline ObjectHashSet* cast(Object* obj) { |
4058 ASSERT(obj->IsHashTable()); | 4064 ASSERT(obj->IsHashTable()); |
4059 return reinterpret_cast<ObjectHashSet*>(obj); | 4065 return reinterpret_cast<ObjectHashSet*>(obj); |
4060 } | 4066 } |
4061 | 4067 |
4062 // Looks up whether the given key is part of this hash set. | 4068 // Looks up whether the given key is part of this hash set. |
4063 bool Contains(Object* key); | 4069 bool Contains(Object* key); |
4064 | 4070 |
4071 static Handle<ObjectHashSet> EnsureCapacity( | |
4072 Handle<ObjectHashSet> table, | |
4073 int n, | |
4074 Handle<Object> key, | |
4075 PretenureFlag pretenure = NOT_TENURED); | |
4076 | |
4077 // Attempt to shrink hash table after removal of key. | |
4078 static Handle<ObjectHashSet> Shrink(Handle<ObjectHashSet> table, | |
4079 Handle<Object> key); | |
4080 | |
4065 // Adds the given key to this hash set. | 4081 // Adds the given key to this hash set. |
4066 MUST_USE_RESULT MaybeObject* Add(Object* key); | 4082 static Handle<ObjectHashSet> Add(Handle<ObjectHashSet> table, |
4083 Handle<Object> key); | |
4067 | 4084 |
4068 // Removes the given key from this hash set. | 4085 // Removes the given key from this hash set. |
4069 MUST_USE_RESULT MaybeObject* Remove(Object* key); | 4086 static Handle<ObjectHashSet> Remove(Handle<ObjectHashSet> table, |
4087 Handle<Object> key); | |
4070 }; | 4088 }; |
4071 | 4089 |
4072 | 4090 |
4073 // ObjectHashTable maps keys that are arbitrary objects to object values by | 4091 // ObjectHashTable maps keys that are arbitrary objects to object values by |
4074 // using the identity hash of the key for hashing purposes. | 4092 // using the identity hash of the key for hashing purposes. |
4075 class ObjectHashTable: public HashTable<ObjectHashTableShape<2>, Object*> { | 4093 class ObjectHashTable: public HashTable<ObjectHashTableShape<2>, Object*> { |
4076 public: | 4094 public: |
4077 static inline ObjectHashTable* cast(Object* obj) { | 4095 static inline ObjectHashTable* cast(Object* obj) { |
4078 ASSERT(obj->IsHashTable()); | 4096 ASSERT(obj->IsHashTable()); |
4079 return reinterpret_cast<ObjectHashTable*>(obj); | 4097 return reinterpret_cast<ObjectHashTable*>(obj); |
4080 } | 4098 } |
4081 | 4099 |
4100 static Handle<ObjectHashTable> EnsureCapacity( | |
4101 Handle<ObjectHashTable> table, | |
4102 int n, | |
4103 Handle<Object> key, | |
4104 PretenureFlag pretenure = NOT_TENURED); | |
4105 | |
4106 // Attempt to shrink hash table after removal of key. | |
4107 static Handle<ObjectHashTable> Shrink(Handle<ObjectHashTable> table, | |
4108 Handle<Object> key); | |
4109 | |
4082 // Looks up the value associated with the given key. The hole value is | 4110 // Looks up the value associated with the given key. The hole value is |
4083 // returned in case the key is not present. | 4111 // returned in case the key is not present. |
4084 Object* Lookup(Object* key); | 4112 Object* Lookup(Object* key); |
4085 | 4113 |
4086 // Adds (or overwrites) the value associated with the given key. Mapping a | 4114 // Adds (or overwrites) the value associated with the given key. Mapping a |
4087 // key to the hole value causes removal of the whole entry. | 4115 // key to the hole value causes removal of the whole entry. |
4088 MUST_USE_RESULT MaybeObject* Put(Object* key, Object* value); | 4116 static Handle<ObjectHashTable> Put(Handle<ObjectHashTable> table, |
4117 Handle<Object> key, | |
4118 Handle<Object> value); | |
4089 | 4119 |
4090 private: | 4120 private: |
4091 friend class MarkCompactCollector; | 4121 friend class MarkCompactCollector; |
4092 | 4122 |
4093 void AddEntry(int entry, Object* key, Object* value); | 4123 void AddEntry(int entry, Object* key, Object* value); |
4094 void RemoveEntry(int entry); | 4124 void RemoveEntry(int entry); |
4095 | 4125 |
4096 // Returns the index to the value of an entry. | 4126 // Returns the index to the value of an entry. |
4097 static inline int EntryToValueIndex(int entry) { | 4127 static inline int EntryToValueIndex(int entry) { |
4098 return EntryToIndex(entry) + 1; | 4128 return EntryToIndex(entry) + 1; |
(...skipping 5251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9350 static bool HasPropertyWithHandler(Handle<JSProxy> proxy, Handle<Name> name); | 9380 static bool HasPropertyWithHandler(Handle<JSProxy> proxy, Handle<Name> name); |
9351 static bool HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index); | 9381 static bool HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index); |
9352 | 9382 |
9353 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, | 9383 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, |
9354 Handle<Name> name, | 9384 Handle<Name> name, |
9355 DeleteMode mode); | 9385 DeleteMode mode); |
9356 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, | 9386 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, |
9357 uint32_t index, | 9387 uint32_t index, |
9358 DeleteMode mode); | 9388 DeleteMode mode); |
9359 | 9389 |
9360 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 9390 MUST_USE_RESULT Object* GetIdentityHash(); |
9361 static Handle<Object> GetIdentityHash(Handle<JSProxy> proxy, | 9391 |
9362 CreationFlag flag); | 9392 static Handle<Object> GetOrCreateIdentityHash(Handle<JSProxy> proxy); |
9363 | 9393 |
9364 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 9394 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
9365 }; | 9395 }; |
9366 | 9396 |
9367 | 9397 |
9368 class JSFunctionProxy: public JSProxy { | 9398 class JSFunctionProxy: public JSProxy { |
9369 public: | 9399 public: |
9370 // [call_trap]: The call trap. | 9400 // [call_trap]: The call trap. |
9371 DECL_ACCESSORS(call_trap, Object) | 9401 DECL_ACCESSORS(call_trap, Object) |
9372 | 9402 |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10440 } else { | 10470 } else { |
10441 value &= ~(1 << bit_position); | 10471 value &= ~(1 << bit_position); |
10442 } | 10472 } |
10443 return value; | 10473 return value; |
10444 } | 10474 } |
10445 }; | 10475 }; |
10446 | 10476 |
10447 } } // namespace v8::internal | 10477 } } // namespace v8::internal |
10448 | 10478 |
10449 #endif // V8_OBJECTS_H_ | 10479 #endif // V8_OBJECTS_H_ |
OLD | NEW |