Skip to content

Conversation

@am11
Copy link
Member

@am11 am11 commented Dec 3, 2024

No description provided.

@ghost ghost added the area-VM-coreclr label Dec 3, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 3, 2024
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@am11
Copy link
Member Author

am11 commented Dec 3, 2024

@EgorBot -windows_intel

using System;
using BenchmarkDotNet.Attributes;

public class Bench
{
    [Benchmark]
    public byte GetRef()
    {
        MyStruct myStruct = new MyStruct(42);
        TypedReference tr = __makeref(myStruct);
        byte fieldValue = __refvalue(tr, MyStruct).Field;
        return fieldValue;
    }
}

public struct MyStruct
{
    public byte Field;

    public MyStruct(byte value)
    {
        Field = value;
    }
}

@am11 am11 marked this pull request as ready for review December 3, 2024 13:14
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.

Thanks



/*************************************************************/
HCIMPL2(BOOL, JIT_IsInstanceOfException, CORINFO_CLASS_HANDLE type, Object* obj)
Copy link
Member Author

Choose a reason for hiding this comment

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

@jkotas, there is a QCall ThrowInvalidCastException below this one which uses COMPlusThrowInvalidCastException. Should we:

Copy link
Member

Choose a reason for hiding this comment

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

I think ThrowInvalidCastException QCall is fine as is. I do not see what we would gain by "return the intermediate result" or "pass a callback from managed" refactoring. It would just make the code more complicated.

in favor of asm helpers

I am not sure what you mean by this. This QCall is not related to any asm helpers.

Copy link
Member Author

Choose a reason for hiding this comment

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

his QCall is not related to any asm helpers.

Ah, sorry I thought COMPlusThrow ends up using C++ exception and confusing it with your comment in earlier PR #109087 (comment).

eduardo-vp pushed a commit to eduardo-vp/runtime that referenced this pull request Dec 5, 2024
* Move GetRefAny (with FCThrow) to managed

* Move impl. to TypeReference
mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this pull request Dec 10, 2024
* Move GetRefAny (with FCThrow) to managed

* Move impl. to TypeReference
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants