()
| 165 | var jumpTable [opCodeMax + 1]instFunc |
| 166 | |
| 167 | func init() { |
| 168 | jumpTable = [opCodeMax + 1]instFunc{ |
| 169 | func(L *LState, inst uint32, baseframe *callFrame) int { //OP_MOVE |
| 170 | reg := L.reg |
| 171 | cf := L.currentFrame |
| 172 | lbase := cf.LocalBase |
| 173 | A := int(inst>>18) & 0xff //GETA |
| 174 | RA := lbase + A |
| 175 | B := int(inst & 0x1ff) //GETB |
| 176 | v := reg.Get(lbase + B) |
| 177 | // +inline-call reg.Set RA v |
| 178 | return 0 |
| 179 | }, |
| 180 | func(L *LState, inst uint32, baseframe *callFrame) int { //OP_MOVEN |
| 181 | reg := L.reg |
| 182 | cf := L.currentFrame |
| 183 | lbase := cf.LocalBase |
| 184 | A := int(inst>>18) & 0xff //GETA |
| 185 | B := int(inst & 0x1ff) //GETB |
| 186 | C := int(inst>>9) & 0x1ff //GETC |
| 187 | v := reg.Get(lbase + B) |
| 188 | // +inline-call reg.Set lbase+A v |
| 189 | code := cf.Fn.Proto.Code |
| 190 | pc := cf.Pc |
| 191 | for i := 0; i < C; i++ { |
| 192 | inst = code[pc] |
| 193 | pc++ |
| 194 | A = int(inst>>18) & 0xff //GETA |
| 195 | B = int(inst & 0x1ff) //GETB |
| 196 | v := reg.Get(lbase + B) |
| 197 | // +inline-call reg.Set lbase+A v |
| 198 | } |
| 199 | cf.Pc = pc |
| 200 | return 0 |
| 201 | }, |
| 202 | func(L *LState, inst uint32, baseframe *callFrame) int { //OP_LOADK |
| 203 | reg := L.reg |
| 204 | cf := L.currentFrame |
| 205 | lbase := cf.LocalBase |
| 206 | A := int(inst>>18) & 0xff //GETA |
| 207 | RA := lbase + A |
| 208 | Bx := int(inst & 0x3ffff) //GETBX |
| 209 | v := cf.Fn.Proto.Constants[Bx] |
| 210 | // +inline-call reg.Set RA v |
| 211 | return 0 |
| 212 | }, |
| 213 | func(L *LState, inst uint32, baseframe *callFrame) int { //OP_LOADBOOL |
| 214 | reg := L.reg |
| 215 | cf := L.currentFrame |
| 216 | lbase := cf.LocalBase |
| 217 | A := int(inst>>18) & 0xff //GETA |
| 218 | RA := lbase + A |
| 219 | B := int(inst & 0x1ff) //GETB |
| 220 | C := int(inst>>9) & 0x1ff //GETC |
| 221 | if B != 0 { |
| 222 | // +inline-call reg.Set RA LTrue |
| 223 | } else { |
| 224 | // +inline-call reg.Set RA LFalse |
nothing calls this directly
no test coverage detected
searching dependent graphs…