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

Unified Diff: runtime/bin/loader.cc

Issue 2927493002: Restructure code to enable reloading when a kernel dill file is specified on the command line inste… (Closed)
Patch Set: fix format error. Created 3 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/bin/isolate_data.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/loader.cc
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index 62a655dc35aa72ade12e4d28c79d916eda4a74b8..b25f3c86f6fd5e2718cfba066d7cfd6f09a8abeb 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -650,25 +650,26 @@ Dart_Handle Loader::LibraryTagHandler(Dart_LibraryTag tag,
}
return Dart_DefaultCanonicalizeUrl(library_url, url);
}
- if (dfe.UseDartFrontend()) {
- Dart_Isolate current = Dart_CurrentIsolate();
- if (!Dart_IsServiceIsolate(current) && !Dart_IsKernelIsolate(current)) {
- // When using DFE the library tag handler should be called only when we
- // are reloading scripts.
- ASSERT(tag == Dart_kScriptTag);
- return dfe.ReloadScript(current, url);
- }
- // TODO(asiva) We need to ensure that the kernel and service isolates
- // are always loaded from a kernel IR and do not use this path.
- }
const char* url_string = NULL;
Dart_Handle result = Dart_StringToCString(url, &url_string);
if (Dart_IsError(result)) {
return result;
}
-
- // Special case for handling dart: imports and parts.
- if (tag != Dart_kScriptTag) {
+ if (tag == Dart_kScriptTag) {
+ if (dfe.UseDartFrontend()) {
+ Dart_Isolate current = Dart_CurrentIsolate();
+ // Check if we are trying to reload a kernel file or if the '--dfe'
+ // option was specified and we need to compile sources using DFE.
+ if (!Dart_IsServiceIsolate(current) && !Dart_IsKernelIsolate(current)) {
+ // When using DFE the library tag handler should be called only when
+ // we are reloading scripts.
+ return dfe.ReloadScript(current, url_string);
+ }
+ }
+ // TODO(asiva) We need to ensure that the kernel and service isolates
+ // are always loaded from a kernel IR and do not use this path.
+ } else {
+ // Special case for handling dart: imports and parts.
// Grab the library's url.
Dart_Handle library_url = Dart_LibraryUrl(library);
if (Dart_IsError(library_url)) {
« no previous file with comments | « runtime/bin/isolate_data.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698