Revision: 18064
Author: [email protected]
Date: Mon Nov 25 21:18:59 2013 UTC
Log: MIPS: A performance regression in array literal creation was
caused by refactoring.
Port r18046 (99c7352)
Original commit message:
A performance regression in array literal creation was caused by
refactoring that eliminated a special fast case for shallow arrays. At the
same time the general case got a bit slower. This CL restores most of the
performance without coding the special fast case. The virtual dispatching
is unnecessary because we know what we want to do at compile time. A flag
was added to Runtime::CreateArrayLiteral. The flags delivers information
about shallowness but also whether or not allocation mementos should be
created. This is useful for crankshafted code.
BUG=v8:3008
LOG=Y
[email protected]
Review URL: https://codereview.chromium.org/85633004
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=18064
Modified:
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Wed Nov 20 19:01:33
2013 UTC
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Mon Nov 25 21:18:59
2013 UTC
@@ -78,7 +78,7 @@
descriptor->register_param_count_ = 3;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ =
- Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
+
Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry;
}
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Fri Nov 22
11:35:39 2013 UTC
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Nov 25
21:18:59 2013 UTC
@@ -1780,6 +1780,10 @@
Comment cmnt(masm_, "[ ArrayLiteral");
expr->BuildConstantElements(isolate());
+ int flags = expr->depth() == 1
+ ? ArrayLiteral::kShallowElements
+ : ArrayLiteral::kNoFlags;
+
ZoneList<Expression*>* subexprs = expr->values();
int length = subexprs->length();
@@ -1808,8 +1812,9 @@
1, a1, a2);
} else if (expr->depth() > 1 || Serializer::enabled() ||
length > FastCloneShallowArrayStub::kMaximumClonedLength) {
- __ Push(a3, a2, a1);
- __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
+ __ li(a0, Operand(Smi::FromInt(flags)));
+ __ Push(a3, a2, a1, a0);
+ __ CallRuntime(Runtime::kCreateArrayLiteral, 4);
} else {
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
FLAG_smi_only_arrays);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.