Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: src/hydrogen.cc

Issue 16206004: Add smi support to all binops minus shr, sar, shl, div and mod. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 1cf6d836fb11ae9f8dc78d93e92f4e61ce4e01d3..981b8b497e4d0b9eaeb587ff0ec71723ad903570 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -694,13 +694,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;
}
@@ -3472,10 +3468,11 @@ void HGraph::ComputeMinusZeroChecks() {
// int32-to-tagged and int32-to-double.
Representation from = change->value()->representation();
ASSERT(from.Equals(change->from()));
- if (from.IsInteger32()) {
+ if (from.IsSmiOrInteger32()) {
ASSERT(change->to().IsTagged() ||
change->to().IsDouble() ||
- change->to().IsSmi());
+ (change->to().IsSmiOrInteger32() &&
+ !from.Equals(change->to())));
danno 2013/06/06 12:32:13 Why did you add the Equals() clause? This should a
ASSERT(visited.IsEmpty());
PropagateMinusZeroChecks(change->value(), &visited);
visited.Clear();
@@ -4983,8 +4980,6 @@ void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
new(zone()) HCompareIDAndBranch(tag_value,
label_value,
Token::EQ_STRICT);
- compare_->set_observed_input_representation(
- Representation::Integer32(), Representation::Integer32());
compare = compare_;
} else {
compare = new(zone()) HStringCompareAndBranch(context, tag_value,
@@ -5348,8 +5343,6 @@ void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
// Check that we still have more keys.
HCompareIDAndBranch* compare_index =
new(zone()) HCompareIDAndBranch(index, limit, Token::LT);
- compare_index->set_observed_input_representation(
- Representation::Integer32(), Representation::Integer32());
HBasicBlock* loop_body = graph()->CreateBasicBlock();
HBasicBlock* loop_successor = graph()->CreateBasicBlock();
@@ -9087,9 +9080,9 @@ HInstruction* HOptimizedGraphBuilder::BuildIncrement(
// The input to the count operation is on top of the expression stack.
TypeInfo info = expr->type();
Representation rep = ToRepresentation(info);
- if (rep.IsTagged()) {
- rep = Representation::Integer32();
- }
+
+ // TODO(verwaest): Explicitly turn off smi for now. Try to turn back on later.
+ if (rep.IsSmiOrTagged()) rep = Representation::Integer32();
if (returns_original_input) {
// We need an explicit HValue representing ToNumber(input). The
@@ -9627,7 +9620,7 @@ void HOptimizedGraphBuilder::VisitArithmeticExpression(BinaryOperation* expr) {
Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) {
if (info.IsUninitialized()) return Representation::None();
- if (info.IsSmi()) return Representation::Integer32();
+ if (info.IsSmi()) return Representation::Smi();
if (info.IsInteger32()) return Representation::Integer32();
if (info.IsDouble()) return Representation::Double();
if (info.IsNumber()) return Representation::Double();
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698