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

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

Issue 1824023002: VM: Fix a couple of issues in the AOT optimizer, add fast path smi multiply. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 summary->set_in(0, Location::RequiresRegister()); 2822 summary->set_in(0, Location::RequiresRegister());
2823 summary->set_in(1, Location::RequiresRegister()); 2823 summary->set_in(1, Location::RequiresRegister());
2824 switch (op_kind()) { 2824 switch (op_kind()) {
2825 case Token::kEQ: 2825 case Token::kEQ:
2826 case Token::kLT: 2826 case Token::kLT:
2827 case Token::kLTE: 2827 case Token::kLTE:
2828 case Token::kGT: 2828 case Token::kGT:
2829 case Token::kGTE: 2829 case Token::kGTE:
2830 case Token::kADD: 2830 case Token::kADD:
2831 case Token::kSUB: 2831 case Token::kSUB:
2832 case Token::kMUL:
2832 summary->set_out(0, Location::RequiresRegister()); 2833 summary->set_out(0, Location::RequiresRegister());
2833 break; 2834 break;
2834 case Token::kBIT_OR: 2835 case Token::kBIT_OR:
2835 case Token::kBIT_AND: 2836 case Token::kBIT_AND:
2836 case Token::kBIT_XOR: 2837 case Token::kBIT_XOR:
2837 summary->set_out(0, Location::SameAsFirstInput()); 2838 summary->set_out(0, Location::SameAsFirstInput());
2838 break; 2839 break;
2839 default: 2840 default:
2840 UNIMPLEMENTED(); 2841 UNIMPLEMENTED();
2841 } 2842 }
(...skipping 17 matching lines...) Expand all
2859 case Token::kADD: 2860 case Token::kADD:
2860 __ movq(result, left); 2861 __ movq(result, left);
2861 __ addq(result, right); 2862 __ addq(result, right);
2862 __ j(OVERFLOW, slow_path->entry_label()); 2863 __ j(OVERFLOW, slow_path->entry_label());
2863 break; 2864 break;
2864 case Token::kSUB: 2865 case Token::kSUB:
2865 __ movq(result, left); 2866 __ movq(result, left);
2866 __ subq(result, right); 2867 __ subq(result, right);
2867 __ j(OVERFLOW, slow_path->entry_label()); 2868 __ j(OVERFLOW, slow_path->entry_label());
2868 break; 2869 break;
2870 case Token::kMUL:
2871 __ movq(result, left);
2872 __ SmiUntag(result);
2873 __ imulq(result, right);
2874 __ j(OVERFLOW, slow_path->entry_label());
2875 break;
2869 case Token::kBIT_OR: 2876 case Token::kBIT_OR:
2870 ASSERT(left == result); 2877 ASSERT(left == result);
2871 __ orq(result, right); 2878 __ orq(result, right);
2872 break; 2879 break;
2873 case Token::kBIT_AND: 2880 case Token::kBIT_AND:
2874 ASSERT(left == result); 2881 ASSERT(left == result);
2875 __ andq(result, right); 2882 __ andq(result, right);
2876 break; 2883 break;
2877 case Token::kBIT_XOR: 2884 case Token::kBIT_XOR:
2878 ASSERT(left == result); 2885 ASSERT(left == result);
(...skipping 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after
6507 __ Drop(1); 6514 __ Drop(1);
6508 __ popq(result); 6515 __ popq(result);
6509 } 6516 }
6510 6517
6511 6518
6512 } // namespace dart 6519 } // namespace dart
6513 6520
6514 #undef __ 6521 #undef __
6515 6522
6516 #endif // defined TARGET_ARCH_X64 6523 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/aot_optimizer.cc ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698