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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 527043002: Restore behavior of ICDataHasReceiverArgumentClassIds changed by r39471. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index c282dfd76422baadacb10693e07999762e297417..64599e74f1057cdda9e30c976dd98bca3017c6fc 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -921,12 +921,23 @@ static bool ICDataHasOnlyReceiverArgumentClassIds(
static bool ICDataHasReceiverArgumentClassIds(const ICData& ic_data,
intptr_t receiver_class_id,
intptr_t argument_class_id) {
- GrowableArray<intptr_t> receiver_cids(1);
- receiver_cids.Add(receiver_class_id);
- GrowableArray<intptr_t> argument_cids(1);
- argument_cids.Add(argument_class_id);
- return ICDataHasOnlyReceiverArgumentClassIds(
- ic_data, receiver_cids, argument_cids);
+ if (ic_data.NumArgsTested() != 2) {
+ return false;
+ }
+ Function& target = Function::Handle();
+ const intptr_t len = ic_data.NumberOfChecks();
+ for (intptr_t i = 0; i < len; i++) {
+ if (ic_data.IsUsedAt(i)) {
+ GrowableArray<intptr_t> class_ids;
+ ic_data.GetCheckAt(i, &class_ids, &target);
+ ASSERT(class_ids.length() == 2);
+ if ((class_ids[0] == receiver_class_id) &&
+ (class_ids[1] == argument_class_id)) {
+ return true;
+ }
+ }
+ }
+ return false;
}
@@ -1003,10 +1014,7 @@ static bool ShouldSpecializeForDouble(const ICData& ic_data) {
}
// Check that it have seen only smis and doubles.
- GrowableArray<intptr_t> class_ids(2);
- class_ids.Add(kSmiCid);
- class_ids.Add(kDoubleCid);
- return ICDataHasOnlyReceiverArgumentClassIds(ic_data, class_ids, class_ids);
+ return HasTwoDoubleOrSmi(ic_data);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698