Index: runtime/vm/isolate.cc |
=================================================================== |
--- runtime/vm/isolate.cc (revision 32027) |
+++ runtime/vm/isolate.cc (working copy) |
@@ -104,6 +104,9 @@ |
StartIsolateScope start_scope(isolate_); |
StackZone zone(isolate_); |
HandleScope handle_scope(isolate_); |
+ // TODO(turnidge): Rework collection total dart execution. This can |
+ // overcount when other things (gc, compilation) are active. |
+ TIMERSCOPE(time_dart_execution); |
// If the message is in band we lookup the receive port to dispatch to. If |
// the receive port is closed, we drop the message without deserializing it. |
@@ -300,7 +303,7 @@ |
stack_limit_(0), |
saved_stack_limit_(0), |
message_handler_(NULL), |
- spawn_data_(0), |
+ spawn_state_(NULL), |
is_runnable_(false), |
gc_prologue_callbacks_(), |
gc_epilogue_callbacks_(), |
@@ -336,6 +339,7 @@ |
message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. |
ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted. |
delete object_histogram_; |
+ delete spawn_state_; |
} |
void Isolate::SetCurrent(Isolate* current) { |
@@ -498,7 +502,7 @@ |
// Set the isolate as runnable and if we are being spawned schedule |
// isolate on thread pool for execution. |
is_runnable_ = true; |
- IsolateSpawnState* state = reinterpret_cast<IsolateSpawnState*>(spawn_data()); |
+ IsolateSpawnState* state = spawn_state(); |
if (state != NULL) { |
ASSERT(this == state->isolate()); |
Run(); |
@@ -518,9 +522,9 @@ |
Isolate* isolate = reinterpret_cast<Isolate*>(parameter); |
IsolateSpawnState* state = NULL; |
{ |
+ // TODO(turnidge): Is this locking required here at all anymore? |
MutexLocker ml(isolate->mutex()); |
- state = reinterpret_cast<IsolateSpawnState*>(isolate->spawn_data()); |
- isolate->set_spawn_data(0); |
+ state = isolate->spawn_state(); |
} |
{ |
StartIsolateScope start_scope(isolate); |
@@ -540,8 +544,6 @@ |
Object& result = Object::Handle(); |
result = state->ResolveFunction(); |
bool is_spawn_uri = state->is_spawn_uri(); |
- delete state; |
- state = NULL; |
if (result.IsError()) { |
StoreError(isolate, result); |
return false; |