Index: runtime/vm/flow_graph_compiler_arm.cc |
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc |
index 65de695b245330142f79a7741ed06dfed27b0a4c..92c86301d458429673eacf8719216f1777bd94f1 100644 |
--- a/runtime/vm/flow_graph_compiler_arm.cc |
+++ b/runtime/vm/flow_graph_compiler_arm.cc |
@@ -1112,6 +1112,21 @@ void FlowGraphCompiler::CompileGraph() { |
__ bkpt(0); |
ASSERT(assembler()->constant_pool_allowed()); |
GenerateDeferredCode(); |
+ |
+ BeginCodeSourceRange(); |
+ if (is_optimizing() && !FLAG_precompiled_mode) { |
+ // Leave enough space for patching in case of lazy deoptimization. |
+ for (intptr_t i = 0; |
+ i < CallPattern::DeoptCallPatternLengthInInstructions(); |
+ ++i) { |
+ __ nop(); |
+ } |
+ lazy_deopt_return_pc_offset_ = assembler()->CodeSize(); |
+ __ Branch(*StubCode::DeoptimizeLazyFromReturn_entry()); |
+ lazy_deopt_throw_pc_offset_ = assembler()->CodeSize(); |
+ __ Branch(*StubCode::DeoptimizeLazyFromThrow_entry()); |
+ } |
+ EndCodeSourceRange(TokenPosition::kDartCodeEpilogue); |
} |