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

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

Issue 1187063002: MIPS: Fix for Remove unsafe EmitLoadRegister usage in AddI/SubI for constant right operand. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Specify scratch reg to Overflow macros, to avoid 'at' reg conflict. Created 5 years, 6 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
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 Register scratch = scratch1(); 1674 Register scratch = scratch1();
1675 if (right->IsStackSlot()) { 1675 if (right->IsStackSlot()) {
1676 Register right_reg = EmitLoadRegister(right, scratch); 1676 Register right_reg = EmitLoadRegister(right, scratch);
1677 __ SubuAndCheckForOverflow(ToRegister(result), 1677 __ SubuAndCheckForOverflow(ToRegister(result),
1678 ToRegister(left), 1678 ToRegister(left),
1679 right_reg, 1679 right_reg,
1680 overflow); // Reg at also used as scratch. 1680 overflow); // Reg at also used as scratch.
1681 } else { 1681 } else {
1682 DCHECK(right->IsRegister() || right->IsConstantOperand()); 1682 DCHECK(right->IsRegister() || right->IsConstantOperand());
1683 __ SubuAndCheckForOverflow(ToRegister(result), ToRegister(left), 1683 __ SubuAndCheckForOverflow(ToRegister(result), ToRegister(left),
1684 ToOperand(right), 1684 ToOperand(right), overflow, scratch);
1685 overflow); // Reg at also used as scratch.
1686 } 1685 }
1687 DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow, 1686 DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow,
1688 Operand(zero_reg)); 1687 Operand(zero_reg));
1689 } 1688 }
1690 } 1689 }
1691 1690
1692 1691
1693 void LCodeGen::DoConstantI(LConstantI* instr) { 1692 void LCodeGen::DoConstantI(LConstantI* instr) {
1694 __ li(ToRegister(instr->result()), Operand(instr->value())); 1693 __ li(ToRegister(instr->result()), Operand(instr->value()));
1695 } 1694 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 Register scratch = scratch1(); 1870 Register scratch = scratch1();
1872 if (right->IsStackSlot()) { 1871 if (right->IsStackSlot()) {
1873 Register right_reg = EmitLoadRegister(right, scratch); 1872 Register right_reg = EmitLoadRegister(right, scratch);
1874 __ AdduAndCheckForOverflow(ToRegister(result), 1873 __ AdduAndCheckForOverflow(ToRegister(result),
1875 ToRegister(left), 1874 ToRegister(left),
1876 right_reg, 1875 right_reg,
1877 overflow); // Reg at also used as scratch. 1876 overflow); // Reg at also used as scratch.
1878 } else { 1877 } else {
1879 DCHECK(right->IsRegister() || right->IsConstantOperand()); 1878 DCHECK(right->IsRegister() || right->IsConstantOperand());
1880 __ AdduAndCheckForOverflow(ToRegister(result), ToRegister(left), 1879 __ AdduAndCheckForOverflow(ToRegister(result), ToRegister(left),
1881 ToOperand(right), 1880 ToOperand(right), overflow, scratch);
1882 overflow); // Reg at also used as scratch.
1883 } 1881 }
1884 DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow, 1882 DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow,
1885 Operand(zero_reg)); 1883 Operand(zero_reg));
1886 } 1884 }
1887 } 1885 }
1888 1886
1889 1887
1890 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { 1888 void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
1891 LOperand* left = instr->left(); 1889 LOperand* left = instr->left();
1892 LOperand* right = instr->right(); 1890 LOperand* right = instr->right();
(...skipping 4112 matching lines...) Expand 10 before | Expand all | Expand 10 after
6005 __ Push(at, ToRegister(instr->function())); 6003 __ Push(at, ToRegister(instr->function()));
6006 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6004 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6007 RecordSafepoint(Safepoint::kNoLazyDeopt); 6005 RecordSafepoint(Safepoint::kNoLazyDeopt);
6008 } 6006 }
6009 6007
6010 6008
6011 #undef __ 6009 #undef __
6012 6010
6013 } // namespace internal 6011 } // namespace internal
6014 } // namespace v8 6012 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698