/// CHECK-NOT: Deoptimize publicstaticint inlinePolymophicCrossDexSubASubC(Super a) { return a.getValue();
}
/// CHECK-START: int Main.inlineMegamorphic(Super) inliner (before) /// CHECK: InvokeVirtual method_name:Super.getValue
/// CHECK-START: int Main.inlineMegamorphic(Super) inliner (after) /// CHECK: InvokeVirtual method_name:Super.getValue publicstaticint inlineMegamorphic(Super a) { return a.getValue();
}
/// CHECK-START: int Main.inlineMissingTypes(Super) inliner (before) /// CHECK: InvokeVirtual method_name:Super.getValue
/// CHECK-START: int Main.inlineMissingTypes(Super) inliner (after) /// CHECK: InvokeVirtual method_name:Super.getValue publicstaticint inlineMissingTypes(Super a) { return a.getValue();
}
/// CHECK-START: int Main.noInlineCache(Super) inliner (before) /// CHECK: InvokeVirtual method_name:Super.getValue
/// CHECK-START: int Main.noInlineCache(Super) inliner (after) /// CHECK: InvokeVirtual method_name:Super.getValue publicstaticint noInlineCache(Super a) { return a.getValue();
}
// We shouldn't inline `someSubclassesThrow` since we are trying a monomorphic inline and it // always throws for SubA. However, we shouldn't mark it as `always_throws` since we speculatively // tried to inline and other subclasses (e.g. SubB) can call noInlineSomeSubclassesThrow and they // don't throw.
if (inlinePolymophicSubASubB(new SubB()) != 38) { thrownew Error("Expected 38");
}
// Call with a different type than the one from the inline cache. if (inlinePolymophicSubASubB(new SubC()) != 24) { thrownew Error("Expected 25");
}
if (inlinePolymophicCrossDexSubASubC(new SubA()) != 42) { thrownew Error("Expected 42");
}
if (inlinePolymophicCrossDexSubASubC(new SubC()) != 24) { thrownew Error("Expected 24");
}
// Call with a different type than the one from the inline cache. if (inlinePolymophicCrossDexSubASubC(new SubB()) != 38) { thrownew Error("Expected 38");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.