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

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

Issue 2466643002: AOT: Enable branch merging for checked smi comparisons (Closed)
Patch Set: addressed comments Created 4 years, 1 month 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 | « no previous file | runtime/vm/branch_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/aot_optimizer.h" 5 #include "vm/aot_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/branch_optimizer.h" 8 #include "vm/branch_optimizer.h"
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 /* complete = */ true); 1812 /* complete = */ true);
1813 instr->ReplaceWith(call, current_iterator()); 1813 instr->ReplaceWith(call, current_iterator());
1814 return; 1814 return;
1815 } 1815 }
1816 } 1816 }
1817 switch (instr->token_kind()) { 1817 switch (instr->token_kind()) {
1818 case Token::kEQ: 1818 case Token::kEQ:
1819 case Token::kLT: 1819 case Token::kLT:
1820 case Token::kLTE: 1820 case Token::kLTE:
1821 case Token::kGT: 1821 case Token::kGT:
1822 case Token::kGTE: 1822 case Token::kGTE: {
1823 if (HasOnlyTwoOf(*instr->ic_data(), kSmiCid) ||
1824 HasLikelySmiOperand(instr)) {
1825 Definition* left = instr->ArgumentAt(0);
1826 Definition* right = instr->ArgumentAt(1);
1827 CheckedSmiComparisonInstr* smi_op =
1828 new(Z) CheckedSmiComparisonInstr(instr->token_kind(),
1829 new(Z) Value(left),
1830 new(Z) Value(right),
1831 instr);
1832 ReplaceCall(instr, smi_op);
1833 return;
1834 }
1835 break;
1836 }
1823 case Token::kBIT_OR: 1837 case Token::kBIT_OR:
1824 case Token::kBIT_XOR: 1838 case Token::kBIT_XOR:
1825 case Token::kBIT_AND: 1839 case Token::kBIT_AND:
1826 case Token::kADD: 1840 case Token::kADD:
1827 case Token::kSUB: 1841 case Token::kSUB:
1828 case Token::kMUL: { 1842 case Token::kMUL: {
1829 if (HasOnlyTwoOf(*instr->ic_data(), kSmiCid) || 1843 if (HasOnlyTwoOf(*instr->ic_data(), kSmiCid) ||
1830 HasLikelySmiOperand(instr)) { 1844 HasLikelySmiOperand(instr)) {
1831 Definition* left = instr->ArgumentAt(0); 1845 Definition* left = instr->ArgumentAt(0);
1832 Definition* right = instr->ArgumentAt(1); 1846 Definition* right = instr->ArgumentAt(1);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 check->env(), FlowGraph::kEffect); 2241 check->env(), FlowGraph::kEffect);
2228 current_iterator()->RemoveCurrentFromGraph(); 2242 current_iterator()->RemoveCurrentFromGraph();
2229 } 2243 }
2230 } 2244 }
2231 } 2245 }
2232 } 2246 }
2233 2247
2234 #endif // DART_PRECOMPILER 2248 #endif // DART_PRECOMPILER
2235 2249
2236 } // namespace dart 2250 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/branch_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698