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

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

Issue 1826463002: VM: Use propagated type to improve checked smi operations in aot compiler. (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
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_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 (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 2791 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 2802
2803 2803
2804 void CheckedSmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2804 void CheckedSmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2805 CheckedSmiSlowPath* slow_path = 2805 CheckedSmiSlowPath* slow_path =
2806 new CheckedSmiSlowPath(this, compiler->CurrentTryIndex()); 2806 new CheckedSmiSlowPath(this, compiler->CurrentTryIndex());
2807 compiler->AddSlowPathCode(slow_path); 2807 compiler->AddSlowPathCode(slow_path);
2808 // Test operands if necessary. 2808 // Test operands if necessary.
2809 Register left = locs()->in(0).reg(); 2809 Register left = locs()->in(0).reg();
2810 Register right = locs()->in(1).reg(); 2810 Register right = locs()->in(1).reg();
2811 Register result = locs()->out(0).reg(); 2811 Register result = locs()->out(0).reg();
2812 __ orr(result, left, Operand(right)); 2812 intptr_t left_cid = this->left()->Type()->ToCid();
2813 __ tsti(result, Immediate(kSmiTagMask)); 2813 intptr_t right_cid = this->right()->Type()->ToCid();
2814 bool combined_smi_check = false;
2815 if (left_cid == kSmiCid) {
rmacnak 2016/03/22 16:46:16 Missing same definition case.
Florian Schneider 2016/03/22 17:02:44 Done here and for CheckEitherNonSmiInstr as well.
2816 __ tsti(right, Immediate(kSmiTagMask));
2817 } else if (right_cid == kSmiCid) {
2818 __ tsti(left, Immediate(kSmiTagMask));
2819 } else {
2820 combined_smi_check = true;
2821 __ orr(result, left, Operand(right));
2822 __ tsti(result, Immediate(kSmiTagMask));
2823 }
2824
2814 __ b(slow_path->entry_label(), NE); 2825 __ b(slow_path->entry_label(), NE);
2815 switch (op_kind()) { 2826 switch (op_kind()) {
2816 case Token::kADD: 2827 case Token::kADD:
2817 __ adds(result, left, Operand(right)); 2828 __ adds(result, left, Operand(right));
2818 __ b(slow_path->entry_label(), VS); 2829 __ b(slow_path->entry_label(), VS);
2819 break; 2830 break;
2820 case Token::kSUB: 2831 case Token::kSUB:
2821 __ subs(result, left, Operand(right)); 2832 __ subs(result, left, Operand(right));
2822 __ b(slow_path->entry_label(), VS); 2833 __ b(slow_path->entry_label(), VS);
2823 break; 2834 break;
2824 case Token::kBIT_OR: 2835 case Token::kBIT_OR:
2825 // Operation part of combined smi check. 2836 // Operation may be part of combined smi check.
2837 if (!combined_smi_check) {
2838 __ orr(result, left, Operand(right));
2839 }
2826 break; 2840 break;
2827 case Token::kBIT_AND: 2841 case Token::kBIT_AND:
2828 __ and_(result, left, Operand(right)); 2842 __ and_(result, left, Operand(right));
2829 break; 2843 break;
2830 case Token::kBIT_XOR: 2844 case Token::kBIT_XOR:
2831 __ eor(result, left, Operand(right)); 2845 __ eor(result, left, Operand(right));
2832 break; 2846 break;
2833 case Token::kEQ: 2847 case Token::kEQ:
2834 case Token::kLT: 2848 case Token::kLT:
2835 case Token::kLTE: 2849 case Token::kLTE:
(...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after
5671 1, 5685 1,
5672 locs()); 5686 locs());
5673 __ Drop(1); 5687 __ Drop(1);
5674 __ Pop(result); 5688 __ Pop(result);
5675 } 5689 }
5676 5690
5677 5691
5678 } // namespace dart 5692 } // namespace dart
5679 5693
5680 #endif // defined TARGET_ARCH_ARM64 5694 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698