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

Side by Side Diff: src/spaces.h

Issue 214543008: Use acquire/release stores and loads when reading and writing the parallel sweeping state of a page. (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 | « no previous file | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // PARALLEL_SWEEPING_PENDING - This page is ready for parallel sweeping. 477 // PARALLEL_SWEEPING_PENDING - This page is ready for parallel sweeping.
478 enum ParallelSweepingState { 478 enum ParallelSweepingState {
479 PARALLEL_SWEEPING_DONE, 479 PARALLEL_SWEEPING_DONE,
480 PARALLEL_SWEEPING_FINALIZE, 480 PARALLEL_SWEEPING_FINALIZE,
481 PARALLEL_SWEEPING_IN_PROGRESS, 481 PARALLEL_SWEEPING_IN_PROGRESS,
482 PARALLEL_SWEEPING_PENDING 482 PARALLEL_SWEEPING_PENDING
483 }; 483 };
484 484
485 ParallelSweepingState parallel_sweeping() { 485 ParallelSweepingState parallel_sweeping() {
486 return static_cast<ParallelSweepingState>( 486 return static_cast<ParallelSweepingState>(
487 NoBarrier_Load(&parallel_sweeping_)); 487 Acquire_Load(&parallel_sweeping_));
488 } 488 }
489 489
490 void set_parallel_sweeping(ParallelSweepingState state) { 490 void set_parallel_sweeping(ParallelSweepingState state) {
491 NoBarrier_Store(&parallel_sweeping_, state); 491 Release_Store(&parallel_sweeping_, state);
492 } 492 }
493 493
494 bool TryParallelSweeping() { 494 bool TryParallelSweeping() {
495 return NoBarrier_CompareAndSwap(&parallel_sweeping_, 495 return Acquire_CompareAndSwap(&parallel_sweeping_,
496 PARALLEL_SWEEPING_PENDING, 496 PARALLEL_SWEEPING_PENDING,
497 PARALLEL_SWEEPING_IN_PROGRESS) == 497 PARALLEL_SWEEPING_IN_PROGRESS) ==
498 PARALLEL_SWEEPING_PENDING; 498 PARALLEL_SWEEPING_PENDING;
499 } 499 }
500 500
501 // Manage live byte count (count of bytes known to be live, 501 // Manage live byte count (count of bytes known to be live,
502 // because they are marked black). 502 // because they are marked black).
503 void ResetLiveBytes() { 503 void ResetLiveBytes() {
504 if (FLAG_gc_verbose) { 504 if (FLAG_gc_verbose) {
505 PrintF("ResetLiveBytes:%p:%x->0\n", 505 PrintF("ResetLiveBytes:%p:%x->0\n",
506 static_cast<void*>(this), live_byte_count_); 506 static_cast<void*>(this), live_byte_count_);
507 } 507 }
508 live_byte_count_ = 0; 508 live_byte_count_ = 0;
(...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 } 2981 }
2982 // Must be small, since an iteration is used for lookup. 2982 // Must be small, since an iteration is used for lookup.
2983 static const int kMaxComments = 64; 2983 static const int kMaxComments = 64;
2984 }; 2984 };
2985 #endif 2985 #endif
2986 2986
2987 2987
2988 } } // namespace v8::internal 2988 } } // namespace v8::internal
2989 2989
2990 #endif // V8_SPACES_H_ 2990 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698