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

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: whitespace Created 4 years, 10 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 61470ad7f44fb4b8616c7d1267607f10f03519dc..4c7efab9feb455bbf8ca40b15154ea184fab0344 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -312,24 +312,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());
@@ -338,12 +344,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(
+ "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