mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-07 06:58:39 +00:00
Module method IsJITIntrinsic (#77)
This commit is contained in:
@@ -226,9 +226,12 @@ type MethodInfo<'typeGenerics, 'methodGenerics
|
||||
member this.IsPinvokeImpl : bool =
|
||||
this.MethodAttributes.HasFlag MethodAttributes.PinvokeImpl
|
||||
|
||||
member this.IsJITIntrinsic
|
||||
[<RequireQualifiedAccess>]
|
||||
module MethodInfo =
|
||||
let isJITIntrinsic
|
||||
(getMemberRefParentType : MemberReferenceHandle -> TypeRef)
|
||||
(methodDefs : IReadOnlyDictionary<MethodDefinitionHandle, MethodInfo<FakeUnit, GenericParameter>>)
|
||||
(methodDefs : IReadOnlyDictionary<MethodDefinitionHandle, MethodInfo<'a, 'b>>)
|
||||
(this : MethodInfo<'d, 'e>)
|
||||
: bool
|
||||
=
|
||||
this.CustomAttributes
|
||||
@@ -248,8 +251,6 @@ type MethodInfo<'typeGenerics, 'methodGenerics
|
||||
| con -> failwith $"TODO: {con}"
|
||||
)
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module MethodInfo =
|
||||
let mapTypeGenerics<'a, 'b, 'methodGen
|
||||
when 'a :> IComparable<'a> and 'a : comparison and 'b : comparison and 'b :> IComparable<'b>>
|
||||
(f : int -> 'a -> 'b)
|
||||
|
@@ -740,13 +740,14 @@ module IlMachineState =
|
||||
|
||||
// Check for intrinsics first
|
||||
let isIntrinsic =
|
||||
methodToCall.IsJITIntrinsic
|
||||
MethodInfo.isJITIntrinsic
|
||||
(fun handle ->
|
||||
match activeAssy.Members.[handle].Parent with
|
||||
| MetadataToken.TypeReference r -> activeAssy.TypeRefs.[r]
|
||||
| x -> failwith $"{x}"
|
||||
)
|
||||
activeAssy.Methods
|
||||
methodToCall
|
||||
|
||||
match
|
||||
if isIntrinsic then
|
||||
|
Reference in New Issue
Block a user