| 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 5614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5625 // Bit field 3. | 5625 // Bit field 3. |
| 5626 inline uint32_t bit_field3(); | 5626 inline uint32_t bit_field3(); |
| 5627 inline void set_bit_field3(uint32_t bits); | 5627 inline void set_bit_field3(uint32_t bits); |
| 5628 | 5628 |
| 5629 class EnumLengthBits: public BitField<int, 0, 11> {}; | 5629 class EnumLengthBits: public BitField<int, 0, 11> {}; |
| 5630 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; | 5630 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; |
| 5631 class IsShared: public BitField<bool, 22, 1> {}; | 5631 class IsShared: public BitField<bool, 22, 1> {}; |
| 5632 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; | 5632 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; |
| 5633 class DictionaryMap: public BitField<bool, 24, 1> {}; | 5633 class DictionaryMap: public BitField<bool, 24, 1> {}; |
| 5634 class OwnsDescriptors: public BitField<bool, 25, 1> {}; | 5634 class OwnsDescriptors: public BitField<bool, 25, 1> {}; |
| 5635 class IsObserved: public BitField<bool, 26, 1> {}; | 5635 class HasInstanceCallHandler: public BitField<bool, 26, 1> {}; |
| 5636 class Deprecated: public BitField<bool, 27, 1> {}; | 5636 class Deprecated: public BitField<bool, 27, 1> {}; |
| 5637 class IsFrozen: public BitField<bool, 28, 1> {}; | 5637 class IsFrozen: public BitField<bool, 28, 1> {}; |
| 5638 class IsUnstable: public BitField<bool, 29, 1> {}; | 5638 class IsUnstable: public BitField<bool, 29, 1> {}; |
| 5639 class IsMigrationTarget: public BitField<bool, 30, 1> {}; | 5639 class IsMigrationTarget: public BitField<bool, 30, 1> {}; |
| 5640 | 5640 |
| 5641 // Tells whether the object in the prototype property will be used | 5641 // Tells whether the object in the prototype property will be used |
| 5642 // for instances created from this function. If the prototype | 5642 // for instances created from this function. If the prototype |
| 5643 // property is set to a value that is not a JSObject, the prototype | 5643 // property is set to a value that is not a JSObject, the prototype |
| 5644 // property will not be used to create instances of the function. | 5644 // property will not be used to create instances of the function. |
| 5645 // See ECMA-262, 13.2.2. | 5645 // See ECMA-262, 13.2.2. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5688 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. | 5688 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. |
| 5689 inline void set_is_undetectable() { | 5689 inline void set_is_undetectable() { |
| 5690 set_bit_field(bit_field() | (1 << kIsUndetectable)); | 5690 set_bit_field(bit_field() | (1 << kIsUndetectable)); |
| 5691 } | 5691 } |
| 5692 | 5692 |
| 5693 inline bool is_undetectable() { | 5693 inline bool is_undetectable() { |
| 5694 return ((1 << kIsUndetectable) & bit_field()) != 0; | 5694 return ((1 << kIsUndetectable) & bit_field()) != 0; |
| 5695 } | 5695 } |
| 5696 | 5696 |
| 5697 // Tells whether the instance has a call-as-function handler. | 5697 // Tells whether the instance has a call-as-function handler. |
| 5698 inline void set_has_instance_call_handler() { | 5698 inline void set_is_observed() { |
| 5699 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); | 5699 set_bit_field(bit_field() | (1 << kIsObserved)); |
| 5700 } | 5700 } |
| 5701 | 5701 |
| 5702 inline bool has_instance_call_handler() { | 5702 inline bool is_observed() { |
| 5703 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; | 5703 return ((1 << kIsObserved) & bit_field()) != 0; |
| 5704 } | 5704 } |
| 5705 | 5705 |
| 5706 inline void set_is_extensible(bool value); | 5706 inline void set_is_extensible(bool value); |
| 5707 inline bool is_extensible(); | 5707 inline bool is_extensible(); |
| 5708 | 5708 |
| 5709 inline void set_elements_kind(ElementsKind elements_kind) { | 5709 inline void set_elements_kind(ElementsKind elements_kind) { |
| 5710 ASSERT(elements_kind < kElementsKindCount); | 5710 ASSERT(elements_kind < kElementsKindCount); |
| 5711 ASSERT(kElementsKindCount <= (1 << kElementsKindBitCount)); | 5711 ASSERT(kElementsKindCount <= (1 << kElementsKindBitCount)); |
| 5712 ASSERT(!is_observed() || | |
| 5713 elements_kind == DICTIONARY_ELEMENTS || | |
| 5714 elements_kind == NON_STRICT_ARGUMENTS_ELEMENTS || | |
| 5715 IsExternalArrayElementsKind(elements_kind)); | |
| 5716 set_bit_field2((bit_field2() & ~kElementsKindMask) | | 5712 set_bit_field2((bit_field2() & ~kElementsKindMask) | |
| 5717 (elements_kind << kElementsKindShift)); | 5713 (elements_kind << kElementsKindShift)); |
| 5718 ASSERT(this->elements_kind() == elements_kind); | 5714 ASSERT(this->elements_kind() == elements_kind); |
| 5719 } | 5715 } |
| 5720 | 5716 |
| 5721 inline ElementsKind elements_kind() { | 5717 inline ElementsKind elements_kind() { |
| 5722 return static_cast<ElementsKind>( | 5718 return static_cast<ElementsKind>( |
| 5723 (bit_field2() & kElementsKindMask) >> kElementsKindShift); | 5719 (bit_field2() & kElementsKindMask) >> kElementsKindShift); |
| 5724 } | 5720 } |
| 5725 | 5721 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5954 if (length != kInvalidEnumCache) { | 5950 if (length != kInvalidEnumCache) { |
| 5955 ASSERT(length >= 0); | 5951 ASSERT(length >= 0); |
| 5956 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); | 5952 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); |
| 5957 ASSERT(length <= NumberOfOwnDescriptors()); | 5953 ASSERT(length <= NumberOfOwnDescriptors()); |
| 5958 } | 5954 } |
| 5959 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); | 5955 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); |
| 5960 } | 5956 } |
| 5961 | 5957 |
| 5962 inline bool owns_descriptors(); | 5958 inline bool owns_descriptors(); |
| 5963 inline void set_owns_descriptors(bool is_shared); | 5959 inline void set_owns_descriptors(bool is_shared); |
| 5964 inline bool is_observed(); | 5960 inline bool has_instance_call_handler(); |
| 5965 inline void set_is_observed(bool is_observed); | 5961 inline void set_has_instance_call_handler(); |
| 5966 inline void freeze(); | 5962 inline void freeze(); |
| 5967 inline bool is_frozen(); | 5963 inline bool is_frozen(); |
| 5968 inline void mark_unstable(); | 5964 inline void mark_unstable(); |
| 5969 inline bool is_stable(); | 5965 inline bool is_stable(); |
| 5970 inline void set_migration_target(bool value); | 5966 inline void set_migration_target(bool value); |
| 5971 inline bool is_migration_target(); | 5967 inline bool is_migration_target(); |
| 5972 inline void deprecate(); | 5968 inline void deprecate(); |
| 5973 inline bool is_deprecated(); | 5969 inline bool is_deprecated(); |
| 5974 inline bool CanBeDeprecated(); | 5970 inline bool CanBeDeprecated(); |
| 5975 // Returns a non-deprecated version of the input. If the input was not | 5971 // Returns a non-deprecated version of the input. If the input was not |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6214 | 6210 |
| 6215 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset); | 6211 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset); |
| 6216 | 6212 |
| 6217 // Bit positions for bit field. | 6213 // Bit positions for bit field. |
| 6218 static const int kUnused = 0; // To be used for marking recently used maps. | 6214 static const int kUnused = 0; // To be used for marking recently used maps. |
| 6219 static const int kHasNonInstancePrototype = 1; | 6215 static const int kHasNonInstancePrototype = 1; |
| 6220 static const int kIsHiddenPrototype = 2; | 6216 static const int kIsHiddenPrototype = 2; |
| 6221 static const int kHasNamedInterceptor = 3; | 6217 static const int kHasNamedInterceptor = 3; |
| 6222 static const int kHasIndexedInterceptor = 4; | 6218 static const int kHasIndexedInterceptor = 4; |
| 6223 static const int kIsUndetectable = 5; | 6219 static const int kIsUndetectable = 5; |
| 6224 static const int kHasInstanceCallHandler = 6; | 6220 static const int kIsObserved = 6; |
| 6225 static const int kIsAccessCheckNeeded = 7; | 6221 static const int kIsAccessCheckNeeded = 7; |
| 6226 | 6222 |
| 6227 // Bit positions for bit field 2 | 6223 // Bit positions for bit field 2 |
| 6228 static const int kIsExtensible = 0; | 6224 static const int kIsExtensible = 0; |
| 6229 static const int kStringWrapperSafeForDefaultValueOf = 1; | 6225 static const int kStringWrapperSafeForDefaultValueOf = 1; |
| 6230 static const int kAttachedToSharedFunctionInfo = 2; | 6226 static const int kAttachedToSharedFunctionInfo = 2; |
| 6231 // No bits can be used after kElementsKindFirstBit, they are all reserved for | 6227 // No bits can be used after kElementsKindFirstBit, they are all reserved for |
| 6232 // storing ElementKind. | 6228 // storing ElementKind. |
| 6233 static const int kElementsKindShift = 3; | 6229 static const int kElementsKindShift = 3; |
| 6234 static const int kElementsKindBitCount = 5; | 6230 static const int kElementsKindBitCount = 5; |
| (...skipping 4205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10440 } else { | 10436 } else { |
| 10441 value &= ~(1 << bit_position); | 10437 value &= ~(1 << bit_position); |
| 10442 } | 10438 } |
| 10443 return value; | 10439 return value; |
| 10444 } | 10440 } |
| 10445 }; | 10441 }; |
| 10446 | 10442 |
| 10447 } } // namespace v8::internal | 10443 } } // namespace v8::internal |
| 10448 | 10444 |
| 10449 #endif // V8_OBJECTS_H_ | 10445 #endif // V8_OBJECTS_H_ |
| OLD | NEW |