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

Unified Diff: runtime/vm/dart_api_impl.h

Issue 10693071: Use VM type cast and save handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months 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/code_generator.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
===================================================================
--- runtime/vm/dart_api_impl.h (revision 9315)
+++ runtime/vm/dart_api_impl.h (working copy)
@@ -20,47 +20,47 @@
#define CURRENT_FUNC CanonicalFunction(__FUNCTION__)
// Checks that the current isolate is not NULL.
-#define CHECK_ISOLATE(isolate) \
- do { \
- if ((isolate) == NULL) { \
- FATAL1("%s expects there to be a current isolate. Did you " \
- "forget to call Dart_CreateIsolate or Dart_EnterIsolate?", \
- CURRENT_FUNC); \
- } \
+#define CHECK_ISOLATE(isolate) \
+ do { \
+ if ((isolate) == NULL) { \
+ FATAL1("%s expects there to be a current isolate. Did you " \
+ "forget to call Dart_CreateIsolate or Dart_EnterIsolate?", \
+ CURRENT_FUNC); \
+ } \
} while (0)
// Checks that the current isolate is NULL.
-#define CHECK_NO_ISOLATE(isolate) \
- do { \
- if ((isolate) != NULL) { \
- FATAL1("%s expects there to be no current isolate. Did you " \
- "forget to call Dart_ExitIsolate?", CURRENT_FUNC); \
- } \
+#define CHECK_NO_ISOLATE(isolate) \
+ do { \
+ if ((isolate) != NULL) { \
+ FATAL1("%s expects there to be no current isolate. Did you " \
+ "forget to call Dart_ExitIsolate?", CURRENT_FUNC); \
+ } \
} while (0)
// Checks that the current isolate is not NULL and that it has an API scope.
-#define CHECK_ISOLATE_SCOPE(isolate) \
- do { \
- Isolate* tmp = (isolate); \
- CHECK_ISOLATE(tmp); \
- ApiState* state = tmp->api_state(); \
- ASSERT(state); \
- if (state->top_scope() == NULL) { \
- FATAL1("%s expects to find a current scope. Did you forget to call " \
- "Dart_EnterScope?", CURRENT_FUNC); \
- } \
+#define CHECK_ISOLATE_SCOPE(isolate) \
+ do { \
+ Isolate* tmp = (isolate); \
+ CHECK_ISOLATE(tmp); \
+ ApiState* state = tmp->api_state(); \
+ ASSERT(state); \
+ if (state->top_scope() == NULL) { \
+ FATAL1("%s expects to find a current scope. Did you forget to call " \
+ "Dart_EnterScope?", CURRENT_FUNC); \
+ } \
} while (0)
-#define DARTSCOPE_NOCHECKS(isolate) \
- Isolate* __temp_isolate__ = (isolate); \
- ASSERT(__temp_isolate__ != NULL); \
- Zone zone(__temp_isolate__); \
+#define DARTSCOPE_NOCHECKS(isolate) \
+ Isolate* __temp_isolate__ = (isolate); \
+ ASSERT(__temp_isolate__ != NULL); \
+ Zone zone(__temp_isolate__); \
HANDLESCOPE(__temp_isolate__);
-#define DARTSCOPE(isolate) \
- Isolate* __temp_isolate__ = (isolate); \
- CHECK_ISOLATE_SCOPE(__temp_isolate__); \
- Zone zone(__temp_isolate__); \
+#define DARTSCOPE(isolate) \
+ Isolate* __temp_isolate__ = (isolate); \
+ CHECK_ISOLATE_SCOPE(__temp_isolate__); \
+ Zone zone(__temp_isolate__); \
HANDLESCOPE(__temp_isolate__);
@@ -80,8 +80,8 @@
// Unwraps a raw Type from the handle. The handle will be null if
// the object was not of the requested Type.
-#define DECLARE_UNWRAP(Type) \
- static const Type& Unwrap##Type##Handle(Isolate* isolate, \
+#define DECLARE_UNWRAP(Type) \
+ static const Type& Unwrap##Type##Handle(Isolate* isolate, \
Dart_Handle object);
CLASS_LIST_NO_OBJECT(DECLARE_UNWRAP)
#undef DECLARE_UNWRAP
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698