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

Unified Diff: runtime/bin/loader.cc

Issue 2894773004: Changes to make isolate reload functionality work with the --dfe option. (Closed)
Patch Set: Fix regression test errors. Created 3 years, 7 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/gen_snapshot.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 92da2ed1743262e60557a05a4b104ead1a4307fb..fb5fad38763dfa96c4e3f16ea47be065b328f18d 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -7,6 +7,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
+#include "bin/dfe.h"
#include "bin/extensions.h"
#include "bin/file.h"
#include "bin/lockers.h"
@@ -19,6 +20,10 @@ namespace bin {
// Development flag.
static bool trace_loader = false;
+#if !defined(DART_PRECOMPILED_RUNTIME)
+extern DFE dfe;
+#endif
+
// Keep in sync with loader.dart.
static const intptr_t _Dart_kImportExtension = 9;
static const intptr_t _Dart_kResolveAsFilePath = 10;
@@ -638,6 +643,19 @@ Dart_Handle Loader::DartColonLibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle Loader::LibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle library,
Dart_Handle 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.
+ // TODO(asiva) We need to ensure that the kernel and service isolates
+ // and the spawnURI paths are always loaded from a kernel IR and do
+ // not use this path.
+ if (tag == Dart_kScriptTag) {
+ return dfe.ReloadScript(current, url);
+ }
+ }
+ }
if (tag == Dart_kCanonicalizeUrl) {
Dart_Handle library_url = Dart_LibraryUrl(library);
if (Dart_IsError(library_url)) {
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698