Chromium Code Reviews| Index: runtime/vm/coverage.cc |
| =================================================================== |
| --- runtime/vm/coverage.cc (revision 28180) |
| +++ runtime/vm/coverage.cc (working copy) |
| @@ -21,9 +21,24 @@ |
| void CodeCoverage::CompileAndAdd(const Function& function, |
| const JSONArray& hits_arr) { |
| if (!function.HasCode()) { |
| - if (Compiler::CompileFunction(function) != Error::null()) { |
| + // If the function should not be compiled or if the compilation failed, |
| + // then just skip this method. |
| + // TODO(iposva): Maybe we should skip synthesized methods in general too. |
| + if (function.is_abstract() || function.IsRedirectingFactory()) { |
| return; |
| } |
| + if (function.IsNonImplicitClosureFunction() && |
| + (function.context_scope() == ContextScope::null())) { |
| + // TODO(iposva): This can arise if we attempt to compile an inner function |
| + // before we have compiled its enclosing function. |
|
hausner
2013/10/04 16:06:23
Or the enclosing function failed to compile.
Ivan Posva
2013/10/04 20:50:02
Done.
|
| + OS::Print("### Coverage skipped compiling: %s\n", function.ToCString()); |
| + return; |
| + } |
| + const Error& err = Error::Handle(Compiler::CompileFunction(function)); |
| + if (!err.IsNull()) { |
| + OS::Print("### Coverage failed compiling:\n%s\n", err.ToErrorCString()); |
| + return; |
| + } |
| } |
| ASSERT(function.HasCode()); |