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

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

Issue 10933046: Cleanup: Replace LoadInstanceFieldInstr with LoadVMFieldInstr. (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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/hash_map.h" 10 #include "vm/hash_map.h"
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 String::Handle(Field::NameFromGetter(call->function_name())); 607 String::Handle(Field::NameFromGetter(call->function_name()));
608 const Field& field = Field::Handle(GetField(class_ids[0], field_name)); 608 const Field& field = Field::Handle(GetField(class_ids[0], field_name));
609 ASSERT(!field.IsNull()); 609 ASSERT(!field.IsNull());
610 610
611 if (InstanceCallNeedsClassCheck(call)) { 611 if (InstanceCallNeedsClassCheck(call)) {
612 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); 612 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy());
613 } 613 }
614 // Detach environment from the original instruction because it can't 614 // Detach environment from the original instruction because it can't
615 // deoptimize. 615 // deoptimize.
616 call->set_env(NULL); 616 call->set_env(NULL);
617 LoadInstanceFieldInstr* load = 617 LoadVMFieldInstr* load = new LoadVMFieldInstr(
618 new LoadInstanceFieldInstr(field, call->ArgumentAt(0)->value()); 618 call->ArgumentAt(0)->value(),
619 field.Offset(),
620 AbstractType::ZoneHandle(field.type()));
619 call->ReplaceWith(load, current_iterator()); 621 call->ReplaceWith(load, current_iterator());
620 RemovePushArguments(call); 622 RemovePushArguments(call);
621 return true; 623 return true;
622 } 624 }
623 625
624 // Not an implicit getter. 626 // Not an implicit getter.
625 MethodRecognizer::Kind recognized_kind = 627 MethodRecognizer::Kind recognized_kind =
626 MethodRecognizer::RecognizeKind(target); 628 MethodRecognizer::RecognizeKind(target);
627 629
628 // VM objects length getter. 630 // VM objects length getter.
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 DirectChainedHashMap<Definition*> child_map(*map); // Copy map. 1419 DirectChainedHashMap<Definition*> child_map(*map); // Copy map.
1418 OptimizeRecursive(child, &child_map); 1420 OptimizeRecursive(child, &child_map);
1419 } else { 1421 } else {
1420 OptimizeRecursive(child, map); // Reuse map for the last child. 1422 OptimizeRecursive(child, map); // Reuse map for the last child.
1421 } 1423 }
1422 } 1424 }
1423 } 1425 }
1424 1426
1425 1427
1426 } // namespace dart 1428 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698