Skip to content

Commit

Permalink
reach
Browse files Browse the repository at this point in the history
  • Loading branch information
G3Kappa committed Apr 30, 2024
1 parent 20df60a commit 32596ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 3 additions & 5 deletions Ergo/Ergo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);TRACE;_ERGO_PARSER_DIAGNOSTICS;_ERGO_INTERPRETER_DIAGNOSTICS;_ERGO_VM_DIAGNOSTICS</DefineConstants>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>$(DefineConstants);_ERGO_PARSER_DIAGNOSTICS;_ERGO_INTERPRETER_DIAGNOSTICS;_ERGO_VM_DIAGNOSTICS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Diagnostics|AnyCPU'">
<DefineConstants>$(DefineConstants);TRACE;ERGO_PARSER_DIAGNOSTICS;ERGO_INTERPRETER_DIAGNOSTICS;ERGO_VM_DIAGNOSTICS</DefineConstants>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions Ergo/Lang/Compiler/ExecutionGraph.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Ergo.Interpreter;
using Ergo.Runtime.BuiltIns;
using System.Diagnostics;

namespace Ergo.Lang.Compiler;

Expand All @@ -23,7 +22,7 @@ private ErgoVM.Op CompileAndCache()
if (Root is not SequenceNode)
Root.IsContinuationDet = true;
var compiledRoot = Root.Compile();
Debug.WriteLine(Root.Explain(false));
//Debug.WriteLine(Root.Explain(false));
// NOTE: PrepareDelegate pre-JITs 'op' so that we don't incur JIT overhead at runtime.
RuntimeHelpers.PrepareDelegate(compiledRoot);
Compiled = compiledRoot;
Expand Down
2 changes: 2 additions & 0 deletions Ergo/Lang/Types/TermMarshall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ internal static ITypeResolver EnsureNamedResolver(Type t)

private static TermAttribute GetAttribute(Type type)
{
if (type.IsArray)
type = type.GetElementType();
if (AttributeCache.TryGetValue(type, out var attribute)) return attribute;
return AttributeCache[type] = type.GetCustomAttribute<TermAttribute>();
}
Expand Down
2 changes: 1 addition & 1 deletion Ergo/Runtime/ErgoVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ protected virtual void CleanUp()
SubstitutionMap.Pool.Release(Environment);
}

[Conditional("DEBUG")]
[Conditional("ERGO_VM_DIAGNOSTICS")]
internal void LogState([CallerMemberName] string state = null)
{
Debug.WriteLine($"vm{Id:000}:: {state}".Indent(NumChoicePoints, tabWidth: 1));
Expand Down

0 comments on commit 32596ab

Please sign in to comment.