Index: src/crankshaft/lithium-codegen.cc |
diff --git a/src/crankshaft/lithium-codegen.cc b/src/crankshaft/lithium-codegen.cc |
index 10e06dd65d4e4865ca224094cc7f94504779723d..5bd1e6a9b872426627bc306eb5bbec9f95b64306 100644 |
--- a/src/crankshaft/lithium-codegen.cc |
+++ b/src/crankshaft/lithium-codegen.cc |
@@ -332,10 +332,17 @@ void LCodeGenBase::PopulateDeoptimizationData(Handle<Code> code) { |
void LCodeGenBase::PopulateDeoptimizationLiteralsWithInlinedFunctions() { |
DCHECK_EQ(0, deoptimization_literals_.length()); |
- for (auto function : chunk()->inlined_functions()) { |
+ for (Handle<SharedFunctionInfo> function : chunk()->inlined_functions()) { |
DefineDeoptimizationLiteral(function); |
} |
inlined_function_count_ = deoptimization_literals_.length(); |
+ |
+ // Define deoptimization literals for all unoptimized code objects of inlined |
+ // functions. This ensures unoptimized code is kept alive by optimized code. |
+ AllowDeferredHandleDereference allow_shared_function_info_dereference; |
+ for (Handle<SharedFunctionInfo> function : chunk()->inlined_functions()) { |
+ DefineDeoptimizationLiteral(handle(function->code())); |
+ } |
} |