Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

NS2.0 Implement Synchronized(Stream).BeginRead() and BeginWrite() #3251

Closed
ghost opened this issue Apr 7, 2017 · 2 comments · Fixed by dotnet/runtime#72252
Closed

NS2.0 Implement Synchronized(Stream).BeginRead() and BeginWrite() #3251

ghost opened this issue Apr 7, 2017 · 2 comments · Fixed by dotnet/runtime#72252
Milestone

Comments

@ghost
Copy link

ghost commented Apr 7, 2017

This method needs to know if a Stream has overridden BeginRead or BeginWrite. CoreCLR does this with an FCall. We don't have a direct alternative (other than shudder, Reflection.)

Need to figure out something here.

@MichalStrehovsky
Copy link
Member

Once Roslyn implements dotnet/roslyn#11475, can we implement this using a combination of LoadFunctionPointer and LoadVirtualFunctionPointer?

@ghost ghost added this to the UWP6.0 milestone Jun 1, 2017
@ghost
Copy link
Author

ghost commented Jun 15, 2017

TFS 451292

@ghost ghost closed this as completed Jun 15, 2017
marek-safar added a commit to marek-safar/coreclr that referenced this issue May 31, 2018
jkotas pushed a commit to dotnet/coreclr that referenced this issue Jun 1, 2018
* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to dotnet/corert#3251
dotnet-bot pushed a commit that referenced this issue Jun 1, 2018
* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to #3251

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
dotnet-bot pushed a commit to dotnet/corefx that referenced this issue Jun 1, 2018
* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to dotnet/corert#3251

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
stephentoub pushed a commit to dotnet/corefx that referenced this issue Jun 1, 2018
* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to dotnet/corert#3251

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
jkotas pushed a commit that referenced this issue Jun 1, 2018
* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to #3251

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
caesar-chen pushed a commit to caesar-chen/corefx that referenced this issue Jun 1, 2018
* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to dotnet/corert#3251

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
MichalStrehovsky added a commit to MichalStrehovsky/runtime that referenced this issue Jul 15, 2022
Fixes dotnet/corert#3251.

`Stream.HasOverriddenBeginEndRead`/`Stream.HasOverriddenBeginEndWrite` are magic methods that call into the runtime on both CoreCLR and Mono to find out whether `Stream.BeginRead`/`EndRead`/`BeginWrite`/`EndWrite` are overriden on the current class.

Since we don't have a runtime in NativeAOT, implement this in the compiler. The answer to this question is expressible in IL: load function pointer to the method virtually and non-virtually and compare. I'm not calling into `FunctionPointerOps` because I can't imagine a scenario where this wouldn't work, but I can be persuaded to call to `FunctionPointerOps` to do the comparison.

Should make us pass all System.IO libraries tests.
jkotas pushed a commit to dotnet/runtime that referenced this issue Jul 16, 2022
Fixes dotnet/corert#3251.

`Stream.HasOverriddenBeginEndRead`/`Stream.HasOverriddenBeginEndWrite` are magic methods that call into the runtime on both CoreCLR and Mono to find out whether `Stream.BeginRead`/`EndRead`/`BeginWrite`/`EndWrite` are overriden on the current class.

Since we don't have a runtime in NativeAOT, implement this in the compiler. The answer to this question is expressible in IL: load function pointer to the method virtually and non-virtually and compare. I'm not calling into `FunctionPointerOps` because I can't imagine a scenario where this wouldn't work, but I can be persuaded to call to `FunctionPointerOps` to do the comparison.

Should make us pass all System.IO libraries tests.
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant