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

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

Issue 2904543002: Fix misoptimization of 'is' test (Closed)
Patch Set: Remove inadvertent change Created 3 years, 7 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 false.
688 if (deopt == NULL) { 688 if (deopt == NULL) {
689 #ifdef DEBUG
Vyacheslav Egorov (Google) 2017/05/23 16:00:31 I think this needs to go to constructor.
erikcorry 2017/05/24 13:37:15 Done.
690 // The entry for Smi can be special, but all other entries have
691 // to match in the no-deopt case.
692 for (intptr_t i = 4; i < data.length(); i += 2) {
693 ASSERT(data[i + 1] == data[3]);
694 }
695 #endif
696 // If the cid is not in the list, jump to the opposite label from the cids
Vyacheslav Egorov (Google) 2017/05/23 16:00:31 Please add a comment to the instruction in the int
erikcorry 2017/05/24 13:37:15 Done.
697 // that are in the list.
689 Label* target = result ? labels.false_label : labels.true_label; 698 Label* target = result ? labels.false_label : labels.true_label;
690 if (target != labels.fall_through) { 699 if (target != labels.fall_through) {
691 __ jmp(target); 700 __ jmp(target);
692 } 701 }
693 } else { 702 } else {
694 __ jmp(deopt); 703 __ jmp(deopt);
695 } 704 }
696 // Dummy result as the last instruction is a jump, any conditional 705 // Dummy result as the last instruction is a jump, any conditional
697 // branch using the result will therefore be skipped. 706 // branch using the result will therefore be skipped.
698 return ZERO; 707 return ZERO;
(...skipping 6077 matching lines...) Expand 10 before | Expand all | Expand 10 after
6776 __ Drop(1); 6785 __ Drop(1);
6777 __ popq(result); 6786 __ popq(result);
6778 } 6787 }
6779 6788
6780 6789
6781 } // namespace dart 6790 } // namespace dart
6782 6791
6783 #undef __ 6792 #undef __
6784 6793
6785 #endif // defined TARGET_ARCH_X64 6794 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698