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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 | 1733 |
1734 // Iterates over all pointers contained in the object except the | 1734 // Iterates over all pointers contained in the object except the |
1735 // first map pointer. The object type is given in the first | 1735 // first map pointer. The object type is given in the first |
1736 // parameter. This function does not access the map pointer in the | 1736 // parameter. This function does not access the map pointer in the |
1737 // object, and so is safe to call while the map pointer is modified. | 1737 // object, and so is safe to call while the map pointer is modified. |
1738 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); | 1738 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); |
1739 | 1739 |
1740 // Returns the heap object's size in bytes | 1740 // Returns the heap object's size in bytes |
1741 inline int Size(); | 1741 inline int Size(); |
1742 | 1742 |
1743 // Returns true if this heap object may contain pointers to objects in new | 1743 // Returns true if this heap object may contain raw values, i.e., values that |
1744 // space. | 1744 // look like pointers to heap objects. |
1745 inline bool MayContainNewSpacePointers(); | 1745 inline bool MayContainRawValues(); |
1746 | 1746 |
1747 // Given a heap object's map pointer, returns the heap size in bytes | 1747 // Given a heap object's map pointer, returns the heap size in bytes |
1748 // Useful when the map pointer field is used for other purposes. | 1748 // Useful when the map pointer field is used for other purposes. |
1749 // GC internal. | 1749 // GC internal. |
1750 inline int SizeFromMap(Map* map); | 1750 inline int SizeFromMap(Map* map); |
1751 | 1751 |
1752 // Returns the field at offset in obj, as a read/write Object* reference. | 1752 // Returns the field at offset in obj, as a read/write Object* reference. |
1753 // Does no checking, and is safe to use during GC, while maps are invalid. | 1753 // Does no checking, and is safe to use during GC, while maps are invalid. |
1754 // Does not invoke write barrier, so should only be assigned to | 1754 // Does not invoke write barrier, so should only be assigned to |
1755 // during marking GC. | 1755 // during marking GC. |
(...skipping 9399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11155 } else { | 11155 } else { |
11156 value &= ~(1 << bit_position); | 11156 value &= ~(1 << bit_position); |
11157 } | 11157 } |
11158 return value; | 11158 return value; |
11159 } | 11159 } |
11160 }; | 11160 }; |
11161 | 11161 |
11162 } } // namespace v8::internal | 11162 } } // namespace v8::internal |
11163 | 11163 |
11164 #endif // V8_OBJECTS_H_ | 11164 #endif // V8_OBJECTS_H_ |
OLD | NEW |