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

Unified Diff: runtime/vm/report.cc

Issue 1149713002: With --noopt run unoptimized code through optimizer, more optimizations can be done later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: m 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
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/report.cc
diff --git a/runtime/vm/report.cc b/runtime/vm/report.cc
index 9c1b811c01790e51175ef9810edce52dfe3655e5..4ef7362cde03d76c21579710191397124d5ad001 100644
--- a/runtime/vm/report.cc
+++ b/runtime/vm/report.cc
@@ -21,6 +21,7 @@ DEFINE_FLAG(bool, warn_on_javascript_compatibility, false,
"Warn on incompatibilities between vm and dart2js.");
DEFINE_FLAG(bool, warning_as_error, false, "Treat warnings as errors.");
+DECLARE_FLAG(bool, always_megamorphic_calls);
RawString* Report::PrependSnippet(Kind kind,
const Script& script,
@@ -178,8 +179,13 @@ void Report::JSWarningFromNative(bool is_static_native, const char* msg) {
// Assume an unoptimized static call. Optimization was prevented.
CodePatcher::GetUnoptimizedStaticCallAt(caller_pc, caller_code, &ic_data);
} else {
- // Assume an instance call.
- CodePatcher::GetInstanceCallAt(caller_pc, caller_code, &ic_data);
+ if (FLAG_always_megamorphic_calls) {
+ Report::JSWarningFromFrame(caller_frame, msg);
+ return;
+ } else {
+ // Assume an instance call.
+ CodePatcher::GetInstanceCallAt(caller_pc, caller_code, &ic_data);
+ }
}
ASSERT(!ic_data.IsNull());
// Report warning only if not already reported at this location.
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698