| Index: runtime/vm/dart_api_impl.cc
|
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
|
| index b701c0e28a4deab358e5b16cedf0e4fb55997ca3..052011af06a0134e79ee1c84c544aad95536ad49 100644
|
| --- a/runtime/vm/dart_api_impl.cc
|
| +++ b/runtime/vm/dart_api_impl.cc
|
| @@ -1773,19 +1773,20 @@ DART_EXPORT Dart_Port Dart_GetMainPortId() {
|
| // --- Scopes ----
|
|
|
| DART_EXPORT void Dart_EnterScope() {
|
| - Isolate* isolate = Isolate::Current();
|
| + Thread* thread = Thread::Current();
|
| + Isolate* isolate = thread->isolate();
|
| CHECK_ISOLATE(isolate);
|
| ApiState* state = isolate->api_state();
|
| ASSERT(state != NULL);
|
| ApiLocalScope* new_scope = state->reusable_scope();
|
| if (new_scope == NULL) {
|
| new_scope = new ApiLocalScope(state->top_scope(),
|
| - isolate->top_exit_frame_info());
|
| + thread->top_exit_frame_info());
|
| ASSERT(new_scope != NULL);
|
| } else {
|
| - new_scope->Reinit(isolate,
|
| + new_scope->Reinit(thread,
|
| state->top_scope(),
|
| - isolate->top_exit_frame_info());
|
| + thread->top_exit_frame_info());
|
| state->set_reusable_scope(NULL);
|
| }
|
| state->set_top_scope(new_scope); // New scope is now the top scope.
|
| @@ -1793,14 +1794,15 @@ DART_EXPORT void Dart_EnterScope() {
|
|
|
|
|
| DART_EXPORT void Dart_ExitScope() {
|
| - Isolate* isolate = Isolate::Current();
|
| + Thread* thread = Thread::Current();
|
| + Isolate* isolate = thread->isolate();
|
| CHECK_ISOLATE_SCOPE(isolate);
|
| ApiState* state = isolate->api_state();
|
| ApiLocalScope* scope = state->top_scope();
|
| ApiLocalScope* reusable_scope = state->reusable_scope();
|
| state->set_top_scope(scope->previous()); // Reset top scope to previous.
|
| if (reusable_scope == NULL) {
|
| - scope->Reset(isolate); // Reset the old scope which we just exited.
|
| + scope->Reset(thread); // Reset the old scope which we just exited.
|
| state->set_reusable_scope(scope);
|
| } else {
|
| ASSERT(reusable_scope != scope);
|
|
|