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

Unified Diff: runtime/vm/object.cc

Issue 10981010: Move HasOneTarget to ICData. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 12803)
+++ runtime/vm/object.cc (working copy)
@@ -8296,6 +8296,22 @@
}
+// Returns true if all targets are the same.
+// TODO(srdjan): if targets are native use their C_function to compare.
+bool ICData::HasOneTarget() const {
+ ASSERT(NumberOfChecks() > 0);
+ const Function& first_target = Function::Handle(GetTargetAt(0));
+ Function& test_target = Function::Handle();
+ for (intptr_t i = 1; i < NumberOfChecks(); i++) {
+ test_target = GetTargetAt(i);
+ if (first_target.raw() != test_target.raw()) {
+ return false;
+ }
+ }
+ return true;
+}
+
+
RawICData* ICData::New(const Function& function,
const String& target_name,
intptr_t deopt_id,
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698