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

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

Issue 2914483002: Revert "Fix misoptimization of 'is' test" (Closed)
Patch Set: 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_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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_DBC. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 ASSERT(num_cases <= 255); 639 ASSERT(num_cases <= 255);
640 __ TestCids(value, num_cases); 640 __ TestCids(value, num_cases);
641 641
642 bool result = false; 642 bool result = false;
643 for (intptr_t i = 0; i < data.length(); i += 2) { 643 for (intptr_t i = 0; i < data.length(); i += 2) {
644 const intptr_t test_cid = data[i]; 644 const intptr_t test_cid = data[i];
645 result = data[i + 1] == true_result; 645 result = data[i + 1] == true_result;
646 __ Nop(result ? 1 : 0, compiler->ToEmbeddableCid(test_cid, this)); 646 __ Nop(result ? 1 : 0, compiler->ToEmbeddableCid(test_cid, this));
647 } 647 }
648 648
649 // No match found, deoptimize or default action. 649 // No match found, deoptimize or false.
650 if (CanDeoptimize()) { 650 if (CanDeoptimize()) {
651 compiler->EmitDeopt(deopt_id(), ICData::kDeoptTestCids, 651 compiler->EmitDeopt(deopt_id(), ICData::kDeoptTestCids,
652 licm_hoisted_ ? ICData::kHoisted : 0); 652 licm_hoisted_ ? ICData::kHoisted : 0);
653 } else { 653 } else {
654 // If the cid is not in the list, jump to the opposite label from the cids
655 // that are in the list. These must be all the same (see asserts in the
656 // constructor).
657 Label* target = result ? labels.false_label : labels.true_label; 654 Label* target = result ? labels.false_label : labels.true_label;
658 __ Jump(target); 655 __ Jump(target);
659 } 656 }
660 657
661 return NEXT_IS_TRUE; 658 return NEXT_IS_TRUE;
662 } 659 }
663 660
664 661
665 void TestCidsInstr::EmitBranchCode(FlowGraphCompiler* compiler, 662 void TestCidsInstr::EmitBranchCode(FlowGraphCompiler* compiler,
666 BranchInstr* branch) { 663 BranchInstr* branch) {
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 } 2073 }
2077 __ IfULe(length, index); 2074 __ IfULe(length, index);
2078 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, 2075 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
2079 (generalized_ ? ICData::kGeneralized : 0) | 2076 (generalized_ ? ICData::kGeneralized : 0) |
2080 (licm_hoisted_ ? ICData::kHoisted : 0)); 2077 (licm_hoisted_ ? ICData::kHoisted : 0));
2081 } 2078 }
2082 2079
2083 } // namespace dart 2080 } // namespace dart
2084 2081
2085 #endif // defined TARGET_ARCH_DBC 2082 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698