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

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

Issue 203263014: Added sweeping time measurement for old space sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/heap.cc ('k') | no next file » | 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 4222 matching lines...) Expand 10 before | Expand all | Expand 10 after
4233 4233
4234 // Unlink evacuation candidates before sweeper threads access the list of 4234 // Unlink evacuation candidates before sweeper threads access the list of
4235 // pages to avoid race condition. 4235 // pages to avoid race condition.
4236 UnlinkEvacuationCandidates(); 4236 UnlinkEvacuationCandidates();
4237 4237
4238 // Noncompacting collections simply sweep the spaces to clear the mark 4238 // Noncompacting collections simply sweep the spaces to clear the mark
4239 // bits and free the nonlive blocks (for old and map spaces). We sweep 4239 // bits and free the nonlive blocks (for old and map spaces). We sweep
4240 // the map space last because freeing non-live maps overwrites them and 4240 // the map space last because freeing non-live maps overwrites them and
4241 // the other spaces rely on possibly non-live maps to get the sizes for 4241 // the other spaces rely on possibly non-live maps to get the sizes for
4242 // non-live objects. 4242 // non-live objects.
4243 SequentialSweepingScope scope(this); 4243 { GCTracer::Scope sweep_scope(tracer_, GCTracer::Scope::MC_SWEEP_OLDSPACE);
4244 SweepSpace(heap()->old_pointer_space(), how_to_sweep); 4244 { SequentialSweepingScope scope(this);
4245 SweepSpace(heap()->old_data_space(), how_to_sweep); 4245 SweepSpace(heap()->old_pointer_space(), how_to_sweep);
4246 SweepSpace(heap()->old_data_space(), how_to_sweep);
4247 }
4246 4248
4247 if (how_to_sweep == PARALLEL_CONSERVATIVE || 4249 if (how_to_sweep == PARALLEL_CONSERVATIVE ||
4248 how_to_sweep == CONCURRENT_CONSERVATIVE) { 4250 how_to_sweep == CONCURRENT_CONSERVATIVE) {
4249 // TODO(hpayer): fix race with concurrent sweeper 4251 // TODO(hpayer): fix race with concurrent sweeper
4250 StartSweeperThreads(); 4252 StartSweeperThreads();
4253 }
4254
4255 if (how_to_sweep == PARALLEL_CONSERVATIVE) {
4256 WaitUntilSweepingCompleted();
4257 }
4251 } 4258 }
4252
4253 if (how_to_sweep == PARALLEL_CONSERVATIVE) {
4254 WaitUntilSweepingCompleted();
4255 }
4256
4257 RemoveDeadInvalidatedCode(); 4259 RemoveDeadInvalidatedCode();
4258 SweepSpace(heap()->code_space(), PRECISE); 4260 SweepSpace(heap()->code_space(), PRECISE);
4259 4261
4260 SweepSpace(heap()->cell_space(), PRECISE); 4262 SweepSpace(heap()->cell_space(), PRECISE);
4261 SweepSpace(heap()->property_cell_space(), PRECISE); 4263 SweepSpace(heap()->property_cell_space(), PRECISE);
4262 4264
4263 EvacuateNewSpaceAndCandidates(); 4265 EvacuateNewSpaceAndCandidates();
4264 4266
4265 // ClearNonLiveTransitions depends on precise sweeping of map space to 4267 // ClearNonLiveTransitions depends on precise sweeping of map space to
4266 // detect whether unmarked map became dead in this collection or in one 4268 // detect whether unmarked map became dead in this collection or in one
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
4513 while (buffer != NULL) { 4515 while (buffer != NULL) {
4514 SlotsBuffer* next_buffer = buffer->next(); 4516 SlotsBuffer* next_buffer = buffer->next();
4515 DeallocateBuffer(buffer); 4517 DeallocateBuffer(buffer);
4516 buffer = next_buffer; 4518 buffer = next_buffer;
4517 } 4519 }
4518 *buffer_address = NULL; 4520 *buffer_address = NULL;
4519 } 4521 }
4520 4522
4521 4523
4522 } } // namespace v8::internal 4524 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698