SILGen: Use super_method for native non-final methods in classes

Use the `super_method` instruction for non-final `func` and `class func`
declarations in native Swift classes. Previously, we would always emit
a static `function_ref` for these, which prevents resilient dynamic
dispatch.

This is hidden behind a -use-native-super-dispatch flag while I
survey the effects on devirtualization and stack promotion. When
that's figured out, I'll add more tests and update test cases that
still assume static dispatch.

rdar://problem/22749732
This commit is contained in:
David Farler
2015-12-01 16:06:28 -08:00
parent 5e25990d08
commit a53a31cb6e
7 changed files with 89 additions and 18 deletions

View File

@@ -1002,6 +1002,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.GenerateProfile |= Args.hasArg(OPT_profile_generate);
Opts.EmitProfileCoverageMapping |= Args.hasArg(OPT_profile_coverage_mapping);
Opts.UseNativeSuperMethod |=
Args.hasArg(OPT_use_native_super_method);
return false;
}