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

Method Code

UnLuac/src/unluac/decompile/Code.java:15–43  ·  view source on GitHub ↗
(LFunction function)

Source from the content-addressed store, hash-verified

13 public final int length;
14
15 public Code(LFunction function) {
16 this.code = function.code;
17 this.length = code.length;
18 map = function.header.opmap;
19 extractor = function.header.extractor;
20 extraByte = new boolean[length];
21 for(int i = 0; i < length; i++) {
22 int line = i + 1;
23 Op op = op(line);
24 extraByte[i] = op != null && op.hasExtraByte(codepoint(line), extractor);
25 }
26 upvalue = new boolean[length];
27 if(function.header.version.upvaluedeclarationtype.get() == Version.UpvalueDeclarationType.INLINE) {
28 for(int i = 0; i < length; i++) {
29 int line = i + 1;
30 if(op(line) == Op.CLOSURE) {
31 int f = Bx(line);
32 if(f < function.functions.length) {
33 int nups = function.functions[f].numUpvalues;
34 for(int j = 1; j <= nups; j++) {
35 if(i + j < length) {
36 upvalue[i + j] = true;
37 }
38 }
39 }
40 }
41 }
42 }
43 }
44
45 public CodeExtract getExtractor() {
46 return extractor;

Callers

nothing calls this directly

Calls 5

opMethod · 0.95
hasExtraByteMethod · 0.95
codepointMethod · 0.95
BxMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected