Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: runtime/vm/native_entry.cc

Issue 1473403003: Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone e… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-patch Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/native_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_entry.cc
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc
index adedfb78914f4555036492b085899939b56926ab..92a99e8c7d59d24b3270c4f286be79947a2e1c2e 100644
--- a/runtime/vm/native_entry.cc
+++ b/runtime/vm/native_entry.cc
@@ -36,7 +36,7 @@ NativeFunction NativeEntry::ResolveNative(const Library& library,
Dart_EnterScope(); // Enter a new Dart API scope as we invoke API entries.
Dart_NativeEntryResolver resolver = library.native_entry_resolver();
Dart_NativeFunction native_function =
- resolver(Api::NewHandle(Isolate::Current(), function_name.raw()),
+ resolver(Api::NewHandle(Thread::Current(), function_name.raw()),
number_of_arguments, auto_setup_scope);
Dart_ExitScope(); // Exit the Dart API scope.
return reinterpret_cast<NativeFunction>(native_function);
@@ -98,8 +98,8 @@ void NativeEntry::NativeCallWrapper(Dart_NativeArguments args,
ApiState* state = isolate->api_state();
ASSERT(state != NULL);
- ApiLocalScope* current_top_scope = state->top_scope();
- ApiLocalScope* scope = state->reusable_scope();
+ ApiLocalScope* current_top_scope = thread->api_top_scope();
+ ApiLocalScope* scope = thread->api_reusable_scope();
TRACE_NATIVE_CALL("0x%" Px "", reinterpret_cast<uintptr_t>(func));
if (scope == NULL) {
scope = new ApiLocalScope(current_top_scope,
@@ -109,19 +109,19 @@ void NativeEntry::NativeCallWrapper(Dart_NativeArguments args,
scope->Reinit(thread,
current_top_scope,
thread->top_exit_frame_info());
- state->set_reusable_scope(NULL);
+ thread->set_api_reusable_scope(NULL);
}
- state->set_top_scope(scope); // New scope is now the top scope.
+ thread->set_api_top_scope(scope); // New scope is now the top scope.
func(args);
ASSERT(current_top_scope == scope->previous());
- state->set_top_scope(current_top_scope); // Reset top scope to previous.
- if (state->reusable_scope() == NULL) {
+ thread->set_api_top_scope(current_top_scope); // Reset top scope to previous.
+ if (thread->api_reusable_scope() == NULL) {
scope->Reset(thread); // Reset the old scope which we just exited.
- state->set_reusable_scope(scope);
+ thread->set_api_reusable_scope(scope);
} else {
- ASSERT(state->reusable_scope() != scope);
+ ASSERT(thread->api_reusable_scope() != scope);
delete scope;
}
DEOPTIMIZE_ALOT;
« no previous file with comments | « runtime/vm/native_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698