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_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 class PretenuringScope; | 1506 class PretenuringScope; |
1507 | 1507 |
1508 // External strings table is a place where all external strings are | 1508 // External strings table is a place where all external strings are |
1509 // registered. We need to keep track of such strings to properly | 1509 // registered. We need to keep track of such strings to properly |
1510 // finalize them. | 1510 // finalize them. |
1511 class ExternalStringTable { | 1511 class ExternalStringTable { |
1512 public: | 1512 public: |
1513 // Registers an external string. | 1513 // Registers an external string. |
1514 inline void AddString(String* string); | 1514 inline void AddString(String* string); |
1515 | 1515 |
1516 inline void Iterate(ObjectVisitor* v); | 1516 inline void IterateAll(ObjectVisitor* v); |
| 1517 inline void IterateNewSpaceStrings(ObjectVisitor* v); |
1517 | 1518 |
1518 // Restores internal invariant and gets rid of collected strings. | 1519 // Restores internal invariant and gets rid of collected strings. Must be |
1519 // Must be called after each Iterate() that modified the strings. | 1520 // called after each Iterate*() that modified the strings. |
1520 void CleanUp(); | 1521 void CleanUpAll(); |
| 1522 void CleanUpNewSpaceStrings(); |
1521 | 1523 |
1522 // Destroys all allocated memory. | 1524 // Destroys all allocated memory. |
1523 void TearDown(); | 1525 void TearDown(); |
1524 | 1526 |
1525 private: | 1527 private: |
1526 explicit ExternalStringTable(Heap* heap) : heap_(heap) {} | 1528 explicit ExternalStringTable(Heap* heap) : heap_(heap) {} |
1527 | 1529 |
1528 inline void Verify(); | 1530 inline void Verify(); |
1529 | 1531 |
1530 inline void AddOldString(String* string); | 1532 inline void AddOldString(String* string); |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 friend class LargeObjectSpace; | 2641 friend class LargeObjectSpace; |
2640 friend class NewSpace; | 2642 friend class NewSpace; |
2641 friend class PagedSpace; | 2643 friend class PagedSpace; |
2642 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2644 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2643 }; | 2645 }; |
2644 | 2646 |
2645 } // namespace internal | 2647 } // namespace internal |
2646 } // namespace v8 | 2648 } // namespace v8 |
2647 | 2649 |
2648 #endif // V8_HEAP_HEAP_H_ | 2650 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |