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

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

Issue 2904543002: Fix misoptimization of 'is' test (Closed)
Patch Set: Feedback from Slava, do same optimization on AOT and JIT Created 3 years, 6 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_mips.cc ('k') | runtime/vm/jit_optimizer.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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 __ testq(val_reg, Immediate(kSmiTagMask)); 677 __ testq(val_reg, Immediate(kSmiTagMask));
678 __ j(ZERO, result ? labels.true_label : labels.false_label); 678 __ j(ZERO, result ? labels.true_label : labels.false_label);
679 __ LoadClassId(cid_reg, val_reg); 679 __ LoadClassId(cid_reg, val_reg);
680 for (intptr_t i = 2; i < data.length(); i += 2) { 680 for (intptr_t i = 2; i < data.length(); i += 2) {
681 const intptr_t test_cid = data[i]; 681 const intptr_t test_cid = data[i];
682 ASSERT(test_cid != kSmiCid); 682 ASSERT(test_cid != kSmiCid);
683 result = data[i + 1] == true_result; 683 result = data[i + 1] == true_result;
684 __ cmpq(cid_reg, Immediate(test_cid)); 684 __ cmpq(cid_reg, Immediate(test_cid));
685 __ j(EQUAL, result ? labels.true_label : labels.false_label); 685 __ j(EQUAL, result ? labels.true_label : labels.false_label);
686 } 686 }
687 // No match found, deoptimize or false. 687 // No match found, deoptimize or default action.
688 if (deopt == NULL) { 688 if (deopt == NULL) {
689 // If the cid is not in the list, jump to the opposite label from the cids
690 // that are in the list. These must be all the same (see asserts in the
691 // constructor).
689 Label* target = result ? labels.false_label : labels.true_label; 692 Label* target = result ? labels.false_label : labels.true_label;
690 if (target != labels.fall_through) { 693 if (target != labels.fall_through) {
691 __ jmp(target); 694 __ jmp(target);
692 } 695 }
693 } else { 696 } else {
694 __ jmp(deopt); 697 __ jmp(deopt);
695 } 698 }
696 // Dummy result as the last instruction is a jump, any conditional 699 // Dummy result as the last instruction is a jump, any conditional
697 // branch using the result will therefore be skipped. 700 // branch using the result will therefore be skipped.
698 return ZERO; 701 return ZERO;
(...skipping 6077 matching lines...) Expand 10 before | Expand all | Expand 10 after
6776 __ Drop(1); 6779 __ Drop(1);
6777 __ popq(result); 6780 __ popq(result);
6778 } 6781 }
6779 6782
6780 6783
6781 } // namespace dart 6784 } // namespace dart
6782 6785
6783 #undef __ 6786 #undef __
6784 6787
6785 #endif // defined TARGET_ARCH_X64 6788 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698