Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index 59965b18c6a4611fbaaae4b190bd67377e370ae1..1e9b0bdb9432c2ac6f20fa3d191d458caf5e3b8a 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -5890,13 +5890,11 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
site_context.ExitScope(site, boilerplate); |
} else { |
NoObservableSideEffectsScope no_effects(this); |
- Handle<LiteralsArray> closure_literals(closure->literals(), isolate()); |
Handle<FixedArray> constant_properties = expr->constant_properties(); |
int literal_index = expr->literal_index(); |
int flags = expr->ComputeFlags(true); |
- Add<HPushArguments>(Add<HConstant>(closure_literals), |
- Add<HConstant>(literal_index), |
+ Add<HPushArguments>(AddThisFunction(), Add<HConstant>(literal_index), |
Add<HConstant>(constant_properties), |
Add<HConstant>(flags)); |
@@ -6059,10 +6057,8 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
int literal_index = expr->literal_index(); |
int flags = expr->ComputeFlags(true); |
- Add<HPushArguments>(Add<HConstant>(literals), |
- Add<HConstant>(literal_index), |
- Add<HConstant>(constants), |
- Add<HConstant>(flags)); |
+ Add<HPushArguments>(AddThisFunction(), Add<HConstant>(literal_index), |
+ Add<HConstant>(constants), Add<HConstant>(flags)); |
Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; |
literal = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 4); |
@@ -11720,6 +11716,11 @@ void HOptimizedGraphBuilder::VisitEmptyParentheses(EmptyParentheses* expr) { |
} |
+HValue* HOptimizedGraphBuilder::AddThisFunction() { |
+ return AddInstruction(BuildThisFunction()); |
+} |
+ |
+ |
HInstruction* HOptimizedGraphBuilder::BuildThisFunction() { |
// If we share optimized code between different closures, the |
// this-function is not a constant, except inside an inlined body. |