AS3 - list of instructions after CTRL+SPACE fix

AS3 - methodinfo refactoring
This commit is contained in:
Jindra Pet��k
2011-07-10 17:31:01 +02:00
parent 6b3a959054
commit 27df4647a0
3 changed files with 10 additions and 15 deletions
+4 -4
View File
@@ -169,8 +169,8 @@ public class ABC {
bodies[i].method_info = ais.readU30(); bodies[i].method_info = ais.readU30();
bodies[i].max_stack = ais.readU30(); bodies[i].max_stack = ais.readU30();
bodies[i].max_regs = ais.readU30(); bodies[i].max_regs = ais.readU30();
bodies[i].scope_depth = ais.readU30(); bodies[i].init_scope_depth = ais.readU30();
bodies[i].max_scope = ais.readU30(); bodies[i].max_scope_depth = ais.readU30();
int code_length = ais.readU30(); int code_length = ais.readU30();
bodies[i].codeBytes = new byte[code_length]; bodies[i].codeBytes = new byte[code_length];
for (int j = 0; j < code_length; j++) { for (int j = 0; j < code_length; j++) {
@@ -279,8 +279,8 @@ public class ABC {
aos.writeU30(bodies[i].method_info); aos.writeU30(bodies[i].method_info);
aos.writeU30(bodies[i].max_stack); aos.writeU30(bodies[i].max_stack);
aos.writeU30(bodies[i].max_regs); aos.writeU30(bodies[i].max_regs);
aos.writeU30(bodies[i].scope_depth); aos.writeU30(bodies[i].init_scope_depth);
aos.writeU30(bodies[i].max_scope); aos.writeU30(bodies[i].max_scope_depth);
byte codeBytes[] = bodies[i].code.getBytes(); byte codeBytes[] = bodies[i].code.getBytes();
aos.writeU30(codeBytes.length); aos.writeU30(codeBytes.length);
try { try {
@@ -175,11 +175,6 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener {
rightPanel.setLayout(new BorderLayout()); rightPanel.setLayout(new BorderLayout());
rightPanel.add(new JScrollPane(sourceTextArea), BorderLayout.CENTER); rightPanel.add(new JScrollPane(sourceTextArea), BorderLayout.CENTER);
sourceTextArea.setContentType("text/flasm3"); sourceTextArea.setContentType("text/flasm3");
ActionMap am=sourceTextArea.getActionMap();
ComboCompletionAction cca=(ComboCompletionAction)am.get("combo-completion");
List<String> items=new ArrayList<String>();
items.add("ahoj");
cca.setItems(items);
JPanel buttonsPan = new JPanel(); JPanel buttonsPan = new JPanel();
buttonsPan.setLayout(new FlowLayout()); buttonsPan.setLayout(new FlowLayout());
JButton verifyButton = new JButton("Verify"); JButton verifyButton = new JButton("Verify");
@@ -30,8 +30,8 @@ public class MethodBody implements Cloneable {
public int method_info; public int method_info;
public int max_stack; public int max_stack;
public int max_regs; public int max_regs;
public int scope_depth; public int init_scope_depth;
public int max_scope; public int max_scope_depth;
public byte codeBytes[]; public byte codeBytes[];
public AVM2Code code; public AVM2Code code;
public ABCException exceptions[] = new ABCException[0]; public ABCException exceptions[] = new ABCException[0];
@@ -40,7 +40,7 @@ public class MethodBody implements Cloneable {
@Override @Override
public String toString() { public String toString() {
String s = ""; String s = "";
s += "method_info=" + method_info + " max_stack=" + max_stack + " max_regs=" + max_regs + " scope_depth=" + scope_depth + " max_scope=" + max_scope; s += "method_info=" + method_info + " max_stack=" + max_stack + " max_regs=" + max_regs + " scope_depth=" + init_scope_depth + " max_scope=" + max_scope_depth;
s += "\r\nCode:\r\n" + code.toString(); s += "\r\nCode:\r\n" + code.toString();
return s; return s;
} }
@@ -87,10 +87,10 @@ public class MethodBody implements Cloneable {
ret.codeBytes = codeBytes; ret.codeBytes = codeBytes;
ret.exceptions = exceptions; ret.exceptions = exceptions;
ret.max_regs = max_regs; ret.max_regs = max_regs;
ret.max_scope = max_scope; ret.max_scope_depth = max_scope_depth;
ret.max_stack = max_stack; ret.max_stack = max_stack;
ret.method_info = method_info; ret.method_info = method_info;
ret.scope_depth = scope_depth; ret.init_scope_depth = init_scope_depth;
ret.traits = traits; //maybe deep clone ret.traits = traits; //maybe deep clone
return ret; return ret;
} }