private void encodeBranch(Branch branch) { writer.writeUI8(branch.code); writer.writeUI16(2); int pos = writer.Pos; if (labels.ContainsKey(branch.target)) { // label came earlier writer.writeSI16(getLabelOffset(branch.target) - pos - 2); } else { // label comes later. don't know the offset yet. updates.Add(new UpdateEntry(pos + 2, pos, branch)); writer.writeSI16(0); } }
public override void jump(Branch action) { encodeBranch(action); }
public override void ifAction(Branch action) { encodeBranch(action); }