OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 } | 1900 } |
1901 | 1901 |
1902 | 1902 |
1903 void LCodeGen::DoAddI(LAddI* instr) { | 1903 void LCodeGen::DoAddI(LAddI* instr) { |
1904 LOperand* left = instr->left(); | 1904 LOperand* left = instr->left(); |
1905 LOperand* right = instr->right(); | 1905 LOperand* right = instr->right(); |
1906 LOperand* result = instr->result(); | 1906 LOperand* result = instr->result(); |
1907 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); | 1907 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
1908 | 1908 |
1909 if (!can_overflow) { | 1909 if (!can_overflow) { |
1910 DCHECK(right->IsRegister()); | 1910 DCHECK(right->IsRegister() || right->IsConstantOperand()); |
1911 __ Daddu(ToRegister(result), ToRegister(left), ToOperand(right)); | 1911 __ Daddu(ToRegister(result), ToRegister(left), ToOperand(right)); |
1912 } else { // can_overflow. | 1912 } else { // can_overflow. |
1913 Register overflow = scratch0(); | 1913 Register overflow = scratch0(); |
1914 Register scratch = scratch1(); | 1914 Register scratch = scratch1(); |
1915 if (right->IsConstantOperand()) { | 1915 if (right->IsConstantOperand()) { |
1916 Register right_reg = EmitLoadRegister(right, scratch); | 1916 Register right_reg = EmitLoadRegister(right, scratch); |
1917 __ AdduAndCheckForOverflow(ToRegister(result), | 1917 __ AdduAndCheckForOverflow(ToRegister(result), |
1918 ToRegister(left), | 1918 ToRegister(left), |
1919 right_reg, | 1919 right_reg, |
1920 overflow); // Reg at also used as scratch. | 1920 overflow); // Reg at also used as scratch. |
(...skipping 4202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6123 __ Push(at, ToRegister(instr->function())); | 6123 __ Push(at, ToRegister(instr->function())); |
6124 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6124 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6125 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6125 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6126 } | 6126 } |
6127 | 6127 |
6128 | 6128 |
6129 #undef __ | 6129 #undef __ |
6130 | 6130 |
6131 } // namespace internal | 6131 } // namespace internal |
6132 } // namespace v8 | 6132 } // namespace v8 |
OLD | NEW |