Revision: 6514
Author: [email protected]
Date: Thu Jan 27 06:04:07 2011
Log: Cleanup unused code from the type oracle.

Review URL: http://codereview.chromium.org/6135004
http://code.google.com/p/v8/source/detail?r=6514

Modified:
 /branches/bleeding_edge/src/ast.cc
 /branches/bleeding_edge/src/ast.h
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/type-info.cc
 /branches/bleeding_edge/src/type-info.h

=======================================
--- /branches/bleeding_edge/src/ast.cc  Tue Jan 25 07:51:10 2011
+++ /branches/bleeding_edge/src/ast.cc  Thu Jan 27 06:04:07 2011
@@ -663,21 +663,13 @@
     is_monomorphic_ = ComputeTarget(map, name);
   }
 }
-
-
-void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
-  TypeInfo left = oracle->BinaryType(this, TypeFeedbackOracle::LEFT);
-  TypeInfo right = oracle->BinaryType(this, TypeFeedbackOracle::RIGHT);
-  is_smi_only_ = left.IsSmi() && right.IsSmi();
-}


 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
-  TypeInfo left = oracle->CompareType(this, TypeFeedbackOracle::LEFT);
-  TypeInfo right = oracle->CompareType(this, TypeFeedbackOracle::RIGHT);
-  if (left.IsSmi() && right.IsSmi()) {
+  TypeInfo info = oracle->CompareType(this);
+  if (info.IsSmi()) {
     compare_type_ = SMI_ONLY;
-  } else if (left.IsNonPrimitive() && right.IsNonPrimitive()) {
+  } else if (info.IsNonPrimitive()) {
     compare_type_ = OBJECT_ONLY;
   } else {
     ASSERT(compare_type_ == NONE);
=======================================
--- /branches/bleeding_edge/src/ast.h   Tue Jan 25 07:51:10 2011
+++ /branches/bleeding_edge/src/ast.h   Thu Jan 27 06:04:07 2011
@@ -1398,7 +1398,7 @@
                   Expression* left,
                   Expression* right,
                   int pos)
- : op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) {
+      : op_(op), left_(left), right_(right), pos_(pos) {
     ASSERT(Token::IsBinaryOp(op));
     right_id_ = (op == Token::AND || op == Token::OR)
         ? static_cast<int>(GetNextId())
@@ -1418,10 +1418,6 @@
   Expression* left() const { return left_; }
   Expression* right() const { return right_; }
   int position() const { return pos_; }
-
-  // Type feedback information.
-  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
-  bool IsSmiOnly() const { return is_smi_only_; }

   // Bailout support.
   int RightId() const { return right_id_; }
@@ -1431,7 +1427,6 @@
   Expression* left_;
   Expression* right_;
   int pos_;
-  bool is_smi_only_;
   // The short-circuit logical operations have an AST ID for their
   // right-hand subexpression.
   int right_id_;
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Thu Jan 27 00:35:39 2011
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Jan 27 06:04:07 2011
@@ -3390,7 +3390,6 @@
   // We have a second position recorded in the FullCodeGenerator to have
   // type feedback for the binary operation.
   BinaryOperation* operation = expr->binary_operation();
-  operation->RecordTypeFeedback(oracle());

   if (var != NULL) {
     if (!var->is_global() && !var->IsStackAllocated()) {
@@ -4814,7 +4813,7 @@
     default:
       UNREACHABLE();
   }
-  TypeInfo info = oracle()->BinaryType(expr, TypeFeedbackOracle::RESULT);
+  TypeInfo info = oracle()->BinaryType(expr);
   // If we hit an uninitialized binary op stub we will get type info
   // for a smi operation. If one of the operands is a constant string
   // do not generate code assuming it is a smi operation.
@@ -4965,7 +4964,7 @@
   HValue* left = Pop();
   Token::Value op = expr->op();

-  TypeInfo info = oracle()->CompareType(expr, TypeFeedbackOracle::RESULT);
+  TypeInfo info = oracle()->CompareType(expr);
   HInstruction* instr = NULL;
   if (op == Token::INSTANCEOF) {
     // Check to see if the rhs of the instanceof is a global function not
=======================================
--- /branches/bleeding_edge/src/type-info.cc    Tue Jan 18 08:54:48 2011
+++ /branches/bleeding_edge/src/type-info.cc    Thu Jan 27 06:04:07 2011
@@ -171,7 +171,7 @@
 }


-TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) {
+TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr) {
   Handle<Object> object = GetElement(map_, expr->position());
   TypeInfo unknown = TypeInfo::Unknown();
   if (!object->IsCode()) return unknown;
@@ -198,7 +198,7 @@
 }


-TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr, Side side) {
+TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr) {
   Handle<Object> object = GetElement(map_, expr->position());
   TypeInfo unknown = TypeInfo::Unknown();
   if (!object->IsCode()) return unknown;
=======================================
--- /branches/bleeding_edge/src/type-info.h     Tue Jan 18 08:54:48 2011
+++ /branches/bleeding_edge/src/type-info.h     Thu Jan 27 06:04:07 2011
@@ -236,12 +236,6 @@

 class TypeFeedbackOracle BASE_EMBEDDED {
  public:
-  enum Side {
-    LEFT,
-    RIGHT,
-    RESULT
-  };
-
   TypeFeedbackOracle(Handle<Code> code, Handle<Context> global_context);

   bool LoadIsMonomorphic(Property* expr);
@@ -261,8 +255,8 @@
   bool LoadIsBuiltin(Property* expr, Builtins::Name id);

   // Get type information for arithmetic operations and compares.
-  TypeInfo BinaryType(BinaryOperation* expr, Side side);
-  TypeInfo CompareType(CompareOperation* expr, Side side);
+  TypeInfo BinaryType(BinaryOperation* expr);
+  TypeInfo CompareType(CompareOperation* expr);
   TypeInfo SwitchType(CaseClause* clause);

  private:

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to