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

Unified Diff: runtime/vm/bootstrap.cc

Issue 1152833002: Add a runtime flag to control availability of dart:mirrors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: runtime/vm/bootstrap.cc
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index b844d0143fe8eabe712eb45536fb00ade464df10..f6c7f92fff4e7b8eedd6eb8a425fdf975b1c4806 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -16,6 +16,8 @@
namespace dart {
+DECLARE_FLAG(bool, use_mirrors);
+
#define INIT_LIBRARY(index, name, source, patch) \
{ index, \
"dart:"#name, source, \
@@ -273,6 +275,11 @@ RawError* Bootstrap::LoadandCompileScripts() {
bootstrap_libraries[i].index_ != ObjectStore::kNone;
++i) {
uri = Symbols::New(bootstrap_libraries[i].uri_);
+
+ if (!FLAG_use_mirrors && (uri.raw() == Symbols::DartMirrors().raw())) {
+ continue;
+ }
+
lib = Library::LookupLibrary(uri);
if (lib.IsNull()) {
lib = Library::NewLibraryHelper(uri, false);
@@ -288,6 +295,11 @@ RawError* Bootstrap::LoadandCompileScripts() {
bootstrap_libraries[i].index_ != ObjectStore::kNone;
++i) {
uri = Symbols::New(bootstrap_libraries[i].uri_);
+
+ if (!FLAG_use_mirrors && (uri.raw() == Symbols::DartMirrors().raw())) {
+ continue;
+ }
+
lib = Library::LookupLibrary(uri);
ASSERT(!lib.IsNull());
source = GetLibrarySource(lib, uri, false);
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/vm/bootstrap_natives.cc » ('j') | runtime/vm/dart.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698