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

Unified Diff: src/hydrogen.cc

Issue 14972008: Remove obsolete HObjectLiteral instruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix after rebase. Created 7 years, 7 months 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/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index cd46747fb0234d67e31d39bf1fed1eefff7e1944..98bcd196e4981f70e11f4e1838211da4f17fc4f1 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6758,16 +6758,32 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
pointer_size,
DONT_TRACK_ALLOCATION_SITE);
} else {
+ NoObservableSideEffectsScope no_effects(this);
Handle<FixedArray> closure_literals(closure->literals(), isolate());
+ Handle<FixedArray> constant_properties = expr->constant_properties();
+ int literal_index = expr->literal_index();
+ int flags = expr->fast_elements()
+ ? ObjectLiteral::kFastElements : ObjectLiteral::kNoFlags;
+ flags |= expr->has_function()
+ ? ObjectLiteral::kHasFunction : ObjectLiteral::kNoFlags;
+
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(closure_literals, Representation::Tagged()))));
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(literal_index, Representation::Tagged()))));
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(constant_properties, Representation::Tagged()))));
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(flags, Representation::Tagged()))));
+
+ Runtime::FunctionId function_id =
+ (expr->depth() > 1 || expr->may_store_doubles())
+ ? Runtime::kCreateObjectLiteral : Runtime::kCreateObjectLiteralShallow;
literal = AddInstruction(
- new(zone()) HObjectLiteral(context,
- expr->constant_properties(),
- closure_literals,
- expr->fast_elements(),
- expr->literal_index(),
- expr->depth(),
- expr->may_store_doubles(),
- expr->has_function()));
+ new(zone()) HCallRuntime(context,
+ isolate()->factory()->empty_string(),
+ Runtime::FunctionForId(function_id),
+ 4));
}
// The object is expected in the bailout environment during computation
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698