github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/engine/wazevo/backend/isa/amd64/machine.go (about) 1 package amd64 2 3 import ( 4 "context" 5 6 "github.com/bananabytelabs/wazero/internal/engine/wazevo/backend" 7 "github.com/bananabytelabs/wazero/internal/engine/wazevo/backend/regalloc" 8 "github.com/bananabytelabs/wazero/internal/engine/wazevo/ssa" 9 "github.com/bananabytelabs/wazero/internal/engine/wazevo/wazevoapi" 10 ) 11 12 // NewBackend returns a new backend for arm64. 13 func NewBackend() backend.Machine { 14 m := &machine{} 15 return m 16 } 17 18 // machine implements backend.Machine for amd64. 19 type machine struct { 20 stackBoundsCheckDisabled bool 21 } 22 23 // ExecutableContext implements backend.Machine. 24 func (m *machine) ExecutableContext() backend.ExecutableContext { 25 // TODO implement me 26 panic("implement me") 27 } 28 29 // DisableStackCheck implements backend.Machine. 30 func (m *machine) DisableStackCheck() { 31 m.stackBoundsCheckDisabled = true 32 } 33 34 // RegisterInfo implements backend.Machine. 35 func (m *machine) RegisterInfo() *regalloc.RegisterInfo { 36 // TODO implement me 37 panic("implement me") 38 } 39 40 // InitializeABI implements backend.Machine. 41 func (m *machine) InitializeABI(sig *ssa.Signature) { 42 // TODO implement me 43 panic("implement me") 44 } 45 46 // ABI implements backend.Machine. 47 func (m *machine) ABI() backend.FunctionABI { 48 // TODO implement me 49 panic("implement me") 50 } 51 52 // SetCompiler implements backend.Machine. 53 func (m *machine) SetCompiler(compiler backend.Compiler) { 54 // TODO implement me 55 panic("implement me") 56 } 57 58 // StartLoweringFunction implements backend.Machine. 59 func (m *machine) StartLoweringFunction(maximumBlockID ssa.BasicBlockID) { 60 // TODO implement me 61 panic("implement me") 62 } 63 64 // StartBlock implements backend.Machine. 65 func (m *machine) StartBlock(block ssa.BasicBlock) { 66 // TODO implement me 67 panic("implement me") 68 } 69 70 // LowerSingleBranch implements backend.Machine. 71 func (m *machine) LowerSingleBranch(b *ssa.Instruction) { 72 // TODO implement me 73 panic("implement me") 74 } 75 76 // LowerConditionalBranch implements backend.Machine. 77 func (m *machine) LowerConditionalBranch(b *ssa.Instruction) { 78 // TODO implement me 79 panic("implement me") 80 } 81 82 // LowerInstr implements backend.Machine. 83 func (m *machine) LowerInstr(instruction *ssa.Instruction) { 84 // TODO implement me 85 panic("implement me") 86 } 87 88 // EndBlock implements backend.Machine. 89 func (m *machine) EndBlock() { 90 // TODO implement me 91 panic("implement me") 92 } 93 94 // LinkAdjacentBlocks implements backend.Machine. 95 func (m *machine) LinkAdjacentBlocks(prev, next ssa.BasicBlock) { 96 // TODO implement me 97 panic("implement me") 98 } 99 100 // Reset implements backend.Machine. 101 func (m *machine) Reset() { 102 // TODO implement me 103 panic("implement me") 104 } 105 106 // FlushPendingInstructions implements backend.Machine. 107 func (m *machine) FlushPendingInstructions() { 108 // TODO implement me 109 panic("implement me") 110 } 111 112 // InsertMove implements backend.Machine. 113 func (m *machine) InsertMove(dst, src regalloc.VReg, typ ssa.Type) { 114 // TODO implement me 115 panic("implement me") 116 } 117 118 // InsertReturn implements backend.Machine. 119 func (m *machine) InsertReturn() { 120 // TODO implement me 121 panic("implement me") 122 } 123 124 // InsertLoadConstant implements backend.Machine. 125 func (m *machine) InsertLoadConstant(instr *ssa.Instruction, vr regalloc.VReg) { 126 // TODO implement me 127 panic("implement me") 128 } 129 130 // Format implements backend.Machine. 131 func (m *machine) Format() string { 132 // TODO implement me 133 panic("implement me") 134 } 135 136 // Function implements backend.Machine. 137 func (m *machine) Function() regalloc.Function { 138 // TODO implement me 139 panic("implement me") 140 } 141 142 // SetupPrologue implements backend.Machine. 143 func (m *machine) SetupPrologue() { 144 // TODO implement me 145 panic("implement me") 146 } 147 148 // SetupEpilogue implements backend.Machine. 149 func (m *machine) SetupEpilogue() { 150 // TODO implement me 151 panic("implement me") 152 } 153 154 // ResolveRelativeAddresses implements backend.Machine. 155 func (m *machine) ResolveRelativeAddresses(ctx context.Context) { 156 // TODO implement me 157 panic("implement me") 158 } 159 160 // ResolveRelocations implements backend.Machine. 161 func (m *machine) ResolveRelocations(refToBinaryOffset map[ssa.FuncRef]int, binary []byte, relocations []backend.RelocationInfo) { 162 // TODO implement me 163 panic("implement me") 164 } 165 166 // Encode implements backend.Machine. 167 func (m *machine) Encode() { 168 // TODO implement me 169 panic("implement me") 170 } 171 172 // CompileGoFunctionTrampoline implements backend.Machine. 173 func (m *machine) CompileGoFunctionTrampoline(exitCode wazevoapi.ExitCode, sig *ssa.Signature, needModuleContextPtr bool) []byte { 174 // TODO implement me 175 panic("implement me") 176 } 177 178 // CompileStackGrowCallSequence implements backend.Machine. 179 func (m *machine) CompileStackGrowCallSequence() []byte { 180 // TODO implement me 181 panic("implement me") 182 } 183 184 // CompileEntryPreamble implements backend.Machine. 185 func (m *machine) CompileEntryPreamble(signature *ssa.Signature) []byte { 186 // TODO implement me 187 panic("implement me") 188 }