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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 12646012: Improve code (less code, slightly faster) for polymorphic calls, by loading the argument descriptor… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/code_patcher_x64.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_ia32.cc
===================================================================
--- runtime/vm/flow_graph_compiler_ia32.cc (revision 20234)
+++ runtime/vm/flow_graph_compiler_ia32.cc (working copy)
@@ -1381,8 +1381,8 @@
void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
Register class_id_reg,
- intptr_t arg_count,
- const Array& arg_names,
+ intptr_t argument_count,
+ const Array& argument_names,
Label* deopt,
intptr_t deopt_id,
intptr_t token_index,
@@ -1392,6 +1392,12 @@
const intptr_t len = ic_data.NumberOfChecks();
GrowableArray<CidTarget> sorted(len);
SortICDataByCount(ic_data, &sorted);
+ ASSERT(class_id_reg != EDX);
+ ASSERT(len > 0); // Why bother otherwise.
+ const Array& arguments_descriptor =
+ Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
+ argument_names));
+ __ LoadObject(EDX, arguments_descriptor);
for (intptr_t i = 0; i < len; i++) {
const bool is_last_check = (i == (len - 1));
Label next_test;
@@ -1401,12 +1407,16 @@
} else {
assembler()->j(NOT_EQUAL, &next_test);
}
- GenerateStaticCall(deopt_id,
- token_index,
- *sorted[i].target,
- arg_count,
- arg_names,
- locs);
+ // Do not use the code from the function, but let the code be patched so
+ // that we can record the outgoing edges to other code.
+ GenerateDartCall(deopt_id,
+ token_index,
+ &StubCode::CallStaticFunctionLabel(),
+ PcDescriptors::kFuncCall,
+ locs);
+ const Function& function = *sorted[i].target;
+ AddStaticCallTarget(function);
+ __ Drop(argument_count);
if (!is_last_check) {
assembler()->jmp(&match_found);
}
« no previous file with comments | « runtime/vm/code_patcher_x64.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698