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

Unified Diff: src/compiler/js-create-lowering.cc

Issue 2423913002: [turbofan] Manually smash the type on literal allocation. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-create-lowering.cc
diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc
index 288108d5bd3dd77326384188821932dd19e99ec1..8629aa7dc75706ad15c41bdc0185d667a6566202 100644
--- a/src/compiler/js-create-lowering.cc
+++ b/src/compiler/js-create-lowering.cc
@@ -36,12 +36,16 @@ class AllocationBuilder final {
control_(control) {}
// Primitive allocation of static size.
- void Allocate(int size, PretenureFlag pretenure = NOT_TENURED) {
+ void Allocate(int size, PretenureFlag pretenure = NOT_TENURED,
+ Type* type = Type::Any()) {
effect_ = graph()->NewNode(
common()->BeginRegion(RegionObservability::kNotObservable), effect_);
allocation_ =
graph()->NewNode(simplified()->Allocate(pretenure),
jsgraph()->Constant(size), effect_, control_);
+ // TODO(turbofan): Maybe we should put the Type* onto the Allocate operator
+ // at some point, or maybe we should have a completely differnt story.
+ NodeProperties::SetType(allocation_, type);
effect_ = allocation_;
}
@@ -65,7 +69,7 @@ class AllocationBuilder final {
int size = (map->instance_type() == FIXED_ARRAY_TYPE)
? FixedArray::SizeFor(length)
: FixedDoubleArray::SizeFor(length);
- Allocate(size, pretenure);
+ Allocate(size, pretenure, Type::OtherInternal());
Store(AccessBuilder::ForMap(), map);
Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length));
}
@@ -1109,7 +1113,8 @@ Node* JSCreateLowering::AllocateFastLiteral(
// Actually allocate and initialize the object.
AllocationBuilder builder(jsgraph(), effect, control);
- builder.Allocate(boilerplate_map->instance_size(), pretenure);
+ builder.Allocate(boilerplate_map->instance_size(), pretenure,
+ Type::OtherObject());
builder.Store(AccessBuilder::ForMap(), boilerplate_map);
builder.Store(AccessBuilder::ForJSObjectProperties(), properties);
builder.Store(AccessBuilder::ForJSObjectElements(), elements);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698