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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10356051: First steps toward a two stages new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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_compiler_arm.h » ('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 7399)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1182,11 +1182,15 @@
const Function& function = node->function();
if (function.IsNonImplicitClosureFunction()) {
- const ContextScope& context_scope = ContextScope::ZoneHandle(
- node->scope()->PreserveOuterScope(owner()->context_level()));
- ASSERT(!function.HasCode());
- ASSERT(function.context_scope() == ContextScope::null());
- function.set_context_scope(context_scope);
+ // The context scope may have already been set by the new non-optimizing
regis 2012/05/08 16:07:32 I would drop "new".
srdjan 2012/05/08 16:16:03 Done in next CL.
+ // compiler. If it was not, set it here.
+ if (function.context_scope() == ContextScope::null()) {
+ const ContextScope& context_scope = ContextScope::ZoneHandle(
+ node->scope()->PreserveOuterScope(owner()->context_level()));
+ ASSERT(!function.HasCode());
+ ASSERT(function.context_scope() == ContextScope::null());
+ function.set_context_scope(context_scope);
+ }
} else if (function.IsImplicitInstanceClosureFunction()) {
ValueGraphVisitor for_receiver(owner(), temp_index());
node->receiver()->Visit(&for_receiver);
@@ -2447,7 +2451,7 @@
}
-void FlowGraphBuilder::BuildGraph() {
+void FlowGraphBuilder::BuildGraph(bool for_optimized) {
if (FLAG_print_ast) {
// Print the function ast before IL generation.
AstPrinter::PrintFunctionNodes(parsed_function());
@@ -2470,7 +2474,9 @@
&preorder_block_entries_,
&postorder_block_entries_,
&parent);
- ComputeDominators(&preorder_block_entries_, &parent);
+ if (for_optimized) {
+ ComputeDominators(&preorder_block_entries_, &parent);
+ }
}
if (for_effect.entry() != NULL) {
// Perform a depth-first traversal of the graph to build preorder and
@@ -2479,7 +2485,9 @@
&preorder_block_entries_,
&postorder_block_entries_,
&parent);
- ComputeDominators(&preorder_block_entries_, &parent);
+ if (for_optimized) {
+ ComputeDominators(&preorder_block_entries_, &parent);
+ }
}
isolate->set_computation_id(prev_cid);
if (FLAG_print_flow_graph) {
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698