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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE | | 658 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE | |
659 kNotInternalizedTag, | 659 kNotInternalizedTag, |
660 | 660 |
661 // Non-string names | 661 // Non-string names |
662 SYMBOL_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE, LAST_NAME_TYPE | 662 SYMBOL_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE, LAST_NAME_TYPE |
663 | 663 |
664 // Objects allocated in their own spaces (never in new space). | 664 // Objects allocated in their own spaces (never in new space). |
665 MAP_TYPE, | 665 MAP_TYPE, |
666 CODE_TYPE, | 666 CODE_TYPE, |
667 ODDBALL_TYPE, | 667 ODDBALL_TYPE, |
668 CELL_TYPE, | |
669 | 668 |
670 // "Data", objects that cannot contain non-map-word pointers to heap | 669 // "Data", objects that cannot contain non-map-word pointers to heap |
671 // objects. | 670 // objects. |
672 HEAP_NUMBER_TYPE, | 671 HEAP_NUMBER_TYPE, |
673 MUTABLE_HEAP_NUMBER_TYPE, | 672 MUTABLE_HEAP_NUMBER_TYPE, |
674 FOREIGN_TYPE, | 673 FOREIGN_TYPE, |
675 BYTE_ARRAY_TYPE, | 674 BYTE_ARRAY_TYPE, |
676 FREE_SPACE_TYPE, | 675 FREE_SPACE_TYPE, |
677 EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE | 676 EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE |
678 EXTERNAL_UINT8_ARRAY_TYPE, | 677 EXTERNAL_UINT8_ARRAY_TYPE, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 CODE_CACHE_TYPE, | 712 CODE_CACHE_TYPE, |
714 POLYMORPHIC_CODE_CACHE_TYPE, | 713 POLYMORPHIC_CODE_CACHE_TYPE, |
715 TYPE_FEEDBACK_INFO_TYPE, | 714 TYPE_FEEDBACK_INFO_TYPE, |
716 ALIASED_ARGUMENTS_ENTRY_TYPE, | 715 ALIASED_ARGUMENTS_ENTRY_TYPE, |
717 BOX_TYPE, | 716 BOX_TYPE, |
718 DEBUG_INFO_TYPE, | 717 DEBUG_INFO_TYPE, |
719 BREAK_POINT_INFO_TYPE, | 718 BREAK_POINT_INFO_TYPE, |
720 FIXED_ARRAY_TYPE, | 719 FIXED_ARRAY_TYPE, |
721 CONSTANT_POOL_ARRAY_TYPE, | 720 CONSTANT_POOL_ARRAY_TYPE, |
722 SHARED_FUNCTION_INFO_TYPE, | 721 SHARED_FUNCTION_INFO_TYPE, |
| 722 CELL_TYPE, |
723 WEAK_CELL_TYPE, | 723 WEAK_CELL_TYPE, |
724 PROPERTY_CELL_TYPE, | 724 PROPERTY_CELL_TYPE, |
725 PROTOTYPE_INFO_TYPE, | 725 PROTOTYPE_INFO_TYPE, |
726 | 726 |
727 // All the following types are subtypes of JSReceiver, which corresponds to | 727 // All the following types are subtypes of JSReceiver, which corresponds to |
728 // 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 |
729 // the two forms of function. This organization enables using the same | 729 // the two forms of function. This organization enables using the same |
730 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the | 730 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the |
731 // NONCALLABLE_JS_OBJECT range. | 731 // NONCALLABLE_JS_OBJECT range. |
732 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 |
(...skipping 9038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9771 | 9771 |
9772 class Cell: public HeapObject { | 9772 class Cell: public HeapObject { |
9773 public: | 9773 public: |
9774 // [value]: value of the cell. | 9774 // [value]: value of the cell. |
9775 DECL_ACCESSORS(value, Object) | 9775 DECL_ACCESSORS(value, Object) |
9776 | 9776 |
9777 DECLARE_CAST(Cell) | 9777 DECLARE_CAST(Cell) |
9778 | 9778 |
9779 static inline Cell* FromValueAddress(Address value) { | 9779 static inline Cell* FromValueAddress(Address value) { |
9780 Object* result = FromAddress(value - kValueOffset); | 9780 Object* result = FromAddress(value - kValueOffset); |
9781 DCHECK(result->IsCell()); | |
9782 return static_cast<Cell*>(result); | 9781 return static_cast<Cell*>(result); |
9783 } | 9782 } |
9784 | 9783 |
9785 inline Address ValueAddress() { | 9784 inline Address ValueAddress() { |
9786 return address() + kValueOffset; | 9785 return address() + kValueOffset; |
9787 } | 9786 } |
9788 | 9787 |
9789 // Dispatched behavior. | 9788 // Dispatched behavior. |
9790 DECLARE_PRINTER(Cell) | 9789 DECLARE_PRINTER(Cell) |
9791 DECLARE_VERIFIER(Cell) | 9790 DECLARE_VERIFIER(Cell) |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11074 } else { | 11073 } else { |
11075 value &= ~(1 << bit_position); | 11074 value &= ~(1 << bit_position); |
11076 } | 11075 } |
11077 return value; | 11076 return value; |
11078 } | 11077 } |
11079 }; | 11078 }; |
11080 | 11079 |
11081 } } // namespace v8::internal | 11080 } } // namespace v8::internal |
11082 | 11081 |
11083 #endif // V8_OBJECTS_H_ | 11082 #endif // V8_OBJECTS_H_ |
OLD | NEW |