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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2639853002: PPC/s390: Check for overflow when SubI IntMin (Closed)
Patch Set: addressed comments Created 3 years, 11 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/crankshaft/s390/lithium-codegen-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 const bool isInteger = !instr->hydrogen()->representation().IsSmi(); 1700 const bool isInteger = !instr->hydrogen()->representation().IsSmi();
1701 #else 1701 #else
1702 const bool isInteger = false; 1702 const bool isInteger = false;
1703 #endif 1703 #endif
1704 if (!can_overflow || isInteger) { 1704 if (!can_overflow || isInteger) {
1705 if (right->IsConstantOperand()) { 1705 if (right->IsConstantOperand()) {
1706 __ Add(result, left, -(ToOperand(right).immediate()), r0); 1706 __ Add(result, left, -(ToOperand(right).immediate()), r0);
1707 } else { 1707 } else {
1708 __ sub(result, left, EmitLoadRegister(right, ip)); 1708 __ sub(result, left, EmitLoadRegister(right, ip));
1709 } 1709 }
1710 if (can_overflow) {
1710 #if V8_TARGET_ARCH_PPC64 1711 #if V8_TARGET_ARCH_PPC64
1711 if (can_overflow) {
1712 __ TestIfInt32(result, r0); 1712 __ TestIfInt32(result, r0);
1713 #else
1714 __ TestIfInt32(scratch0(), result, r0);
1715 #endif
1713 DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow); 1716 DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow);
1714 } 1717 }
1715 #endif 1718
1716 } else { 1719 } else {
1717 if (right->IsConstantOperand()) { 1720 if (right->IsConstantOperand()) {
1718 __ AddAndCheckForOverflow(result, left, -(ToOperand(right).immediate()), 1721 __ AddAndCheckForOverflow(result, left, -(ToOperand(right).immediate()),
1719 scratch0(), r0); 1722 scratch0(), r0);
1720 } else { 1723 } else {
1721 __ SubAndCheckForOverflow(result, left, EmitLoadRegister(right, ip), 1724 __ SubAndCheckForOverflow(result, left, EmitLoadRegister(right, ip),
1722 scratch0(), r0); 1725 scratch0(), r0);
1723 } 1726 }
1724 DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0); 1727 DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0);
1725 } 1728 }
(...skipping 3911 matching lines...) Expand 10 before | Expand all | Expand 10 after
5637 __ LoadP(result, 5640 __ LoadP(result,
5638 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5641 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5639 __ bind(deferred->exit()); 5642 __ bind(deferred->exit());
5640 __ bind(&done); 5643 __ bind(&done);
5641 } 5644 }
5642 5645
5643 #undef __ 5646 #undef __
5644 5647
5645 } // namespace internal 5648 } // namespace internal
5646 } // namespace v8 5649 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698