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

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

Issue 2487873003: Speculate on bitwise operators. (Closed)
Patch Set: . 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
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/redundancy_elimination.h" 5 #include "vm/redundancy_elimination.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph.h" 8 #include "vm/flow_graph.h"
9 #include "vm/hash_map.h" 9 #include "vm/hash_map.h"
10 #include "vm/il_printer.h" 10 #include "vm/il_printer.h"
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 } 1040 }
1041 1041
1042 // Check if any use of the definition can create an alias. 1042 // Check if any use of the definition can create an alias.
1043 // Can add more objects into aliasing_worklist_. 1043 // Can add more objects into aliasing_worklist_.
1044 bool AnyUseCreatesAlias(Definition* defn) { 1044 bool AnyUseCreatesAlias(Definition* defn) {
1045 for (Value* use = defn->input_use_list(); 1045 for (Value* use = defn->input_use_list();
1046 use != NULL; 1046 use != NULL;
1047 use = use->next_use()) { 1047 use = use->next_use()) {
1048 Instruction* instr = use->instruction(); 1048 Instruction* instr = use->instruction();
1049 if (instr->IsPushArgument() || 1049 if (instr->IsPushArgument() ||
1050 instr->IsCheckedSmiOp() ||
1051 instr->IsCheckedSmiComparison() ||
Florian Schneider 2016/11/11 18:12:20 Good catch!
1050 (instr->IsStoreIndexed() 1052 (instr->IsStoreIndexed()
1051 && (use->use_index() == StoreIndexedInstr::kValuePos)) || 1053 && (use->use_index() == StoreIndexedInstr::kValuePos)) ||
1052 instr->IsStoreStaticField() || 1054 instr->IsStoreStaticField() ||
1053 instr->IsPhi()) { 1055 instr->IsPhi()) {
1054 return true; 1056 return true;
1055 } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) && 1057 } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) &&
1056 AnyUseCreatesAlias(instr->AsDefinition())) { 1058 AnyUseCreatesAlias(instr->AsDefinition())) {
1057 return true; 1059 return true;
1058 } else if ((instr->IsStoreInstanceField() 1060 } else if ((instr->IsStoreInstanceField()
1059 && (use->use_index() != StoreInstanceFieldInstr::kInstancePos))) { 1061 && (use->use_index() != StoreInstanceFieldInstr::kInstancePos))) {
(...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after
3491 join->phis_ = NULL; 3493 join->phis_ = NULL;
3492 } else { 3494 } else {
3493 join->phis_->TruncateTo(to_index); 3495 join->phis_->TruncateTo(to_index);
3494 } 3496 }
3495 } 3497 }
3496 } 3498 }
3497 } 3499 }
3498 3500
3499 3501
3500 } // namespace dart 3502 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698