MCPcopy Create free account
hub / github.com/Hiro420/NikkeTools / processLine

Method processLine

UnLuac/src/unluac/decompile/Decompiler.java:290–768  ·  view source on GitHub ↗
(State state, int line)

Source from the content-addressed store, hash-verified

288 }
289
290 private List<Operation> processLine(State state, int line) {
291 Registers r = state.r;
292 boolean[] skip = state.skip;
293 List<Operation> operations = new LinkedList<Operation>();
294 int A = code.A(line);
295 int B = code.B(line);
296 int C = code.C(line);
297 int Bx = code.Bx(line);
298 switch(code.op(line)) {
299 case MOVE:
300 operations.add(new RegisterSet(line, A, r.getExpression(B, line)));
301 break;
302 case LOADI:
303 operations.add(new RegisterSet(line, A, ConstantExpression.createInteger(code.sBx(line))));
304 break;
305 case LOADF:
306 operations.add(new RegisterSet(line, A, ConstantExpression.createDouble((double) code.sBx(line))));
307 break;
308 case LOADK:
309 operations.add(new RegisterSet(line, A, f.getConstantExpression(Bx)));
310 break;
311 case LOADKX:
312 if(line + 1 > code.length || code.op(line + 1) != Op.EXTRAARG) throw new IllegalStateException();
313 operations.add(new RegisterSet(line, A, f.getConstantExpression(code.Ax(line + 1))));
314 break;
315 case LOADBOOL:
316 operations.add(new RegisterSet(line, A, ConstantExpression.createBoolean(B != 0)));
317 break;
318 case LOADFALSE:
319 case LFALSESKIP:
320 operations.add(new RegisterSet(line, A, ConstantExpression.createBoolean(false)));
321 break;
322 case LOADTRUE:
323 operations.add(new RegisterSet(line, A, ConstantExpression.createBoolean(true)));
324 break;
325 case LOADNIL:
326 operations.add(new LoadNil(line, A, B));
327 break;
328 case LOADNIL52:
329 operations.add(new LoadNil(line, A, A + B));
330 break;
331 case GETGLOBAL:
332 operations.add(new RegisterSet(line, A, f.getGlobalExpression(Bx)));
333 break;
334 case SETGLOBAL:
335 operations.add(new GlobalSet(line, f.getGlobalName(Bx), r.getExpression(A, line)));
336 break;
337 case GETUPVAL:
338 operations.add(new RegisterSet(line, A, upvalues.getExpression(B)));
339 break;
340 case SETUPVAL:
341 operations.add(new UpvalueSet(line, upvalues.getName(B), r.getExpression(A, line)));
342 break;
343 case GETTABUP:
344 operations.add(new RegisterSet(line, A, new TableReference(upvalues.getExpression(B), r.getKExpression(C, line))));
345 break;
346 case GETTABUP54:
347 operations.add(new RegisterSet(line, A, new TableReference(upvalues.getExpression(B), f.getConstantExpression(C))));

Callers 1

processSequenceMethod · 0.95

Calls 15

getExpressionMethod · 0.95
createIntegerMethod · 0.95
createDoubleMethod · 0.95
createBooleanMethod · 0.95
getKExpressionMethod · 0.95
getKExpression54Method · 0.95
fb2int50Method · 0.95
fb2intMethod · 0.95
handle50BinOpMethod · 0.95
handle54BinOpMethod · 0.95
decodeBinOpMethod · 0.95
makeMethod · 0.95

Tested by

no test coverage detected