| 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 |
| 1814 // During garbage collection, the map word of a heap object does not | 1822 // During garbage collection, the map word of a heap object does not |
| 1815 // necessarily contain a map pointer. | 1823 // necessarily contain a map pointer. |
| 1816 inline MapWord map_word(); | 1824 inline MapWord map_word(); |
| 1817 inline void set_map_word(MapWord map_word); | 1825 inline void set_map_word(MapWord map_word); |
| 1818 | 1826 |
| 1819 // The Heap the object was allocated in. Used also to access Isolate. | 1827 // The Heap the object was allocated in. Used also to access Isolate. |
| 1820 inline Heap* GetHeap(); | 1828 inline Heap* GetHeap(); |
| 1821 | 1829 |
| 1822 // Convenience method to get current isolate. | 1830 // Convenience method to get current isolate. |
| 1823 inline Isolate* GetIsolate(); | 1831 inline Isolate* GetIsolate(); |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2988 | 2996 |
| 2989 | 2997 |
| 2990 // Common superclass for FixedArrays that allow implementations to share | 2998 // Common superclass for FixedArrays that allow implementations to share |
| 2991 // common accessors and some code paths. | 2999 // common accessors and some code paths. |
| 2992 class FixedArrayBase: public HeapObject { | 3000 class FixedArrayBase: public HeapObject { |
| 2993 public: | 3001 public: |
| 2994 // [length]: length of the array. | 3002 // [length]: length of the array. |
| 2995 inline int length(); | 3003 inline int length(); |
| 2996 inline void set_length(int value); | 3004 inline void set_length(int value); |
| 2997 | 3005 |
| 3006 // Get and set the length using acquire loads and release stores. |
| 3007 inline int synchronized_length(); |
| 3008 inline void synchronized_set_length(int value); |
| 3009 |
| 2998 inline static FixedArrayBase* cast(Object* object); | 3010 inline static FixedArrayBase* cast(Object* object); |
| 2999 | 3011 |
| 3000 // Layout description. | 3012 // Layout description. |
| 3001 // Length is smi tagged when it is stored. | 3013 // Length is smi tagged when it is stored. |
| 3002 static const int kLengthOffset = HeapObject::kHeaderSize; | 3014 static const int kLengthOffset = HeapObject::kHeaderSize; |
| 3003 static const int kHeaderSize = kLengthOffset + kPointerSize; | 3015 static const int kHeaderSize = kLengthOffset + kPointerSize; |
| 3004 }; | 3016 }; |
| 3005 | 3017 |
| 3006 | 3018 |
| 3007 class FixedDoubleArray; | 3019 class FixedDoubleArray; |
| (...skipping 5742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8750 Vector<const uint8_t> buffer_; | 8762 Vector<const uint8_t> buffer_; |
| 8751 State state_; | 8763 State state_; |
| 8752 | 8764 |
| 8753 friend class String; | 8765 friend class String; |
| 8754 }; | 8766 }; |
| 8755 | 8767 |
| 8756 // Get and set the length of the string. | 8768 // Get and set the length of the string. |
| 8757 inline int length(); | 8769 inline int length(); |
| 8758 inline void set_length(int value); | 8770 inline void set_length(int value); |
| 8759 | 8771 |
| 8772 // Get and set the length of the string using acquire loads and release |
| 8773 // stores. |
| 8774 inline int synchronized_length(); |
| 8775 inline void synchronized_set_length(int value); |
| 8776 |
| 8760 // Returns whether this string has only ASCII chars, i.e. all of them can | 8777 // 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 | 8778 // be ASCII encoded. This might be the case even if the string is |
| 8762 // two-byte. Such strings may appear when the embedder prefers | 8779 // two-byte. Such strings may appear when the embedder prefers |
| 8763 // two-byte external representations even for ASCII data. | 8780 // two-byte external representations even for ASCII data. |
| 8764 inline bool IsOneByteRepresentation(); | 8781 inline bool IsOneByteRepresentation(); |
| 8765 inline bool IsTwoByteRepresentation(); | 8782 inline bool IsTwoByteRepresentation(); |
| 8766 | 8783 |
| 8767 // Cons and slices have an encoding flag that may not represent the actual | 8784 // 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. | 8785 // encoding of the underlying string. This is taken into account here. |
| 8769 // Requires: this->IsFlat() | 8786 // Requires: this->IsFlat() |
| (...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10786 } else { | 10803 } else { |
| 10787 value &= ~(1 << bit_position); | 10804 value &= ~(1 << bit_position); |
| 10788 } | 10805 } |
| 10789 return value; | 10806 return value; |
| 10790 } | 10807 } |
| 10791 }; | 10808 }; |
| 10792 | 10809 |
| 10793 } } // namespace v8::internal | 10810 } } // namespace v8::internal |
| 10794 | 10811 |
| 10795 #endif // V8_OBJECTS_H_ | 10812 #endif // V8_OBJECTS_H_ |
| OLD | NEW |