Reviewers: Jakob,
Message:
PTAL
Description:
Don't force representations in the loop builder.
Additionally, infer None-typed CompareIDAndBranch to Smi+actual input.
Please review this at https://chromiumcodereview.appspot.com/16365004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/hydrogen-instructions.cc
M src/hydrogen.h
M src/hydrogen.cc
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index
5fae5f72237cc824f27bae036f158a0df0ebed92..d1de4a5176c1fc9cbc702c3eb880a0d4510459fc
100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2499,7 +2499,9 @@ void
HCompareIDAndBranch::InferRepresentation(HInferRepresentation* h_infer) {
Representation observed_right = observed_input_representation(1);
Representation rep = Representation::Smi();
- if (observed_left.IsInteger32() && observed_right.IsInteger32()) {
+ rep = rep.generalize(observed_left);
+ rep = rep.generalize(observed_right);
+ if (rep.IsSmiOrInteger32()) {
if (!left_rep.IsTagged()) rep = rep.generalize(left_rep);
if (!right_rep.IsTagged()) rep = rep.generalize(right_rep);
} else {
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
85a75345691e94428690c858887f0a2bd3a21e2d..181bc866666cb5e7ee6ac0d5eb4d4ab7700a8452
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -898,13 +898,11 @@
HGraphBuilder::LoopBuilder::LoopBuilder(HGraphBuilder* builder,
HValue* HGraphBuilder::LoopBuilder::BeginBody(
HValue* initial,
HValue* terminating,
- Token::Value token,
- Representation input_representation) {
+ Token::Value token) {
HEnvironment* env = builder_->environment();
phi_ = new(zone()) HPhi(env->values()->length(), zone());
header_block_->AddPhi(phi_);
phi_->AddInput(initial);
- phi_->AssumeRepresentation(Representation::Integer32());
env->Push(initial);
builder_->current_block()->GotoNoSimulate(header_block_);
@@ -918,9 +916,6 @@ HValue* HGraphBuilder::LoopBuilder::BeginBody(
builder_->set_current_block(header_block_);
HCompareIDAndBranch* compare =
new(zone()) HCompareIDAndBranch(phi_, terminating, token);
- compare->set_observed_input_representation(input_representation,
- input_representation);
- compare->AssumeRepresentation(input_representation);
compare->SetSuccessorAt(0, body_block_);
compare->SetSuccessorAt(1, exit_block_);
builder_->current_block()->Finish(compare);
@@ -934,7 +929,6 @@ HValue* HGraphBuilder::LoopBuilder::BeginBody(
increment_ = HSub::New(zone(), context_, phi_, one);
}
increment_->ClearFlag(HValue::kCanOverflow);
- increment_->AssumeRepresentation(Representation::Integer32());
builder_->AddInstruction(increment_);
return increment_;
} else {
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index
db607d548373b681b0f1a7554bb768a8d496a52e..5cb99a1a8d78d78c38c9a92a205f55af168735e1
100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1217,8 +1217,7 @@ class HGraphBuilder {
HValue* BeginBody(
HValue* initial,
HValue* terminating,
- Token::Value token,
- Representation input_representation = Representation::Integer32());
+ Token::Value token);
void EndBody();
private:
--
--
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.