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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // - SeqInternalizedString | 115 // - SeqInternalizedString |
116 // - SeqOneByteInternalizedString | 116 // - SeqOneByteInternalizedString |
117 // - SeqTwoByteInternalizedString | 117 // - SeqTwoByteInternalizedString |
118 // - ConsInternalizedString | 118 // - ConsInternalizedString |
119 // - ExternalInternalizedString | 119 // - ExternalInternalizedString |
120 // - ExternalOneByteInternalizedString | 120 // - ExternalOneByteInternalizedString |
121 // - ExternalTwoByteInternalizedString | 121 // - ExternalTwoByteInternalizedString |
122 // - Symbol | 122 // - Symbol |
123 // - HeapNumber | 123 // - HeapNumber |
124 // - Cell | 124 // - Cell |
125 // - PropertyCell | 125 // - PropertyCell |
126 // - Code | 126 // - Code |
127 // - Map | 127 // - Map |
128 // - Oddball | 128 // - Oddball |
129 // - Foreign | 129 // - Foreign |
130 // - SharedFunctionInfo | 130 // - SharedFunctionInfo |
131 // - Struct | 131 // - Struct |
132 // - Box | 132 // - Box |
133 // - AccessorInfo | 133 // - AccessorInfo |
134 // - ExecutableAccessorInfo | 134 // - ExecutableAccessorInfo |
135 // - AccessorPair | 135 // - AccessorPair |
(...skipping 9581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9717 | 9717 |
9718 typedef FixedBodyDescriptor<kValueOffset, | 9718 typedef FixedBodyDescriptor<kValueOffset, |
9719 kValueOffset + kPointerSize, | 9719 kValueOffset + kPointerSize, |
9720 kSize> BodyDescriptor; | 9720 kSize> BodyDescriptor; |
9721 | 9721 |
9722 private: | 9722 private: |
9723 DISALLOW_IMPLICIT_CONSTRUCTORS(Cell); | 9723 DISALLOW_IMPLICIT_CONSTRUCTORS(Cell); |
9724 }; | 9724 }; |
9725 | 9725 |
9726 | 9726 |
9727 class PropertyCell: public Cell { | 9727 class PropertyCell : public HeapObject { |
9728 public: | 9728 public: |
9729 // [value]: value of the global property. | 9729 // [value]: value of the global property. |
9730 DECL_ACCESSORS(value, Object) | 9730 DECL_ACCESSORS(value, Object) |
9731 // [dependent_code]: dependent code that depends on the type of the global | 9731 // [dependent_code]: dependent code that depends on the type of the global |
9732 // property. | 9732 // property. |
9733 DECL_ACCESSORS(dependent_code, DependentCode) | 9733 DECL_ACCESSORS(dependent_code, DependentCode) |
9734 | 9734 |
9735 // Computes the new type of the cell's contents for the given value, but | 9735 // Computes the new type of the cell's contents for the given value, but |
9736 // without actually modifying the details. | 9736 // without actually modifying the details. |
9737 static PropertyCellType UpdatedType(Handle<PropertyCell> cell, | 9737 static PropertyCellType UpdatedType(Handle<PropertyCell> cell, |
9738 Handle<Object> value, | 9738 Handle<Object> value, |
9739 PropertyDetails details); | 9739 PropertyDetails details); |
9740 static Handle<Object> UpdateCell(Handle<NameDictionary> dictionary, int entry, | 9740 static Handle<Object> UpdateCell(Handle<NameDictionary> dictionary, int entry, |
9741 Handle<Object> value, | 9741 Handle<Object> value, |
9742 PropertyDetails details); | 9742 PropertyDetails details); |
9743 | 9743 |
9744 static Handle<PropertyCell> InvalidateEntry(Handle<NameDictionary> dictionary, | 9744 static Handle<PropertyCell> InvalidateEntry(Handle<NameDictionary> dictionary, |
9745 int entry); | 9745 int entry); |
9746 | 9746 |
9747 static void AddDependentCompilationInfo(Handle<PropertyCell> cell, | 9747 static void AddDependentCompilationInfo(Handle<PropertyCell> cell, |
9748 CompilationInfo* info); | 9748 CompilationInfo* info); |
9749 | 9749 |
9750 DECLARE_CAST(PropertyCell) | 9750 DECLARE_CAST(PropertyCell) |
9751 | 9751 |
9752 // Dispatched behavior. | 9752 // Dispatched behavior. |
9753 DECLARE_PRINTER(PropertyCell) | 9753 DECLARE_PRINTER(PropertyCell) |
9754 DECLARE_VERIFIER(PropertyCell) | 9754 DECLARE_VERIFIER(PropertyCell) |
9755 | 9755 |
9756 // Layout description. | 9756 // Layout description. |
| 9757 static const int kValueOffset = HeapObject::kHeaderSize; |
9757 static const int kDependentCodeOffset = kValueOffset + kPointerSize; | 9758 static const int kDependentCodeOffset = kValueOffset + kPointerSize; |
9758 static const int kSize = kDependentCodeOffset + kPointerSize; | 9759 static const int kSize = kDependentCodeOffset + kPointerSize; |
9759 | 9760 |
9760 static const int kPointerFieldsBeginOffset = kValueOffset; | 9761 static const int kPointerFieldsBeginOffset = kValueOffset; |
9761 static const int kPointerFieldsEndOffset = kSize; | 9762 static const int kPointerFieldsEndOffset = kSize; |
9762 | 9763 |
9763 typedef FixedBodyDescriptor<kValueOffset, | 9764 typedef FixedBodyDescriptor<kValueOffset, |
9764 kSize, | 9765 kSize, |
9765 kSize> BodyDescriptor; | 9766 kSize> BodyDescriptor; |
9766 | 9767 |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10987 } else { | 10988 } else { |
10988 value &= ~(1 << bit_position); | 10989 value &= ~(1 << bit_position); |
10989 } | 10990 } |
10990 return value; | 10991 return value; |
10991 } | 10992 } |
10992 }; | 10993 }; |
10993 | 10994 |
10994 } } // namespace v8::internal | 10995 } } // namespace v8::internal |
10995 | 10996 |
10996 #endif // V8_OBJECTS_H_ | 10997 #endif // V8_OBJECTS_H_ |
OLD | NEW |