Conditional Compilation Though Compile time variable / parameters / fields / functions Annotation

Suminda Dharmasena sirinath at sakrio.com
Mon Apr 15 23:47:51 PDT 2013


Hi,

I think the compiler can eliminate code based on final fields. I think it
makes sense to add an annotation to maker variable / parameters / fields /
functions as compile time only. At some point the compiler should be able
to determine the code path or value of the marked constructs through static
analysis and replace the code as appropriate. Other than parameters once
compiled the constructs will not be part of the class file. For determined
literals the compiler will replace the function call with
an appropriate generated function at the point of calling. If a function is
marked as compile type only the return value is determined through static
analysis and the function is eliminated from point of calling. If private
the function is removed altogether.

If the code path or call param elimination or return values cannot
be statically determined the compiler should generate a warning and ignore
the tag.

Aside from this an annotation for compile time inlining is desirable.

This will give java an enhanced conditional compilation mechanism.

Suminda
--
Suminda Sirinath Salpitikorala Dharmasena, B.Sc. Comp. & I.S. (Hon.) Lond.,
P.G.Dip. Ind. Maths. J'Pura, MIEEE, MACM, CEO Sakrīō! ▣ *Address*: 6G • 1st
Lane • Pagoda Road • Nugegoda 10250 • Sri Lanka. ▣ *Tele*: +94-(0)11-5
864614 / 5 875614 / 2 825908 ▣ *Web*: http://www.sakrio.com ▣

This email is subjected to the email Terms of Use and Disclaimer:
http://www.sakrio.com/email-legal. Please read this first.
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20130416/f5d094ab/attachment.html 


More information about the compiler-dev mailing list