mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:06:59 +00:00
Fix fall out from hide isolate pointer change
BUG= Review URL: https://codereview.chromium.org//1146523003
This commit is contained in:
parent
42368dc7fb
commit
966aafbc81
|
@ -976,14 +976,16 @@ DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id,
|
||||||
|
|
||||||
|
|
||||||
DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id) {
|
DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id) {
|
||||||
Isolate* isolate = PortMap::GetIsolate(isolate_id);
|
// Dart_Isolate is now the same as Dart_IsolateId.
|
||||||
return Api::CastIsolate(isolate);
|
// TODO(johnmccutchan): Kill Dart_IsolateId.
|
||||||
|
return reinterpret_cast<Dart_Isolate>(isolate_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) {
|
DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) {
|
||||||
Isolate* isolate = Api::CastIsolate(dart_isolate);
|
// Dart_Isolate is now the same as Dart_IsolateId.
|
||||||
return isolate->debugger()->GetIsolateId();
|
// TODO(johnmccutchan): Kill Dart_IsolateId.
|
||||||
|
return reinterpret_cast<Dart_IsolateId>(dart_isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace dart
|
} // namespace dart
|
||||||
|
|
|
@ -1668,7 +1668,8 @@ void Isolate::TrackDeoptimizedCode(const Code& code) {
|
||||||
|
|
||||||
|
|
||||||
void Isolate::WakePauseEventHandler(Dart_Isolate isolate) {
|
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_);
|
MonitorLocker ml(iso->pause_loop_monitor_);
|
||||||
ml.Notify();
|
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) {
|
void Isolate::AddIsolateTolist(Isolate* isolate) {
|
||||||
MonitorLocker ml(isolates_list_monitor_);
|
MonitorLocker ml(isolates_list_monitor_);
|
||||||
ASSERT(isolate != NULL);
|
ASSERT(isolate != NULL);
|
||||||
|
|
|
@ -819,6 +819,7 @@ class Isolate : public BaseIsolate {
|
||||||
static void WakePauseEventHandler(Dart_Isolate isolate);
|
static void WakePauseEventHandler(Dart_Isolate isolate);
|
||||||
|
|
||||||
// Manage list of existing isolates.
|
// Manage list of existing isolates.
|
||||||
|
static Isolate* FindIsolateInList(Dart_Isolate isolate);
|
||||||
static void AddIsolateTolist(Isolate* isolate);
|
static void AddIsolateTolist(Isolate* isolate);
|
||||||
static void RemoveIsolateFromList(Isolate* isolate);
|
static void RemoveIsolateFromList(Isolate* isolate);
|
||||||
static void CheckForDuplicateThreadState(InterruptableThreadState* state);
|
static void CheckForDuplicateThreadState(InterruptableThreadState* state);
|
||||||
|
|
Loading…
Reference in a new issue