Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: src/hydrogen.cc

Issue 6461021: Add a genuine unary minus instruction to Crankshaft.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4624 matching lines...) Expand 10 before | Expand all | Expand 10 after
4635 } 4635 }
4636 } else if (op == Token::BIT_NOT || op == Token::SUB) { 4636 } else if (op == Token::BIT_NOT || op == Token::SUB) {
4637 VISIT_FOR_VALUE(expr->expression()); 4637 VISIT_FOR_VALUE(expr->expression());
4638 HValue* value = Pop(); 4638 HValue* value = Pop();
4639 HInstruction* instr = NULL; 4639 HInstruction* instr = NULL;
4640 switch (op) { 4640 switch (op) {
4641 case Token::BIT_NOT: 4641 case Token::BIT_NOT:
4642 instr = new HBitNot(value); 4642 instr = new HBitNot(value);
4643 break; 4643 break;
4644 case Token::SUB: 4644 case Token::SUB:
4645 instr = new HMul(graph_->GetConstantMinus1(), value); 4645 instr = new HNeg(value);
4646 break; 4646 break;
4647 default: 4647 default:
4648 UNREACHABLE(); 4648 UNREACHABLE();
4649 break; 4649 break;
4650 } 4650 }
4651 ast_context()->ReturnInstruction(instr, expr->id()); 4651 ast_context()->ReturnInstruction(instr, expr->id());
4652 } else if (op == Token::TYPEOF) { 4652 } else if (op == Token::TYPEOF) {
4653 VISIT_FOR_VALUE(expr->expression()); 4653 VISIT_FOR_VALUE(expr->expression());
4654 HValue* value = Pop(); 4654 HValue* value = Pop();
4655 ast_context()->ReturnInstruction(new HTypeof(value), expr->id()); 4655 ast_context()->ReturnInstruction(new HTypeof(value), expr->id());
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
5818 UseInterval* cur_interval = range->first_interval(); 5818 UseInterval* cur_interval = range->first_interval();
5819 while (cur_interval != NULL) { 5819 while (cur_interval != NULL) {
5820 trace_.Add(" [%d, %d[", 5820 trace_.Add(" [%d, %d[",
5821 cur_interval->start().Value(), 5821 cur_interval->start().Value(),
5822 cur_interval->end().Value()); 5822 cur_interval->end().Value());
5823 cur_interval = cur_interval->next(); 5823 cur_interval = cur_interval->next();
5824 } 5824 }
5825 5825
5826 UsePosition* current_pos = range->first_pos(); 5826 UsePosition* current_pos = range->first_pos();
5827 while (current_pos != NULL) { 5827 while (current_pos != NULL) {
5828 if (current_pos->RegisterIsBeneficial()) { 5828 if (current_pos->RegisterIsBeneficial() || FLAG_trace_all_uses) {
5829 trace_.Add(" %d M", current_pos->pos().Value()); 5829 trace_.Add(" %d M", current_pos->pos().Value());
5830 } 5830 }
5831 current_pos = current_pos->next(); 5831 current_pos = current_pos->next();
5832 } 5832 }
5833 5833
5834 trace_.Add(" \"\"\n"); 5834 trace_.Add(" \"\"\n");
5835 } 5835 }
5836 } 5836 }
5837 5837
5838 5838
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
5926 } 5926 }
5927 } 5927 }
5928 5928
5929 #ifdef DEBUG 5929 #ifdef DEBUG
5930 if (graph_ != NULL) graph_->Verify(); 5930 if (graph_ != NULL) graph_->Verify();
5931 if (allocator_ != NULL) allocator_->Verify(); 5931 if (allocator_ != NULL) allocator_->Verify();
5932 #endif 5932 #endif
5933 } 5933 }
5934 5934
5935 } } // namespace v8::internal 5935 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698