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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Feedback. Created 7 years, 4 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 } 1502 }
1503 1503
1504 switch (instr->op()) { 1504 switch (instr->op()) {
1505 case Token::BIT_AND: 1505 case Token::BIT_AND:
1506 __ And(result, left, right); 1506 __ And(result, left, right);
1507 break; 1507 break;
1508 case Token::BIT_OR: 1508 case Token::BIT_OR:
1509 __ Or(result, left, right); 1509 __ Or(result, left, right);
1510 break; 1510 break;
1511 case Token::BIT_XOR: 1511 case Token::BIT_XOR:
1512 __ Xor(result, left, right); 1512 if (right_op->IsConstantOperand() && right.immediate() == int32_t(~0)) {
1513 __ Nor(result, zero_reg, left);
1514 } else {
1515 __ Xor(result, left, right);
1516 }
1513 break; 1517 break;
1514 default: 1518 default:
1515 UNREACHABLE(); 1519 UNREACHABLE();
1516 break; 1520 break;
1517 } 1521 }
1518 } 1522 }
1519 1523
1520 1524
1521 void LCodeGen::DoShiftI(LShiftI* instr) { 1525 void LCodeGen::DoShiftI(LShiftI* instr) {
1522 // Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so 1526 // Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 __ Addu(at, scratch, index); 1784 __ Addu(at, scratch, index);
1781 __ sb(value, MemOperand(at)); 1785 __ sb(value, MemOperand(at));
1782 } else { 1786 } else {
1783 __ sll(at, index, 1); 1787 __ sll(at, index, 1);
1784 __ Addu(at, scratch, at); 1788 __ Addu(at, scratch, at);
1785 __ sh(value, MemOperand(at)); 1789 __ sh(value, MemOperand(at));
1786 } 1790 }
1787 } 1791 }
1788 1792
1789 1793
1790 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1791 Register input = ToRegister(instr->value());
1792 Register result = ToRegister(instr->result());
1793 __ Nor(result, zero_reg, Operand(input));
1794 }
1795
1796
1797 void LCodeGen::DoThrow(LThrow* instr) { 1794 void LCodeGen::DoThrow(LThrow* instr) {
1798 Register input_reg = EmitLoadRegister(instr->value(), at); 1795 Register input_reg = EmitLoadRegister(instr->value(), at);
1799 __ push(input_reg); 1796 __ push(input_reg);
1800 CallRuntime(Runtime::kThrow, 1, instr); 1797 CallRuntime(Runtime::kThrow, 1, instr);
1801 1798
1802 if (FLAG_debug_code) { 1799 if (FLAG_debug_code) {
1803 __ stop("Unreachable code."); 1800 __ stop("Unreachable code.");
1804 } 1801 }
1805 } 1802 }
1806 1803
(...skipping 4048 matching lines...) Expand 10 before | Expand all | Expand 10 after
5855 __ Subu(scratch, result, scratch); 5852 __ Subu(scratch, result, scratch);
5856 __ lw(result, FieldMemOperand(scratch, 5853 __ lw(result, FieldMemOperand(scratch,
5857 FixedArray::kHeaderSize - kPointerSize)); 5854 FixedArray::kHeaderSize - kPointerSize));
5858 __ bind(&done); 5855 __ bind(&done);
5859 } 5856 }
5860 5857
5861 5858
5862 #undef __ 5859 #undef __
5863 5860
5864 } } // namespace v8::internal 5861 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698