Commit 5659e7c8 authored by olivf@chromium.org's avatar olivf@chromium.org

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=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/23754002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16414 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b320dfcf
...@@ -1537,14 +1537,15 @@ HLoadNamedField* HGraphBuilder::AddLoadFixedArrayLength(HValue* object) { ...@@ -1537,14 +1537,15 @@ HLoadNamedField* HGraphBuilder::AddLoadFixedArrayLength(HValue* object) {
HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* old_capacity) { 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); new_capacity->ClearFlag(HValue::kCanOverflow);
HValue* min_growth = Add<HConstant>(16); 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); new_capacity->ClearFlag(HValue::kCanOverflow);
return new_capacity; return new_capacity;
......
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