| Index: runtime/vm/isolate_reload.cc
|
| diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
|
| index 9a3a7bc7fe7e4dd29098be852c26e61139310855..2fc607f98913480c54996e5a39b3482511fea1fb 100644
|
| --- a/runtime/vm/isolate_reload.cc
|
| +++ b/runtime/vm/isolate_reload.cc
|
| @@ -881,6 +881,46 @@ ObjectStore* IsolateReloadContext::object_store() {
|
| }
|
|
|
|
|
| +static void ResetICs(const Function& function, const Code& code) {
|
| + // TODO(johnmccutchan): Relying on the function's ICData Map can miss ICDatas.
|
| + // Use the code's object pool instead.
|
| + if (function.ic_data_array() == Array::null()) {
|
| + // TODO(johnmccutchan): Even in this case, we need to scan the code's object
|
| + // pool instead.
|
| + return; // Already reset in an earlier round.
|
| + }
|
| +
|
| + Thread* thread = Thread::Current();
|
| + Zone* zone = thread->zone();
|
| +
|
| + ZoneGrowableArray<const ICData*>* ic_data_array =
|
| + new(zone) ZoneGrowableArray<const ICData*>();
|
| + function.RestoreICDataMap(ic_data_array, false /* clone ic-data */);
|
| + const intptr_t ic_data_array_length = ic_data_array->length();
|
| + if (ic_data_array_length == 0) {
|
| + return;
|
| + }
|
| + const PcDescriptors& descriptors =
|
| + PcDescriptors::Handle(code.pc_descriptors());
|
| + PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kIcCall |
|
| + RawPcDescriptors::kUnoptStaticCall);
|
| + while (iter.MoveNext()) {
|
| + const intptr_t index = iter.DeoptId();
|
| + if (index >= ic_data_array_length) {
|
| + // TODO(johnmccutchan): Investigate how this can happen.
|
| + continue;
|
| + }
|
| + const ICData* ic_data = (*ic_data_array)[index];
|
| + if (ic_data == NULL) {
|
| + // TODO(johnmccutchan): Investigate how this can happen.
|
| + continue;
|
| + }
|
| + bool is_static_call = iter.Kind() == RawPcDescriptors::kUnoptStaticCall;
|
| + ic_data->Reset(is_static_call);
|
| + }
|
| +}
|
| +
|
| +
|
| void IsolateReloadContext::ResetUnoptimizedICsOnStack() {
|
| Code& code = Code::Handle();
|
| Function& function = Function::Handle();
|
| @@ -895,10 +935,10 @@ void IsolateReloadContext::ResetUnoptimizedICsOnStack() {
|
| function = code.function();
|
| code = function.unoptimized_code();
|
| ASSERT(!code.IsNull());
|
| - code.ResetICDatas(function);
|
| + ResetICs(function, code);
|
| } else {
|
| function = code.function();
|
| - code.ResetICDatas(function);
|
| + ResetICs(function, code);
|
| }
|
| frame = iterator.NextFrame();
|
| }
|
| @@ -975,7 +1015,7 @@ class MarkFunctionsForRecompilation : public ObjectVisitor {
|
| ASSERT(!code_.IsNull());
|
| // We are preserving the unoptimized code, fill all ICData arrays with
|
| // the sentinel values so that we have no stale type feedback.
|
| - code_.ResetICDatas(func);
|
| + func.FillICDataWithSentinels(code_);
|
| }
|
|
|
| bool IsFromDirtyLibrary(const Function& func) {
|
|
|