Index: runtime/vm/code_generator.cc |
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc |
index bb7d5e07101ef6c16078be03916854870c7a036c..11b7f8c73c097e139a579c6dd0ac7b2e1174fd97 100644 |
--- a/runtime/vm/code_generator.cc |
+++ b/runtime/vm/code_generator.cc |
@@ -1793,6 +1793,17 @@ END_LEAF_RUNTIME_ENTRY |
// materialization phase. |
DEFINE_RUNTIME_ENTRY(DeoptimizeMaterialize, 0) { |
#if !defined(DART_PRECOMPILED_RUNTIME) |
+#if defined(DEBUG) |
+ { |
+ // We may rendezvous for a safepoint at entry or GC from the allocations |
+ // below. Check the stack is walkable. |
+ StackFrameIterator frames_iterator(StackFrameIterator::kValidateFrames); |
+ StackFrame* frame = frames_iterator.NextFrame(); |
+ while (frame != NULL) { |
+ frame = frames_iterator.NextFrame(); |
+ } |
+ } |
+#endif |
DeoptContext* deopt_context = isolate->deopt_context(); |
intptr_t deopt_arg_count = deopt_context->MaterializeDeferredObjects(); |
isolate->set_deopt_context(NULL); |