Fix fall out from hide isolate pointer change

BUG=

Review URL: https://codereview.chromium.org//1146523003
This commit is contained in:
John McCutchan 2015-05-18 15:13:35 -07:00
parent 42368dc7fb
commit 966aafbc81
3 changed files with 23 additions and 5 deletions

View file

@ -976,14 +976,16 @@ DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id,
DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id) {
Isolate* isolate = PortMap::GetIsolate(isolate_id);
return Api::CastIsolate(isolate);
// Dart_Isolate is now the same as Dart_IsolateId.
// TODO(johnmccutchan): Kill Dart_IsolateId.
return reinterpret_cast<Dart_Isolate>(isolate_id);
}
DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) {
Isolate* isolate = Api::CastIsolate(dart_isolate);
return isolate->debugger()->GetIsolateId();
// Dart_Isolate is now the same as Dart_IsolateId.
// TODO(johnmccutchan): Kill Dart_IsolateId.
return reinterpret_cast<Dart_IsolateId>(dart_isolate);
}
} // namespace dart

View file

@ -1668,7 +1668,8 @@ void Isolate::TrackDeoptimizedCode(const Code& code) {
void Isolate::WakePauseEventHandler(Dart_Isolate isolate) {
Isolate* iso = reinterpret_cast<Isolate*>(isolate);
Isolate* iso = FindIsolateInList(isolate);
ASSERT(iso != NULL);
MonitorLocker ml(iso->pause_loop_monitor_);
ml.Notify();
}
@ -1737,6 +1738,20 @@ intptr_t Isolate::IsolateListLength() {
}
Isolate* Isolate::FindIsolateInList(Dart_Isolate isolate) {
MonitorLocker ml(isolates_list_monitor_);
Isolate* current = isolates_list_head_;
while (current != NULL) {
if (Api::CastIsolate(current) == isolate) {
// We've found the isolate.
return current;
}
current = current->next_;
}
return NULL;
}
void Isolate::AddIsolateTolist(Isolate* isolate) {
MonitorLocker ml(isolates_list_monitor_);
ASSERT(isolate != NULL);

View file

@ -819,6 +819,7 @@ class Isolate : public BaseIsolate {
static void WakePauseEventHandler(Dart_Isolate isolate);
// Manage list of existing isolates.
static Isolate* FindIsolateInList(Dart_Isolate isolate);
static void AddIsolateTolist(Isolate* isolate);
static void RemoveIsolateFromList(Isolate* isolate);
static void CheckForDuplicateThreadState(InterruptableThreadState* state);