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

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

Issue 23589008: Clean up handling of guarded fields in the flow graph builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | 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/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/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 LoadFieldInstr* load = new LoadFieldInstr( 1589 LoadFieldInstr* load = new LoadFieldInstr(
1590 new Value(call->ArgumentAt(0)), 1590 new Value(call->ArgumentAt(0)),
1591 field.Offset(), 1591 field.Offset(),
1592 AbstractType::ZoneHandle(field.type()), 1592 AbstractType::ZoneHandle(field.type()),
1593 field.is_final()); 1593 field.is_final());
1594 load->set_field(&field); 1594 load->set_field(&field);
1595 if (field.guarded_cid() != kIllegalCid) { 1595 if (field.guarded_cid() != kIllegalCid) {
1596 if (!field.is_nullable() || (field.guarded_cid() == kNullCid)) { 1596 if (!field.is_nullable() || (field.guarded_cid() == kNullCid)) {
1597 load->set_result_cid(field.guarded_cid()); 1597 load->set_result_cid(field.guarded_cid());
1598 } 1598 }
1599 flow_graph_->builder().AddToGuardedFields(field); 1599 FlowGraph::AddToGuardedFields(flow_graph_->guarded_fields(), &field);
1600 } 1600 }
1601 1601
1602 // Discard the environment from the original instruction because the load 1602 // Discard the environment from the original instruction because the load
1603 // can't deoptimize. 1603 // can't deoptimize.
1604 call->RemoveEnvironment(); 1604 call->RemoveEnvironment();
1605 ReplaceCall(call, load); 1605 ReplaceCall(call, load);
1606 1606
1607 if (load->result_cid() != kDynamicCid) { 1607 if (load->result_cid() != kDynamicCid) {
1608 // Reset value types if guarded_cid was used. 1608 // Reset value types if guarded_cid was used.
1609 for (Value::Iterator it(load->input_use_list()); 1609 for (Value::Iterator it(load->input_use_list());
(...skipping 6047 matching lines...) Expand 10 before | Expand all | Expand 10 after
7657 } 7657 }
7658 7658
7659 // Insert materializations at environment uses. 7659 // Insert materializations at environment uses.
7660 for (intptr_t i = 0; i < exits.length(); i++) { 7660 for (intptr_t i = 0; i < exits.length(); i++) {
7661 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); 7661 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields);
7662 } 7662 }
7663 } 7663 }
7664 7664
7665 7665
7666 } // namespace dart 7666 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698