Robin, Hmmm.... very interesting indeed. I also see another way you could use this... you could use it for code obfuscation of some sort as well. I like this a lot... I will dwell on this some more... thanks for posting.
Cheers, Sam On Sep 13, 2007, at 10:43 AM, Robin Debreuil wrote: > Essentially just that.. Your class gets an index, all properties > and methods > of it get an index, link to parent etc gets an index. You give > overrides the > same indexes, then overloading works automatically. You have to > treat static > members a little bit specially, basically separate them, so you > need to know > the maximum reasonable number of members of each type there will > be. You > then put the table pointers in registers, and it gets pretty fast : ). > > Then to run code, it looks 'something like': > > locals[3] = new types[98][2](arg[0], locals[2]); // [2] is > overloaded ctor > locals[3][12](); > > Etc. > > The big relevation to be in the prototype can be thought of > 'exactly' as the > type. I don't know how I missed that in the years before, but once > you have > that everything falls into place and makes perfect sense. The > confusion is > you say "new Button()" and think the Button function is the type, > but really > it is just a constructor method on the button prototype. The > prototype isn't > given a name in JS, but if it is all indexes, then it very > naturally reveals > itself as the type and nothing else : ). Ctors and fucntions are > the same > thing then, and only differentiated in how they are used. > > The only really hard (near impossilbe) problem was the timing of > running of > the static ctors. They need to run just before first access > in .Net, which > requires a lot of keeping track of things at runtime. That is > pretty minor, > but is a problem when you initialize things there... > > This kind of thing allows Xamlon running .net on v6 to be much > faster than > the latest running on flash 8 with all the bytecode optimizations/ > registers > there. > > Anyhow, flashback to a previous life over ; ). > > Cheers, > Robin > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:osflash- > [EMAIL PROTECTED] On > Behalf Of Samuel Agesilas > Sent: Thursday, September 13, 2007 10:02 AM > To: Open Source Flash Mailing List > Subject: Re: [osflash] Anybody interest in developing a new compiler? > > Hi Robin, > > Interesting points. I too use integers for function names as > opposed to > their string values. I find it much faster as well. I use a > customized > post-processor I wrote in Java. It's amazing how fast it speeds > things up. > I'm curious when you mentioned storing everything in tables > (arrays), what > exactly did you mean? Can you provide and example. Thanks! > > Cheers, > Sam > > > _______________________________________________ > osflash mailing list > [email protected] > http://osflash.org/mailman/listinfo/osflash_osflash.org _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
