Revert "Remove BinaryOp::result_type"
authorrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Jul 2013 11:57:43 +0000 (11:57 +0000)
committerrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Jul 2013 11:57:43 +0000 (11:57 +0000)
This reverts https://code.google.com/p/v8/source/detail?r=15265, due to performance regression.

TBR=jkummerow@chromium.org
BUG=

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

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

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

index 6336b3a14b0e144aee345f0f2b91acce270f37ac..b9a98e0b7d12ac7c29593ed4b9efa97bfa06ecf8 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -1884,6 +1884,9 @@ 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; }
 
@@ -1910,6 +1913,7 @@ 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 d38c6f1a3c2df3f89db496c69a6e1f3b741771b8..432a6bc5fcd63fe08b81bb60ea30c91747a2218e 100644 (file)
@@ -8897,7 +8897,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->lower_type();
+  Handle<Type> result_type = expr->result_type();
   Maybe<int> fixed_right_arg = expr->fixed_right_arg();
   Representation left_rep = ToRepresentation(left_type);
   Representation right_rep = ToRepresentation(right_type);
index aa1f509e2d54053c9cd12d6831f4aaa2ddc996f5..a1c1f54cc12d95959cea6485952d3fa7a7a31210 100644 (file)
@@ -303,9 +303,9 @@ class TypeFeedbackOracle: public ZoneObject {
                   Maybe<int>* fixed_right_arg);
 
   void CompareType(TypeFeedbackId id,
-                   Handle<Type>* left,
-                   Handle<Type>* right,
-                   Handle<Type>* combined);
+                   Handle<Type>* left_type,
+                   Handle<Type>* right_type,
+                   Handle<Type>* combined_type);
 
   Handle<Type> ClauseType(TypeFeedbackId id);
 
index 3f3ff6014bcac000b67e1f1e70065188a9e70649..7c116120a21c349c8baf243a9d09b4cfc4e6496b 100644 (file)
@@ -432,13 +432,13 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
   CHECK_ALIVE(Visit(expr->right()));
 
   // Collect type feedback.
-  Handle<Type> type, left_type, right_type;
+  Handle<Type> left_type, right_type, result_type;
   Maybe<int> fixed_right_arg;
   oracle()->BinaryType(expr->BinaryOperationFeedbackId(),
-      &left_type, &right_type, &type, &fixed_right_arg);
-  MergeLowerType(expr, type);
+      &left_type, &right_type, &result_type, &fixed_right_arg);
   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());