From b974c59a7cf29ac98ed3d030023c899c3106ca95 Mon Sep 17 00:00:00 2001 From: ike709 Date: Thu, 24 Oct 2024 14:42:46 -0500 Subject: [PATCH] Rename `AssignPop` to `AssignNoPush` (#2058) Co-authored-by: ike709 --- DMCompiler/Bytecode/DreamProcOpcode.cs | 2 +- DMCompiler/Optimizer/PeepholeOptimizations.cs | 10 +++++----- OpenDreamRuntime/Procs/DMOpcodeHandlers.cs | 2 +- OpenDreamRuntime/Procs/DMProc.cs | 2 +- OpenDreamRuntime/Procs/ProcDecoder.cs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DMCompiler/Bytecode/DreamProcOpcode.cs b/DMCompiler/Bytecode/DreamProcOpcode.cs index 6aa9f3744b..f0f7a6f2a5 100644 --- a/DMCompiler/Bytecode/DreamProcOpcode.cs +++ b/DMCompiler/Bytecode/DreamProcOpcode.cs @@ -255,7 +255,7 @@ public enum DreamProcOpcode : byte { // Peephole optimization opcodes //0x84 [OpcodeMetadata(-1, OpcodeArgType.Reference)] - AssignPop = 0x85, + AssignNoPush = 0x85, [OpcodeMetadata(1, OpcodeArgType.Reference, OpcodeArgType.String)] PushRefAndDereferenceField = 0x86, [OpcodeMetadata(true, 0, OpcodeArgType.Int)] diff --git a/DMCompiler/Optimizer/PeepholeOptimizations.cs b/DMCompiler/Optimizer/PeepholeOptimizations.cs index 899dfc5e84..ad82b829a4 100644 --- a/DMCompiler/Optimizer/PeepholeOptimizations.cs +++ b/DMCompiler/Optimizer/PeepholeOptimizations.cs @@ -4,8 +4,8 @@ namespace DMCompiler.Optimizer; // Assign [ref] // Pop -// -> AssignPop [ref] -internal sealed class AssignPop : IPeepholeOptimization { +// -> AssignNoPush [ref] +internal sealed class AssignNoPush : IPeepholeOptimization { public ReadOnlySpan GetOpcodes() { return [ DreamProcOpcode.Assign, @@ -22,18 +22,18 @@ public void Apply(List input, int index) { AnnotatedBytecodeReference assignTarget = firstInstruction.GetArg(0); input.RemoveRange(index, 2); - input.Insert(index, new AnnotatedBytecodeInstruction(DreamProcOpcode.AssignPop, [assignTarget])); + input.Insert(index, new AnnotatedBytecodeInstruction(DreamProcOpcode.AssignNoPush, [assignTarget])); } } // PushNull -// AssignPop [ref] +// AssignNoPush [ref] // -> AssignNull [ref] internal sealed class AssignNull : IPeepholeOptimization { public ReadOnlySpan GetOpcodes() { return [ DreamProcOpcode.PushNull, - DreamProcOpcode.AssignPop + DreamProcOpcode.AssignNoPush ]; } diff --git a/OpenDreamRuntime/Procs/DMOpcodeHandlers.cs b/OpenDreamRuntime/Procs/DMOpcodeHandlers.cs index 1d1e856773..60e217d242 100644 --- a/OpenDreamRuntime/Procs/DMOpcodeHandlers.cs +++ b/OpenDreamRuntime/Procs/DMOpcodeHandlers.cs @@ -2877,7 +2877,7 @@ public static ProcStatus NullRef(DMProcState state) { return ProcStatus.Continue; } - public static ProcStatus AssignPop(DMProcState state) { + public static ProcStatus AssignNoPush(DMProcState state) { DreamReference reference = state.ReadReference(); DreamValue value = state.Pop(); diff --git a/OpenDreamRuntime/Procs/DMProc.cs b/OpenDreamRuntime/Procs/DMProc.cs index 0db9fe6aeb..43bdb47088 100644 --- a/OpenDreamRuntime/Procs/DMProc.cs +++ b/OpenDreamRuntime/Procs/DMProc.cs @@ -304,7 +304,7 @@ public sealed class DMProcState : ProcState { {DreamProcOpcode.Rgb, DMOpcodeHandlers.Rgb}, // Peephole optimizer opcode handlers {DreamProcOpcode.NullRef, DMOpcodeHandlers.NullRef}, - {DreamProcOpcode.AssignPop, DMOpcodeHandlers.AssignPop}, + {DreamProcOpcode.AssignNoPush, DMOpcodeHandlers.AssignNoPush}, {DreamProcOpcode.PushRefAndDereferenceField, DMOpcodeHandlers.PushReferenceAndDereferenceField}, {DreamProcOpcode.PushNRefs, DMOpcodeHandlers.PushNRefs}, {DreamProcOpcode.PushNFloats, DMOpcodeHandlers.PushNFloats}, diff --git a/OpenDreamRuntime/Procs/ProcDecoder.cs b/OpenDreamRuntime/Procs/ProcDecoder.cs index c4c19ce291..63ba7a60fa 100644 --- a/OpenDreamRuntime/Procs/ProcDecoder.cs +++ b/OpenDreamRuntime/Procs/ProcDecoder.cs @@ -108,7 +108,7 @@ public ITuple DecodeInstruction() { case DreamProcOpcode.OutputReference: case DreamProcOpcode.PushReferenceValue: case DreamProcOpcode.PopReference: - case DreamProcOpcode.AssignPop: + case DreamProcOpcode.AssignNoPush: case DreamProcOpcode.ReturnReferenceValue: return (opcode, ReadReference());