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, |
668 | 669 |
669 // "Data", objects that cannot contain non-map-word pointers to heap | 670 // "Data", objects that cannot contain non-map-word pointers to heap |
670 // objects. | 671 // objects. |
671 HEAP_NUMBER_TYPE, | 672 HEAP_NUMBER_TYPE, |
672 MUTABLE_HEAP_NUMBER_TYPE, | 673 MUTABLE_HEAP_NUMBER_TYPE, |
673 FOREIGN_TYPE, | 674 FOREIGN_TYPE, |
674 BYTE_ARRAY_TYPE, | 675 BYTE_ARRAY_TYPE, |
675 FREE_SPACE_TYPE, | 676 FREE_SPACE_TYPE, |
676 EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE | 677 EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE |
677 EXTERNAL_UINT8_ARRAY_TYPE, | 678 EXTERNAL_UINT8_ARRAY_TYPE, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 CODE_CACHE_TYPE, | 713 CODE_CACHE_TYPE, |
713 POLYMORPHIC_CODE_CACHE_TYPE, | 714 POLYMORPHIC_CODE_CACHE_TYPE, |
714 TYPE_FEEDBACK_INFO_TYPE, | 715 TYPE_FEEDBACK_INFO_TYPE, |
715 ALIASED_ARGUMENTS_ENTRY_TYPE, | 716 ALIASED_ARGUMENTS_ENTRY_TYPE, |
716 BOX_TYPE, | 717 BOX_TYPE, |
717 DEBUG_INFO_TYPE, | 718 DEBUG_INFO_TYPE, |
718 BREAK_POINT_INFO_TYPE, | 719 BREAK_POINT_INFO_TYPE, |
719 FIXED_ARRAY_TYPE, | 720 FIXED_ARRAY_TYPE, |
720 CONSTANT_POOL_ARRAY_TYPE, | 721 CONSTANT_POOL_ARRAY_TYPE, |
721 SHARED_FUNCTION_INFO_TYPE, | 722 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 9037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9770 | 9770 |
9771 class Cell: public HeapObject { | 9771 class Cell: public HeapObject { |
9772 public: | 9772 public: |
9773 // [value]: value of the cell. | 9773 // [value]: value of the cell. |
9774 DECL_ACCESSORS(value, Object) | 9774 DECL_ACCESSORS(value, Object) |
9775 | 9775 |
9776 DECLARE_CAST(Cell) | 9776 DECLARE_CAST(Cell) |
9777 | 9777 |
9778 static inline Cell* FromValueAddress(Address value) { | 9778 static inline Cell* FromValueAddress(Address value) { |
9779 Object* result = FromAddress(value - kValueOffset); | 9779 Object* result = FromAddress(value - kValueOffset); |
| 9780 DCHECK(result->IsCell()); |
9780 return static_cast<Cell*>(result); | 9781 return static_cast<Cell*>(result); |
9781 } | 9782 } |
9782 | 9783 |
9783 inline Address ValueAddress() { | 9784 inline Address ValueAddress() { |
9784 return address() + kValueOffset; | 9785 return address() + kValueOffset; |
9785 } | 9786 } |
9786 | 9787 |
9787 // Dispatched behavior. | 9788 // Dispatched behavior. |
9788 DECLARE_PRINTER(Cell) | 9789 DECLARE_PRINTER(Cell) |
9789 DECLARE_VERIFIER(Cell) | 9790 DECLARE_VERIFIER(Cell) |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11072 } else { | 11073 } else { |
11073 value &= ~(1 << bit_position); | 11074 value &= ~(1 << bit_position); |
11074 } | 11075 } |
11075 return value; | 11076 return value; |
11076 } | 11077 } |
11077 }; | 11078 }; |
11078 | 11079 |
11079 } } // namespace v8::internal | 11080 } } // namespace v8::internal |
11080 | 11081 |
11081 #endif // V8_OBJECTS_H_ | 11082 #endif // V8_OBJECTS_H_ |
OLD | NEW |