New Alpha/Updated Loom Sample App

1 view
Skip to first unread message

maxim.porges

unread,
Apr 16, 2009, 1:20:17 AM4/16/09
to loom-as3
Hello all,

I just uploaded the latest Loom SWC and sample app to the discussion
group. Note that the API for DynamicProxyFactory has changed slightly
- you now pass in the AbcFile to the constructor instead of to
createProxy().

Loom can now proxy any object that is given to it so long as the
opcodes in the object are within the range of those implemented in
Loom. I have 32 out of 158 opcodes in the AVM spec implemented, and
have not done the others yet mainly due to the fact that defining them
is tedious and I have no easy way to test them other than loading real
code, which I can't do until I finish the SWFLoader. If you have a use
case in mind and are having issues loading it, send me a copy of the
class and I'll add in the opcodes that are missing for you.

There are a few known issues with this release, which I discovered
today after loading the most complex class definition I have
available. This class definition defines every bit of the AS3 class
spec, so it's a great test case, and was the first time I had hit most
of the test cases below.

KNOWN ISSUES/LIMITATIONS
- Methods accepting ...rest arguments only pass the second argument
in the rest array to the proxied MethodInvocation
- Methods accepting optional arguments fail when called
- Setters/Getters fail when called
- Methods with custom namespace declarations fail when called
- Static class methods defer to the superclass implementation and
are not proxied

So, to summarize, regular method invocations without ...rest or
optional arguments work fine, but most of the other types are not
working. I don't think these issues will take long to resolve, and I
will be working on them this week with a goal of knocking them out by
the end of the upcoming weekend.

If anybody is messing around with the library yet, please let me know
how it's going.

Thanks,

- max

Josh McDonald

unread,
Apr 16, 2009, 2:13:11 AM4/16/09
to loom...@googlegroups.com
Hey Max,

A couple more quick questions: When are you hoping the source is going to escape? Are you going to wait until SWFLoader is done? I'm pretty confident I can build what I need on top of Loom without changing it, but I'll need to get my hands fairly dirty experimenting in order to become familiar enough with it to do so :)

Also, I'm wondering why the current restriction on opcodes? Does Loom effectively need to disassemble and reassemble the ABC, or is it just inserting some opcodes and adjusting pointers?

Meanwhile, keep up the good work! :)

Cheers,
-Josh

2009/4/16 maxim.porges <maxim....@gmail.com>



--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Josh 'G-Funk' McDonald
  -  jo...@joshmcdonald.info
  -  http://twitter.com/sophistifunk
  -  http://flex.joshmcdonald.info/

Maxim Porges

unread,
Apr 16, 2009, 10:38:58 AM4/16/09
to loom...@googlegroups.com
Hey Josh,

Glad to hear you are getting ready to kick the tires. 

When are you hoping the source is going to escape?

I was going to wait until the SWFLoader is done since the API should be better settled by then, but at the rate I am going I might release the private source URI to the group after I get the issues in the latest release fixed later this week.


Also, I'm wondering why the current restriction on opcodes? Does Loom effectively need to disassemble and reassemble the ABC, or is it just inserting some opcodes and adjusting pointers? 

Correct, the opcodes have symmetric read/write capability so I use them to parse the original ABC file so that you can dump the "decompiled" source (I say "decompiled" since it doesn't generate source, it just shows the opcodes and their arguments). For dynamic proxying, Loom actually throws every opcode away except for the ones in the static initializer. As far as pointers in to the constant pool, Loom figures out their positions via lookup when re-serializing the ABC file.

Getting the remaining opcodes in won't be hard, it's just tedious, so I stuck to the ones that I was able to test as part of the proxying capabilities. If you hit any that are not in there, you'll get an "unknown opcode XX" error, and they are easy enough to add yourself using a new instance of the Opcode class. Check the Loom asdocs and the AVM spec and it should make sense, or you can hit me up with questions.

I generated the opcode source for the items that are broken in the latest alpha and they did not look like rocket science to fix, so I'm still feeling good about having them working by the end of the weekend.

Thanks,

- max

2009/4/16 maxim.porges <maxim....@gmail.com>
So, to summarize, regular method invocations without ....rest or

optional arguments work fine, but most of the other types are not
working. I don't think these issues will take long to resolve, and I
will be working on them this week with a goal of knocking them out by
the end of the upcoming weekend.

If anybody is messing around with the library yet, please let me know
how it's going.

Thanks,

- max

Reply all
Reply to author
Forward
0 new messages