Jean-Philippe Lesot wrote:
>
> Hi,
>
> I'm sorry to disturb you, but I am studying our Japhar implementation
> of a JVM. I have several questions about it :
>
> 1/ I don't see the namespace separation provide by the classloader in
> the class-repository files. Is there no namespace separation?
> (Cf. p. 89 of 'Inside the JAVA Virtual Machine' by B. Venners).
The class-repository stuff is only used for "system" classes - those
loader by the primordial classloader. any subclass of Classloader is
supposed to maintain its own hashtable.
> 2/ In initialize_class_recurse, the lines after CLASS_NOT_INITIALIZED
> don't MONITOR_notifyAll to wakeup threads waiting on the
> MONITOR_wait. See the diff, is it OK?
Well, the code in arch/monitor.c used to be such that MONITOR_exit also
called notifyAll, but petter appears to have commented that out. so
yes, this place will need fixing (in addition to any other places that
depended on that behavior.)
> And, why not use a simple MONITOR_enter/MONITOR_exit scheme in this
> function initialize_class_recurse?
>
> 3/ There are no calls to MONITOR in the class-repository. So how can
> you handle the concurrency in the find_class_on_classpath function?
> (two differents threads resolving the same class at the same time?)
you can't. this is a bug - the class repository should lock stuff.
> 4/ It is very strange to have the quite same functions
> (op_stack_allocate, op_stack_deallocate, etc) in op_stack.h
> (inlined) and op_stack.c (not inlined). Why ?
because I haven't cleaned op_stack.c up yet :) seriously, I'd like to
remove the opstack functions altogether... soon.
> Thanks you, and I apologize for my bad English.
no problem, and thanks for the bug report!
xtoph