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

Unified Diff: runtime/vm/compiler.cc

Issue 10431006: First step toward an optimizing 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 | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
===================================================================
--- runtime/vm/compiler.cc (revision 7951)
+++ runtime/vm/compiler.cc (working copy)
@@ -15,6 +15,7 @@
#include "vm/flags.h"
#include "vm/flow_graph_builder.h"
#include "vm/flow_graph_compiler.h"
+#include "vm/flow_graph_optimizer.h"
#include "vm/longjump.h"
#include "vm/object.h"
#include "vm/object_store.h"
@@ -93,8 +94,9 @@
code.ExtractIcDataArraysAtCalls(&computation_ids, ic_data_objs);
const Array& result = Array::Handle(Array::New(max_id + 1));
for (intptr_t i = 0; i < computation_ids.length(); i++) {
- ASSERT(result.At(i) == Object::null());
- result.SetAt(i, Object::Handle(ic_data_objs.At(i)));
+ intptr_t result_index = computation_ids[i];
+ ASSERT(result.At(result_index) == Object::null());
+ result.SetAt(result_index, Object::Handle(ic_data_objs.At(i)));
}
return result.raw();
}
@@ -153,6 +155,8 @@
const ParsedFunction& parsed_function, bool optimized) {
bool is_compiled = false;
Isolate* isolate = Isolate::Current();
+ const intptr_t prev_cid = isolate->computation_id();
+ isolate->set_computation_id(0);
LongJump* old_base = isolate->long_jump_base();
LongJump bailout_jump;
isolate->set_long_jump_base(&bailout_jump);
@@ -191,6 +195,10 @@
for (intptr_t i = length - 1; i >= 0; --i) {
block_order.Add(graph_builder.postorder_block_entries()[i]);
}
+ if (optimized) {
+ FlowGraphOptimizer optimizer(block_order);
+ optimizer.ApplyICData();
+ }
}
Assembler assembler;
@@ -240,6 +248,7 @@
is_compiled = false;
}
isolate->set_long_jump_base(old_base);
+ isolate->set_computation_id(prev_cid);
return is_compiled;
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698