From 2c5ff87481ebb0ee44a3d42a7d178b4cca0f5af8 Mon Sep 17 00:00:00 2001 From: Phil Garcia Date: Sun, 20 Oct 2024 11:56:22 -0700 Subject: [PATCH] Created GC SafePoint (#1245) * - Update packages - Fixed Explorer tool / Emit binary * - Update packages - Fixed Explorer tool / Emit binary * - Added Garbage Collection Point * - Update minor build component * - Replace insecure methods * - Renamed GCPoint to SafePoint and stub stage --- Source/Data/IR-Instructions.json | 2 +- Source/Mosa.Compiler.Framework/Compiler.cs | 2 +- Source/Mosa.Compiler.Framework/IR.cs | 2 +- .../Instructions/{GCPoint.cs => SafePoint.cs} | 6 +++--- .../Stages/{PreciseGCStage.cs => SafePointStage.cs} | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) rename Source/Mosa.Compiler.Framework/Instructions/{GCPoint.cs => SafePoint.cs} (77%) rename Source/Mosa.Compiler.Framework/Stages/{PreciseGCStage.cs => SafePointStage.cs} (73%) diff --git a/Source/Data/IR-Instructions.json b/Source/Data/IR-Instructions.json index 4f9b7e9aa1..e453d10a7d 100644 --- a/Source/Data/IR-Instructions.json +++ b/Source/Data/IR-Instructions.json @@ -1494,7 +1494,7 @@ "IgnoreInstructionBasicBlockTargets": "true" }, { - "Name": "GCPoint", + "Name": "SafePoint", "FamilyName": "IR", "ResultCount": 0, "OperandCount": 0, diff --git a/Source/Mosa.Compiler.Framework/Compiler.cs b/Source/Mosa.Compiler.Framework/Compiler.cs index 0afdf88c98..5eb29149d5 100644 --- a/Source/Mosa.Compiler.Framework/Compiler.cs +++ b/Source/Mosa.Compiler.Framework/Compiler.cs @@ -198,7 +198,7 @@ public sealed class Compiler new DeadBlockStage(), new AdvancedBlockOrderingStage(), - //new PreciseGCStage(), + new SafePointStage(), new CodeGenerationStage(), mosaSettings.EmitBinary ? new ProtectedRegionLayoutStage() : null, diff --git a/Source/Mosa.Compiler.Framework/IR.cs b/Source/Mosa.Compiler.Framework/IR.cs index 87c92bc72f..4249c041a3 100644 --- a/Source/Mosa.Compiler.Framework/IR.cs +++ b/Source/Mosa.Compiler.Framework/IR.cs @@ -224,7 +224,7 @@ public static class IR public static readonly BaseInstruction Truncate64x32 = new Truncate64x32(); public static readonly BaseInstruction TryEnd = new TryEnd(); public static readonly BaseInstruction TryStart = new TryStart(); - public static readonly BaseInstruction GCPoint = new GCPoint(); + public static readonly BaseInstruction SafePoint = new SafePoint(); public static readonly BaseInstruction Rethrow = new Rethrow(); public static readonly BaseInstruction GetVirtualFunctionPtr = new GetVirtualFunctionPtr(); public static readonly BaseInstruction MemoryCopy = new MemoryCopy(); diff --git a/Source/Mosa.Compiler.Framework/Instructions/GCPoint.cs b/Source/Mosa.Compiler.Framework/Instructions/SafePoint.cs similarity index 77% rename from Source/Mosa.Compiler.Framework/Instructions/GCPoint.cs rename to Source/Mosa.Compiler.Framework/Instructions/SafePoint.cs index 19e9259aab..dea9f8bddd 100644 --- a/Source/Mosa.Compiler.Framework/Instructions/GCPoint.cs +++ b/Source/Mosa.Compiler.Framework/Instructions/SafePoint.cs @@ -5,11 +5,11 @@ namespace Mosa.Compiler.Framework.Instructions; /// -/// GCPoint +/// SafePoint /// -public sealed class GCPoint : BaseIRInstruction +public sealed class SafePoint : BaseIRInstruction { - public GCPoint() + public SafePoint() : base(0, 0) { } diff --git a/Source/Mosa.Compiler.Framework/Stages/PreciseGCStage.cs b/Source/Mosa.Compiler.Framework/Stages/SafePointStage.cs similarity index 73% rename from Source/Mosa.Compiler.Framework/Stages/PreciseGCStage.cs rename to Source/Mosa.Compiler.Framework/Stages/SafePointStage.cs index 80c5dab7c6..bece041e2b 100644 --- a/Source/Mosa.Compiler.Framework/Stages/PreciseGCStage.cs +++ b/Source/Mosa.Compiler.Framework/Stages/SafePointStage.cs @@ -3,9 +3,9 @@ namespace Mosa.Compiler.Framework.Stages; /// -/// This stage determines were object references are located in code. +/// This stage inserts the GC safe points. /// -public class PreciseGCStage : BaseMethodCompilerStage +public class SafePointStage : BaseMethodCompilerStage { private TraceLog trace;