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

Unified Diff: runtime/vm/object.cc

Issue 2647913002: Optimizations to IC stub for unoptimized code performance on x64. (Closed)
Patch Set: Add MIPS and remove more overflow checks Created 3 years, 11 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 69810fdf5e52e4f1c0a9d0174e5082ef65af3f60..499da7e951ffcd5a408940279fece9938511a488 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -13465,6 +13465,11 @@ intptr_t ICData::GetCountAt(intptr_t index) const {
const Array& data = Array::Handle(ic_data());
const intptr_t data_pos =
index * TestEntryLength() + CountIndexFor(NumArgsTested());
+ if (data_pos < 0) {
regis 2017/01/24 18:27:21 Can you explain with a comment how this is possibl
+ // Overflow.
+ SetCountAt(index, 0);
+ return 0;
+ }
return Smi::Value(Smi::RawCast(data.At(data_pos)));
}

Powered by Google App Engine
This is Rietveld 408576698