LemChops
Joined: Oct 27, 2007
Messages: 1
Offline
|
Hi Ralf,
I think it would be good to let developers set the branch offsets directly, instead of relying on labels.
I'm currently working on an open source project, Ruby On Flash, a compiler written in Java that compiles Ruby source code directly into Flash applications(.swf files), http://sourceforge.net/projects/rubyonflash (give me a few days to set up the sourceforge website , haha)
I've made a few additions to the following code, and I hope you can add these officially to JSwiff.
Jump.java:
public Jump(short branchOffset) {
code = ActionConstants.JUMP;
this.branchOffset = branchOffset;
}
If.java:
public If(short branchOffset) {
code = ActionConstants.IF;
this.branchOffset = branchOffset;
}
ActionBlock.java
//in the write method
//replace branch label only if label is not null
if(((Branch)action).getBranchLabel()!=null){
replaceBranchLabelWithRelOffset((Branch) action);
}
Thanks!
Lem
|