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

Unified Diff: runtime/vm/flow_graph_builder.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 27696)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -45,7 +45,6 @@
FlowGraphBuilder::FlowGraphBuilder(ParsedFunction* parsed_function,
const Array& ic_data_array,
InlineExitCollector* exit_collector,
- GrowableArray<const Field*>* guarded_fields,
intptr_t osr_id)
: parsed_function_(parsed_function),
ic_data_array_(ic_data_array),
@@ -56,7 +55,7 @@
: 0),
num_stack_locals_(parsed_function->num_stack_locals()),
exit_collector_(exit_collector),
- guarded_fields_(guarded_fields),
+ guarded_fields_(new ZoneGrowableArray<const Field*>()),
last_used_block_id_(0), // 0 is used for the graph entry.
context_level_(0),
try_index_(CatchClauseNode::kInvalidTryIndex),
@@ -72,20 +71,6 @@
}
-void FlowGraphBuilder::AddToGuardedFields(const Field& field) const {
- if ((field.guarded_cid() == kDynamicCid) ||
- (field.guarded_cid() == kIllegalCid)) {
- return;
- }
- for (intptr_t j = 0; j < guarded_fields_->length(); j++) {
- if ((*guarded_fields_)[j]->raw() == field.raw()) {
- return;
- }
- }
- guarded_fields_->Add(&field);
-}
-
-
void InlineExitCollector::PrepareGraphs(FlowGraph* callee_graph) {
ASSERT(callee_graph->graph_entry()->SuccessorCount() == 1);
ASSERT(callee_graph->max_block_id() > caller_graph_->max_block_id());
@@ -3063,7 +3048,7 @@
(node->field().guarded_cid() == kNullCid)) {
load->set_result_cid(node->field().guarded_cid());
}
- owner()->AddToGuardedFields(node->field());
+ FlowGraph::AddToGuardedFields(owner()->guarded_fields(), &node->field());
}
}
ReturnDefinition(load);
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698