Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1469833005: [runtime] Pass closure to %CreateArrayLiteral and %CreateObjectLiteral. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698