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

Side by Side Diff: src/arm/lithium-codegen-arm.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 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 } 1662 }
1663 1663
1664 switch (instr->op()) { 1664 switch (instr->op()) {
1665 case Token::BIT_AND: 1665 case Token::BIT_AND:
1666 __ and_(result, left, right); 1666 __ and_(result, left, right);
1667 break; 1667 break;
1668 case Token::BIT_OR: 1668 case Token::BIT_OR:
1669 __ orr(result, left, right); 1669 __ orr(result, left, right);
1670 break; 1670 break;
1671 case Token::BIT_XOR: 1671 case Token::BIT_XOR:
1672 __ eor(result, left, right); 1672 if (right_op->IsConstantOperand() && right.immediate() == int32_t(~0)) {
1673 __ mvn(result, Operand(left));
1674 } else {
1675 __ eor(result, left, right);
1676 }
1673 break; 1677 break;
1674 default: 1678 default:
1675 UNREACHABLE(); 1679 UNREACHABLE();
1676 break; 1680 break;
1677 } 1681 }
1678 } 1682 }
1679 1683
1680 1684
1681 void LCodeGen::DoShiftI(LShiftI* instr) { 1685 void LCodeGen::DoShiftI(LShiftI* instr) {
1682 // Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so 1686 // Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 __ strb(value, MemOperand(ip, index)); 1950 __ strb(value, MemOperand(ip, index));
1947 } else { 1951 } else {
1948 // MemOperand with ip as the base register is not allowed for strh, so 1952 // MemOperand with ip as the base register is not allowed for strh, so
1949 // we do the address calculation explicitly. 1953 // we do the address calculation explicitly.
1950 __ add(ip, ip, Operand(index, LSL, 1)); 1954 __ add(ip, ip, Operand(index, LSL, 1));
1951 __ strh(value, MemOperand(ip)); 1955 __ strh(value, MemOperand(ip));
1952 } 1956 }
1953 } 1957 }
1954 1958
1955 1959
1956 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1957 Register input = ToRegister(instr->value());
1958 Register result = ToRegister(instr->result());
1959 __ mvn(result, Operand(input));
1960 }
1961
1962
1963 void LCodeGen::DoThrow(LThrow* instr) { 1960 void LCodeGen::DoThrow(LThrow* instr) {
1964 Register input_reg = EmitLoadRegister(instr->value(), ip); 1961 Register input_reg = EmitLoadRegister(instr->value(), ip);
1965 __ push(input_reg); 1962 __ push(input_reg);
1966 CallRuntime(Runtime::kThrow, 1, instr); 1963 CallRuntime(Runtime::kThrow, 1, instr);
1967 1964
1968 if (FLAG_debug_code) { 1965 if (FLAG_debug_code) {
1969 __ stop("Unreachable code."); 1966 __ stop("Unreachable code.");
1970 } 1967 }
1971 } 1968 }
1972 1969
(...skipping 3866 matching lines...) Expand 10 before | Expand all | Expand 10 after
5839 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5836 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5840 __ ldr(result, FieldMemOperand(scratch, 5837 __ ldr(result, FieldMemOperand(scratch,
5841 FixedArray::kHeaderSize - kPointerSize)); 5838 FixedArray::kHeaderSize - kPointerSize));
5842 __ bind(&done); 5839 __ bind(&done);
5843 } 5840 }
5844 5841
5845 5842
5846 #undef __ 5843 #undef __
5847 5844
5848 } } // namespace v8::internal 5845 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/ast.h » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698