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

Unified Diff: runtime/vm/precompiler.cc

Issue 1663893002: Precompilation: Make missing entry points an error. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/bin/main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index f5098bbaa083883da63835398e1010034a56cff7..a73be57ca2b10e0443db7823f636d3f7a9c68c2d 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -311,24 +311,30 @@ void Precompiler::AddEntryPoints(Dart_QualifiedFunctionName entry_points[]) {
lib = Library::LookupLibrary(library_uri);
if (lib.IsNull()) {
- if (FLAG_trace_precompiler) {
- THR_Print("WARNING: Missing %s\n", entry_points[i].library_uri);
- }
- continue;
+ String& msg = String::Handle(Z, String::NewFormatted(
+ "Cannot find entry point %s\n", entry_points[i].library_uri));
+ Jump(Error::Handle(Z, ApiError::New(msg)));
+ UNREACHABLE();
}
if (class_name.raw() == Symbols::TopLevel().raw()) {
- func = lib.LookupFunctionAllowPrivate(function_name);
- field = lib.LookupFieldAllowPrivate(function_name);
+ if (Library::IsPrivate(function_name)) {
+ function_name = lib.PrivateName(function_name);
+ }
+ func = lib.LookupLocalFunction(function_name);
+ field = lib.LookupLocalField(function_name);
} else {
- cls = lib.LookupClassAllowPrivate(class_name);
+ if (Library::IsPrivate(class_name)) {
+ class_name = lib.PrivateName(class_name);
+ }
+ cls = lib.LookupLocalClass(class_name);
if (cls.IsNull()) {
- if (FLAG_trace_precompiler) {
- THR_Print("WARNING: Missing %s %s\n",
- entry_points[i].library_uri,
- entry_points[i].class_name);
- }
- continue;
+ String& msg = String::Handle(Z, String::NewFormatted(
+ "Cannot find entry point %s %s\n",
+ entry_points[i].library_uri,
+ entry_points[i].class_name));
+ Jump(Error::Handle(Z, ApiError::New(msg)));
+ UNREACHABLE();
}
ASSERT(!cls.IsNull());
@@ -337,12 +343,13 @@ void Precompiler::AddEntryPoints(Dart_QualifiedFunctionName entry_points[]) {
}
if (func.IsNull() && field.IsNull()) {
- if (FLAG_trace_precompiler) {
- THR_Print("WARNING: Missing %s %s %s\n",
- entry_points[i].library_uri,
- entry_points[i].class_name,
- entry_points[i].function_name);
- }
+ String& msg = String::Handle(Z, String::NewFormatted(
Florian Schneider 2016/02/04 21:51:48 Uneven indentation?
rmacnak 2016/02/04 22:25:57 Fixed
+ "Cannot find entry point %s %s %s\n",
+ entry_points[i].library_uri,
+ entry_points[i].class_name,
+ entry_points[i].function_name));
+ Jump(Error::Handle(Z, ApiError::New(msg)));
+ UNREACHABLE();
}
if (!func.IsNull()) {
« no previous file with comments | « runtime/bin/main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698