Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: src/heap.h

Issue 11782028: Parallel and concurrent sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 GarbageCollector collector, 1075 GarbageCollector collector,
1076 const char* gc_reason, 1076 const char* gc_reason,
1077 const char* collector_reason); 1077 const char* collector_reason);
1078 1078
1079 // Performs garbage collection operation. 1079 // Performs garbage collection operation.
1080 // Returns whether there is a chance that another major GC could 1080 // Returns whether there is a chance that another major GC could
1081 // collect more garbage. 1081 // collect more garbage.
1082 inline bool CollectGarbage(AllocationSpace space, 1082 inline bool CollectGarbage(AllocationSpace space,
1083 const char* gc_reason = NULL); 1083 const char* gc_reason = NULL);
1084 1084
1085 void StartParallelSweeping(SweeperType sweeper_type);
1086 void WaitUntilParallelSweepingCompleted();
1087 void StealMemoryFromSweeperThreads(PagedSpace* space);
1088 void FinalizeParallelSweeping();
1089 bool IsConcurrentSweepingActivated();
1090 bool AreSweepingThreadsActivated();
1091 bool IsConcurrentSweepingPending();
Michael Starzinger 2013/01/24 17:15:54 We should try to move most of that functionality i
Hannes Payer (out of office) 2013/01/25 10:46:49 Done.
1092
1085 static const int kNoGCFlags = 0; 1093 static const int kNoGCFlags = 0;
1086 static const int kSweepPreciselyMask = 1; 1094 static const int kSweepPreciselyMask = 1;
1087 static const int kReduceMemoryFootprintMask = 2; 1095 static const int kReduceMemoryFootprintMask = 2;
1088 static const int kAbortIncrementalMarkingMask = 4; 1096 static const int kAbortIncrementalMarkingMask = 4;
1089 1097
1090 // Making the heap iterable requires us to sweep precisely and abort any 1098 // Making the heap iterable requires us to sweep precisely and abort any
1091 // incremental marking as well. 1099 // incremental marking as well.
1092 static const int kMakeHeapIterableMask = 1100 static const int kMakeHeapIterableMask =
1093 kSweepPreciselyMask | kAbortIncrementalMarkingMask; 1101 kSweepPreciselyMask | kAbortIncrementalMarkingMask;
1094 1102
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 1568
1561 IncrementalMarking* incremental_marking() { 1569 IncrementalMarking* incremental_marking() {
1562 return &incremental_marking_; 1570 return &incremental_marking_;
1563 } 1571 }
1564 1572
1565 bool IsSweepingComplete() { 1573 bool IsSweepingComplete() {
1566 return old_data_space()->IsSweepingComplete() && 1574 return old_data_space()->IsSweepingComplete() &&
1567 old_pointer_space()->IsSweepingComplete(); 1575 old_pointer_space()->IsSweepingComplete();
1568 } 1576 }
1569 1577
1578 void SweepInParallel(PagedSpace* paged_space,
Michael Starzinger 2013/01/24 17:15:54 This dispatcher should not be necessary.
Hannes Payer (out of office) 2013/01/25 10:46:49 Done.
1579 SweeperType sweeper_type,
1580 FreeList* private_free_list,
1581 FreeList* free_list) {
1582 mark_compact_collector()->SweepInParallel(paged_space,
1583 sweeper_type,
1584 private_free_list,
1585 free_list);
1586 }
1587
1570 bool AdvanceSweepers(int step_size) { 1588 bool AdvanceSweepers(int step_size) {
Michael Starzinger 2013/01/24 17:15:54 This is still being called from the idle notificat
Hannes Payer (out of office) 2013/01/25 10:46:49 Done.
1589 ASSERT(!FLAG_parallel_sweeping && !FLAG_concurrent_sweeping);
1571 bool sweeping_complete = old_data_space()->AdvanceSweeper(step_size); 1590 bool sweeping_complete = old_data_space()->AdvanceSweeper(step_size);
1572 sweeping_complete &= old_pointer_space()->AdvanceSweeper(step_size); 1591 sweeping_complete &= old_pointer_space()->AdvanceSweeper(step_size);
1573 return sweeping_complete; 1592 return sweeping_complete;
1574 } 1593 }
1575 1594
1576 ExternalStringTable* external_string_table() { 1595 ExternalStringTable* external_string_table() {
1577 return &external_string_table_; 1596 return &external_string_table_;
1578 } 1597 }
1579 1598
1580 // Returns the current sweep generation. 1599 // Returns the current sweep generation.
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2860 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2842 2861
2843 private: 2862 private:
2844 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2863 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2845 }; 2864 };
2846 #endif // DEBUG || LIVE_OBJECT_LIST 2865 #endif // DEBUG || LIVE_OBJECT_LIST
2847 2866
2848 } } // namespace v8::internal 2867 } } // namespace v8::internal
2849 2868
2850 #endif // V8_HEAP_H_ 2869 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698