Revision: 17708
Author: [email protected]
Date: Wed Nov 13 17:03:11 2013 UTC
Log: Make HForceRepresentation an idef.
An optimization in the array constructor wasn't firing because the code
would check for constant values, failing to find them through
intervening HForceRepresentation instructions. Repaired this site. A
follow-on CL will provide a better way of making decisions based on
constant HValues.
[email protected]
Review URL: https://codereview.chromium.org/59623009
http://code.google.com/p/v8/source/detail?r=17708
Modified:
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Nov 12 11:53:13
2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed Nov 13 17:03:11
2013 UTC
@@ -1578,6 +1578,9 @@
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
DECLARE_CONCRETE_INSTRUCTION(ForceRepresentation)
+
+ protected:
+ virtual int RedefinedOperandIndex() { return 0; }
private:
HForceRepresentation(HValue* value, Representation
required_representation) {
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Tue Nov 12 14:43:18 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Wed Nov 13 17:03:11 2013 UTC
@@ -2100,10 +2100,10 @@
static const int kLoopUnfoldLimit = 4;
bool unfold_loop = false;
int initial_capacity = JSArray::kPreallocatedArrayElements;
- if (from->IsConstant() && to->IsConstant() &&
+ if (from->ActualValue()->IsConstant() && to->ActualValue()->IsConstant()
&&
initial_capacity <= kLoopUnfoldLimit) {
- HConstant* constant_from = HConstant::cast(from);
- HConstant* constant_to = HConstant::cast(to);
+ HConstant* constant_from = HConstant::cast(from->ActualValue());
+ HConstant* constant_to = HConstant::cast(to->ActualValue());
if (constant_from->HasInteger32Value() &&
constant_from->Integer32Value() == 0 &&
--
--
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.