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

Unified Diff: runtime/vm/code_generator.cc

Issue 2771013002: Add more safe points in compiler (Closed)
Patch Set: Fix logic error in compiler code installation, more safe points, remove safe point in zone code, ni… Created 3 years, 9 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 | « no previous file | runtime/vm/compiler.cc » ('j') | runtime/vm/flow_graph.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | runtime/vm/flow_graph.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698