From 437f8b0c24ed7984ec41abed2fcc27482bf33a45 Mon Sep 17 00:00:00 2001 From: "rossberg@chromium.org" Date: Fri, 5 Jul 2013 08:49:37 +0000 Subject: [PATCH] Unrevert "Remove BinaryOp::result_type"" 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 | 4 ---- src/hydrogen.cc | 2 +- src/type-info.h | 6 +++--- src/typing.cc | 6 +++--- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/ast.h b/src/ast.h index b9a98e0b7..6336b3a14 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 result_type() const { return result_type_; } - void set_result_type(Handle type) { result_type_ = type; } Maybe fixed_right_arg() const { return fixed_right_arg_; } void set_fixed_right_arg(Maybe arg) { fixed_right_arg_ = arg; } @@ -1913,7 +1910,6 @@ class BinaryOperation: public Expression { Expression* right_; int pos_; - Handle result_type_; // TODO(rossberg): the fixed arg should probably be represented as a Constant // type for the RHS. Maybe fixed_right_arg_; diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 7679f9325..60acf99a1 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -8675,7 +8675,7 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation( HValue* context = environment()->LookupContext(); Handle left_type = expr->left()->lower_type(); Handle right_type = expr->right()->lower_type(); - Handle result_type = expr->result_type(); + Handle result_type = expr->lower_type(); Maybe fixed_right_arg = expr->fixed_right_arg(); Representation left_rep = ToRepresentation(left_type); Representation right_rep = ToRepresentation(right_type); diff --git a/src/type-info.h b/src/type-info.h index a1c1f54cc..aa1f509e2 100644 --- a/src/type-info.h +++ b/src/type-info.h @@ -303,9 +303,9 @@ class TypeFeedbackOracle: public ZoneObject { Maybe* fixed_right_arg); void CompareType(TypeFeedbackId id, - Handle* left_type, - Handle* right_type, - Handle* combined_type); + Handle* left, + Handle* right, + Handle* combined); Handle ClauseType(TypeFeedbackId id); diff --git a/src/typing.cc b/src/typing.cc index 7c116120a..3f3ff6014 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 left_type, right_type, result_type; + Handle type, left_type, right_type; Maybe 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()); -- 2.34.1