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

Unified Diff: runtime/vm/object.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-typo Created 4 years, 11 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/native_entry.cc ('k') | runtime/vm/object_graph_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index df6fde0d7ba841ad7fb6223f3caf2ec26c7bb876..ba54f54937c5c458ba0d48dfd9aa4307dc7fda9b 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -2779,8 +2779,7 @@ class CHACodeArray : public WeakCodeReferences {
#if defined(DEBUG)
static bool IsMutatorOrAtSafepoint() {
Thread* thread = Thread::Current();
- return thread->IsMutatorThread() ||
- thread->isolate()->thread_registry()->AtSafepoint();
+ return thread->IsMutatorThread() || thread->IsAtSafepoint();
}
#endif
@@ -10692,7 +10691,6 @@ bool LibraryPrefix::LoadLibrary() const {
} else if (deferred_lib.LoadNotStarted()) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- Api::Scope api_scope(thread);
Zone* zone = thread->zone();
deferred_lib.SetLoadRequested();
const GrowableObjectArray& pending_deferred_loads =
@@ -10701,9 +10699,13 @@ bool LibraryPrefix::LoadLibrary() const {
pending_deferred_loads.Add(deferred_lib);
const String& lib_url = String::Handle(zone, deferred_lib.url());
Dart_LibraryTagHandler handler = isolate->library_tag_handler();
- handler(Dart_kImportTag,
- Api::NewHandle(thread, importer()),
- Api::NewHandle(thread, lib_url.raw()));
+ {
+ TransitionVMToNative transition(thread);
+ Api::Scope api_scope(thread);
+ handler(Dart_kImportTag,
+ Api::NewHandle(thread, importer()),
+ Api::NewHandle(thread, lib_url.raw()));
+ }
} else {
// Another load request is in flight.
ASSERT(deferred_lib.LoadRequested());
« no previous file with comments | « runtime/vm/native_entry.cc ('k') | runtime/vm/object_graph_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698