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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 13351002: First step for fixing Issue 9416. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/dart_api_impl.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 20756)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -80,12 +80,6 @@
} while (0)
-void SetupErrorResult(Isolate* isolate, Dart_Handle* handle) {
- *handle = Api::NewHandle(
- isolate, Isolate::Current()->object_store()->sticky_error());
-}
-
-
Dart_Handle Api::NewHandle(Isolate* isolate, RawObject* raw) {
LocalHandles* local_handles = Api::TopScope(isolate)->local_handles();
ASSERT(local_handles != NULL);
@@ -159,9 +153,8 @@
isolate->object_store()->PreallocateObjects()) {
return Api::Success(isolate);
}
- const Object& obj = Object::Handle(isolate->object_store()->sticky_error());
- ASSERT(obj.IsError());
- return Api::NewHandle(isolate, obj.raw());
+ ASSERT(isolate->object_store()->sticky_error() != Object::null());
+ return Api::NewHandle(isolate, isolate->object_store()->sticky_error());
}
@@ -972,8 +965,7 @@
DART_EXPORT Dart_Handle Dart_RunLoop() {
Isolate* isolate = Isolate::Current();
-
- DARTSCOPE(isolate);
+ CHECK_ISOLATE_SCOPE(isolate);
CHECK_CALLBACK_STATE(isolate);
Monitor monitor;
MonitorLocker ml(&monitor);
@@ -990,12 +982,12 @@
ml.Wait();
}
}
- const Object& obj = Object::Handle(isolate->object_store()->sticky_error());
- isolate->object_store()->clear_sticky_error();
- if (obj.IsError()) {
- return Api::NewHandle(isolate, obj.raw());
+ if (isolate->object_store()->sticky_error() != Object::null()) {
+ Dart_Handle error = Api::NewHandle(isolate,
+ isolate->object_store()->sticky_error());
+ isolate->object_store()->clear_sticky_error();
+ return error;
}
- ASSERT(obj.IsNull());
if (FLAG_print_class_table) {
isolate->class_table()->Print();
}
@@ -1005,10 +997,11 @@
DART_EXPORT Dart_Handle Dart_HandleMessage() {
Isolate* isolate = Isolate::Current();
- CHECK_ISOLATE(isolate);
+ CHECK_ISOLATE_SCOPE(isolate);
+ CHECK_CALLBACK_STATE(isolate);
if (!isolate->message_handler()->HandleNextMessage()) {
- Dart_Handle error =
- Api::NewHandle(isolate, isolate->object_store()->sticky_error());
+ Dart_Handle error = Api::NewHandle(isolate,
+ isolate->object_store()->sticky_error());
isolate->object_store()->clear_sticky_error();
return error;
}
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698