OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 5882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5893 0, kDescriptorIndexBitCount> {}; // NOLINT | 5893 0, kDescriptorIndexBitCount> {}; // NOLINT |
5894 class NumberOfOwnDescriptorsBits: public BitField<int, | 5894 class NumberOfOwnDescriptorsBits: public BitField<int, |
5895 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {}; // NOLINT | 5895 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {}; // NOLINT |
5896 STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20); | 5896 STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20); |
5897 class DictionaryMap : public BitField<bool, 20, 1> {}; | 5897 class DictionaryMap : public BitField<bool, 20, 1> {}; |
5898 class OwnsDescriptors : public BitField<bool, 21, 1> {}; | 5898 class OwnsDescriptors : public BitField<bool, 21, 1> {}; |
5899 class HasInstanceCallHandler : public BitField<bool, 22, 1> {}; | 5899 class HasInstanceCallHandler : public BitField<bool, 22, 1> {}; |
5900 class Deprecated : public BitField<bool, 23, 1> {}; | 5900 class Deprecated : public BitField<bool, 23, 1> {}; |
5901 class IsUnstable : public BitField<bool, 24, 1> {}; | 5901 class IsUnstable : public BitField<bool, 24, 1> {}; |
5902 class IsMigrationTarget : public BitField<bool, 25, 1> {}; | 5902 class IsMigrationTarget : public BitField<bool, 25, 1> {}; |
5903 // Bits 26 and 27 are free. | 5903 class IsStrong : public BitField<bool, 26, 1> {}; |
arv (Not doing code reviews)
2015/05/12 15:00:30
Can you change this to use kNext instead?
| |
5904 // Bit 27 is free. | |
5904 | 5905 |
5905 // Keep this bit field at the very end for better code in | 5906 // Keep this bit field at the very end for better code in |
5906 // Builtins::kJSConstructStubGeneric stub. | 5907 // Builtins::kJSConstructStubGeneric stub. |
5907 // This counter is used for in-object slack tracking and for map aging. | 5908 // This counter is used for in-object slack tracking and for map aging. |
5908 // The in-object slack tracking is considered enabled when the counter is | 5909 // The in-object slack tracking is considered enabled when the counter is |
5909 // in the range [kSlackTrackingCounterStart, kSlackTrackingCounterEnd]. | 5910 // in the range [kSlackTrackingCounterStart, kSlackTrackingCounterEnd]. |
5910 class Counter : public BitField<int, 28, 4> {}; | 5911 class Counter : public BitField<int, 28, 4> {}; |
5911 static const int kSlackTrackingCounterStart = 14; | 5912 static const int kSlackTrackingCounterStart = 14; |
5912 static const int kSlackTrackingCounterEnd = 8; | 5913 static const int kSlackTrackingCounterEnd = 8; |
5913 static const int kRetainingCounterStart = kSlackTrackingCounterEnd - 1; | 5914 static const int kRetainingCounterStart = kSlackTrackingCounterEnd - 1; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5971 | 5972 |
5972 // Tells whether the instance has a call-as-function handler. | 5973 // Tells whether the instance has a call-as-function handler. |
5973 inline void set_is_observed() { | 5974 inline void set_is_observed() { |
5974 set_bit_field(bit_field() | (1 << kIsObserved)); | 5975 set_bit_field(bit_field() | (1 << kIsObserved)); |
5975 } | 5976 } |
5976 | 5977 |
5977 inline bool is_observed() { | 5978 inline bool is_observed() { |
5978 return ((1 << kIsObserved) & bit_field()) != 0; | 5979 return ((1 << kIsObserved) & bit_field()) != 0; |
5979 } | 5980 } |
5980 | 5981 |
5982 inline void set_is_strong(bool value); | |
5983 inline bool is_strong(); | |
5981 inline void set_is_extensible(bool value); | 5984 inline void set_is_extensible(bool value); |
5982 inline bool is_extensible(); | 5985 inline bool is_extensible(); |
5983 inline void set_is_prototype_map(bool value); | 5986 inline void set_is_prototype_map(bool value); |
5984 inline bool is_prototype_map() const; | 5987 inline bool is_prototype_map() const; |
5985 | 5988 |
5986 inline void set_elements_kind(ElementsKind elements_kind) { | 5989 inline void set_elements_kind(ElementsKind elements_kind) { |
5987 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); | 5990 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
5988 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); | 5991 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); |
5989 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); | 5992 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); |
5990 DCHECK(this->elements_kind() == elements_kind); | 5993 DCHECK(this->elements_kind() == elements_kind); |
(...skipping 5116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11107 } else { | 11110 } else { |
11108 value &= ~(1 << bit_position); | 11111 value &= ~(1 << bit_position); |
11109 } | 11112 } |
11110 return value; | 11113 return value; |
11111 } | 11114 } |
11112 }; | 11115 }; |
11113 | 11116 |
11114 } } // namespace v8::internal | 11117 } } // namespace v8::internal |
11115 | 11118 |
11116 #endif // V8_OBJECTS_H_ | 11119 #endif // V8_OBJECTS_H_ |
OLD | NEW |