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

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

Issue 20323002: Add Smi support to Shl (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM / x64 Created 7 years, 5 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 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 case Token::SHR: 1755 case Token::SHR:
1756 if (shift_count == 0 && instr->can_deopt()) { 1756 if (shift_count == 0 && instr->can_deopt()) {
1757 __ test(ToRegister(left), Immediate(0x80000000)); 1757 __ test(ToRegister(left), Immediate(0x80000000));
1758 DeoptimizeIf(not_zero, instr->environment()); 1758 DeoptimizeIf(not_zero, instr->environment());
1759 } else { 1759 } else {
1760 __ shr(ToRegister(left), shift_count); 1760 __ shr(ToRegister(left), shift_count);
1761 } 1761 }
1762 break; 1762 break;
1763 case Token::SHL: 1763 case Token::SHL:
1764 if (shift_count != 0) { 1764 if (shift_count != 0) {
1765 __ shl(ToRegister(left), shift_count); 1765 if (instr->hydrogen_value()->representation().IsSmi() &&
1766 instr->can_deopt()) {
1767 __ shl(ToRegister(left), shift_count - 1);
1768 __ SmiTag(ToRegister(left));
1769 DeoptimizeIf(overflow, instr->environment());
1770 } else {
1771 __ shl(ToRegister(left), shift_count);
1772 }
1766 } 1773 }
1767 break; 1774 break;
1768 default: 1775 default:
1769 UNREACHABLE(); 1776 UNREACHABLE();
1770 break; 1777 break;
1771 } 1778 }
1772 } 1779 }
1773 } 1780 }
1774 1781
1775 1782
(...skipping 4723 matching lines...) Expand 10 before | Expand all | Expand 10 after
6499 FixedArray::kHeaderSize - kPointerSize)); 6506 FixedArray::kHeaderSize - kPointerSize));
6500 __ bind(&done); 6507 __ bind(&done);
6501 } 6508 }
6502 6509
6503 6510
6504 #undef __ 6511 #undef __
6505 6512
6506 } } // namespace v8::internal 6513 } } // namespace v8::internal
6507 6514
6508 #endif // V8_TARGET_ARCH_IA32 6515 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | src/ia32/lithium-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698