| Index: runtime/vm/isolate.cc
|
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
|
| index 186810502a0f0c2e0dfaaae9e2876af9a7e4ee0a..bb1fe767b0cde9158ed55cde334d4f5ba8941a64 100644
|
| --- a/runtime/vm/isolate.cc
|
| +++ b/runtime/vm/isolate.cc
|
| @@ -95,7 +95,8 @@ DEFINE_FLAG_HANDLER(CheckedModeHandler,
|
| "Enable checked mode.");
|
|
|
|
|
| -// Quick access to the locally defined isolate() method.
|
| +// Quick access to the locally defined thread() and isolate() methods.
|
| +#define T (thread())
|
| #define I (isolate())
|
|
|
| #if defined(DEBUG)
|
| @@ -506,28 +507,28 @@ bool IsolateMessageHandler::HandleMessage(Message* message) {
|
|
|
| void IsolateMessageHandler::NotifyPauseOnStart() {
|
| if (Service::debug_stream.enabled()) {
|
| - StartIsolateScope start_isolate(isolate());
|
| - StackZone zone(I);
|
| - HandleScope handle_scope(thread());
|
| - ServiceEvent pause_event(isolate(), ServiceEvent::kPauseStart);
|
| + StartIsolateScope start_isolate(I);
|
| + StackZone zone(T);
|
| + HandleScope handle_scope(T);
|
| + ServiceEvent pause_event(I, ServiceEvent::kPauseStart);
|
| Service::HandleEvent(&pause_event);
|
| } else if (FLAG_trace_service) {
|
| OS::Print("vm-service: Dropping event of type PauseStart (%s)\n",
|
| - isolate()->name());
|
| + I->name());
|
| }
|
| }
|
|
|
|
|
| void IsolateMessageHandler::NotifyPauseOnExit() {
|
| if (Service::debug_stream.enabled()) {
|
| - StartIsolateScope start_isolate(isolate());
|
| - StackZone zone(I);
|
| - HandleScope handle_scope(thread());
|
| - ServiceEvent pause_event(isolate(), ServiceEvent::kPauseExit);
|
| + StartIsolateScope start_isolate(I);
|
| + StackZone zone(T);
|
| + HandleScope handle_scope(T);
|
| + ServiceEvent pause_event(I, ServiceEvent::kPauseExit);
|
| Service::HandleEvent(&pause_event);
|
| } else if (FLAG_trace_service) {
|
| OS::Print("vm-service: Dropping event of type PauseExit (%s)\n",
|
| - isolate()->name());
|
| + I->name());
|
| }
|
| }
|
|
|
| @@ -1272,7 +1273,7 @@ static bool RunIsolate(uword parameter) {
|
| {
|
| StartIsolateScope start_scope(isolate);
|
| ASSERT(thread->isolate() == isolate);
|
| - StackZone zone(isolate);
|
| + StackZone zone(thread);
|
| HandleScope handle_scope(thread);
|
|
|
| // If particular values were requested for this newly spawned isolate, then
|
| @@ -1373,7 +1374,7 @@ static void ShutdownIsolate(uword parameter) {
|
| Thread* thread = Thread::Current();
|
| StartIsolateScope start_scope(isolate);
|
| ASSERT(thread->isolate() == isolate);
|
| - StackZone zone(isolate);
|
| + StackZone zone(thread);
|
| HandleScope handle_scope(thread);
|
| Error& error = Error::Handle();
|
| error = isolate->object_store()->sticky_error();
|
| @@ -1500,7 +1501,7 @@ void Isolate::Shutdown() {
|
| // First, perform higher-level cleanup that may need to allocate.
|
| {
|
| // Ensure we have a zone and handle scope so that we can call VM functions.
|
| - StackZone stack_zone(this);
|
| + StackZone stack_zone(thread);
|
| HandleScope handle_scope(thread);
|
|
|
| // Write out the coverage data if collection has been enabled.
|
| @@ -1525,7 +1526,7 @@ void Isolate::Shutdown() {
|
| {
|
| // Ensure we have a zone and handle scope so that we can call VM functions,
|
| // but we no longer allocate new heap objects.
|
| - StackZone stack_zone(this);
|
| + StackZone stack_zone(thread);
|
| HandleScope handle_scope(thread);
|
| NoSafepointScope no_safepoint_scope;
|
|
|
| @@ -2149,10 +2150,10 @@ void Isolate::RemoveIsolateFromList(Isolate* isolate) {
|
| }
|
|
|
|
|
| -template<class T>
|
| -T* Isolate::AllocateReusableHandle() {
|
| - T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle());
|
| - T::initializeHandle(handle, T::null());
|
| +template<class C>
|
| +C* Isolate::AllocateReusableHandle() {
|
| + C* handle = reinterpret_cast<C*>(reusable_handles_.AllocateScopedHandle());
|
| + C::initializeHandle(handle, C::null());
|
| return handle;
|
| }
|
|
|
|
|