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

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

Issue 10876079: Clean up LoadInstanceField and StoreInstanceField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 if (right != NULL) { 1123 if (right != NULL) {
1124 right->RemoveFromGraph(); 1124 right->RemoveFromGraph();
1125 } 1125 }
1126 // Return left subexpression as the replacement for this instruction. 1126 // Return left subexpression as the replacement for this instruction.
1127 return left; 1127 return left;
1128 } 1128 }
1129 return instr; 1129 return instr;
1130 } 1130 }
1131 1131
1132 1132
1133 Definition* CheckClassComp::TryReplace(BindInstr* instr) const {
1134 const intptr_t v_cid = value()->ResultCid();
1135 const intptr_t num_checks = ic_data()->NumberOfChecks();
1136 if ((num_checks == 1) &&
1137 (v_cid == ic_data()->GetReceiverClassIdAt(0))) {
1138 // No checks needed.
1139 return NULL;
1140 }
1141 return instr;
1142 }
1143
1144
1133 Definition* CheckSmiComp::TryReplace(BindInstr* instr) const { 1145 Definition* CheckSmiComp::TryReplace(BindInstr* instr) const {
1134 return (value()->ResultCid() == kSmiCid) ? NULL : instr; 1146 return (value()->ResultCid() == kSmiCid) ? NULL : instr;
1135 } 1147 }
1136 1148
1137 1149
1138 Definition* CheckEitherNonSmiComp::TryReplace(BindInstr* instr) const { 1150 Definition* CheckEitherNonSmiComp::TryReplace(BindInstr* instr) const {
1139 if ((left()->ResultCid() == kDoubleCid) || 1151 if ((left()->ResultCid() == kDoubleCid) ||
1140 (right()->ResultCid() == kDoubleCid)) { 1152 (right()->ResultCid() == kDoubleCid)) {
1141 return NULL; // Remove from the graph. 1153 return NULL; // Remove from the graph.
1142 } 1154 }
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 ? UseDefinition(values()[i]->AsUse()->definition()) 1551 ? UseDefinition(values()[i]->AsUse()->definition())
1540 : val); 1552 : val);
1541 } 1553 }
1542 return copy; 1554 return copy;
1543 } 1555 }
1544 1556
1545 1557
1546 #undef __ 1558 #undef __
1547 1559
1548 } // namespace dart 1560 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698