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