Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove allocatedHotCodeSize field
  • Loading branch information
kunalspathak committed Nov 12, 2021
commit 9825f8809d95a7d59ef2547f12951805bbe75494
9 changes: 3 additions & 6 deletions src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, Method
#endif
}

if (codeSize != allocatedHotCodeSize)
if (codeSize != _code.Length)
{
// If the generated code is smaller than allocatedHotCodeSize, then trim the codeBlock.
//
Expand All @@ -375,10 +375,10 @@ private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, Method
// accordingly.
if (_compilation.Logger.IsVerbose)
{
Log.WriteLine($"Trimming codeSize from {_code.Length} to {codeSize}, Savings: {allocatedHotCodeSize - codeSize}, Method: {_methodCodeNode.Method.Name}");
Log.WriteLine($"Trimming codeSize from {_code.Length} to {codeSize}, Savings: {_code.Length - codeSize}, Method: {_methodCodeNode.Method.Name}");
}
Debug.Assert(codeSize != 0);
Debug.Assert(allocatedHotCodeSize > codeSize);
Debug.Assert(_code.Length > codeSize);
Array.Resize(ref _code, (int)codeSize);
}
PublishCode();
Expand Down Expand Up @@ -3257,8 +3257,6 @@ private bool getTailCallHelpers(ref CORINFO_RESOLVED_TOKEN callToken, CORINFO_SI
private byte[] _gcInfo;
private CORINFO_EH_CLAUSE[] _ehClauses;

private long allocatedHotCodeSize = 0;

private void allocMem(ref AllocMemArgs args)
{
args.hotCodeBlock = (void*)GetPin(_code = new byte[args.hotCodeSize]);
Expand All @@ -3269,7 +3267,6 @@ private void allocMem(ref AllocMemArgs args)
args.coldCodeBlock = (void*)GetPin(_coldCode = new byte[args.coldCodeSize]);
args.coldCodeBlockRW = args.coldCodeBlock;
}
allocatedHotCodeSize = args.hotCodeSize;

_codeAlignment = -1;
if ((args.flag & CorJitAllocMemFlag.CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN) != 0)
Expand Down