Clean some unuse code of unary negation

R=svenpanne@chromium.org

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

Patch from Weiliang Lin <weiliang.lin2@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ea38ee87
...@@ -307,7 +307,6 @@ void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { ...@@ -307,7 +307,6 @@ void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
bool UnaryOperation::ResultOverwriteAllowed() { bool UnaryOperation::ResultOverwriteAllowed() {
switch (op_) { switch (op_) {
case Token::BIT_NOT: case Token::BIT_NOT:
case Token::SUB:
return true; return true;
default: default:
return false; return false;
......
...@@ -208,8 +208,6 @@ Builtins::JavaScript UnaryOpStub::ToJSBuiltin() { ...@@ -208,8 +208,6 @@ Builtins::JavaScript UnaryOpStub::ToJSBuiltin() {
switch (operation_) { switch (operation_) {
default: default:
UNREACHABLE(); UNREACHABLE();
case Token::SUB:
return Builtins::UNARY_MINUS;
case Token::BIT_NOT: case Token::BIT_NOT:
return Builtins::BIT_NOT; return Builtins::BIT_NOT;
} }
...@@ -239,10 +237,6 @@ void UnaryOpStub::UpdateStatus(Handle<Object> object) { ...@@ -239,10 +237,6 @@ void UnaryOpStub::UpdateStatus(Handle<Object> object) {
State old_state(state_); State old_state(state_);
if (object->IsSmi()) { if (object->IsSmi()) {
state_.Add(SMI); 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()) { } else if (object->IsHeapNumber()) {
state_.Add(HEAP_NUMBER); state_.Add(HEAP_NUMBER);
} else { } else {
...@@ -356,7 +350,6 @@ void BinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) { ...@@ -356,7 +350,6 @@ void BinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) {
void UnaryOpStub::PrintBaseName(StringStream* stream) { void UnaryOpStub::PrintBaseName(StringStream* stream) {
CodeStub::PrintBaseName(stream); CodeStub::PrintBaseName(stream);
if (operation_ == Token::SUB) stream->Add("Minus");
if (operation_ == Token::BIT_NOT) stream->Add("Not"); if (operation_ == Token::BIT_NOT) stream->Add("Not");
} }
......
...@@ -1807,7 +1807,6 @@ class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { ...@@ -1807,7 +1807,6 @@ class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor {
void VisitDelete(UnaryOperation* expr); void VisitDelete(UnaryOperation* expr);
void VisitVoid(UnaryOperation* expr); void VisitVoid(UnaryOperation* expr);
void VisitTypeof(UnaryOperation* expr); void VisitTypeof(UnaryOperation* expr);
void VisitSub(UnaryOperation* expr);
void VisitBitNot(UnaryOperation* expr); void VisitBitNot(UnaryOperation* expr);
void VisitNot(UnaryOperation* expr); void VisitNot(UnaryOperation* expr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment