Index: runtime/vm/isolate_reload.cc |
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc |
index 2fc607f98913480c54996e5a39b3482511fea1fb..e84a99115cb82750c5abddc598ca6ff7e8380987 100644 |
--- a/runtime/vm/isolate_reload.cc |
+++ b/runtime/vm/isolate_reload.cc |
@@ -881,46 +881,6 @@ 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(); |
@@ -935,10 +895,9 @@ void IsolateReloadContext::ResetUnoptimizedICsOnStack() { |
function = code.function(); |
code = function.unoptimized_code(); |
ASSERT(!code.IsNull()); |
- ResetICs(function, code); |
+ code.ResetICDatas(); |
} else { |
- function = code.function(); |
- ResetICs(function, code); |
+ code.ResetICDatas(); |
} |
frame = iterator.NextFrame(); |
} |
@@ -991,7 +950,7 @@ class MarkFunctionsForRecompilation : public ObjectVisitor { |
if (clear_code) { |
ClearAllCode(func); |
} else { |
- PreserveUnoptimizedCode(func); |
+ PreserveUnoptimizedCode(); |
} |
} |
@@ -1011,11 +970,11 @@ class MarkFunctionsForRecompilation : public ObjectVisitor { |
func.set_was_compiled(false); |
} |
- void PreserveUnoptimizedCode(const Function& func) { |
+ void PreserveUnoptimizedCode() { |
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. |
- func.FillICDataWithSentinels(code_); |
+ code_.ResetICDatas(); |
} |
bool IsFromDirtyLibrary(const Function& func) { |