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 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2269 // for hidden properties. If there is no backing store, allocate one. | 2269 // for hidden properties. If there is no backing store, allocate one. |
2270 // If create_if_absent is false, return the hash table backing store | 2270 // If create_if_absent is false, return the hash table backing store |
2271 // or the inline stored identity hash, whatever is found. | 2271 // or the inline stored identity hash, whatever is found. |
2272 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable( | 2272 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable( |
2273 InitializeHiddenProperties init_option); | 2273 InitializeHiddenProperties init_option); |
2274 // Set the hidden property backing store to either a hash table or | 2274 // Set the hidden property backing store to either a hash table or |
2275 // the inline-stored identity hash. | 2275 // the inline-stored identity hash. |
2276 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable( | 2276 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable( |
2277 Object* value); | 2277 Object* value); |
2278 | 2278 |
2279 void NotifyObservers(const char* type, String* name, Object* oldValue); | |
rafaelw
2012/10/31 14:44:31
suggestion: the name "NotifyObservers" is a bit mi
rafaelw
2012/10/31 17:27:24
also, are arguments unix_hacker style?
Toon Verwaest
2012/11/05 13:33:22
Yes, use old_value in the C++ code. Also in other
rossberg
2012/11/05 17:11:08
Done.
rossberg
2012/11/05 17:11:08
Done.
rossberg
2012/11/05 17:11:08
Done.
| |
2280 | |
2279 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); | 2281 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); |
2280 }; | 2282 }; |
2281 | 2283 |
2282 | 2284 |
2283 // Common superclass for FixedArrays that allow implementations to share | 2285 // Common superclass for FixedArrays that allow implementations to share |
2284 // common accessors and some code paths. | 2286 // common accessors and some code paths. |
2285 class FixedArrayBase: public HeapObject { | 2287 class FixedArrayBase: public HeapObject { |
2286 public: | 2288 public: |
2287 // [length]: length of the array. | 2289 // [length]: length of the array. |
2288 inline int length(); | 2290 inline int length(); |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4694 // Bit field 3. | 4696 // Bit field 3. |
4695 inline int bit_field3(); | 4697 inline int bit_field3(); |
4696 inline void set_bit_field3(int value); | 4698 inline void set_bit_field3(int value); |
4697 | 4699 |
4698 class EnumLengthBits: public BitField<int, 0, 11> {}; | 4700 class EnumLengthBits: public BitField<int, 0, 11> {}; |
4699 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; | 4701 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; |
4700 class IsShared: public BitField<bool, 22, 1> {}; | 4702 class IsShared: public BitField<bool, 22, 1> {}; |
4701 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; | 4703 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; |
4702 class DictionaryMap: public BitField<bool, 24, 1> {}; | 4704 class DictionaryMap: public BitField<bool, 24, 1> {}; |
4703 class OwnsDescriptors: public BitField<bool, 25, 1> {}; | 4705 class OwnsDescriptors: public BitField<bool, 25, 1> {}; |
4706 class IsObserved: public BitField<bool, 26, 1> {}; | |
4704 | 4707 |
4705 // Tells whether the object in the prototype property will be used | 4708 // Tells whether the object in the prototype property will be used |
4706 // for instances created from this function. If the prototype | 4709 // for instances created from this function. If the prototype |
4707 // property is set to a value that is not a JSObject, the prototype | 4710 // property is set to a value that is not a JSObject, the prototype |
4708 // property will not be used to create instances of the function. | 4711 // property will not be used to create instances of the function. |
4709 // See ECMA-262, 13.2.2. | 4712 // See ECMA-262, 13.2.2. |
4710 inline void set_non_instance_prototype(bool value); | 4713 inline void set_non_instance_prototype(bool value); |
4711 inline bool has_non_instance_prototype(); | 4714 inline bool has_non_instance_prototype(); |
4712 | 4715 |
4713 // Tells whether function has special prototype property. If not, prototype | 4716 // Tells whether function has special prototype property. If not, prototype |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4961 ASSERT(length >= 0); | 4964 ASSERT(length >= 0); |
4962 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); | 4965 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); |
4963 ASSERT(length <= NumberOfOwnDescriptors()); | 4966 ASSERT(length <= NumberOfOwnDescriptors()); |
4964 } | 4967 } |
4965 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); | 4968 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); |
4966 } | 4969 } |
4967 | 4970 |
4968 | 4971 |
4969 inline bool owns_descriptors(); | 4972 inline bool owns_descriptors(); |
4970 inline void set_owns_descriptors(bool is_shared); | 4973 inline void set_owns_descriptors(bool is_shared); |
4974 inline bool is_observed(); | |
4975 inline void set_is_observed(bool is_observed); | |
4971 | 4976 |
4972 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); | 4977 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); |
4973 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); | 4978 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); |
4974 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); | 4979 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); |
4975 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( | 4980 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( |
4976 DescriptorArray* descriptors, | 4981 DescriptorArray* descriptors, |
4977 String* name, | 4982 String* name, |
4978 TransitionFlag flag, | 4983 TransitionFlag flag, |
4979 int descriptor_index); | 4984 int descriptor_index); |
4980 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, | 4985 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, |
(...skipping 3974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8955 } else { | 8960 } else { |
8956 value &= ~(1 << bit_position); | 8961 value &= ~(1 << bit_position); |
8957 } | 8962 } |
8958 return value; | 8963 return value; |
8959 } | 8964 } |
8960 }; | 8965 }; |
8961 | 8966 |
8962 } } // namespace v8::internal | 8967 } } // namespace v8::internal |
8963 | 8968 |
8964 #endif // V8_OBJECTS_H_ | 8969 #endif // V8_OBJECTS_H_ |
OLD | NEW |