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())); |
1909 | 1910 |
1910 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { | 1911 if (right->IsConstantOperand()) { |
1911 if (right->IsConstantOperand()) { | 1912 __ add(ToOperand(left), ToInteger32Immediate(right)); |
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 } | |
1918 } else { | 1913 } else { |
1919 if (right->IsConstantOperand()) { | 1914 __ add(ToRegister(left), ToOperand(right)); |
1920 __ add(ToOperand(left), ToInteger32Immediate(right)); | 1915 } |
1921 } else { | 1916 |
1922 __ add(ToRegister(left), ToOperand(right)); | 1917 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
1923 } | 1918 DeoptimizeIf(overflow, instr->environment()); |
1924 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | |
1925 DeoptimizeIf(overflow, instr->environment()); | |
1926 } | |
1927 } | 1919 } |
1928 } | 1920 } |
1929 | 1921 |
1930 | 1922 |
1931 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { | 1923 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
1932 CpuFeatureScope scope(masm(), SSE2); | 1924 CpuFeatureScope scope(masm(), SSE2); |
1933 LOperand* left = instr->left(); | 1925 LOperand* left = instr->left(); |
1934 LOperand* right = instr->right(); | 1926 LOperand* right = instr->right(); |
1935 ASSERT(left->Equals(instr->result())); | 1927 ASSERT(left->Equals(instr->result())); |
1936 HMathMinMax::Operation operation = instr->hydrogen()->operation(); | 1928 HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
(...skipping 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6605 FixedArray::kHeaderSize - kPointerSize)); | 6597 FixedArray::kHeaderSize - kPointerSize)); |
6606 __ bind(&done); | 6598 __ bind(&done); |
6607 } | 6599 } |
6608 | 6600 |
6609 | 6601 |
6610 #undef __ | 6602 #undef __ |
6611 | 6603 |
6612 } } // namespace v8::internal | 6604 } } // namespace v8::internal |
6613 | 6605 |
6614 #endif // V8_TARGET_ARCH_IA32 | 6606 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |