mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 14:53:37 +00:00
Added method to IsolateVisitor to check for special isolates (i.e., service / vm isolates) since this check is done frequently.
BUG= R=johnmccutchan@google.com Review-Url: https://codereview.chromium.org/2567193002 .
This commit is contained in:
parent
f125cc7d0b
commit
7eef11a0e8
|
@ -51,8 +51,7 @@ class RegisterRunningIsolatesVisitor : public IsolateVisitor {
|
|||
|
||||
virtual void VisitIsolate(Isolate* isolate) {
|
||||
ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
|
||||
if (ServiceIsolate::IsServiceIsolateDescendant(isolate) ||
|
||||
(isolate == Dart::vm_isolate())) {
|
||||
if (IsVMInternalIsolate(isolate)) {
|
||||
// We do not register the service (and descendants) or the vm-isolate.
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -128,6 +128,12 @@ static Message* SerializeMessage(Dart_Port dest_port, const Instance& obj) {
|
|||
}
|
||||
|
||||
|
||||
bool IsolateVisitor::IsVMInternalIsolate(Isolate* isolate) const {
|
||||
return ((isolate == Dart::vm_isolate()) ||
|
||||
ServiceIsolate::IsServiceIsolateDescendant(isolate));
|
||||
}
|
||||
|
||||
|
||||
NoOOBMessageScope::NoOOBMessageScope(Thread* thread) : StackResource(thread) {
|
||||
thread->DeferOOBMessageInterrupts();
|
||||
}
|
||||
|
@ -2573,9 +2579,7 @@ class IsolateKillerVisitor : public IsolateVisitor {
|
|||
// If a target_ is specified, then only kill the target_.
|
||||
// Otherwise, don't kill the service isolate or vm isolate.
|
||||
return (((target_ != NULL) && (isolate == target_)) ||
|
||||
((target_ == NULL) &&
|
||||
!ServiceIsolate::IsServiceIsolateDescendant(isolate) &&
|
||||
(isolate != Dart::vm_isolate())));
|
||||
((target_ == NULL) && !IsVMInternalIsolate(isolate)));
|
||||
}
|
||||
|
||||
Isolate* target_;
|
||||
|
|
|
@ -91,6 +91,10 @@ class IsolateVisitor {
|
|||
|
||||
virtual void VisitIsolate(Isolate* isolate) = 0;
|
||||
|
||||
protected:
|
||||
// Returns true if |isolate| is the VM or service isolate.
|
||||
bool IsVMInternalIsolate(Isolate* isolate) const;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(IsolateVisitor);
|
||||
};
|
||||
|
|
|
@ -3762,8 +3762,7 @@ class ServiceIsolateVisitor : public IsolateVisitor {
|
|||
virtual ~ServiceIsolateVisitor() {}
|
||||
|
||||
void VisitIsolate(Isolate* isolate) {
|
||||
if ((isolate != Dart::vm_isolate()) &&
|
||||
!ServiceIsolate::IsServiceIsolateDescendant(isolate)) {
|
||||
if (!IsVMInternalIsolate(isolate)) {
|
||||
jsarr_->AddValue(isolate);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue