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

Re: JSR 202 class literals?



I posted a few months ago about some support for this that I whipped up...
Basically, I added a new constant value (ClassConstant) and used the
Constant propagator to detect invocations of Class.forName(String) where the
string was constant and turn them into ClassConstant values.

Then the Constant propagator could then eliminate expressions like:
if(Class.forName("foo") == Class.forName("foo")) ...

Presumably the CONSTANT_Class member could be used in addition to the above
detection.

Steve

At 04:39 PM 1/5/2004 -0600, Archie Cobbs wrote:
Hi,

Are there plans to add support in Soot for class literals
as proposed by JSR 202(*)? In short, this proposal allows a
CONSTANT_Class to be used for Java expressions like "Foo.class".
Soot would then require a new Value which is a ClassRef or
whatever. I'd guess the overall changes would be minimal.

Since this proposal seems likely to go through, it might be a
good idea to go ahead and add support in Soot now before the new
bytecode starts appearing in classfiles (and crashing Soot).

Thanks,
-Archie

(*) http://jcp.org/en/jsr/detail?id=202

__________________________________________________________________________
Archie Cobbs     *    Halloo Communications    *     http://www.halloo.com