Revision: 16414
Author:   [email protected]
Date:     Thu Aug 29 09:54:52 2013 UTC
Log:      Fix assert triggered by constant folding.

Add<> asserts the return type, which might not be an HAdd in this case
because of constant folding.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/23754002
http://code.google.com/p/v8/source/detail?r=16414

Modified:
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Thu Aug 29 09:15:13 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Aug 29 09:54:52 2013 UTC
@@ -1537,14 +1537,15 @@


 HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* old_capacity) {
- HValue* half_old_capacity = Add<HShr>(old_capacity, graph_->GetConstant1());
+  HValue* half_old_capacity = AddUncasted<HShr>(old_capacity,
+                                                graph_->GetConstant1());

-  HValue* new_capacity = Add<HAdd>(half_old_capacity, old_capacity);
+ HValue* new_capacity = AddUncasted<HAdd>(half_old_capacity, old_capacity);
   new_capacity->ClearFlag(HValue::kCanOverflow);

   HValue* min_growth = Add<HConstant>(16);

-  new_capacity = Add<HAdd>(new_capacity, min_growth);
+  new_capacity = AddUncasted<HAdd>(new_capacity, min_growth);
   new_capacity->ClearFlag(HValue::kCanOverflow);

   return new_capacity;

--
--
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.

Reply via email to