OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 public: | 1804 public: |
1805 // [map]: Contains a map which contains the object's reflective | 1805 // [map]: Contains a map which contains the object's reflective |
1806 // information. | 1806 // information. |
1807 inline Map* map(); | 1807 inline Map* map(); |
1808 inline void set_map(Map* value); | 1808 inline void set_map(Map* value); |
1809 // The no-write-barrier version. This is OK if the object is white and in | 1809 // The no-write-barrier version. This is OK if the object is white and in |
1810 // new space, or if the value is an immortal immutable object, like the maps | 1810 // new space, or if the value is an immortal immutable object, like the maps |
1811 // of primitive (non-JS) objects like strings, heap numbers etc. | 1811 // of primitive (non-JS) objects like strings, heap numbers etc. |
1812 inline void set_map_no_write_barrier(Map* value); | 1812 inline void set_map_no_write_barrier(Map* value); |
1813 | 1813 |
| 1814 // Get the map using acquire load. |
| 1815 inline Map* synchronized_map(); |
| 1816 inline MapWord synchronized_map_word(); |
| 1817 |
| 1818 // Set the map using release store |
| 1819 inline void synchronized_set_map(Map* value); |
| 1820 inline void synchronized_set_map_word(MapWord map_word); |
| 1821 |
| 1822 // Get the map using no barrier load. |
| 1823 inline Map* no_barrier_map(); |
| 1824 inline MapWord no_barrier_map_word(); |
| 1825 |
| 1826 // Set the map using no barrier store. |
| 1827 inline void no_barrier_set_map(Map* value); |
| 1828 inline void no_barrier_set_map_word(MapWord map_word); |
| 1829 |
1814 // During garbage collection, the map word of a heap object does not | 1830 // During garbage collection, the map word of a heap object does not |
1815 // necessarily contain a map pointer. | 1831 // necessarily contain a map pointer. |
1816 inline MapWord map_word(); | 1832 inline MapWord map_word(); |
1817 inline void set_map_word(MapWord map_word); | 1833 inline void set_map_word(MapWord map_word); |
1818 | 1834 |
1819 // The Heap the object was allocated in. Used also to access Isolate. | 1835 // The Heap the object was allocated in. Used also to access Isolate. |
1820 inline Heap* GetHeap(); | 1836 inline Heap* GetHeap(); |
1821 | 1837 |
1822 // Convenience method to get current isolate. | 1838 // Convenience method to get current isolate. |
1823 inline Isolate* GetIsolate(); | 1839 inline Isolate* GetIsolate(); |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 | 3004 |
2989 | 3005 |
2990 // Common superclass for FixedArrays that allow implementations to share | 3006 // Common superclass for FixedArrays that allow implementations to share |
2991 // common accessors and some code paths. | 3007 // common accessors and some code paths. |
2992 class FixedArrayBase: public HeapObject { | 3008 class FixedArrayBase: public HeapObject { |
2993 public: | 3009 public: |
2994 // [length]: length of the array. | 3010 // [length]: length of the array. |
2995 inline int length(); | 3011 inline int length(); |
2996 inline void set_length(int value); | 3012 inline void set_length(int value); |
2997 | 3013 |
| 3014 // Get and set the length using acquire loads and release stores. |
| 3015 inline int synchronized_length(); |
| 3016 inline void synchronized_set_length(int value); |
| 3017 |
2998 inline static FixedArrayBase* cast(Object* object); | 3018 inline static FixedArrayBase* cast(Object* object); |
2999 | 3019 |
3000 // Layout description. | 3020 // Layout description. |
3001 // Length is smi tagged when it is stored. | 3021 // Length is smi tagged when it is stored. |
3002 static const int kLengthOffset = HeapObject::kHeaderSize; | 3022 static const int kLengthOffset = HeapObject::kHeaderSize; |
3003 static const int kHeaderSize = kLengthOffset + kPointerSize; | 3023 static const int kHeaderSize = kLengthOffset + kPointerSize; |
3004 }; | 3024 }; |
3005 | 3025 |
3006 | 3026 |
3007 class FixedDoubleArray; | 3027 class FixedDoubleArray; |
(...skipping 5742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8750 Vector<const uint8_t> buffer_; | 8770 Vector<const uint8_t> buffer_; |
8751 State state_; | 8771 State state_; |
8752 | 8772 |
8753 friend class String; | 8773 friend class String; |
8754 }; | 8774 }; |
8755 | 8775 |
8756 // Get and set the length of the string. | 8776 // Get and set the length of the string. |
8757 inline int length(); | 8777 inline int length(); |
8758 inline void set_length(int value); | 8778 inline void set_length(int value); |
8759 | 8779 |
| 8780 // Get and set the length of the string using acquire loads and release |
| 8781 // stores. |
| 8782 inline int synchronized_length(); |
| 8783 inline void synchronized_set_length(int value); |
| 8784 |
8760 // Returns whether this string has only ASCII chars, i.e. all of them can | 8785 // Returns whether this string has only ASCII chars, i.e. all of them can |
8761 // be ASCII encoded. This might be the case even if the string is | 8786 // be ASCII encoded. This might be the case even if the string is |
8762 // two-byte. Such strings may appear when the embedder prefers | 8787 // two-byte. Such strings may appear when the embedder prefers |
8763 // two-byte external representations even for ASCII data. | 8788 // two-byte external representations even for ASCII data. |
8764 inline bool IsOneByteRepresentation(); | 8789 inline bool IsOneByteRepresentation(); |
8765 inline bool IsTwoByteRepresentation(); | 8790 inline bool IsTwoByteRepresentation(); |
8766 | 8791 |
8767 // Cons and slices have an encoding flag that may not represent the actual | 8792 // Cons and slices have an encoding flag that may not represent the actual |
8768 // encoding of the underlying string. This is taken into account here. | 8793 // encoding of the underlying string. This is taken into account here. |
8769 // Requires: this->IsFlat() | 8794 // Requires: this->IsFlat() |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10786 } else { | 10811 } else { |
10787 value &= ~(1 << bit_position); | 10812 value &= ~(1 << bit_position); |
10788 } | 10813 } |
10789 return value; | 10814 return value; |
10790 } | 10815 } |
10791 }; | 10816 }; |
10792 | 10817 |
10793 } } // namespace v8::internal | 10818 } } // namespace v8::internal |
10794 | 10819 |
10795 #endif // V8_OBJECTS_H_ | 10820 #endif // V8_OBJECTS_H_ |
OLD | NEW |