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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 235013002: Fix polymorphic inlining of method dispatchers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
« runtime/vm/flow_graph_inliner.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 34963)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -48,6 +48,19 @@
}
+Definition* Definition::OriginalDefinition() {
+ Definition* defn = this;
+ while (defn->IsRedefinition() || defn->IsAssertAssignable()) {
+ if (defn->IsRedefinition()) {
+ defn = defn->AsRedefinition()->value()->definition();
+ } else {
+ defn = defn->AsAssertAssignable()->value()->definition();
+ }
+ }
+ return defn;
+}
+
+
ICData* Instruction::GetICData(const Array& ic_data_array) const {
ICData& ic_data = ICData::ZoneHandle();
// The deopt_id can be outside the range of the IC data array for
@@ -2160,10 +2173,15 @@
}
-bool PolymorphicInstanceCallInstr::HasSingleDispatcherTarget() const {
- if (!ic_data().HasOneTarget()) return false;
- const Function& target = Function::Handle(ic_data().GetTargetAt(0));
- return target.IsNoSuchMethodDispatcher() || target.IsInvokeFieldDispatcher();
+bool PolymorphicInstanceCallInstr::HasOnlyDispatcherTargets() const {
+ for (intptr_t i = 0; i < ic_data().NumberOfChecks(); ++i) {
+ const Function& target = Function::Handle(ic_data().GetTargetAt(i));
srdjan 2014/04/11 17:01:04 'Allocate' handle outside the loop.
+ if (!target.IsNoSuchMethodDispatcher() &&
+ !target.IsInvokeFieldDispatcher()) {
+ return false;
+ }
+ }
+ return true;
}
« runtime/vm/flow_graph_inliner.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698