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
This commit is contained in:
parent
b320dfcf58
commit
5659e7c84e
@ -1537,14 +1537,15 @@ HLoadNamedField* HGraphBuilder::AddLoadFixedArrayLength(HValue* object) {
|
||||
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user