Reviewers: Sven Panne,

Description:
Clean some unuse code of unary negation

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

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

Affected files:
  M     src/ast.cc
  M     src/code-stubs.cc
  M     src/hydrogen.h


Index: src/ast.cc
===================================================================
--- src/ast.cc  (revision 16035)
+++ src/ast.cc  (working copy)
@@ -307,7 +307,6 @@
 bool UnaryOperation::ResultOverwriteAllowed() {
   switch (op_) {
     case Token::BIT_NOT:
-    case Token::SUB:
       return true;
     default:
       return false;
Index: src/code-stubs.cc
===================================================================
--- src/code-stubs.cc   (revision 16035)
+++ src/code-stubs.cc   (working copy)
@@ -208,8 +208,6 @@
   switch (operation_) {
     default:
       UNREACHABLE();
-    case Token::SUB:
-      return Builtins::UNARY_MINUS;
     case Token::BIT_NOT:
       return Builtins::BIT_NOT;
   }
@@ -239,10 +237,6 @@
   State old_state(state_);
   if (object->IsSmi()) {
     state_.Add(SMI);
-    if (operation_ == Token::SUB && *object == 0) {
-      // The result (-0) has to be represented as double.
-      state_.Add(HEAP_NUMBER);
-    }
   } else if (object->IsHeapNumber()) {
     state_.Add(HEAP_NUMBER);
   } else {
@@ -356,7 +350,6 @@

 void UnaryOpStub::PrintBaseName(StringStream* stream) {
   CodeStub::PrintBaseName(stream);
-  if (operation_ == Token::SUB) stream->Add("Minus");
   if (operation_ == Token::BIT_NOT) stream->Add("Not");
 }

Index: src/hydrogen.h
===================================================================
--- src/hydrogen.h      (revision 16035)
+++ src/hydrogen.h      (working copy)
@@ -1807,7 +1807,6 @@
   void VisitDelete(UnaryOperation* expr);
   void VisitVoid(UnaryOperation* expr);
   void VisitTypeof(UnaryOperation* expr);
-  void VisitSub(UnaryOperation* expr);
   void VisitBitNot(UnaryOperation* expr);
   void VisitNot(UnaryOperation* expr);



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