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

Unified Diff: runtime/vm/parser.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-typo Created 4 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 | « runtime/vm/pages.cc ('k') | runtime/vm/runtime_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 5440dfbba7b979cfdfa5ee6ad5a4d9dcd0eb8f59..35559f484ab8dda5f6cfe61d9aea57b8efde2209 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -30,6 +30,7 @@
#include "vm/regexp_assembler.h"
#include "vm/report.h"
#include "vm/resolver.h"
+#include "vm/safepoint.h"
#include "vm/scanner.h"
#include "vm/scopes.h"
#include "vm/stack_frame.h"
@@ -5672,24 +5673,28 @@ RawObject* Parser::CallLibraryTagHandler(Dart_LibraryTag tag,
// Block class finalization attempts when calling into the library
// tag handler.
I->BlockClassFinalization();
- Api::Scope api_scope(T);
- Dart_Handle result = handler(tag,
- Api::NewHandle(T, library_.raw()),
- Api::NewHandle(T, url.raw()));
+ Object& result = Object::Handle(Z);
+ {
+ TransitionVMToNative transition(T);
+ Api::Scope api_scope(T);
+ Dart_Handle retval = handler(tag,
+ Api::NewHandle(T, library_.raw()),
+ Api::NewHandle(T, url.raw()));
+ result = Api::UnwrapHandle(retval);
+ }
I->UnblockClassFinalization();
- if (Dart_IsError(result)) {
+ if (result.IsError()) {
// In case of an error we append an explanatory error message to the
// error obtained from the library tag handler.
- Error& prev_error = Error::Handle(Z);
- prev_error ^= Api::UnwrapHandle(result);
+ const Error& prev_error = Error::Cast(result);
Report::LongJumpF(prev_error, script_, token_pos, "library handler failed");
}
if (tag == Dart_kCanonicalizeUrl) {
- if (!Dart_IsString(result)) {
+ if (!result.IsString()) {
ReportError(token_pos, "library handler failed URI canonicalization");
}
}
- return Api::UnwrapHandle(result);
+ return result.raw();
}
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/runtime_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698