Unrevert "Remove BinaryOp::result_type""
authorrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 5 Jul 2013 08:49:37 +0000 (08:49 +0000)
committerrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 5 Jul 2013 08:49:37 +0000 (08:49 +0000)
Reenables https://code.google.com/p/v8/source/detail?r=15265

R=jkummerow@chromium.org
BUG=

Review URL: https://codereview.chromium.org/18309005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ast.h
src/hydrogen.cc
src/type-info.h
src/typing.cc

index b9a98e0..6336b3a 100644 (file)
--- 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 7679f93..60acf99 100644 (file)
@@ -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 a1c1f54..aa1f509 100644 (file)
@@ -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 7c11612..3f3ff60 100644 (file)
@@ -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());