Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 6b09efd476a99a20fcd92bbab241aabc2561a2e3..2896d725180f662d382c2b980421d174e8c3de20 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -6753,11 +6753,24 @@ RawArray* Function::ic_data_array() const { |
return raw_ptr()->ic_data_array_; |
} |
-void Function::ClearICData() const { |
+void Function::ClearICDataArray() const { |
set_ic_data_array(Array::Handle()); |
} |
+void Function::SetDeoptReasonForAll(intptr_t deopt_id, |
+ ICData::DeoptReasonId reason) { |
+ const Array& icd_array = Array::Handle(ic_data_array()); |
+ ICData& icd = ICData::Handle(); |
+ for (intptr_t i = 0; i < icd_array.Length(); i++) { |
+ icd ^= icd_array.At(i); |
+ if (icd.deopt_id() == deopt_id) { |
+ icd.AddDeoptReason(reason); |
+ } |
+ } |
+} |
+ |
+ |
bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const { |
if (SourceFingerprint() != fp) { |
const bool recalculatingFingerprints = false; |