Skip to content

Commit

Permalink
Added IR Garbage Collection Point (mosa#1243)
Browse files Browse the repository at this point in the history
* - Update packages
- Fixed Explorer tool / Emit binary

* - Update packages
- Fixed Explorer tool / Emit binary

* - Added Garbage Collection Point
  • Loading branch information
tgiphil authored Oct 20, 2024
1 parent 74cb9d6 commit 12a5673
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 39 deletions.
10 changes: 1 addition & 9 deletions Source/Data/IR-Instructions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1251,14 +1251,6 @@
"ResultCount": 1,
"OperandCount": 2
},
{
"Name": "StableObjectTracking",
"FamilyName": "IR",
"ResultCount": 0,
"OperandCount": 0,
"IgnoreDuringCodeGeneration": "true",
"UnspecifiedSideEffect": "true"
},
{
"Name": "StoreCompound",
"FamilyName": "IR",
Expand Down Expand Up @@ -1502,7 +1494,7 @@
"IgnoreInstructionBasicBlockTargets": "true"
},
{
"Name": "UnstableObjectTracking",
"Name": "GCPoint",
"FamilyName": "IR",
"ResultCount": 0,
"OperandCount": 0,
Expand Down
4 changes: 1 addition & 3 deletions Source/Mosa.Compiler.Framework/BaseTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,7 @@ public static TriState AreStatusFlagsUsed(Node node, bool checkZero, bool checkC
if (at.IsBlockEndInstruction)
return TriState.Unknown;

if (at.Instruction == IR.StableObjectTracking
|| at.Instruction == IR.UnstableObjectTracking
|| at.Instruction == IR.Kill
if (at.Instruction == IR.Kill
|| at.Instruction == IR.KillAll
|| at.Instruction == IR.KillAllExcept
|| at.Instruction == IR.Gen)
Expand Down
3 changes: 1 addition & 2 deletions Source/Mosa.Compiler.Framework/IR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public static class IR
public static readonly BaseInstruction ShiftLeft64 = new ShiftLeft64();
public static readonly BaseInstruction ShiftRight32 = new ShiftRight32();
public static readonly BaseInstruction ShiftRight64 = new ShiftRight64();
public static readonly BaseInstruction StableObjectTracking = new StableObjectTracking();
public static readonly BaseInstruction StoreCompound = new StoreCompound();
public static readonly BaseInstruction StoreR4 = new StoreR4();
public static readonly BaseInstruction StoreR8 = new StoreR8();
Expand Down Expand Up @@ -225,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 UnstableObjectTracking = new UnstableObjectTracking();
public static readonly BaseInstruction GCPoint = new GCPoint();
public static readonly BaseInstruction Rethrow = new Rethrow();
public static readonly BaseInstruction GetVirtualFunctionPtr = new GetVirtualFunctionPtr();
public static readonly BaseInstruction MemoryCopy = new MemoryCopy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace Mosa.Compiler.Framework.Instructions;

/// <summary>
/// StableObjectTracking
/// GCPoint
/// </summary>
public sealed class StableObjectTracking : BaseIRInstruction
public sealed class GCPoint : BaseIRInstruction
{
public StableObjectTracking()
public GCPoint()
: base(0, 0)
{
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ protected static void CopyCompound(Transform transform, Context context, Operand
var srcReg = transform.VirtualRegisters.AllocateNativeInteger();
var dstReg = transform.VirtualRegisters.AllocateNativeInteger();

context.SetInstruction(IR.UnstableObjectTracking);

context.AppendInstruction(transform.AddInstruction, srcReg, sourceBase, source);
context.AppendInstruction(transform.AddInstruction, dstReg, destinationBase, destination);

Expand Down Expand Up @@ -72,8 +70,6 @@ protected static void CopyCompound(Transform transform, Context context, Operand
continue;
}
}

context.AppendInstruction(IR.StableObjectTracking);
}

#endregion Helpers
Expand Down

0 comments on commit 12a5673

Please sign in to comment.