Reviewers: Jakob,

Description:
Unrevert "Remove BinaryOp::result_type""

Reenables https://code.google.com/p/v8/source/detail?r=15265

[email protected]
BUG=

Please review this at https://codereview.chromium.org/18309005/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/ast.h
  M src/hydrogen.cc
  M src/type-info.h
  M src/typing.cc


Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index b9a98e0b7d12ac7c29593ed4b9efa97bfa06ecf8..6336b3a14b0e144aee345f0f2b91acce270f37ac 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1884,9 +1884,6 @@ class BinaryOperation: public Expression {
   BailoutId RightId() const { return right_id_; }

   TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); }
-  // TODO(rossberg): result_type should be subsumed by lower_type.
-  Handle<Type> result_type() const { return result_type_; }
-  void set_result_type(Handle<Type> type) { result_type_ = type; }
   Maybe<int> fixed_right_arg() const { return fixed_right_arg_; }
   void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; }

@@ -1913,7 +1910,6 @@ class BinaryOperation: public Expression {
   Expression* right_;
   int pos_;

-  Handle<Type> result_type_;
// TODO(rossberg): the fixed arg should probably be represented as a Constant
   // type for the RHS.
   Maybe<int> fixed_right_arg_;
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 7679f93257acd1fdf1fb096dd0d03c250ad86187..60acf99a1698974a82724b92ef01af6955a2f365 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8675,7 +8675,7 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation(
   HValue* context = environment()->LookupContext();
   Handle<Type> left_type = expr->left()->lower_type();
   Handle<Type> right_type = expr->right()->lower_type();
-  Handle<Type> result_type = expr->result_type();
+  Handle<Type> result_type = expr->lower_type();
   Maybe<int> fixed_right_arg = expr->fixed_right_arg();
   Representation left_rep = ToRepresentation(left_type);
   Representation right_rep = ToRepresentation(right_type);
Index: src/type-info.h
diff --git a/src/type-info.h b/src/type-info.h
index a1c1f54cc12d95959cea6485952d3fa7a7a31210..aa1f509e2d54053c9cd12d6831f4aaa2ddc996f5 100644
--- a/src/type-info.h
+++ b/src/type-info.h
@@ -303,9 +303,9 @@ class TypeFeedbackOracle: public ZoneObject {
                   Maybe<int>* fixed_right_arg);

   void CompareType(TypeFeedbackId id,
-                   Handle<Type>* left_type,
-                   Handle<Type>* right_type,
-                   Handle<Type>* combined_type);
+                   Handle<Type>* left,
+                   Handle<Type>* right,
+                   Handle<Type>* combined);

   Handle<Type> ClauseType(TypeFeedbackId id);

Index: src/typing.cc
diff --git a/src/typing.cc b/src/typing.cc
index 7c116120a21c349c8baf243a9d09b4cfc4e6496b..3f3ff6014bcac000b67e1f1e70065188a9e70649 100644
--- a/src/typing.cc
+++ b/src/typing.cc
@@ -432,13 +432,13 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
   CHECK_ALIVE(Visit(expr->right()));

   // Collect type feedback.
-  Handle<Type> left_type, right_type, result_type;
+  Handle<Type> type, left_type, right_type;
   Maybe<int> fixed_right_arg;
   oracle()->BinaryType(expr->BinaryOperationFeedbackId(),
-      &left_type, &right_type, &result_type, &fixed_right_arg);
+      &left_type, &right_type, &type, &fixed_right_arg);
+  MergeLowerType(expr, type);
   MergeLowerType(expr->left(), left_type);
   MergeLowerType(expr->right(), right_type);
-  expr->set_result_type(result_type);
   expr->set_fixed_right_arg(fixed_right_arg);
   if (expr->op() == Token::OR || expr->op() == Token::AND) {
     expr->left()->RecordToBooleanTypeFeedback(oracle());


--
--
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.


Reply via email to