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

Side by Side Diff: runtime/vm/isolate.cc

Issue 2126413002: Allow for recursive invocation of SafepointOperationScopes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review comments. Created 4 years, 5 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
« no previous file with comments | « no previous file | runtime/vm/safepoint.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 if (os_thread != NULL) { 2520 if (os_thread != NULL) {
2521 // We are about to associate the thread with an isolate and it would 2521 // We are about to associate the thread with an isolate and it would
2522 // not be possible to correctly track no_safepoint_scope_depth for the 2522 // not be possible to correctly track no_safepoint_scope_depth for the
2523 // thread in the constructor/destructor of MonitorLocker, 2523 // thread in the constructor/destructor of MonitorLocker,
2524 // so we create a MonitorLocker object which does not do any 2524 // so we create a MonitorLocker object which does not do any
2525 // no_safepoint_scope_depth increments/decrements. 2525 // no_safepoint_scope_depth increments/decrements.
2526 MonitorLocker ml(threads_lock(), false); 2526 MonitorLocker ml(threads_lock(), false);
2527 2527
2528 // If a safepoint operation is in progress wait for it 2528 // If a safepoint operation is in progress wait for it
2529 // to finish before scheduling this thread in. 2529 // to finish before scheduling this thread in.
2530 while (!bypass_safepoint && safepoint_handler()->safepoint_in_progress()) { 2530 while (!bypass_safepoint && safepoint_handler()->SafepointInProgress()) {
2531 ml.Wait(); 2531 ml.Wait();
2532 } 2532 }
2533 2533
2534 // Now get a free Thread structure. 2534 // Now get a free Thread structure.
2535 thread = thread_registry()->GetFreeThreadLocked(this, is_mutator); 2535 thread = thread_registry()->GetFreeThreadLocked(this, is_mutator);
2536 ASSERT(thread != NULL); 2536 ASSERT(thread != NULL);
2537 2537
2538 // Set up other values and set the TLS value. 2538 // Set up other values and set the TLS value.
2539 thread->isolate_ = this; 2539 thread->isolate_ = this;
2540 ASSERT(heap() != NULL); 2540 ASSERT(heap() != NULL);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 void IsolateSpawnState::DecrementSpawnCount() { 2831 void IsolateSpawnState::DecrementSpawnCount() {
2832 ASSERT(spawn_count_monitor_ != NULL); 2832 ASSERT(spawn_count_monitor_ != NULL);
2833 ASSERT(spawn_count_ != NULL); 2833 ASSERT(spawn_count_ != NULL);
2834 MonitorLocker ml(spawn_count_monitor_); 2834 MonitorLocker ml(spawn_count_monitor_);
2835 ASSERT(*spawn_count_ > 0); 2835 ASSERT(*spawn_count_ > 0);
2836 *spawn_count_ = *spawn_count_ - 1; 2836 *spawn_count_ = *spawn_count_ - 1;
2837 ml.Notify(); 2837 ml.Notify();
2838 } 2838 }
2839 2839
2840 } // namespace dart 2840 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/safepoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698