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

Unified Diff: runtime/vm/scavenger.cc

Issue 2993863002: Fixes the regression caused by 7568e1f18e. (Closed)
Patch Set: Removes dead code from ScheduleThread Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 3d40c23bcf6e030e6658ee4ba067cdf9a0d55fd4..5ea0c58944feb36bc078081194b11617c8896cb9 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -405,10 +405,8 @@ void Scavenger::Epilogue(Isolate* isolate,
// Ensure the mutator thread will fail the next allocation. This will force
// mutator to allocate a new TLAB
- if (isolate->IsMutatorThreadScheduled()) {
- Thread* mutator_thread = isolate->mutator_thread();
- ASSERT(!mutator_thread->HasActiveTLAB());
- }
+ Thread* mutator_thread = isolate->mutator_thread();
+ ASSERT((mutator_thread == NULL) || (!mutator_thread->HasActiveTLAB()));
double avg_frac = stats_history_.Get(0).PromoCandidatesSuccessFraction();
if (stats_history_.Size() >= 2) {
@@ -716,8 +714,8 @@ void Scavenger::ProcessWeakReferences() {
void Scavenger::MakeNewSpaceIterable() const {
ASSERT(heap_ != NULL);
- if (heap_->isolate()->IsMutatorThreadScheduled() && !scavenging_) {
- Thread* mutator_thread = heap_->isolate()->mutator_thread();
+ Thread* mutator_thread = heap_->isolate()->mutator_thread();
+ if (mutator_thread != NULL && !scavenging_) {
if (mutator_thread->HasActiveTLAB()) {
ASSERT(mutator_thread->top() <=
mutator_thread->heap()->new_space()->top());
@@ -798,11 +796,9 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
int64_t post_safe_point = OS::GetCurrentMonotonicMicros();
heap_->RecordTime(kSafePoint, post_safe_point - pre_safe_point);
- if (isolate->IsMutatorThreadScheduled()) {
- Thread* mutator_thread = isolate->mutator_thread();
- if (mutator_thread->HasActiveTLAB()) {
- heap_->AbandonRemainingTLAB(mutator_thread);
- }
+ Thread* mutator_thread = isolate->mutator_thread();
+ if ((mutator_thread != NULL) && (mutator_thread->HasActiveTLAB())) {
+ heap_->AbandonRemainingTLAB(mutator_thread);
}
// TODO(koda): Make verification more compatible with concurrent sweep.
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698