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

Side by Side Diff: runtime/vm/intrinsifier_x64.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_mips.cc ('k') | runtime/vm/object.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 696
697 // Implementation: 697 // Implementation:
698 // res = left % right; 698 // res = left % right;
699 // if (res < 0) { 699 // if (res < 0) {
700 // if (right < 0) { 700 // if (right < 0) {
701 // res = res - right; 701 // res = res - right;
702 // } else { 702 // } else {
703 // res = res + right; 703 // res = res + right;
704 // } 704 // }
705 // } 705 // }
706 bool Intrinsifier::Integer_modulo(Assembler* assembler) { 706 bool Intrinsifier::Integer_moduloFromInteger(Assembler* assembler) {
707 Label fall_through, negative_result; 707 Label fall_through, negative_result;
708 TestBothArgumentsSmis(assembler, &fall_through); 708 TestBothArgumentsSmis(assembler, &fall_through);
709 // RAX: right argument (divisor) 709 __ movq(RCX, Address(RSP, + 2 * kWordSize));
710 __ movq(RCX, RAX);
711 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument (dividend).
712 // RAX: Tagged left (dividend). 710 // RAX: Tagged left (dividend).
713 // RCX: Tagged right (divisor). 711 // RCX: Tagged right (divisor).
714 __ cmpq(RCX, Immediate(0)); 712 __ cmpq(RCX, Immediate(0));
715 __ j(EQUAL, &fall_through); 713 __ j(EQUAL, &fall_through);
716 EmitRemainderOperation(assembler); 714 EmitRemainderOperation(assembler);
717 // Untagged remainder result in RAX. 715 // Untagged remainder result in RAX.
718 __ cmpq(RAX, Immediate(0)); 716 __ cmpq(RAX, Immediate(0));
719 __ j(LESS, &negative_result, Assembler::kNearJump); 717 __ j(LESS, &negative_result, Assembler::kNearJump);
720 __ SmiTag(RAX); 718 __ SmiTag(RAX);
721 __ ret(); 719 __ ret();
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 __ Bind(&fall_through); 1687 __ Bind(&fall_through);
1690 return false; 1688 return false;
1691 } 1689 }
1692 1690
1693 1691
1694 #undef __ 1692 #undef __
1695 1693
1696 } // namespace dart 1694 } // namespace dart
1697 1695
1698 #endif // defined TARGET_ARCH_X64 1696 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698