Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement instantiating and unboxing through portable stublinker code… #106

Merged
merged 2 commits into from
Nov 21, 2019
Merged

Implement instantiating and unboxing through portable stublinker code… #106

merged 2 commits into from
Nov 21, 2019

Conversation

davidwrighton
Copy link
Member

@davidwrighton davidwrighton commented Nov 18, 2019

  • Handle only the cases with register to register moves
  • Followon work to remove the old instantiating/unboxing stub infra (except for x86, x86 will remain special)
  • Shares abi processing logic with delegate shuffle thunk creation
  • Architecture specific logic is relatively simple
  • Do not permit use of HELPERREG in computed instantiating stubs
  • Fix GetArgLoc such that it works on all architectures and OS combinations

Add a JIT stress test case for testing all of the various combinations

  • Use the same calling convention test architecture that was used as part of tail call work

Rename secure delegates to wrapper delegates

  • Secure delegates are no longer a feature of the runtime
  • But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi

… - Handle only the cases with register to register moves - Followon work to remove the old instantiating/unboxing stub infra (except for x86, x86 will remain special) - Shares abi processing logic with delegate shuffle thunk creation - Architecture specific logic is relatively simple - Do not permit use of HELPERREG in computed instantiating stubs - Fix GetArgLoc such that it works on all architectures and OS combinations

Add a JIT stress test case for testing all of the various combinations
- Use the same calling convention test architecture that was used as part of tail call work

Rename secure delegates to wrapper delegates
- Secure delegates are no longer a feature of the runtime
- But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi
@davidwrighton davidwrighton requested a review from jkotas November 19, 2019 00:11
@@ -62,6 +67,7 @@
<DefineConstants Condition="'$(FeatureDefaultInterfaces)' == 'true'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants>
<DefineConstants Condition="'$(FeatureTypeEquivalence)' == 'true'">$(DefineConstants);FEATURE_TYPEEQUIVALENCE</DefineConstants>
<DefineConstants Condition="'$(FeatureBasicFreeze)' == 'true'">$(DefineConstants);FEATURE_BASICFREEZE</DefineConstants>
<DefineConstants Condition="'$(FeaturePortableShuffleThunks)' == 'true'">$(DefineConstants);FEATURE_PORTABLE_SHUFFLE_THUNKS</DefineConstants>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This is not really needed here. FEATURE_PORTABLE_SHUFFLE_THUNKS has no impact on anything implemented in C# and chances that it will ever have are pretty low. There are number of other FEATURE_XXX that are defined for cmake only.

@@ -562,7 +561,7 @@ protected override MethodInfo GetMethodImpl()
return (MethodInfo)_methodBase;
}

// Otherwise, must be an inner delegate of a SecureDelegate of an open virtual method. In that case, call base implementation
// Otherwise, must be an inner delegate of a WrapperDelegate of an open virtual method. In that case, call base implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Otherwise, must be an inner delegate of a WrapperDelegate of an open virtual method. In that case, call base implementation
// Otherwise, must be an inner delegate of a wrapper delegate of an open virtual method. In that case, call base implementation

@@ -1790,7 +1765,11 @@ class SecureDelegateFrame : public TransitionFrame
PromoteCallerStack(fn, sc);
}

virtual Assembly *GetAssembly();
virtual Assembly *GetAssembly()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore. And the base implementation does not need to be virtual anymore.

@@ -99,6 +99,7 @@ EXTERN_C void SinglecastDelegateInvokeStub();
#define ENREGISTERED_RETURNTYPE_INTEGER_MAXSIZE 4
#define CALLDESCR_ARGREGS 1 // CallDescrWorker has ArgumentRegister parameter

#define NO_SHUFFLE_INSTANTIATINGSTUB 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no, that's a legacy of an old factoring of the FEATURE flags that was terrible. Let me delete that.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jashook
Copy link
Contributor

jashook commented Nov 19, 2019

@davidwrighton is this worth running outerloop testing on?

@davidwrighton
Copy link
Member Author

@jashook I've run outerloop before in the coreclr repo, and it found nothing, so I don't really want to run it more unless I have to. I have a small set of changes from Jan to incorporate, and then I'll run the normal CI again, and then merge the code.

@davidwrighton
Copy link
Member Author

/azp list

@davidwrighton
Copy link
Member Author

/azp run runtime-coreclr

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidwrighton davidwrighton merged commit be8e050 into dotnet:master Nov 21, 2019
@jashook
Copy link
Contributor

jashook commented Nov 21, 2019

@davidwrighton I have started collecting data on the merged commit.

@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants