[vm/bytecode] Avoid eager foreground compilations from InlineCacheMissHandler

Previously, InlineCacheMissHandler forced foreground compilation of a target
even if interpreter is enabled. This might cause excessive compilation of
functions which are executed only a few times, as well as simultaneous
compilation of a function in background and foreground.

Change-Id: If716370d408cf9cff1b72123ab24d609246961a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112200
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov 2019-08-07 16:51:51 +00:00 committed by commit-bot@chromium.org
parent 08205fd62f
commit 00bbb5fe75

View file

@ -1139,6 +1139,12 @@ static void TrySwitchInstanceCall(const ICData& ic_data,
return;
}
// Avoid forcing foreground compilation if target function is still
// interpreted.
if (FLAG_enable_interpreter && !target_function.HasCode()) {
return;
}
const Array& data = Array::Handle(zone, ic_data.entries());
const Code& target = Code::Handle(zone, target_function.EnsureHasCode());
CodePatcher::PatchInstanceCallAt(caller_frame->pc(), caller_code, data,