OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 object->SizeFromMap(map), | 565 object->SizeFromMap(map), |
566 &marker); | 566 &marker); |
567 } | 567 } |
568 } | 568 } |
569 }; | 569 }; |
570 | 570 |
571 | 571 |
572 void MarkCompactCollector::MarkSymbolTable() { | 572 void MarkCompactCollector::MarkSymbolTable() { |
573 // Objects reachable from symbols are marked as live so as to ensure | 573 // Objects reachable from symbols are marked as live so as to ensure |
574 // that if the symbol itself remains alive after GC for any reason, | 574 // that if the symbol itself remains alive after GC for any reason, |
575 // and if it is a sliced string or a cons string backed by an | 575 // and if it is a cons string backed by an external string (even indirectly), |
576 // external string (even indirectly), then the external string does | 576 // then the external string does not receive a weak reference callback. |
577 // not receive a weak reference callback. | |
578 SymbolTable* symbol_table = Heap::raw_unchecked_symbol_table(); | 577 SymbolTable* symbol_table = Heap::raw_unchecked_symbol_table(); |
579 // Mark the symbol table itself. | 578 // Mark the symbol table itself. |
580 SetMark(symbol_table); | 579 SetMark(symbol_table); |
581 // Explicitly mark the prefix. | 580 // Explicitly mark the prefix. |
582 MarkingVisitor marker; | 581 MarkingVisitor marker; |
583 symbol_table->IteratePrefix(&marker); | 582 symbol_table->IteratePrefix(&marker); |
584 ProcessMarkingStack(&marker); | 583 ProcessMarkingStack(&marker); |
585 // Mark subparts of the symbols but not the symbols themselves | 584 // Mark subparts of the symbols but not the symbols themselves |
586 // (unless reachable from another symbol). | 585 // (unless reachable from another symbol). |
587 SymbolMarkingVisitor symbol_marker; | 586 SymbolMarkingVisitor symbol_marker; |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 | 1806 |
1808 void MarkCompactCollector::RebuildRSets() { | 1807 void MarkCompactCollector::RebuildRSets() { |
1809 #ifdef DEBUG | 1808 #ifdef DEBUG |
1810 ASSERT(state_ == RELOCATE_OBJECTS); | 1809 ASSERT(state_ == RELOCATE_OBJECTS); |
1811 state_ = REBUILD_RSETS; | 1810 state_ = REBUILD_RSETS; |
1812 #endif | 1811 #endif |
1813 Heap::RebuildRSets(); | 1812 Heap::RebuildRSets(); |
1814 } | 1813 } |
1815 | 1814 |
1816 } } // namespace v8::internal | 1815 } } // namespace v8::internal |
OLD | NEW |