This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: preliminary invocation patch


Tom Tromey <tromey@redhat.com> writes:

> Per> If we can get these problems taken care of quickly, we then need
> Per> to consider whether to include this in the gcc-3.0 branch.
> 
> I'd prefer we not do that.  This is a big change to a piece of code
> that has been touchy in the past.  I think it can wait until 3.1.

That may make sense.  I'll check the code into the trunk only for now
(after I'm satisfied with it).

> Per> +extern void runFirst(::java::lang::Class *klass, ::java::lang::Object *args);
> 
> I think functions like this must start with `_Jv_' or must be a static
> member of some class.  This name is a namespace bug.

This was one of preliminary hacks.  runFirst is now a static function
in prims.cc.

> Per> +jstring
> Per> +java::lang::Thread::gen_name (void)
> Per> +{
> Per> +  JvSynchronize dummy(&java::lang::Thread::class$);
> Per> +  char buf[20];
> Per> +  sprintf (buf, "Thread-%d", nextThreadNumber);
> Per> +  nextThreadNumber++;
> Per> +  return JvNewStringLatin1 (buf);
> Per> +}
> 
> Although we have a shocking number of calls to printf() already, I
> think we should avoid adding any more.  I'd eventually not like to
> require printf at all.  printf is rather big, and if you can eliminate
> its use then embedded executables can be smaller.

Well, much of the size of printf is number conversion - which we need
anyway.  While I agree in prnciple, I think worrying about the size of
printf is premature at best.

> Also I think this particular part of the patch is probably a needless
> optimization.

It wasn't just an optimization - the code was crashing before I
made gen_name native, probably because something wasn't initialized.
I'm didn't look too deeply into it.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]