Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index f74b18297d5eb9f5ed14e505be2752d0d1020bad..7d4b1504ca1a937ffdbf95c97670aca388a964df 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -5481,10 +5481,10 @@ void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { |
// We also have a stack overflow if the recursive compilation did. |
if (HasStackOverflow()) return; |
// Use the fast case closure allocation code that allocates in new |
- // space for nested functions that don't need literals cloning. |
+ // space for nested functions that don't need pretenuring. |
HConstant* shared_info_value = Add<HConstant>(shared_info); |
HInstruction* instr; |
- if (!expr->pretenure() && shared_info->num_literals() == 0) { |
+ if (!expr->pretenure()) { |
FastNewClosureStub stub(isolate(), shared_info->language_mode(), |
shared_info->kind()); |
FastNewClosureDescriptor descriptor(isolate()); |
@@ -8432,6 +8432,9 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target, |
// does not remove the code with the deoptimization support. |
top_info()->AddInlinedFunction(target_info.shared_info()); |
+ // If target was lazily compiled, it's literals array may not yet be set up. |
+ JSFunction::EnsureLiterals(target); |
Benedikt Meurer
2016/01/15 11:36:43
Can we check this in the heap verifier?
|
+ |
// ---------------------------------------------------------------- |
// After this point, we've made a decision to inline this function (so |
// TryInline should always return true). |