Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Preparation to introduce parallelism into CrossGen2 #27068

Merged
merged 3 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/tools/crossgen2/Common/Compiler/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Logger

public Logger(TextWriter writer, bool isVerbose)
{
Writer = writer;
Writer = TextWriter.Synchronized(writer);
IsVerbose = isVerbose;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;

using ILCompiler.DependencyAnalysis;
using System.Threading;

using Internal.JitInterface;
using Internal.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
Expand All @@ -25,9 +25,9 @@ public class ModuleTokenResolver
/// Reverse lookup table mapping external types to reference tokens in the input modules. The table
/// gets lazily initialized as various tokens are resolved in CorInfoImpl.
/// </summary>
private readonly Dictionary<EcmaType, ModuleToken> _typeToRefTokens = new Dictionary<EcmaType, ModuleToken>();
private readonly ConcurrentDictionary<EcmaType, ModuleToken> _typeToRefTokens = new ConcurrentDictionary<EcmaType, ModuleToken>();

private readonly Dictionary<FieldDesc, ModuleToken> _fieldToRefTokens = new Dictionary<FieldDesc, ModuleToken>();
private readonly ConcurrentDictionary<FieldDesc, ModuleToken> _fieldToRefTokens = new ConcurrentDictionary<FieldDesc, ModuleToken>();

private readonly CompilationModuleGroup _compilationModuleGroup;

Expand Down Expand Up @@ -163,6 +163,7 @@ public void AddModuleTokenForField(FieldDesc field, ModuleToken token)
}

_fieldToRefTokens[canonField] = token;

switch (token.TokenType)
{
case CorTokenType.mdtMemberRef:
Expand Down
Loading