Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: =?windows-1252?Q?Android=97Why_Dalvik=3F?= Date: Tue, 31 May 2011 15:20:51 -0700 Organization: albasani.net Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net 1I7h3p9FsRenxFSR/mppxgkVbQFMdkYssunRLzM51RDiYzslJ2ZJp+BLzXHRjOPrQZo1xL49nAT6OYfenofMk3SMF8/Shf/pVRYW2UOZb1llYul9II7mjZVdZ3bPQdJo NNTP-Posting-Date: Tue, 31 May 2011 22:23:54 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="VSfySqrYj6Vx4L2of+dvT65l3uVGb/+O/z5eYIKZA6VoJRLV/fk2QjYlo0dwbJDHjUcRUCZirym5ngnvnqyz9n1AhRFohLBHQpdh7RuTxENA3gNfwBufLhCLhjP001t+"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:qsEXnwi7qWgGr1dR6Jmq+bXxH5Q= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4827 On 5/31/2011 2:09 PM, Andreas Leitgeb wrote: > Lawrence D'Oliveiro wrote: >> In message, Joshua Cranmer wrote: >>> Besides, all autoconf gets you is setting up the hundreds of #defines. >>> It does nothing else with respect to the #ifdef mess. >> Still better than anything Java can offer. > > This is now about Java versus C, isn't it? > Java has one big advantage: The compiled thing is typically still > "portable". For this, it would "need" to do any OS-#ifdef'ery at > runtime, anyway, not at compile-time. > note: it could be done at JIT-time, which is not strictly the same as run-time, since JIT-time operations need not involve runtime checks... however, yes, 'javac' in such a case would likely spit out code with every possible ifdef branch included, and then the classloader/JIT would discard any of the branches which are irrelevant to the given target. how this would "best" be done in a standard JVM is uncertain, but my VM (technically, not a JVM) basically handles it via block-folding and attributes (ifdef blocks are folded off into their own functions/methods, which are invisibly called by the parent method, with any dropped blocks having no-op calls). or such...