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

Unified Diff: runtime/vm/compiler.cc

Issue 10378093: Adding collected type feedback to the IL nodes (only in optimized mode). (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/intermediate_language.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 7505)
+++ runtime/vm/compiler.cc (working copy)
@@ -83,6 +83,23 @@
}
+// Returns an array indexed by computation id, containing the extracted ICData.
+static RawArray* ExtractTypeFeedbackArray(const Code& code) {
+ ASSERT(!code.IsNull() && !code.is_optimized());
+ GrowableArray<intptr_t> computation_ids;
+ const GrowableObjectArray& ic_data_objs =
+ GrowableObjectArray::Handle(GrowableObjectArray::New());
+ const intptr_t max_id =
+ 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)));
+ }
+ return result.raw();
+}
+
+
RawError* Compiler::Compile(const Library& library, const Script& script) {
Isolate* isolate = Isolate::Current();
LongJump* base = isolate->long_jump_base();
@@ -168,7 +185,10 @@
// deoptimized too often.
if (parsed_function.function().deoptimization_counter() <
FLAG_deoptimization_counter_threshold) {
- // Extract type feedback etc.
+ const Code& unoptimized_code =
+ Code::Handle(parsed_function.function().unoptimized_code());
+ isolate->set_ic_data_array(
+ ExtractTypeFeedbackArray(unoptimized_code));
}
}
}
@@ -181,6 +201,7 @@
&CompilerStats::graphcompiler_timer,
isolate);
graph_compiler.CompileGraph();
+ isolate->set_ic_data_array(Array::null());
}
{
TimerScope timer(FLAG_compiler_stats,
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698