Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #15876

Re: Java processors

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Java processors
Date 2012-07-08 09:16 -0700
Organization albasani.net
Message-ID <jtcboe$um6$1@news.albasani.net> (permalink)
References (10 earlier) <jt9hjc$qin$1@news.albasani.net> <ac1iv7lue61ncqckd8dr1vau4oik8a17np@4ax.com> <jtb5vf$jjd$1@news.albasani.net> <jtb7lc$pk3$1@news.albasani.net> <jtc8lf$oie$1@news.albasani.net>

Show all headers | View raw


BGB wrote:
> Lew wrote:
>> HotSpot and other Java JIT compilers have an advantage over static
>> optimizers such as you describe - they can account for current run-time
>> conditions.
>>
>> For example, it might be that none but one thread are using a section of
>> code so all synchronization operations can be removed for a while.
>>
>> Or perhaps there are no aliases extant for a given member variable, so
>> it is safe to enregister the value for a while, even though statically
>> it would not be safe.
>>
>> HotSpot also will "unJIT" code - go back to the interpreted bytecode and
>> drop the machine-code compilation - when circumstances change.
>>
>
> I wasn't focusing solely on static compilers, as a lot of this applies to JIT
> compilers as well.
>
>
> yes, but the question would be how many of these would risk compromising the
> ability of the VM to readily switch between the JIT output and bytecode.

None of them.

> very possibly, the JIT would be focusing more on optimizations which would not
> hinder its own operation.

None of the optimizations it does hinder its own operation, so that's 
trivially true.

> an example would be maintaining "sequential consistency", where theoretically,
> an optimizer would alter the relative order in which operations take place, or
> reorganize the control flow within a method, ...

You explained the other use of quotation marks quite well. What is the intent 
of these here?

The optimizer does, indeed, alter the naive order of operations as it deems 
helpful, according to what I've read.

It does so, when it does so, in a way that does not break the observed order 
of events as mandated by the JLS.

> although possible, this would hinder the ability to easily jump into or out-of
> the JITed output code, so a JIT would likely refrain from doing so (upholding
> the behavior that events take place in the native code in the same relative
> order as they appear in the bytecode, ...).

The compiler avoids breaking the promise mandated by the JLS. It does not bind 
itself further than that with respect to altering the order of events.

When you say "likely", how likely and on what are you basing your probability 
estimate?

It is 100% certain that the optimizer doesn't break the promise of execution 
order mandated by the JLS. It has nothing to do with jumping into or "out-of 
[sic]" native code. It has to do with maintaining mandatory program semantics.

The optimizer cheerfully rearranges execution order in ways that do not 
violate the promise, when it finds it advantageous to do so. I do not know how 
to estimate the probability of that happening, except that documentation 
claims that it does sometimes happen.

> very likely, the JIT would also arrange that the overall state is consistent
> at points where it may jump into or out of the generated code (all values
> properly stored in their respective variables, ...).

Again with the "very likely". How likely is that? Based on what evidence?

-- 
Lew


-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Java processors bob smith <bob@coolfone.comze.com> - 2012-07-05 08:01 -0700
  Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-05 11:28 -0400
    Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-05 13:00 -0500
      Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-05 14:31 -0400
        Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-05 16:42 -0500
        Re: Java processors Arne Vajhøj <arne@vajhoej.dk> - 2012-07-05 20:30 -0400
          Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-05 21:12 -0500
          Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-06 00:13 -0400
            Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 13:26 -0700
              Re: Java processors Gene Wirchenko <genew@ocis.net> - 2012-07-06 13:50 -0700
                Re: Java processors Lew <lewbloch@gmail.com> - 2012-07-06 14:17 -0700
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 19:07 -0700
                Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-07 09:34 -0500
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-07 21:01 -0700
                Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-08 00:28 -0500
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-07 23:00 -0700
                Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-08 10:20 -0500
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-08 09:16 -0700
                Re: Java processors Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-08 17:46 +0000
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-08 11:52 -0700
                Re: Java processors Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-08 21:41 +0000
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-08 17:56 -0700
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-08 19:44 -0700
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-09 23:41 -0700
                Re: Java processors David Lamb <dalamb@cs.queensu.ca> - 2012-07-16 13:22 -0400
                Re: Java processors Lew <lewbloch@gmail.com> - 2012-07-16 14:03 -0700
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-08 19:42 -0700
                Re: Java processors Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-07-10 01:13 +0200
                Re: Java processors Lew <lewbloch@gmail.com> - 2012-07-09 16:26 -0700
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-11 15:41 -0700
                Re: Java processors Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-07-12 01:02 +0200
                Re: Java processors Wanja Gayk <brixomatic@yahoo.com> - 2012-07-21 18:46 +0200
                Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-21 13:05 -0400
                Re: Java processors Wanja Gayk <brixomatic@yahoo.com> - 2012-07-21 19:23 +0200
                Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-21 14:10 -0400
                Re: Java processors Wanja Gayk <brixomatic@yahoo.com> - 2012-07-23 01:17 +0200
                Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-22 20:15 -0400
                Re: Java processors Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-07-22 15:13 +0200
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 19:03 -0700
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-08 19:51 -0700
              Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-07 21:17 -0700
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-07 23:04 -0700
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-08 09:29 -0700
                Re: Java processors Lew <noone@lewscanon.com> - 2012-07-08 11:57 -0700
            Re: Java processors Wanja Gayk <brixomatic@yahoo.com> - 2012-07-08 15:40 +0200
              Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-08 10:36 -0500
          Re: Java processors Lew <lewbloch@gmail.com> - 2012-07-06 11:31 -0700
      Re: Java processors Jim Janney <jjanney@shell.xmission.com> - 2012-07-05 13:02 -0600
        Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-05 16:09 -0500
        Re: Java processors Jan Burse <janburse@fastmail.fm> - 2012-07-06 01:29 +0200
          Re: Java processors Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-06 00:42 +0000
            Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 13:53 -0700
              Re: Java processors Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-06 21:18 +0000
                Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-06 18:17 -0400
                Re: Java processors Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-06 22:29 +0000
                Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 19:10 -0700
                Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-07 09:42 -0500
                Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-07 10:58 -0400
                (OT) Was: Re: Java processors Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-07 11:38 -0400
                Re: (OT) Was: Re: Java processors Gene Wirchenko <genew@ocis.net> - 2012-07-07 21:19 -0700
                Re: (OT) Was: Re: Java processors "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-07-08 12:15 +0200
                Re: Java processors Gene Wirchenko <genew@ocis.net> - 2012-07-07 21:17 -0700
          Re: Java processors Jim Janney <jjanney@shell.xmission.com> - 2012-07-05 19:14 -0600
        Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 13:34 -0700
          Re: Java processors Jan Burse <janburse@fastmail.fm> - 2012-07-06 23:04 +0200
            Re: Java processors Silvio Bierman <silvio@moc.com> - 2012-07-07 00:13 +0200
              Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 19:16 -0700
                Re: Java processors "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-07-08 11:37 +0200
      Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 13:24 -0700
        Re: Java processors BGB <cr88192@hotmail.com> - 2012-07-07 10:06 -0500
  Re: Java processors Roedy Green <see_website@mindprod.com.invalid> - 2012-07-06 05:22 -0700

csiph-web