From 91eda65014bc2daf50215bda51658d0629fb2f74 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 13 Jun 2013 18:09:33 +0000 Subject: [PATCH] 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 --- src/hydrogen.cc | 14 +------------- src/hydrogen.h | 13 +++++-------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 8ecb4c6f25..e7fbabae1d 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -709,13 +709,9 @@ HGraphBuilder::IfBuilder::IfBuilder( HInstruction* HGraphBuilder::IfBuilder::IfCompare( HValue* left, HValue* right, - Token::Value token, - Representation input_representation) { + Token::Value token) { HCompareIDAndBranch* compare = new(zone()) HCompareIDAndBranch(left, right, token); - compare->set_observed_input_representation(input_representation, - input_representation); - compare->AssumeRepresentation(input_representation); AddCompare(compare); return compare; } @@ -1169,7 +1165,6 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object, if (is_js_array) { HValue* new_length = AddInstruction( HAdd::New(zone, context, length, graph_->GetConstant1())); - new_length->AssumeRepresentation(Representation::Integer32()); new_length->ClearFlag(HValue::kCanOverflow); Representation representation = IsFastElementsKind(kind) @@ -1346,14 +1341,12 @@ HValue* HGraphBuilder::BuildAllocateElements(HValue* context, AddInstruction(elements_size_value); HValue* mul = AddInstruction( HMul::New(zone, context, capacity, elements_size_value)); - mul->AssumeRepresentation(Representation::Integer32()); mul->ClearFlag(HValue::kCanOverflow); HConstant* header_size = new(zone) HConstant(FixedArray::kHeaderSize); AddInstruction(header_size); HValue* total_size = AddInstruction( HAdd::New(zone, context, mul, header_size)); - total_size->AssumeRepresentation(Representation::Integer32()); total_size->ClearFlag(HValue::kCanOverflow); HAllocate::Flags flags = HAllocate::DefaultFlags(kind); @@ -1450,19 +1443,16 @@ HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* context, HValue* half_old_capacity = AddInstruction(HShr::New(zone, context, old_capacity, graph_->GetConstant1())); - half_old_capacity->AssumeRepresentation(Representation::Integer32()); half_old_capacity->ClearFlag(HValue::kCanOverflow); HValue* new_capacity = AddInstruction( HAdd::New(zone, context, half_old_capacity, old_capacity)); - new_capacity->AssumeRepresentation(Representation::Integer32()); new_capacity->ClearFlag(HValue::kCanOverflow); HValue* min_growth = AddInstruction(new(zone) HConstant(16)); new_capacity = AddInstruction( HAdd::New(zone, context, new_capacity, min_growth)); - new_capacity->AssumeRepresentation(Representation::Integer32()); new_capacity->ClearFlag(HValue::kCanOverflow); return new_capacity; @@ -1834,14 +1824,12 @@ HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize( AddInstruction(elements_size_value); HInstruction* mul = HMul::New(zone(), context, length_node, elements_size_value); - mul->AssumeRepresentation(Representation::Integer32()); mul->ClearFlag(HValue::kCanOverflow); AddInstruction(mul); HInstruction* base = new(zone()) HConstant(base_size); AddInstruction(base); HInstruction* total_size = HAdd::New(zone(), context, base, mul); - total_size->AssumeRepresentation(Representation::Integer32()); total_size->ClearFlag(HValue::kCanOverflow); AddInstruction(total_size); return total_size; diff --git a/src/hydrogen.h b/src/hydrogen.h index 3aff6eb368..cefc1bb28a 100644 --- a/src/hydrogen.h +++ b/src/hydrogen.h @@ -1091,8 +1091,7 @@ class HGraphBuilder { HInstruction* IfCompare( HValue* left, HValue* right, - Token::Value token, - Representation input_representation = Representation::Integer32()); + Token::Value token); HInstruction* IfCompareMap(HValue* left, Handle map); @@ -1124,10 +1123,9 @@ class HGraphBuilder { HInstruction* OrIfCompare( HValue* p1, HValue* p2, - Token::Value token, - Representation input_representation = Representation::Integer32()) { + Token::Value token) { Or(); - return IfCompare(p1, p2, token, input_representation); + return IfCompare(p1, p2, token); } HInstruction* OrIfCompareMap(HValue* left, Handle map) { @@ -1150,10 +1148,9 @@ class HGraphBuilder { HInstruction* AndIfCompare( HValue* p1, HValue* p2, - Token::Value token, - Representation input_representation = Representation::Integer32()) { + Token::Value token) { And(); - return IfCompare(p1, p2, token, input_representation); + return IfCompare(p1, p2, token); } HInstruction* AndIfCompareMap(HValue* left, Handle map) {