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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 11418046: First part of static call cleanup: store static call targets into code object, referenced by code-o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 15037)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -144,6 +144,8 @@
is_optimizing ? new StackmapTableBuilder() : NULL),
block_info_(block_order_.length()),
deopt_infos_(),
+ static_calls_target_table_(GrowableObjectArray::ZoneHandle(
+ GrowableObjectArray::New())),
is_optimizing_(is_optimizing),
may_reoptimize_(false),
bool_true_(Bool::ZoneHandle(Bool::True())),
@@ -282,6 +284,13 @@
}
+void FlowGraphCompiler::AddStaticCallTarget(const Function& func) {
+ static_calls_target_table_.Add(
+ Smi::Handle(Smi::New(assembler()->CodeSize())));
+ static_calls_target_table_.Add(func);
+}
+
+
void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
intptr_t token_pos) {
ASSERT(is_optimizing());
@@ -396,6 +405,7 @@
code.set_deopt_info_array(array);
const Array& object_array =
Array::Handle(Array::MakeArray(builder.object_table()));
+ ASSERT(code.object_table() == Array::null());
code.set_object_table(object_array);
}
@@ -426,6 +436,12 @@
}
+void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) {
siva 2012/11/16 23:15:23 ASSERT(code.static_calls_target_table() == Array::
srdjan 2012/11/17 00:47:24 Done.
+ code.set_static_calls_target_table(
+ Array::Handle(Array::MakeArray(static_calls_target_table_)));
+}
+
+
// Returns 'true' if code generation for this function is complete, i.e.,
// no fall-through to regular code is needed.
bool FlowGraphCompiler::TryIntrinsify() {

Powered by Google App Engine
This is Rietveld 408576698