OLD | NEW |
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 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 if (FLAG_debug_code) { | 1899 if (FLAG_debug_code) { |
1900 Comment("Unreachable code."); | 1900 Comment("Unreachable code."); |
1901 __ int3(); | 1901 __ int3(); |
1902 } | 1902 } |
1903 } | 1903 } |
1904 | 1904 |
1905 | 1905 |
1906 void LCodeGen::DoAddI(LAddI* instr) { | 1906 void LCodeGen::DoAddI(LAddI* instr) { |
1907 LOperand* left = instr->left(); | 1907 LOperand* left = instr->left(); |
1908 LOperand* right = instr->right(); | 1908 LOperand* right = instr->right(); |
1909 ASSERT(left->Equals(instr->result())); | |
1910 | 1909 |
1911 if (right->IsConstantOperand()) { | 1910 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { |
1912 __ add(ToOperand(left), ToInteger32Immediate(right)); | 1911 if (right->IsConstantOperand()) { |
| 1912 int32_t offset = ToInteger32(LConstantOperand::cast(right)); |
| 1913 __ lea(ToRegister(instr->result()), MemOperand(ToRegister(left), offset)); |
| 1914 } else { |
| 1915 Operand address(ToRegister(left), ToRegister(right), times_1, 0); |
| 1916 __ lea(ToRegister(instr->result()), address); |
| 1917 } |
1913 } else { | 1918 } else { |
1914 __ add(ToRegister(left), ToOperand(right)); | 1919 if (right->IsConstantOperand()) { |
| 1920 __ add(ToOperand(left), ToInteger32Immediate(right)); |
| 1921 } else { |
| 1922 __ add(ToRegister(left), ToOperand(right)); |
| 1923 } |
1915 } | 1924 } |
1916 | 1925 |
1917 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 1926 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
1918 DeoptimizeIf(overflow, instr->environment()); | 1927 DeoptimizeIf(overflow, instr->environment()); |
1919 } | 1928 } |
1920 } | 1929 } |
1921 | 1930 |
1922 | 1931 |
1923 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { | 1932 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
1924 CpuFeatureScope scope(masm(), SSE2); | 1933 CpuFeatureScope scope(masm(), SSE2); |
(...skipping 4715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6640 FixedArray::kHeaderSize - kPointerSize)); | 6649 FixedArray::kHeaderSize - kPointerSize)); |
6641 __ bind(&done); | 6650 __ bind(&done); |
6642 } | 6651 } |
6643 | 6652 |
6644 | 6653 |
6645 #undef __ | 6654 #undef __ |
6646 | 6655 |
6647 } } // namespace v8::internal | 6656 } } // namespace v8::internal |
6648 | 6657 |
6649 #endif // V8_TARGET_ARCH_IA32 | 6658 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |