[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VM02 v1.0 Released! April Fools???



In comp.sys.apple2 DaveSchmenk <dschmenk@gmail.com> wrote:
> DESIGN.TXT:
> http://vm02.cvs.sourceforge.net/viewvc/*checkout*/vm02/vm02/DESIGN.TXT?revision=1.18

Impressive!

"Since the 6502 will be interpreting the Java bytecodes, I simply
implemented a byte counter after each interpreted bytecode and call the
scheduler when it reaches zero."

Why every instruction?  If you only check it on backward branches,
method return, and exceptions, you are guaranteed that it will trigger
eventually.  You trade off a bit of predictability (in terms of how many
instructions are actually executed before a context switch) but lose
the overhead of updating a counter on every instruction.  (Although I
suppose that will also make timed-wait less accurate.)

"There are two ways to invoke methods ... The other way to call is
asynchronously by way of class loading or finalizers."

Would it clean things up to have a finalization thread, and "schedule"
finalizable objects to run later?  (I suppose the complexity would make
this undesirable, and the added latency between an object becoming
unreachable and being freed would be detrimental on such a small
system.)

Have you considered a text "spinner" or EOR #$FF on $2000 while the GC
is working?  Save the current value, update the text or hires location
every N objects, restore the value before resuming.  That would let
people know it's doing something.

"Finally, any class initializer is called to set up the class."

Are you calling <clinit> on class load rather than first use?  (Thinking of
section "5.5 Initialization" in the VM Spec 2nd edition.)

You mention "synchronized objects" in the Threads section, but I don't
see much about that.  Is this what the locked/unlocked states of
memory blocks are for?


So when will Swing be ported over? :-)

-- 
Send mail to fadden@fadden.com (Andy McFadden) - http://www.fadden.com/
Fight Internet Spam - http://spam.abuse.net/spam/ & http://spamcop.net/