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()) { |
1915 } | 1920 __ add(ToOperand(left), ToInteger32Immediate(right)); |
1916 | 1921 } else { |
1917 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 1922 __ add(ToRegister(left), ToOperand(right)); |
1918 DeoptimizeIf(overflow, instr->environment()); | 1923 } |
| 1924 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
| 1925 DeoptimizeIf(overflow, instr->environment()); |
| 1926 } |
1919 } | 1927 } |
1920 } | 1928 } |
1921 | 1929 |
1922 | 1930 |
1923 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { | 1931 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
1924 CpuFeatureScope scope(masm(), SSE2); | 1932 CpuFeatureScope scope(masm(), SSE2); |
1925 LOperand* left = instr->left(); | 1933 LOperand* left = instr->left(); |
1926 LOperand* right = instr->right(); | 1934 LOperand* right = instr->right(); |
1927 ASSERT(left->Equals(instr->result())); | 1935 ASSERT(left->Equals(instr->result())); |
1928 HMathMinMax::Operation operation = instr->hydrogen()->operation(); | 1936 HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
(...skipping 4678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6607 FixedArray::kHeaderSize - kPointerSize)); | 6615 FixedArray::kHeaderSize - kPointerSize)); |
6608 __ bind(&done); | 6616 __ bind(&done); |
6609 } | 6617 } |
6610 | 6618 |
6611 | 6619 |
6612 #undef __ | 6620 #undef __ |
6613 | 6621 |
6614 } } // namespace v8::internal | 6622 } } // namespace v8::internal |
6615 | 6623 |
6616 #endif // V8_TARGET_ARCH_IA32 | 6624 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |