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

Unified Diff: runtime/vm/object.cc

Issue 1149403005: Prevent excessive deoptimization when optimistically assuming Smi in typed data stores. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: ws Created 5 years, 7 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
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;
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/weak_code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698