Reduce usage of AssumeRepresentation

BUG=
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16871011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15132 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2013-06-13 18:09:33 +00:00
parent 674d594606
commit 91eda65014
2 changed files with 6 additions and 21 deletions

View File

@ -709,13 +709,9 @@ HGraphBuilder::IfBuilder::IfBuilder(
HInstruction* HGraphBuilder::IfBuilder::IfCompare( HInstruction* HGraphBuilder::IfBuilder::IfCompare(
HValue* left, HValue* left,
HValue* right, HValue* right,
Token::Value token, Token::Value token) {
Representation input_representation) {
HCompareIDAndBranch* compare = HCompareIDAndBranch* compare =
new(zone()) HCompareIDAndBranch(left, right, token); new(zone()) HCompareIDAndBranch(left, right, token);
compare->set_observed_input_representation(input_representation,
input_representation);
compare->AssumeRepresentation(input_representation);
AddCompare(compare); AddCompare(compare);
return compare; return compare;
} }
@ -1169,7 +1165,6 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object,
if (is_js_array) { if (is_js_array) {
HValue* new_length = AddInstruction( HValue* new_length = AddInstruction(
HAdd::New(zone, context, length, graph_->GetConstant1())); HAdd::New(zone, context, length, graph_->GetConstant1()));
new_length->AssumeRepresentation(Representation::Integer32());
new_length->ClearFlag(HValue::kCanOverflow); new_length->ClearFlag(HValue::kCanOverflow);
Representation representation = IsFastElementsKind(kind) Representation representation = IsFastElementsKind(kind)
@ -1346,14 +1341,12 @@ HValue* HGraphBuilder::BuildAllocateElements(HValue* context,
AddInstruction(elements_size_value); AddInstruction(elements_size_value);
HValue* mul = AddInstruction( HValue* mul = AddInstruction(
HMul::New(zone, context, capacity, elements_size_value)); HMul::New(zone, context, capacity, elements_size_value));
mul->AssumeRepresentation(Representation::Integer32());
mul->ClearFlag(HValue::kCanOverflow); mul->ClearFlag(HValue::kCanOverflow);
HConstant* header_size = new(zone) HConstant(FixedArray::kHeaderSize); HConstant* header_size = new(zone) HConstant(FixedArray::kHeaderSize);
AddInstruction(header_size); AddInstruction(header_size);
HValue* total_size = AddInstruction( HValue* total_size = AddInstruction(
HAdd::New(zone, context, mul, header_size)); HAdd::New(zone, context, mul, header_size));
total_size->AssumeRepresentation(Representation::Integer32());
total_size->ClearFlag(HValue::kCanOverflow); total_size->ClearFlag(HValue::kCanOverflow);
HAllocate::Flags flags = HAllocate::DefaultFlags(kind); HAllocate::Flags flags = HAllocate::DefaultFlags(kind);
@ -1450,19 +1443,16 @@ HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* context,
HValue* half_old_capacity = HValue* half_old_capacity =
AddInstruction(HShr::New(zone, context, old_capacity, AddInstruction(HShr::New(zone, context, old_capacity,
graph_->GetConstant1())); graph_->GetConstant1()));
half_old_capacity->AssumeRepresentation(Representation::Integer32());
half_old_capacity->ClearFlag(HValue::kCanOverflow); half_old_capacity->ClearFlag(HValue::kCanOverflow);
HValue* new_capacity = AddInstruction( HValue* new_capacity = AddInstruction(
HAdd::New(zone, context, half_old_capacity, old_capacity)); HAdd::New(zone, context, half_old_capacity, old_capacity));
new_capacity->AssumeRepresentation(Representation::Integer32());
new_capacity->ClearFlag(HValue::kCanOverflow); new_capacity->ClearFlag(HValue::kCanOverflow);
HValue* min_growth = AddInstruction(new(zone) HConstant(16)); HValue* min_growth = AddInstruction(new(zone) HConstant(16));
new_capacity = AddInstruction( new_capacity = AddInstruction(
HAdd::New(zone, context, new_capacity, min_growth)); HAdd::New(zone, context, new_capacity, min_growth));
new_capacity->AssumeRepresentation(Representation::Integer32());
new_capacity->ClearFlag(HValue::kCanOverflow); new_capacity->ClearFlag(HValue::kCanOverflow);
return new_capacity; return new_capacity;
@ -1834,14 +1824,12 @@ HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize(
AddInstruction(elements_size_value); AddInstruction(elements_size_value);
HInstruction* mul = HMul::New(zone(), context, length_node, HInstruction* mul = HMul::New(zone(), context, length_node,
elements_size_value); elements_size_value);
mul->AssumeRepresentation(Representation::Integer32());
mul->ClearFlag(HValue::kCanOverflow); mul->ClearFlag(HValue::kCanOverflow);
AddInstruction(mul); AddInstruction(mul);
HInstruction* base = new(zone()) HConstant(base_size); HInstruction* base = new(zone()) HConstant(base_size);
AddInstruction(base); AddInstruction(base);
HInstruction* total_size = HAdd::New(zone(), context, base, mul); HInstruction* total_size = HAdd::New(zone(), context, base, mul);
total_size->AssumeRepresentation(Representation::Integer32());
total_size->ClearFlag(HValue::kCanOverflow); total_size->ClearFlag(HValue::kCanOverflow);
AddInstruction(total_size); AddInstruction(total_size);
return total_size; return total_size;

View File

@ -1091,8 +1091,7 @@ class HGraphBuilder {
HInstruction* IfCompare( HInstruction* IfCompare(
HValue* left, HValue* left,
HValue* right, HValue* right,
Token::Value token, Token::Value token);
Representation input_representation = Representation::Integer32());
HInstruction* IfCompareMap(HValue* left, Handle<Map> map); HInstruction* IfCompareMap(HValue* left, Handle<Map> map);
@ -1124,10 +1123,9 @@ class HGraphBuilder {
HInstruction* OrIfCompare( HInstruction* OrIfCompare(
HValue* p1, HValue* p1,
HValue* p2, HValue* p2,
Token::Value token, Token::Value token) {
Representation input_representation = Representation::Integer32()) {
Or(); Or();
return IfCompare(p1, p2, token, input_representation); return IfCompare(p1, p2, token);
} }
HInstruction* OrIfCompareMap(HValue* left, Handle<Map> map) { HInstruction* OrIfCompareMap(HValue* left, Handle<Map> map) {
@ -1150,10 +1148,9 @@ class HGraphBuilder {
HInstruction* AndIfCompare( HInstruction* AndIfCompare(
HValue* p1, HValue* p1,
HValue* p2, HValue* p2,
Token::Value token, Token::Value token) {
Representation input_representation = Representation::Integer32()) {
And(); And();
return IfCompare(p1, p2, token, input_representation); return IfCompare(p1, p2, token);
} }
HInstruction* AndIfCompareMap(HValue* left, Handle<Map> map) { HInstruction* AndIfCompareMap(HValue* left, Handle<Map> map) {