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

Unified Diff: runtime/vm/intermediate_language.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_x64.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 37100)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -2336,6 +2336,26 @@
void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ ICData& call_ic_data = ICData::ZoneHandle(ic_data()->raw());
+ if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) {
+ const Array& arguments_descriptor =
+ Array::Handle(ArgumentsDescriptor::New(ArgumentCount(),
+ argument_names()));
+ // TODO(srdjan): Improve performance of function recognition.
+ MethodRecognizer::Kind recognized_kind =
+ MethodRecognizer::RecognizeKind(function());
+ int num_args_checked = 0;
+ if ((recognized_kind == MethodRecognizer::kMathMin) ||
+ (recognized_kind == MethodRecognizer::kMathMax)) {
+ num_args_checked = 2;
+ }
+ call_ic_data = ICData::New(compiler->parsed_function().function(),
+ String::Handle(function().name()),
+ arguments_descriptor,
+ deopt_id(),
+ num_args_checked); // No arguments checked.
+ call_ic_data.AddTarget(function());
+ }
if (!compiler->is_optimizing()) {
// Some static calls can be optimized by the optimizing compiler (e.g. sqrt)
// and therefore need a deoptimization descriptor.
@@ -2348,7 +2368,8 @@
function(),
ArgumentCount(),
argument_names(),
- locs());
+ locs(),
+ call_ic_data);
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698