C# 클래스 kOS.Safe.Compilation.OpcodePushRelocateLater

This class is an ugly placeholder to handle the fact that sometimes The compiler creates an OpcodePush that uses relocatable DestinationLabels as a temporary place to store their arguments in the list until they get added to the program. Basically, it's this: Old way: 1. In some cases, like setting up locks, Compiler would create an OpcodePush with Argument = null, and a DestinationLabel = something. 2. ProgramBuilder would rebuild the OpcodePush's Argument by copying it from the DestinationLabel as part of ReplaceLabels at runtime. The Problem: When storing this in the ML file, BOTH the Argument AND the DestinationLabel would need to be stored as [MLFields] even though they are never BOTH populated at the same time, which causes ridiculous bloat. New Way: 1. Compiler creates an OpcodePushRelocateLater with a DestinationLabel = something. 2. ProgramBuilder replaces this with a normal OpcodePush who's argument is set to the relocated value of the DestinationLabel. Why: This way the MLFile only stores 1 argument: If it's an OpcodePush, it stores OpcodePush.Argument. If it's an OpcodePushRelocateLater, then it stores just OpcodePushRelocateLater.DestinationLabel and no argument.
상속: Opcode
파일 보기 프로젝트 열기: KSP-KOS/KOS

Private Properties

프로퍼티 타입 설명

공개 메소드들

메소드 설명
Execute ( ICpu cpu ) : void
OpcodePushRelocateLater ( string destLabel ) : System
PopulateFromMLFields ( List fields ) : void
ToString ( ) : string

보호된 메소드들

메소드 설명
OpcodePushRelocateLater ( ) : System

This variant of the constructor is just for ML file save/load to use.

메소드 상세

Execute() 공개 메소드

public Execute ( ICpu cpu ) : void
cpu ICpu
리턴 void

OpcodePushRelocateLater() 보호된 메소드

This variant of the constructor is just for ML file save/load to use.
protected OpcodePushRelocateLater ( ) : System
리턴 System

OpcodePushRelocateLater() 공개 메소드

public OpcodePushRelocateLater ( string destLabel ) : System
destLabel string
리턴 System

PopulateFromMLFields() 공개 메소드

public PopulateFromMLFields ( List fields ) : void
fields List
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string