Commit 5738535e authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[interpreter/fcg] Remove support for optimizing away memento creation

FCG implemented an optimziation which could avoid emitting a memento if the
memento was only needed for transitioning. This optimization is currently
turned off as we always run with pretenuring. Since this optimization will not
be ported to Ignition for now, we just remove the support from FCG.

Disabling allocation site pretenuring will then not make FCG and Iginition
diverge in their behavior.

BUG=chromium:693413

Change-Id: I69aea73426fc69d48e1fe6ed13caaf28f9cfb32f
Reviewed-on: https://chromium-review.googlesource.com/445258
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43345}
parent 875ccb48
......@@ -1347,15 +1347,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
__ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ mov(r2, Operand(SmiFromSlot(expr->literal_slot())));
......@@ -1366,7 +1357,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1332,15 +1332,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
__ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ Mov(x2, SmiFromSlot(expr->literal_slot()));
......@@ -1351,7 +1342,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1271,15 +1271,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_constant_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
if (MustCreateArrayLiteralWithRuntime(expr)) {
__ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
......@@ -1292,7 +1283,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ mov(ebx, Immediate(SmiFromSlot(expr->literal_slot())));
__ mov(ecx, Immediate(constant_elements));
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1346,15 +1346,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
__ mov(a0, result_register());
__ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
......@@ -1366,7 +1357,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1348,15 +1348,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
__ mov(a0, result_register());
__ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
......@@ -1368,7 +1359,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1315,15 +1315,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
__ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ LoadSmiLiteral(r5, SmiFromSlot(expr->literal_slot()));
......@@ -1334,7 +1325,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1279,15 +1279,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
__ LoadP(r5, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ LoadSmiLiteral(r4, SmiFromSlot(expr->literal_slot()));
......@@ -1298,7 +1289,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1298,15 +1298,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_constant_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
if (MustCreateArrayLiteralWithRuntime(expr)) {
__ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
......@@ -1319,7 +1310,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ Move(rbx, SmiFromSlot(expr->literal_slot()));
__ Move(rcx, constant_elements);
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -1261,15 +1261,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<ConstantElementsPair> constant_elements =
expr->GetOrBuildConstantElements(isolate());
bool has_constant_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) {
// If the only customer of allocation sites is transitioning, then
// we can turn it off if we don't have anywhere else to transition to.
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
}
if (MustCreateArrayLiteralWithRuntime(expr)) {
__ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
......@@ -1282,7 +1273,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ mov(ebx, Immediate(Smi::FromInt(expr->literal_index())));
__ mov(ecx, Immediate(constant_elements));
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
CodeFactory::FastCloneShallowArray(isolate(), TRACK_ALLOCATION_SITE);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
......
......@@ -2804,7 +2804,6 @@ void Interpreter::DoCreateArrayLiteral(InterpreterAssembler* assembler) {
__ Bind(&fast_shallow_clone);
{
DCHECK(FLAG_allocation_site_pretenuring);
ConstructorBuiltinsAssembler constructor_assembler(assembler->state());
Node* result = constructor_assembler.EmitFastCloneShallowArray(
closure, literal_index, context, &call_runtime, TRACK_ALLOCATION_SITE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment