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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 // - InterceptorInfo | 137 // - InterceptorInfo |
138 // - CallHandlerInfo | 138 // - CallHandlerInfo |
139 // - TemplateInfo | 139 // - TemplateInfo |
140 // - FunctionTemplateInfo | 140 // - FunctionTemplateInfo |
141 // - ObjectTemplateInfo | 141 // - ObjectTemplateInfo |
142 // - Script | 142 // - Script |
143 // - TypeSwitchInfo | 143 // - TypeSwitchInfo |
144 // - DebugInfo | 144 // - DebugInfo |
145 // - BreakPointInfo | 145 // - BreakPointInfo |
146 // - CodeCache | 146 // - CodeCache |
147 // - PrototypeInfo | |
147 // - WeakCell | 148 // - WeakCell |
148 // | 149 // |
149 // Formats of Object*: | 150 // Formats of Object*: |
150 // Smi: [31 bit signed int] 0 | 151 // Smi: [31 bit signed int] 0 |
151 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 | 152 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 |
152 | 153 |
153 namespace v8 { | 154 namespace v8 { |
154 namespace internal { | 155 namespace internal { |
155 | 156 |
156 enum KeyedAccessStoreMode { | 157 enum KeyedAccessStoreMode { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 V(SIGNATURE_INFO_TYPE) \ | 414 V(SIGNATURE_INFO_TYPE) \ |
414 V(TYPE_SWITCH_INFO_TYPE) \ | 415 V(TYPE_SWITCH_INFO_TYPE) \ |
415 V(ALLOCATION_MEMENTO_TYPE) \ | 416 V(ALLOCATION_MEMENTO_TYPE) \ |
416 V(ALLOCATION_SITE_TYPE) \ | 417 V(ALLOCATION_SITE_TYPE) \ |
417 V(SCRIPT_TYPE) \ | 418 V(SCRIPT_TYPE) \ |
418 V(CODE_CACHE_TYPE) \ | 419 V(CODE_CACHE_TYPE) \ |
419 V(POLYMORPHIC_CODE_CACHE_TYPE) \ | 420 V(POLYMORPHIC_CODE_CACHE_TYPE) \ |
420 V(TYPE_FEEDBACK_INFO_TYPE) \ | 421 V(TYPE_FEEDBACK_INFO_TYPE) \ |
421 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 422 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
422 V(BOX_TYPE) \ | 423 V(BOX_TYPE) \ |
424 V(PROTOTYPE_INFO_TYPE) \ | |
423 \ | 425 \ |
424 V(FIXED_ARRAY_TYPE) \ | 426 V(FIXED_ARRAY_TYPE) \ |
425 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 427 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
426 V(CONSTANT_POOL_ARRAY_TYPE) \ | 428 V(CONSTANT_POOL_ARRAY_TYPE) \ |
427 V(SHARED_FUNCTION_INFO_TYPE) \ | 429 V(SHARED_FUNCTION_INFO_TYPE) \ |
428 V(WEAK_CELL_TYPE) \ | 430 V(WEAK_CELL_TYPE) \ |
429 \ | 431 \ |
430 V(JS_MESSAGE_OBJECT_TYPE) \ | 432 V(JS_MESSAGE_OBJECT_TYPE) \ |
431 \ | 433 \ |
432 V(JS_VALUE_TYPE) \ | 434 V(JS_VALUE_TYPE) \ |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 | 512 |
511 // A struct is a simple object a set of object-valued fields. Including an | 513 // A struct is a simple object a set of object-valued fields. Including an |
512 // object type in this causes the compiler to generate most of the boilerplate | 514 // object type in this causes the compiler to generate most of the boilerplate |
513 // code for the class including allocation and garbage collection routines, | 515 // code for the class including allocation and garbage collection routines, |
514 // casts and predicates. All you need to define is the class, methods and | 516 // casts and predicates. All you need to define is the class, methods and |
515 // object verification routines. Easy, no? | 517 // object verification routines. Easy, no? |
516 // | 518 // |
517 // Note that for subtle reasons related to the ordering or numerical values of | 519 // Note that for subtle reasons related to the ordering or numerical values of |
518 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST | 520 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST |
519 // manually. | 521 // manually. |
520 #define STRUCT_LIST(V) \ | 522 #define STRUCT_LIST(V) \ |
Jakob Kummerow
2015/03/24 10:40:14
clang-format...
| |
521 V(BOX, Box, box) \ | 523 V(BOX, Box, box) \ |
522 V(EXECUTABLE_ACCESSOR_INFO, ExecutableAccessorInfo, executable_accessor_info)\ | 524 V(EXECUTABLE_ACCESSOR_INFO, ExecutableAccessorInfo, \ |
523 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 525 executable_accessor_info) \ |
524 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 526 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
525 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 527 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
526 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 528 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
527 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 529 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
528 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 530 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
529 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ | 531 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
530 V(SCRIPT, Script, script) \ | 532 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ |
531 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 533 V(SCRIPT, Script, script) \ |
532 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 534 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
533 V(CODE_CACHE, CodeCache, code_cache) \ | 535 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
534 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \ | 536 V(CODE_CACHE, CodeCache, code_cache) \ |
535 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ | 537 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \ |
536 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ | 538 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ |
537 V(DEBUG_INFO, DebugInfo, debug_info) \ | 539 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ |
538 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) | 540 V(DEBUG_INFO, DebugInfo, debug_info) \ |
541 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ | |
542 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) | |
539 | 543 |
540 // We use the full 8 bits of the instance_type field to encode heap object | 544 // We use the full 8 bits of the instance_type field to encode heap object |
541 // instance types. The high-order bit (bit 7) is set if the object is not a | 545 // instance types. The high-order bit (bit 7) is set if the object is not a |
542 // string, and cleared if it is a string. | 546 // string, and cleared if it is a string. |
543 const uint32_t kIsNotStringMask = 0x80; | 547 const uint32_t kIsNotStringMask = 0x80; |
544 const uint32_t kStringTag = 0x0; | 548 const uint32_t kStringTag = 0x0; |
545 const uint32_t kNotStringTag = 0x80; | 549 const uint32_t kNotStringTag = 0x80; |
546 | 550 |
547 // Bit 6 indicates that the object is an internalized string (if set) or not. | 551 // Bit 6 indicates that the object is an internalized string (if set) or not. |
548 // Bit 7 has to be clear as well. | 552 // Bit 7 has to be clear as well. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
711 TYPE_FEEDBACK_INFO_TYPE, | 715 TYPE_FEEDBACK_INFO_TYPE, |
712 ALIASED_ARGUMENTS_ENTRY_TYPE, | 716 ALIASED_ARGUMENTS_ENTRY_TYPE, |
713 BOX_TYPE, | 717 BOX_TYPE, |
714 DEBUG_INFO_TYPE, | 718 DEBUG_INFO_TYPE, |
715 BREAK_POINT_INFO_TYPE, | 719 BREAK_POINT_INFO_TYPE, |
716 FIXED_ARRAY_TYPE, | 720 FIXED_ARRAY_TYPE, |
717 CONSTANT_POOL_ARRAY_TYPE, | 721 CONSTANT_POOL_ARRAY_TYPE, |
718 SHARED_FUNCTION_INFO_TYPE, | 722 SHARED_FUNCTION_INFO_TYPE, |
719 WEAK_CELL_TYPE, | 723 WEAK_CELL_TYPE, |
720 PROPERTY_CELL_TYPE, | 724 PROPERTY_CELL_TYPE, |
725 PROTOTYPE_INFO_TYPE, | |
721 | 726 |
722 // All the following types are subtypes of JSReceiver, which corresponds to | 727 // All the following types are subtypes of JSReceiver, which corresponds to |
723 // objects in the JS sense. The first and the last type in this range are | 728 // objects in the JS sense. The first and the last type in this range are |
724 // the two forms of function. This organization enables using the same | 729 // the two forms of function. This organization enables using the same |
725 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the | 730 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the |
726 // NONCALLABLE_JS_OBJECT range. | 731 // NONCALLABLE_JS_OBJECT range. |
727 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE | 732 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE |
728 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE | 733 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE |
729 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE | 734 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE |
730 JS_MESSAGE_OBJECT_TYPE, | 735 JS_MESSAGE_OBJECT_TYPE, |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2042 // Returns the number of enumerable elements. | 2047 // Returns the number of enumerable elements. |
2043 int GetEnumElementKeys(FixedArray* storage); | 2048 int GetEnumElementKeys(FixedArray* storage); |
2044 | 2049 |
2045 // Returns a new map with all transitions dropped from the object's current | 2050 // Returns a new map with all transitions dropped from the object's current |
2046 // map and the ElementsKind set. | 2051 // map and the ElementsKind set. |
2047 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, | 2052 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, |
2048 ElementsKind to_kind); | 2053 ElementsKind to_kind); |
2049 static void TransitionElementsKind(Handle<JSObject> object, | 2054 static void TransitionElementsKind(Handle<JSObject> object, |
2050 ElementsKind to_kind); | 2055 ElementsKind to_kind); |
2051 | 2056 |
2052 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); | 2057 // Always use this to migrate an object to a new map. |
2058 // |expected_additional_properties| is only used for fast-to-slow transitions | |
2059 // and ignored otherwise. | |
2060 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map, | |
2061 int expected_additional_properties = 0); | |
2053 | 2062 |
2054 // Convert the object to use the canonical dictionary | 2063 // Convert the object to use the canonical dictionary |
2055 // representation. If the object is expected to have additional properties | 2064 // representation. If the object is expected to have additional properties |
2056 // added this number can be indicated to have the backing store allocated to | 2065 // added this number can be indicated to have the backing store allocated to |
2057 // an initial capacity for holding these properties. | 2066 // an initial capacity for holding these properties. |
2058 static void NormalizeProperties(Handle<JSObject> object, | 2067 static void NormalizeProperties(Handle<JSObject> object, |
2059 PropertyNormalizationMode mode, | 2068 PropertyNormalizationMode mode, |
2060 int expected_additional_properties, | 2069 int expected_additional_properties, |
2061 const char* reason); | 2070 const char* reason); |
2062 | 2071 |
(...skipping 3726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5789 // Instance type. | 5798 // Instance type. |
5790 inline InstanceType instance_type(); | 5799 inline InstanceType instance_type(); |
5791 inline void set_instance_type(InstanceType value); | 5800 inline void set_instance_type(InstanceType value); |
5792 | 5801 |
5793 // Tells how many unused property fields are available in the | 5802 // Tells how many unused property fields are available in the |
5794 // instance (only used for JSObject in fast mode). | 5803 // instance (only used for JSObject in fast mode). |
5795 inline int unused_property_fields(); | 5804 inline int unused_property_fields(); |
5796 inline void set_unused_property_fields(int value); | 5805 inline void set_unused_property_fields(int value); |
5797 | 5806 |
5798 // Bit field. | 5807 // Bit field. |
5799 inline byte bit_field(); | 5808 inline byte bit_field() const; |
5800 inline void set_bit_field(byte value); | 5809 inline void set_bit_field(byte value); |
5801 | 5810 |
5802 // Bit field 2. | 5811 // Bit field 2. |
5803 inline byte bit_field2(); | 5812 inline byte bit_field2() const; |
5804 inline void set_bit_field2(byte value); | 5813 inline void set_bit_field2(byte value); |
5805 | 5814 |
5806 // Bit field 3. | 5815 // Bit field 3. |
5807 inline uint32_t bit_field3(); | 5816 inline uint32_t bit_field3() const; |
5808 inline void set_bit_field3(uint32_t bits); | 5817 inline void set_bit_field3(uint32_t bits); |
5809 | 5818 |
5810 class EnumLengthBits: public BitField<int, | 5819 class EnumLengthBits: public BitField<int, |
5811 0, kDescriptorIndexBitCount> {}; // NOLINT | 5820 0, kDescriptorIndexBitCount> {}; // NOLINT |
5812 class NumberOfOwnDescriptorsBits: public BitField<int, | 5821 class NumberOfOwnDescriptorsBits: public BitField<int, |
5813 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {}; // NOLINT | 5822 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {}; // NOLINT |
5814 STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20); | 5823 STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20); |
5815 class DictionaryMap : public BitField<bool, 20, 1> {}; | 5824 class DictionaryMap : public BitField<bool, 20, 1> {}; |
5816 class OwnsDescriptors : public BitField<bool, 21, 1> {}; | 5825 class OwnsDescriptors : public BitField<bool, 21, 1> {}; |
5817 class HasInstanceCallHandler : public BitField<bool, 22, 1> {}; | 5826 class HasInstanceCallHandler : public BitField<bool, 22, 1> {}; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5892 set_bit_field(bit_field() | (1 << kIsObserved)); | 5901 set_bit_field(bit_field() | (1 << kIsObserved)); |
5893 } | 5902 } |
5894 | 5903 |
5895 inline bool is_observed() { | 5904 inline bool is_observed() { |
5896 return ((1 << kIsObserved) & bit_field()) != 0; | 5905 return ((1 << kIsObserved) & bit_field()) != 0; |
5897 } | 5906 } |
5898 | 5907 |
5899 inline void set_is_extensible(bool value); | 5908 inline void set_is_extensible(bool value); |
5900 inline bool is_extensible(); | 5909 inline bool is_extensible(); |
5901 inline void set_is_prototype_map(bool value); | 5910 inline void set_is_prototype_map(bool value); |
5902 inline bool is_prototype_map(); | 5911 inline bool is_prototype_map() const; |
5903 | 5912 |
5904 inline void set_elements_kind(ElementsKind elements_kind) { | 5913 inline void set_elements_kind(ElementsKind elements_kind) { |
5905 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); | 5914 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
5906 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); | 5915 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); |
5907 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); | 5916 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); |
5908 DCHECK(this->elements_kind() == elements_kind); | 5917 DCHECK(this->elements_kind() == elements_kind); |
5909 } | 5918 } |
5910 | 5919 |
5911 inline ElementsKind elements_kind() { | 5920 inline ElementsKind elements_kind() { |
5912 return Map::ElementsKindBits::decode(bit_field2()); | 5921 return Map::ElementsKindBits::decode(bit_field2()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5963 bool DictionaryElementsInPrototypeChainOnly(); | 5972 bool DictionaryElementsInPrototypeChainOnly(); |
5964 | 5973 |
5965 inline Map* ElementsTransitionMap(); | 5974 inline Map* ElementsTransitionMap(); |
5966 | 5975 |
5967 inline FixedArrayBase* GetInitialElements(); | 5976 inline FixedArrayBase* GetInitialElements(); |
5968 | 5977 |
5969 // [raw_transitions]: Provides access to the transitions storage field. | 5978 // [raw_transitions]: Provides access to the transitions storage field. |
5970 // Don't call set_raw_transitions() directly to overwrite transitions, use | 5979 // Don't call set_raw_transitions() directly to overwrite transitions, use |
5971 // the TransitionArray::ReplaceTransitions() wrapper instead! | 5980 // the TransitionArray::ReplaceTransitions() wrapper instead! |
5972 DECL_ACCESSORS(raw_transitions, Object) | 5981 DECL_ACCESSORS(raw_transitions, Object) |
5982 // [prototype_info]: Per-prototype metadata. Aliased with transitions | |
5983 // (which prototype maps don't have). | |
5984 DECL_ACCESSORS(prototype_info, Object) | |
5973 | 5985 |
5974 Map* FindRootMap(); | 5986 Map* FindRootMap(); |
5975 Map* FindFieldOwner(int descriptor); | 5987 Map* FindFieldOwner(int descriptor); |
5976 | 5988 |
5977 inline int GetInObjectPropertyOffset(int index); | 5989 inline int GetInObjectPropertyOffset(int index); |
5978 | 5990 |
5979 int NumberOfFields(); | 5991 int NumberOfFields(); |
5980 | 5992 |
5981 // TODO(ishell): candidate with JSObject::MigrateToMap(). | 5993 // TODO(ishell): candidate with JSObject::MigrateToMap(). |
5982 bool InstancesNeedRewriting(Map* target, int target_number_of_fields, | 5994 bool InstancesNeedRewriting(Map* target, int target_number_of_fields, |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6321 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; | 6333 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; |
6322 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; | 6334 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; |
6323 static const int kBitField3Offset = kInstanceAttributesOffset + kIntSize; | 6335 static const int kBitField3Offset = kInstanceAttributesOffset + kIntSize; |
6324 static const int kPrototypeOffset = kBitField3Offset + kPointerSize; | 6336 static const int kPrototypeOffset = kBitField3Offset + kPointerSize; |
6325 static const int kConstructorOrBackPointerOffset = | 6337 static const int kConstructorOrBackPointerOffset = |
6326 kPrototypeOffset + kPointerSize; | 6338 kPrototypeOffset + kPointerSize; |
6327 // When there is only one transition, it is stored directly in this field; | 6339 // When there is only one transition, it is stored directly in this field; |
6328 // otherwise a transition array is used. | 6340 // otherwise a transition array is used. |
6329 // For prototype maps, this slot is used to store a pointer to the prototype | 6341 // For prototype maps, this slot is used to store a pointer to the prototype |
6330 // object using this map. | 6342 // object using this map. |
6331 static const int kTransitionsOffset = | 6343 static const int kTransitionsOrPrototypeInfoOffset = |
6332 kConstructorOrBackPointerOffset + kPointerSize; | 6344 kConstructorOrBackPointerOffset + kPointerSize; |
6333 static const int kDescriptorsOffset = kTransitionsOffset + kPointerSize; | 6345 static const int kDescriptorsOffset = |
6346 kTransitionsOrPrototypeInfoOffset + kPointerSize; | |
6334 #if V8_DOUBLE_FIELDS_UNBOXING | 6347 #if V8_DOUBLE_FIELDS_UNBOXING |
6335 static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize; | 6348 static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize; |
6336 static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize; | 6349 static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize; |
6337 #else | 6350 #else |
6338 static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed. | 6351 static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed. |
6339 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; | 6352 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; |
6340 #endif | 6353 #endif |
6341 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; | 6354 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; |
6342 static const int kWeakCellCacheOffset = kDependentCodeOffset + kPointerSize; | 6355 static const int kWeakCellCacheOffset = kDependentCodeOffset + kPointerSize; |
6343 static const int kSize = kWeakCellCacheOffset + kPointerSize; | 6356 static const int kSize = kWeakCellCacheOffset + kPointerSize; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6525 DECLARE_VERIFIER(Box) | 6538 DECLARE_VERIFIER(Box) |
6526 | 6539 |
6527 static const int kValueOffset = HeapObject::kHeaderSize; | 6540 static const int kValueOffset = HeapObject::kHeaderSize; |
6528 static const int kSize = kValueOffset + kPointerSize; | 6541 static const int kSize = kValueOffset + kPointerSize; |
6529 | 6542 |
6530 private: | 6543 private: |
6531 DISALLOW_IMPLICIT_CONSTRUCTORS(Box); | 6544 DISALLOW_IMPLICIT_CONSTRUCTORS(Box); |
6532 }; | 6545 }; |
6533 | 6546 |
6534 | 6547 |
6548 // Container for metadata stored on each prototype map. | |
6549 class PrototypeInfo : public Struct { | |
6550 public: | |
6551 // [prototype_object]: The object using the map holding this PrototypeInfo. | |
6552 DECL_ACCESSORS(prototype_object, JSObject) | |
6553 // [prototype_users]: WeakFixedArray containing maps using this prototype, | |
6554 // or Smi(0) if uninitialized. | |
6555 DECL_ACCESSORS(prototype_users, Object) | |
6556 // [validity_cell]: Cell containing the validity bit for prototype chains | |
6557 // going through this object, or Smi(0) if uninitialized. | |
6558 DECL_ACCESSORS(validity_cell, Object) | |
6559 | |
6560 DECLARE_CAST(PrototypeInfo) | |
6561 | |
6562 // Dispatched behavior. | |
6563 DECLARE_PRINTER(PrototypeInfo) | |
6564 DECLARE_VERIFIER(PrototypeInfo) | |
6565 | |
6566 static const int kPrototypeObjectOffset = HeapObject::kHeaderSize; | |
6567 static const int kPrototypeUsersOffset = | |
6568 kPrototypeObjectOffset + kPointerSize; | |
6569 static const int kValidityCellOffset = kPrototypeUsersOffset + kPointerSize; | |
6570 static const int kSize = kValidityCellOffset + kPointerSize; | |
6571 | |
6572 private: | |
6573 DISALLOW_IMPLICIT_CONSTRUCTORS(PrototypeInfo); | |
6574 }; | |
6575 | |
6576 | |
6535 // Script describes a script which has been added to the VM. | 6577 // Script describes a script which has been added to the VM. |
6536 class Script: public Struct { | 6578 class Script: public Struct { |
6537 public: | 6579 public: |
6538 // Script types. | 6580 // Script types. |
6539 enum Type { | 6581 enum Type { |
6540 TYPE_NATIVE = 0, | 6582 TYPE_NATIVE = 0, |
6541 TYPE_EXTENSION = 1, | 6583 TYPE_EXTENSION = 1, |
6542 TYPE_NORMAL = 2 | 6584 TYPE_NORMAL = 2 |
6543 }; | 6585 }; |
6544 | 6586 |
(...skipping 4445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10990 } else { | 11032 } else { |
10991 value &= ~(1 << bit_position); | 11033 value &= ~(1 << bit_position); |
10992 } | 11034 } |
10993 return value; | 11035 return value; |
10994 } | 11036 } |
10995 }; | 11037 }; |
10996 | 11038 |
10997 } } // namespace v8::internal | 11039 } } // namespace v8::internal |
10998 | 11040 |
10999 #endif // V8_OBJECTS_H_ | 11041 #endif // V8_OBJECTS_H_ |
OLD | NEW |