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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 } 1672 }
1673 1673
1674 1674
1675 void LCodeGen::DoBitI(LBitI* instr) { 1675 void LCodeGen::DoBitI(LBitI* instr) {
1676 LOperand* left = instr->left(); 1676 LOperand* left = instr->left();
1677 LOperand* right = instr->right(); 1677 LOperand* right = instr->right();
1678 ASSERT(left->Equals(instr->result())); 1678 ASSERT(left->Equals(instr->result()));
1679 ASSERT(left->IsRegister()); 1679 ASSERT(left->IsRegister());
1680 1680
1681 if (right->IsConstantOperand()) { 1681 if (right->IsConstantOperand()) {
1682 int right_operand = ToRepresentation(LConstantOperand::cast(right), 1682 int32_t right_operand =
1683 instr->hydrogen()->representation()); 1683 ToRepresentation(LConstantOperand::cast(right),
1684 instr->hydrogen()->representation());
1684 switch (instr->op()) { 1685 switch (instr->op()) {
1685 case Token::BIT_AND: 1686 case Token::BIT_AND:
1686 __ and_(ToRegister(left), right_operand); 1687 __ and_(ToRegister(left), right_operand);
1687 break; 1688 break;
1688 case Token::BIT_OR: 1689 case Token::BIT_OR:
1689 __ or_(ToRegister(left), right_operand); 1690 __ or_(ToRegister(left), right_operand);
1690 break; 1691 break;
1691 case Token::BIT_XOR: 1692 case Token::BIT_XOR:
1692 __ xor_(ToRegister(left), right_operand); 1693 if (right_operand == int32_t(~0)) {
1694 __ not_(ToRegister(left));
1695 } else {
1696 __ xor_(ToRegister(left), right_operand);
1697 }
1693 break; 1698 break;
1694 default: 1699 default:
1695 UNREACHABLE(); 1700 UNREACHABLE();
1696 break; 1701 break;
1697 } 1702 }
1698 } else { 1703 } else {
1699 switch (instr->op()) { 1704 switch (instr->op()) {
1700 case Token::BIT_AND: 1705 case Token::BIT_AND:
1701 __ and_(ToRegister(left), ToOperand(right)); 1706 __ and_(ToRegister(left), ToOperand(right));
1702 break; 1707 break;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 if (encoding == String::ONE_BYTE_ENCODING) { 1988 if (encoding == String::ONE_BYTE_ENCODING) {
1984 __ mov_b(FieldOperand(string, index, times_1, SeqString::kHeaderSize), 1989 __ mov_b(FieldOperand(string, index, times_1, SeqString::kHeaderSize),
1985 value); 1990 value);
1986 } else { 1991 } else {
1987 __ mov_w(FieldOperand(string, index, times_2, SeqString::kHeaderSize), 1992 __ mov_w(FieldOperand(string, index, times_2, SeqString::kHeaderSize),
1988 value); 1993 value);
1989 } 1994 }
1990 } 1995 }
1991 1996
1992 1997
1993 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1994 LOperand* input = instr->value();
1995 ASSERT(input->Equals(instr->result()));
1996 __ not_(ToRegister(input));
1997 }
1998
1999
2000 void LCodeGen::DoThrow(LThrow* instr) { 1998 void LCodeGen::DoThrow(LThrow* instr) {
2001 __ push(ToOperand(instr->value())); 1999 __ push(ToOperand(instr->value()));
2002 ASSERT(ToRegister(instr->context()).is(esi)); 2000 ASSERT(ToRegister(instr->context()).is(esi));
2003 CallRuntime(Runtime::kThrow, 1, instr); 2001 CallRuntime(Runtime::kThrow, 1, instr);
2004 2002
2005 if (FLAG_debug_code) { 2003 if (FLAG_debug_code) {
2006 Comment("Unreachable code."); 2004 Comment("Unreachable code.");
2007 __ int3(); 2005 __ int3();
2008 } 2006 }
2009 } 2007 }
(...skipping 4522 matching lines...) Expand 10 before | Expand all | Expand 10 after
6532 FixedArray::kHeaderSize - kPointerSize)); 6530 FixedArray::kHeaderSize - kPointerSize));
6533 __ bind(&done); 6531 __ bind(&done);
6534 } 6532 }
6535 6533
6536 6534
6537 #undef __ 6535 #undef __
6538 6536
6539 } } // namespace v8::internal 6537 } } // namespace v8::internal
6540 6538
6541 #endif // V8_TARGET_ARCH_IA32 6539 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698