| From | Sent On | Attachments |
|---|---|---|
| Jim Laskey | Jul 2, 2012 6:04 am | .zip, .zip |
| Rémi Forax | Jul 2, 2012 6:54 am | |
| Jim Laskey | Jul 2, 2012 7:05 am | |
| ravenex | Jul 2, 2012 7:11 am | |
| Jim Laskey | Jul 2, 2012 7:21 am | |
| ravenex | Jul 2, 2012 7:33 am | |
| Rémi Forax | Jul 2, 2012 7:41 am | |
| Mark Roos | Jul 2, 2012 10:23 am | |
| Jim Laskey | Jul 2, 2012 11:50 am | |
| Mark Roos | Jul 2, 2012 4:13 pm | |
| Charles Oliver Nutter | Jul 2, 2012 5:51 pm | |
| Howard Lovatt | Jul 2, 2012 10:28 pm | |
| Krystal Mok | Jul 2, 2012 10:39 pm | |
| Howard Lovatt | Jul 2, 2012 10:45 pm | |
| Krystal Mok | Jul 2, 2012 10:57 pm | |
| Thomas Wuerthinger | Jul 3, 2012 6:49 am | |
| Mark Roos | Jul 3, 2012 6:01 pm | |
| Jim Laskey | Jul 3, 2012 6:18 pm | |
| Rémi Forax | Jul 4, 2012 2:00 am | |
| Jim Laskey | Jul 4, 2012 2:12 am | |
| Jim Laskey | Jul 4, 2012 2:18 am | |
| Mark Roos | Jul 5, 2012 1:25 pm | |
| Jim Laskey | Jul 5, 2012 1:41 pm | |
| Rémi Forax | Jul 5, 2012 5:23 pm | |
| Jim Laskey | Jul 5, 2012 5:58 pm | |
| Mark Roos | Jul 5, 2012 7:41 pm | |
| Mark Roos | Jul 6, 2012 11:48 am | |
| Rémi Forax | Jul 6, 2012 2:17 pm | |
| Mark Roos | Jul 6, 2012 7:54 pm | |
| Rémi Forax | Jul 7, 2012 1:53 am | |
| Dain Sundstrom | Jul 7, 2012 10:02 am | |
| Rémi Forax | Jul 7, 2012 11:42 am | |
| Vitaly Davidovich | Jul 7, 2012 11:48 am | |
| Dain Sundstrom | Jul 7, 2012 12:07 pm | |
| Mark Roos | Jul 7, 2012 12:08 pm | |
| Mark Roos | Jul 7, 2012 2:43 pm | |
| Charles Oliver Nutter | Jul 7, 2012 2:44 pm |
| Subject: | Re: TaggedArrays (Proposal) | |
|---|---|---|
| From: | Rémi Forax (for...@univ-mlv.fr) | |
| Date: | Jul 7, 2012 1:53:44 am | |
| List: | net.java.openjdk.mlvm-dev | |
On 07/07/2012 04:54 AM, Mark Roos wrote:
Hi Rémi, you mention And now the trick, there is a nice way (several in fact) to explain to the JIT that even if the bytecode contains tests, if the variable contains effectively an int, it's a good idea to remove them.
Ok, in Smalltalk there are some methods which are usually integer ops so its easy to determine vars that are likely integer. I have slots in the stack reserved for just this idea.
So if I have a pair of slots A and B where A would be the integer from and B the reference. Would I test B to be null and if so do an integer op on A?
yes, that the basic idea.
So plese point me at the bytecode tricks that make the test go away.
It's not a bytecode trick, it's a JIT trick. The VM profiles jump instruction like 'if' to know which branch is taken, and doesn't generate code but a deoptimization code if a branch is never taken. So the generator of a backend will generate a code like this for a + 1:
int r1 = ... Object o1 = ... if (o1 == null) { r2 = r1 + 1 o2 = null } else { r2 = 0 o2 = invokedynamic + o1, 1 }
if (o2 == null) { // next instruction ... } else { ... ...
and because o1 is never null, the JIT will generate
jne a_deoptimization_code inc r2
also because the JIT propagates null value aggressively, the jump can also disappear because there is perhaps already another check before, by example, the check o2 == null will be removed here.
So the idea is to consider that if a variable can store an int, you should use two variables in the bytecode, so result of an operation will be spilled into two variables instead of using the stack. I call this idea, split-path and this is really effective, the main drawback is that the generated bytecode size is big compared to the code of the generated assembler so the JIT may decide to not inline something that it should.
You have also to figure out how to get two return values from a method call, but exceptions are your best friend here.
regards mark
rgds, Rémi
_______________________________________________ mlvm-dev mailing list mlvm...@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev






.zip, .zip