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

Side by Side Diff: runtime/vm/intrinsifier_mips.cc

Issue 22839003: Polymorphic inlining for some recognized methods in the optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed modulo performance regression Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 714
715 // Implementation: 715 // Implementation:
716 // res = left % right; 716 // res = left % right;
717 // if (res < 0) { 717 // if (res < 0) {
718 // if (right < 0) { 718 // if (right < 0) {
719 // res = res - right; 719 // res = res - right;
720 // } else { 720 // } else {
721 // res = res + right; 721 // res = res + right;
722 // } 722 // }
723 // } 723 // }
724 bool Intrinsifier::Integer_modulo(Assembler* assembler) { 724 bool Intrinsifier::Integer_moduloFromInteger(Assembler* assembler) {
725 Label fall_through, subtract; 725 Label fall_through, subtract;
726 TestBothArgumentsSmis(assembler, &fall_through); 726 // Test arguments for smi.
727 __ lw(T1, Address(SP, 0 * kWordSize));
728 __ lw(T0, Address(SP, 1 * kWordSize));
729 __ or_(CMPRES, T0, T1);
730 __ andi(CMPRES, CMPRES, Immediate(kSmiTagMask));
731 __ bne(CMPRES, ZR, &fall_through);
727 // T1: Tagged left (dividend). 732 // T1: Tagged left (dividend).
728 // T0: Tagged right (divisor). 733 // T0: Tagged right (divisor).
729 // Check if modulo by zero -> exception thrown in main function. 734 // Check if modulo by zero -> exception thrown in main function.
730 __ beq(T0, ZR, &fall_through); 735 __ beq(T0, ZR, &fall_through);
731 EmitRemainderOperation(assembler); 736 EmitRemainderOperation(assembler);
732 // Untagged right in T0. Untagged remainder result in V0. 737 // Untagged right in T0. Untagged remainder result in V0.
733 738
734 Label done; 739 Label done;
735 __ bgez(V0, &done); 740 __ bgez(V0, &done);
736 __ bltz(T0, &subtract); 741 __ bltz(T0, &subtract);
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 __ Bind(&ok); 1780 __ Bind(&ok);
1776 __ Ret(); 1781 __ Ret();
1777 1782
1778 __ Bind(&fall_through); 1783 __ Bind(&fall_through);
1779 return false; 1784 return false;
1780 } 1785 }
1781 1786
1782 } // namespace dart 1787 } // namespace dart
1783 1788
1784 #endif // defined TARGET_ARCH_MIPS 1789 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698