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

Unified Diff: vm/dart_api_impl.h

Issue 12036098: First set of changes towards cleaning up the bytearray access APIs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 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 | « vm/base_isolate.h ('k') | vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl.h
===================================================================
--- vm/dart_api_impl.h (revision 17884)
+++ vm/dart_api_impl.h (working copy)
@@ -52,11 +52,6 @@
} \
} while (0)
-#define DARTSCOPE_NOCHECKS(isolate) \
- Isolate* __temp_isolate__ = (isolate); \
- ASSERT(__temp_isolate__ != NULL); \
- HANDLESCOPE(__temp_isolate__);
-
#define DARTSCOPE(isolate) \
Isolate* __temp_isolate__ = (isolate); \
CHECK_ISOLATE_SCOPE(__temp_isolate__); \
@@ -109,6 +104,16 @@
// Gets the handle used to designate successful return.
static Dart_Handle Success(Isolate* isolate);
+ // Sets up the callback error object after initializing an Isolate. This
+ // object is pre-created because we will not be able to allocate this
+ // object when the error actually occurs. When the error occurs there will
+ // be outstanding acquires to internal data pointers making it unsafe to
+ // allocate objects on the dart heap.
+ static void SetupCallbackError(Isolate* isolate);
+
+ // Gets the handle which holds the pre-created callback error object.
+ static Dart_Handle CallbackError(Isolate* isolate);
+
// Returns true if the handle holds a Smi.
static bool IsSmi(Dart_Handle handle) {
// TODO(turnidge): Assumes RawObject* is at offset zero. Fix.
@@ -175,6 +180,19 @@
DISALLOW_COPY_AND_ASSIGN(IsolateSaver);
};
+// Start a scope in which no Dart API call backs are allowed.
+#define START_NO_CALLBACK_SCOPE(isolate) \
+ isolate->IncrementNoCallbackScopeDepth()
+
+// End a no Dart API call backs Scope.
+#define END_NO_CALLBACK_SCOPE(isolate) \
+ isolate->DecrementNoCallbackScopeDepth()
+
+#define CHECK_CALLBACK_STATE(isolate) \
+ if (isolate->no_callback_scope_depth() != 0) { \
+ return reinterpret_cast<Dart_Handle>(Api::CallbackError(isolate)); \
+ } \
+
} // namespace dart.
#endif // VM_DART_API_IMPL_H_
« no previous file with comments | « vm/base_isolate.h ('k') | vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698