diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs index 64a1741a6d0e88..68fb7ddfc6b2db 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs @@ -305,9 +305,9 @@ private void CreateNodeCaches() tentative.RealBody : (IMethodBodyNode)entrypoint); }); - _tentativeMethods = new NodeCache(method => + _tentativeMethods = new NodeCache(method => { - return new TentativeInstanceMethodNode((IMethodBodyNode)MethodEntrypoint(method)); + return new TentativeInstanceMethodNode(method); }); _unboxingStubs = new NodeCache(CreateUnboxingStubNode); @@ -1106,14 +1106,14 @@ public IMethodNode TentativeMethodEntrypoint(MethodDesc method, bool unboxingStu return _tentativeMethodEntrypoints.GetOrAdd(method); } - private NodeCache _tentativeMethods; + private NodeCache _tentativeMethods; public IMethodNode MethodEntrypointOrTentativeMethod(MethodDesc method, bool unboxingStub = false) { // We might be able to optimize the method body away if the owning type was never seen as allocated. if (method.NotCallableWithoutOwningEEType() && CompilationModuleGroup.AllowInstanceMethodOptimization(method)) { Debug.Assert(!unboxingStub); - return _tentativeMethods.GetOrAdd(method); + return _tentativeMethods.GetOrAdd((IMethodBodyNode)MethodEntrypoint(method, unboxingStub)); } return MethodEntrypoint(method, unboxingStub);