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

Unified Diff: runtime/vm/isolate.cc

Issue 1041523002: Refactor Thread lifecycle interface, add Thread::Enter/ExitIsolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/native_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
===================================================================
--- runtime/vm/isolate.cc (revision 44762)
+++ runtime/vm/isolate.cc (working copy)
@@ -536,7 +536,7 @@
object##_handle_(NULL),
Isolate::Isolate()
- : mutator_thread_(new Thread(this)),
+ : mutator_thread_(NULL),
vm_tag_(0),
store_buffer_(),
message_notify_callback_(NULL),
@@ -604,7 +604,7 @@
}
Isolate::Isolate(Isolate* original)
- : mutator_thread_(new Thread(this)),
+ : mutator_thread_(NULL),
vm_tag_(0),
store_buffer_(true),
class_table_(original->class_table()),
@@ -685,7 +685,6 @@
delete spawn_state_;
delete log_;
log_ = NULL;
- delete mutator_thread_;
}
@@ -696,31 +695,6 @@
#endif // DEBUG
-void Isolate::SetCurrent(Isolate* current) {
- Isolate* old_current = Current();
- if (old_current != NULL) {
- old_current->set_vm_tag(VMTag::kIdleTagId);
- old_current->set_thread_state(NULL);
- Profiler::EndExecution(old_current);
- }
- if (current != NULL) {
- Thread::SetCurrent(current->mutator_thread());
- ASSERT(current->thread_state() == NULL);
- InterruptableThreadState* thread_state =
- ThreadInterrupter::GetCurrentThreadState();
-#if defined(DEBUG)
- CheckForDuplicateThreadState(thread_state);
-#endif
- ASSERT(thread_state != NULL);
- Profiler::BeginExecution(current);
- current->set_thread_state(thread_state);
- current->set_vm_tag(VMTag::kVMTagId);
- } else {
- Thread::SetCurrent(NULL);
- }
-}
-
-
void Isolate::InitOnce() {
create_callback_ = NULL;
isolates_list_monitor_ = new Monitor();
@@ -740,7 +714,7 @@
// TODO(5411455): For now just set the recently created isolate as
// the current isolate.
- SetCurrent(result);
+ Thread::EnterIsolate(result);
// Setup the isolate specific resuable handles.
#define REUSABLE_HANDLE_ALLOCATION(object) \
@@ -1441,7 +1415,7 @@
// TODO(5411455): For now just make sure there are no current isolates
// as we are shutting down the isolate.
- SetCurrent(NULL);
+ Thread::ExitIsolate();
Profiler::ShutdownProfilingForIsolate(this);
}
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/native_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698