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

Side by Side Diff: src/mark-compact.cc

Issue 12462002: Wait for sweeper threads in EnsureSweeperProgress() only if the main thread finished its sweeping p… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #ifdef DEBUG 60 #ifdef DEBUG
61 state_(IDLE), 61 state_(IDLE),
62 #endif 62 #endif
63 sweep_precisely_(false), 63 sweep_precisely_(false),
64 reduce_memory_footprint_(false), 64 reduce_memory_footprint_(false),
65 abort_incremental_marking_(false), 65 abort_incremental_marking_(false),
66 marking_parity_(ODD_MARKING_PARITY), 66 marking_parity_(ODD_MARKING_PARITY),
67 compacting_(false), 67 compacting_(false),
68 was_marked_incrementally_(false), 68 was_marked_incrementally_(false),
69 sweeping_pending_(false), 69 sweeping_pending_(false),
70 sequential_sweeping_(false),
70 tracer_(NULL), 71 tracer_(NULL),
71 migration_slots_buffer_(NULL), 72 migration_slots_buffer_(NULL),
72 heap_(NULL), 73 heap_(NULL),
73 code_flusher_(NULL), 74 code_flusher_(NULL),
74 encountered_weak_maps_(NULL) { } 75 encountered_weak_maps_(NULL) { }
75 76
76 77
77 #ifdef VERIFY_HEAP 78 #ifdef VERIFY_HEAP
78 class VerifyMarkingVisitor: public ObjectVisitor { 79 class VerifyMarkingVisitor: public ObjectVisitor {
79 public: 80 public:
(...skipping 3808 matching lines...) Expand 10 before | Expand all | Expand 10 after
3888 FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE; 3889 FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE;
3889 if (FLAG_parallel_sweeping) how_to_sweep = PARALLEL_CONSERVATIVE; 3890 if (FLAG_parallel_sweeping) how_to_sweep = PARALLEL_CONSERVATIVE;
3890 if (FLAG_concurrent_sweeping) how_to_sweep = CONCURRENT_CONSERVATIVE; 3891 if (FLAG_concurrent_sweeping) how_to_sweep = CONCURRENT_CONSERVATIVE;
3891 if (FLAG_expose_gc) how_to_sweep = CONSERVATIVE; 3892 if (FLAG_expose_gc) how_to_sweep = CONSERVATIVE;
3892 if (sweep_precisely_) how_to_sweep = PRECISE; 3893 if (sweep_precisely_) how_to_sweep = PRECISE;
3893 // Noncompacting collections simply sweep the spaces to clear the mark 3894 // Noncompacting collections simply sweep the spaces to clear the mark
3894 // bits and free the nonlive blocks (for old and map spaces). We sweep 3895 // bits and free the nonlive blocks (for old and map spaces). We sweep
3895 // the map space last because freeing non-live maps overwrites them and 3896 // the map space last because freeing non-live maps overwrites them and
3896 // the other spaces rely on possibly non-live maps to get the sizes for 3897 // the other spaces rely on possibly non-live maps to get the sizes for
3897 // non-live objects. 3898 // non-live objects.
3898 3899 SequentialSweepingScope scope(this);
3899 SweepSpace(heap()->old_pointer_space(), how_to_sweep); 3900 SweepSpace(heap()->old_pointer_space(), how_to_sweep);
3900 SweepSpace(heap()->old_data_space(), how_to_sweep); 3901 SweepSpace(heap()->old_data_space(), how_to_sweep);
3901 3902
3902 if (how_to_sweep == PARALLEL_CONSERVATIVE || 3903 if (how_to_sweep == PARALLEL_CONSERVATIVE ||
3903 how_to_sweep == CONCURRENT_CONSERVATIVE) { 3904 how_to_sweep == CONCURRENT_CONSERVATIVE) {
3904 // TODO(hpayer): fix race with concurrent sweeper 3905 // TODO(hpayer): fix race with concurrent sweeper
3905 StartSweeperThreads(); 3906 StartSweeperThreads();
3906 } 3907 }
3907 3908
3908 if (how_to_sweep == PARALLEL_CONSERVATIVE) { 3909 if (how_to_sweep == PARALLEL_CONSERVATIVE) {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4120 while (buffer != NULL) { 4121 while (buffer != NULL) {
4121 SlotsBuffer* next_buffer = buffer->next(); 4122 SlotsBuffer* next_buffer = buffer->next();
4122 DeallocateBuffer(buffer); 4123 DeallocateBuffer(buffer);
4123 buffer = next_buffer; 4124 buffer = next_buffer;
4124 } 4125 }
4125 *buffer_address = NULL; 4126 *buffer_address = NULL;
4126 } 4127 }
4127 4128
4128 4129
4129 } } // namespace v8::internal 4130 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698