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

Unified Diff: runtime/vm/dart_api_impl.h

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/bootstrap.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.h
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index 9e7cb5fd684b466731ed83b248518d85e45ea573..ccd8fa1f3a5fbdbdf53ec38adf08b494aba4ba7f 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -56,13 +56,12 @@ const char* CanonicalFunction(const char* func);
} while (0)
// Checks that the current isolate is not NULL and that it has an API scope.
-#define CHECK_ISOLATE_SCOPE(isolate) \
+#define CHECK_API_SCOPE(thread) \
do { \
- Isolate* tmp = (isolate); \
- CHECK_ISOLATE(tmp); \
- ApiState* state = tmp->api_state(); \
- ASSERT(state); \
- if (state->top_scope() == NULL) { \
+ Thread* tmpT = (thread); \
+ Isolate* tmpI = tmpT->isolate(); \
+ CHECK_ISOLATE(tmpI); \
+ if (tmpT->api_top_scope() == NULL) { \
FATAL1("%s expects to find a current scope. Did you forget to call " \
"Dart_EnterScope?", CURRENT_FUNC); \
} \
@@ -70,8 +69,7 @@ const char* CanonicalFunction(const char* func);
#define DARTSCOPE(thread) \
Thread* T = (thread); \
- Isolate* I = T->isolate(); \
- CHECK_ISOLATE_SCOPE(I); \
+ CHECK_API_SCOPE(T); \
HANDLESCOPE(T);
@@ -124,7 +122,7 @@ class Api : AllStatic {
};
// Creates a new local handle.
- static Dart_Handle NewHandle(Isolate* isolate, RawObject* raw);
+ static Dart_Handle NewHandle(Thread* thread, RawObject* raw);
// Unwraps the raw object from the handle.
static RawObject* UnwrapHandle(Dart_Handle object);
@@ -146,7 +144,7 @@ class Api : AllStatic {
// Returns an Error handle if isolate is in an inconsistent state
// or there was an error while finalizing classes.
// Returns a Success handle when no error condition exists.
- static Dart_Handle CheckAndFinalizePendingClasses(Isolate *isolate);
+ static Dart_Handle CheckAndFinalizePendingClasses(Thread *thread);
// Casts the internal Isolate* type to the external Dart_Isolate type.
static Dart_Isolate CastIsolate(Isolate* isolate);
@@ -216,7 +214,7 @@ class Api : AllStatic {
}
// Retrieves the top ApiLocalScope.
- static ApiLocalScope* TopScope(Isolate* isolate);
+ static ApiLocalScope* TopScope(Thread* thread);
// Performs one-time initialization needed by the API.
static void InitOnce();
@@ -273,7 +271,7 @@ class Api : AllStatic {
const String& name);
private:
- static Dart_Handle InitNewHandle(Isolate* isolate, RawObject* raw);
+ static Dart_Handle InitNewHandle(Thread* thread, RawObject* raw);
// Thread local key used by the API. Currently holds the current
// ApiNativeScope if any.
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698