| 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.
|
|
|