X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fcode.h;h=fb94bd4f5ab597af6af118fc6d221f554cf8f6b8;hb=29543aab8e1996fab6f1c32ee0b57ecd9fa52814;hp=a53c02b89ee5578d7de253e8af516f5a88d9d85d;hpb=06ff5b9080ab817073bea93cecf5a7ad8971389d;p=swftools.git diff --git a/lib/as3/code.h b/lib/as3/code.h index a53c02b..fb94bd4 100644 --- a/lib/as3/code.h +++ b/lib/as3/code.h @@ -4,6 +4,7 @@ #include "../q.h" DECLARE(abc_code); +DECLARE(codestats); #include "abc.h" @@ -15,19 +16,35 @@ typedef struct _opcode int stack_minus; int stack_plus; - int scope_stack_change; + int scope_stack_plus; int flags; } opcode_t; struct _abc_code { U8 opcode; U8 len; - void*params[2]; + void*data[2]; abc_code_t*next; abc_code_t*prev; abc_code_t*parent; + + abc_code_t*branch; + int pos; //used during code path evaluation +}; + +struct _codestats { + int max_stack; + int local_count; + int init_scope_depth; + int max_scope_depth; }; -abc_code_t* add_opcode(abc_code_t*atag, U8 op); +abc_code_t*add_opcode(abc_code_t*atag, U8 op); + +abc_code_t*code_parse(TAG*tag, int len, abc_file_t*file, pool_t*pool); +int code_dump(abc_code_t*c, abc_file_t*file, char*prefix, FILE*fo); +void code_write(TAG*tag, abc_code_t*code, pool_t*pool, abc_file_t*file); +void code_free(abc_code_t*c); + #endif