Index: src/arm/deoptimizer-arm.cc |
diff --git a/src/arm/deoptimizer-arm.cc b/src/arm/deoptimizer-arm.cc |
index 7c2529e10805224bd6a3c1a6a9d09fe6cd510718..bfa24207ab838c7fa758ff0a6647f3e19f94f9de 100644 |
--- a/src/arm/deoptimizer-arm.cc |
+++ b/src/arm/deoptimizer-arm.cc |
@@ -118,6 +118,11 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) { |
node->set_next(data->deoptimizing_code_list_); |
data->deoptimizing_code_list_ = node; |
+ // We might be in the middle of incremental marking with compaction. |
+ // Tell collector to treat this code object in a special way and |
+ // ignore all slots that might have been recorded on it. |
+ isolate->heap()->mark_compact_collector()->InvalidateCode(code); |
+ |
// Set the code for the function to non-optimized version. |
function->ReplaceCode(function->shared()->code()); |