Chromium Code Reviews| Index: runtime/vm/code_generator.cc |
| diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc |
| index 22005f0796f98f707b0e57f508a8c723680c9222..7295cf48f5a63e8a9295db87d769b6302534aebd 100644 |
| --- a/runtime/vm/code_generator.cc |
| +++ b/runtime/vm/code_generator.cc |
| @@ -1706,7 +1706,12 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| function.usage_counter()); |
| } |
| + // We need to save the original code because the way we check for the |
| + // success of the compiler pipeline is to see if it installed the new code. |
| + // We also need the original because the pipeline installs the code even |
| + // though it is OSR code and not usable for normal entry. |
| const Code& original_code = Code::Handle(function.CurrentCode()); |
| + |
| // Since the code is referenced from the frame and the ZoneHandle, |
| // it cannot have been removed from the function. |
| ASSERT(!original_code.IsNull()); |
| @@ -1725,6 +1730,13 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| // code. |
| uword optimized_entry = |
| Instructions::UncheckedEntryPoint(optimized_code.instructions()); |
| + // Unfortunately, while we were compiling, the background compiler may |
|
Vyacheslav Egorov (Google)
2017/03/27 14:11:51
The comment is inaccurate: it is background compil
erikcorry
2017/03/30 14:10:19
I now made more serious changes to this section in
|
| + // have completed a non-OSR compilation of the same code. Our call to the |
| + // compiler overwrote the optimized version with an unusable OSR version, |
| + // which doesn't have the right entry point. If it did that it also |
| + // disabled the old version, so we have to reenable it before we install |
| + // it. See https://github.com/dart-lang/sdk/issues/29160 |
| + original_code.Enable(); |
| function.AttachCode(original_code); |
| frame->set_pc(optimized_entry); |
| frame->set_pc_marker(optimized_code.raw()); |