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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 322633002: Share ic data between unoptimized and optimized static calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('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 37100)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -888,21 +888,32 @@
const Function& function,
intptr_t argument_count,
const Array& argument_names,
- LocationSummary* locs) {
- const Array& arguments_descriptor =
- Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
- argument_names));
+ LocationSummary* locs,
+ const ICData& ic_data) {
+ const Array& arguments_descriptor = Array::ZoneHandle(
+ ic_data.IsNull() ? ArgumentsDescriptor::New(argument_count,
+ argument_names)
+ : ic_data.arguments_descriptor());
// Proper reporting of Javascript incompatibilities requires icdata and
// may therefore prevent the optimization of some static calls.
if (is_optimizing() &&
!(FLAG_warn_on_javascript_compatibility &&
(MethodRecognizer::RecognizeKind(function) ==
MethodRecognizer::kObjectIdentical))) {
- EmitOptimizedStaticCall(function, arguments_descriptor, argument_count,
- deopt_id, token_pos, locs);
+ EmitOptimizedStaticCall(function, arguments_descriptor,
+ argument_count, deopt_id, token_pos, locs);
} else {
- EmitUnoptimizedStaticCall(function, arguments_descriptor, argument_count,
- deopt_id, token_pos, locs);
+ ICData& call_ic_data = ICData::ZoneHandle(ic_data.raw());
+ if (call_ic_data.IsNull()) {
+ call_ic_data = ICData::New(parsed_function().function(), // Caller fun.
+ String::Handle(function.name()),
+ arguments_descriptor,
+ deopt_id,
+ 0); // No arguments checked.
+ call_ic_data.AddTarget(function);
+ }
+ EmitUnoptimizedStaticCall(argument_count, deopt_id, token_pos, locs,
+ call_ic_data);
}
}
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698