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

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
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 15090)
+++ 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,18 @@
}
+void FlowGraphCompiler::AddStaticCallTarget(const Function& func) {
+ ASSERT(Code::kSCallTableEntryLength == 3);
+ ASSERT(Code::kSCallTableOffsetEntry == 0);
+ static_calls_target_table_.Add(
+ Smi::Handle(Smi::New(assembler()->CodeSize())));
+ ASSERT(Code::kSCallTableFunctionEntry == 1);
+ static_calls_target_table_.Add(func);
+ ASSERT(Code::kSCallTableCodeEntry == 2);
+ static_calls_target_table_.Add(Code::Handle());
+}
+
+
void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
intptr_t token_pos) {
ASSERT(is_optimizing());
@@ -396,6 +410,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 +441,13 @@
}
+void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) {
+ ASSERT(code.static_calls_target_table() == Array::null());
+ 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() {
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698