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

Unified Diff: runtime/vm/code_generator.cc

Issue 2357343003: Fix lazy deoptimization in the presence of exceptions (Closed)
Patch Set: new test case Created 4 years, 3 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/flow_graph.cc » ('j') | runtime/vm/flow_graph_compiler.h » ('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 51e70e8a0bee2ff314c1267803ffcaf20f8c51f3..f6c22472a5d05c0696ee65a320b4b59fc5bb228d 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1949,11 +1949,23 @@ void DeoptimizeAt(const Code& optimized_code, uword pc) {
{
WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
CodePatcher::InsertDeoptimizationCallAt(pc, lazy_deopt_jump);
- }
- if (FLAG_trace_patching) {
- const String& name = String::Handle(function.name());
- OS::PrintErr("InsertDeoptimizationCallAt: %" Px " to %" Px " for %s\n", pc,
- lazy_deopt_jump, name.ToCString());
+ if (FLAG_trace_patching) {
+ const String& name = String::Handle(function.name());
+ OS::PrintErr(
+ "InsertDeoptimizationCallAt: 0x%" Px " to 0x%" Px " for %s\n",
+ pc, lazy_deopt_jump, name.ToCString());
+ }
+ const ExceptionHandlers& handlers =
+ ExceptionHandlers::Handle(zone, optimized_code.exception_handlers());
+ RawExceptionHandlers::HandlerInfo info;
+ for (intptr_t i = 0; i < handlers.num_entries(); ++i) {
+ handlers.GetHandlerInfo(i, &info);
+ const uword patch_pc = instrs.PayloadStart() + info.handler_pc_offset;
+ CodePatcher::InsertDeoptimizationCallAt(patch_pc, lazy_deopt_jump);
+ if (FLAG_trace_patching) {
+ OS::PrintErr(" at handler 0x%" Px "\n", patch_pc);
+ }
+ }
}
// Mark code as dead (do not GC its embedded objects).
optimized_code.set_is_alive(false);
« no previous file with comments | « no previous file | runtime/vm/flow_graph.cc » ('j') | runtime/vm/flow_graph_compiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698