Revision: 17787
Author: mvstan...@chromium.org
Date: Fri Nov 15 12:10:59 2013 UTC
Log: Regression fix: HForceRepresentation shouldn't be an idef.
Instead, code sites that are interested in underlying constant integer
values
should use HValue::IsInteger32Constant(). The issue is that the infer
representation phase shouldn't "see through" HForceRepresentation nodes to
an underlying, and less specific representation.
R=mstarzin...@chromium.org
Review URL: https://codereview.chromium.org/65643003
http://code.google.com/p/v8/source/detail?r=17787
Modified:
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Nov 12
11:53:13 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Nov 15
12:10:59 2013 UTC
@@ -521,12 +521,19 @@
bool HValue::IsInteger32Constant() {
- return IsConstant() && HConstant::cast(this)->HasInteger32Value();
+ HValue* value_to_check = IsForceRepresentation()
+ ? HForceRepresentation::cast(this)->value()
+ : this;
+ return value_to_check->IsConstant() &&
+ HConstant::cast(value_to_check)->HasInteger32Value();
}
int32_t HValue::GetInteger32Constant() {
- return HConstant::cast(this)->Integer32Value();
+ HValue* constant_value = IsForceRepresentation()
+ ? HForceRepresentation::cast(this)->value()
+ : this;
+ return HConstant::cast(constant_value)->Integer32Value();
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Nov 15 10:52:05
2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Nov 15 12:10:59
2013 UTC
@@ -1578,9 +1578,6 @@
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 Fri Nov 15 10:52:05 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Fri Nov 15 12:10:59 2013 UTC
@@ -2209,15 +2209,12 @@
static const int kLoopUnfoldLimit = 8;
STATIC_ASSERT(JSArray::kPreallocatedArrayElements <= kLoopUnfoldLimit);
int initial_capacity = -1;
- if (from->ActualValue()->IsConstant() &&
to->ActualValue()->IsConstant()) {
- HConstant* constant_from = HConstant::cast(from->ActualValue());
- HConstant* constant_to = HConstant::cast(to->ActualValue());
+ if (from->IsInteger32Constant() && to->IsInteger32Constant()) {
+ int constant_from = from->GetInteger32Constant();
+ int constant_to = to->GetInteger32Constant();
- if (constant_from->HasInteger32Value() &&
- constant_from->Integer32Value() == 0 &&
- constant_to->HasInteger32Value() &&
- constant_to->Integer32Value() <= kLoopUnfoldLimit) {
- initial_capacity = constant_to->Integer32Value();
+ if (constant_from == 0 && constant_to <= kLoopUnfoldLimit) {
+ initial_capacity = constant_to;
}
}
--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.