Charlie said
or
finer, like switchpoint-per-class-and-method-name, which I am playing with
now
Did you ever come to a conclusion here?
And also
polymorphic
caching, with each entry being a GWT (to check type) and a SP (to check
modification)
What happens when the SP triggers?
Thx John.
I was looking for boot strap args to
allow byte[] constants from the constantPool.
Is that planned?
mark
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
Hi John,
Does this allow the use of a byteArray
as one or more of the bootstrap constants?
I seem to recall that was something
I wished for when I did a similar effort with
constant call sites.
mark
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
John mentioned
There's a fiber frame
system struggling to emerge here.
This is interesting. The approaches
I have looked at involve lots of code
rewriting especially to capture the
stack as its unwound. Are you thinking
of some approach where the exception
could capture the stack as it
Good to see this.
What is the philosophy for code annotations,
line numbers and stack maps?
Would they be some form of constant
entry?
regards
mark
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
With respect to general data in constant pools
Adding raw bytes as a constant type would be a good
thing. I currently
have to encode my object serialization as hex utf8
which is not nice.
As for the use of a MH to instantiate the constant.
Would this be done
at load time or would it just
t; It works that way, when a PIC is first created, it's just a mutable
> callsite that has the the deopt lambda as target, thus, the first
> time the PIC is called the deopt lambda is called. This lambda takes
> a Control object that takes a test method handle and a target method
In my perfect world a pic looks like this
at the lowest level
mov
object field ==> eax
je
eax=test1 to implementation1 " the special GWT you mention
"
je
eax=test2 to implementation2
...
handle
miss
I would want to move the testN order
to optimize,
ld try prototyping this.
>>
>> Duncan.
>>
>> On 23/07/2016, 00:25, "mlvm-dev on behalf of John Rose"
>> <mlvm-dev-boun...@openjdk.java.net on behalf of john.r.r...@oracle.com>
>> wrote:
>>>> On May 31, 2016, at 12:41 PM, Mark Roos <mr
A few questions on implementation.
My old prototype looks like:
private
RtObject[] _mDicts
= new
RtObject[8]; // array
of method dicts
private
MethodHandle[] _methods
= new
MethodHandle[8]; //
the code MH
MethodHandle lookupSelf(RtObject rcvr,
Thx Vladimir
Turns out this was self inflicted by
the means I was using for PIC invalidation. There
is an interesting case when only one
class returns false and all others true ( isNil). Since
this is often in a loop the impact is
severe. I see how to handle this corner case but
it does reopen
I have been implementing a Smalltalk on
the JVM (Rtalk) which has gone quite well. But recently
I was told that one of our key benchmarks
had suffered a large slowdown, from a few hundred
mS to seconds. And strangely it
gets slower the more its executed until we reset all of the call sites.
Hi Jochen
On why I am looking at projections for
behavior determination.
In my case I use an object reference
in the receiver to determine the method to execute. One
could say that this is a projection
from the class to an address which is an integer. So in this
case computing the projection is
Summary, I would like to consider a projection based PIC along with a
highly
optimized GWT based one.
After a short discussion, some reading and a reexamination of my use
model I
feel like there are two designs for a PIC api which I would like to hear
suggestions
on. I am planning a
Jochen writes
So far I have avoided using projections since I am not sure about
how to
do this. Basically I am missing a way to project a Class to an
usable
int.
After this discussion, reading Rémi's suggested paper and some more
analysis of my code base
I am
Jochen
The comment on the test part of the pic is interesting. Since I am looking
at multimethods
I would like to have a better understanding of how you decide which code
to dispatch at a site.
My pic suggestion assumes that one test method is applied to the arguments
and its result
used
Thanks Rémi, I was looking for a paper like that. Not for multimethods
but for a way to
improve code reuse across a hierarchy. Will savor it later with a fine
pinot :)
What I was thinking about for multi methods was a simpler tree like
approach.
http://dl.acm.org/citation.cfm?id=28732
In
Rémi your suggested paper and comments caused me to take a look at my code
base some more. What I found was that for a given selector+arity 93% of
them
have 5 implementations or less ( across 2000 classes and 25K methods).
Combining
this with my prior observations that 99% of the call sites
Hi Jochen
uses basically guardWithTest, so the order of the handles is never
changed to for example trying the last one first or the one with the
most hits recently. Is it not worth the trouble?
In my case I always add the new gwt to the head of the chain. This fits
my use case where
the most
From Jochen
Do I also understand right, that your test for checking if the current
target is still valid is limited to only the receiver?
Well yes and no. In my case the test examines all of the arguments on the
stack and computes
an 'behavior' reference. This reference is the head of a
Remi commented
I think you can adapt this code to implement what Mark want quite easily
I don't disagree that pics are easy to code, my premise is that with a
construct such I
I proposed the jvm would do a better job of optimizing. Especially taking
into account
invalidation, multi core
Hi Rémi,
I assume you want me to be more specific about my concerns on:
taking into account invalidation, multi core memory model and
volatile state.
My model is that I have a GWT chain, a cache, and a fallback which is
updating the chain, and more
than one core using the same
Hi Jochen
I have to think about yours some more but I thought I would share mine. I
condensed it to
make it easier to explain.
regards
mark
I extended callsite to hold a bunch of values one of which is the depth.
And my model for the cache is up to 10 chained GWTs after that I drop the
From Julian
How is it different from Rémi's construct?
Performance would be the hope.
My position has been that with a decent pic api the jvm would be able to
optimize the
pic to a few test/branch instructions for the large majority of callsites.
For your use case do you have the same
I was thinking about a generic pic, easy to use but flexible and came up
with the following concept api.
By passing the callsite and the testValue around with allowing an optional
pic update I can envision
this as a nice building block for several caching strategies. Of course
this is all
From Valdimir
We don't want to make Unsafe.defineAnonymousClass() part of public API,
but consider moving forward on that front providing lightweight code
loading machinery.
While I used defineAnno for awhile currently I just use defineClass in my
own class loader.
My only concern is that
Julian wrote
An open question that I have is that of facilitating the support
of overloaded methods.
It's typically something dynamically-typed languages struggle
with, and doing it
correctly *and* efficiently is not that pretty.
Overloaded and multi methods have
New could would mean adding a {MethodHandle, ConstantPoolData}
tuple to a particular callsite?s representation.
Now if we could add a item for the object reference used for the
comparison in the test part of a GWT we would have a structure which could
be used
in a PIC
I would like to see some form of PIC (polymorphic inline cache ) support
that
jits (inlines) well and transitions from mono to bi to multi(4,5) to mega
nicely.
The main thought would be to inline two or three with some way to reopt
as the types/counters change.
Of course my types are not
A statement from Remi defined the reason for my original question very
well.
the ASM packages are only
re-exported [1] for nashorn
Like the Nashorn folks I am building a language using the jvm for which it
would
be helpful if there was a standard api for bytecode writing.
I see that jdk8 now includes a copy of ASM
(jdk.internal.org.objectweb.asm).
Is it recommended to use that instance vs suppling a copy with my
application?
thanks
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
Thx
Sent from my iPhone
On Feb 17, 2015, at 11:59 AM, Remi Forax fo...@univ-mlv.fr wrote:
On 02/17/2015 08:30 PM, Mark Roos wrote:
I see that jdk8 now includes a copy of ASM (jdk.internal.org.objectweb.asm).
Is it recommended to use that instance vs suppling a copy with my
From Morris
All that assert laden code is nice to see.
I just finished watching a video from Doug Lea where he mentioned that
having asserts can
inhibit inlining due to the additional byte codes. So he sadly does not
use them due to
performance issues.
Does anyone have any insights
Duncan
I have looked on and off at using the class hierarchy for method lookup.
What drives that
is noticing that most methods only have one implementation and so my PICs
can get
overloaded with receivers which all dispatch to the same method. This is
one on my
main sources of megamorphic
Thomas, Thanks I did read Chris' note and it sounds promising.
Is there some reading on this?
regards
mark
p.s. I am still wondering why Ruby was the target, not why there was
a target.___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
Thomas
You state
...a new language implementation platform.
and then
I strongly believe that Truffle is the best currently available
vehicle to make
Ruby competitive in terms of performance with node.js.
If the goal is to create a 'new language' platform then why not
--PURE OPINION---
Thomas
you state:
Overall, I still believe that sometimes a larger step is needed
when current
techniques start to reach local maxima.
Which, as you mention in other posts, only time will tell if your beliefs
are correct.
I have learned that when proposing
Comment on Jochen's long stack traces.
The difference must be in how our languages expect the call site to
resolve.
In my case I compile all of the target methods to match the callsite stack
structure.
So the fast path adds no additional manipulations ( binds etc ) between
the callsite
and the
Thanks John, it does bring up a topic I have wanted to ask about
Hotspot's specialization
for Java and how I could take advantage of it. Particularly in the area
of PIC optimization.
You mention:
And we expect to get better at capturing the call-site specific
types,
values,
Thomas stated
A successful research project should ultimately also advance the
state
of the art of what is used in production.
Thomas one of the reasons many of us are building on the JVM is to take
advantage of the entire
universe of Java code available. Truffle, to me at
Thanks for the stack traces Jochen, interesting.
I really have no place to complain but I can see your point.
regards
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
In answer to Charles question on what others do to help the startup.
Smalltalk is like Ruby in that we always start from source code. In our
case
there are a few hundred classes and a few thousand methods that would
be considered minimal ( we call these the base ) and around a thousand
classes
I am more of the side that invoke dynamic is awesome for enabling dynamic
languages on the
JVM. Given that there are two areas where I can see some help for my use
case which
is a true Smalltalk on the JVM.
First like Charles I do have a few dependencies on plain old Java methods
during
Hi Charles
Just out of curiosity and a desire to compare my times to yours,
how long is it from the time of launch until the ruby code can
execute? Any how long in time until you see the peak performance?
I always run 64bit and mainly on a Mac so I have been using server
mode from the start.
example about a simple Groovy program being able to run in about 40MB
memory, but needing quite a bit more with indy. Since I can observe the
memory drain with a small program already, and since I know that handles
are not that reusable yet...
I see about the same, about 2X larger in jvm than
Hi Raffaello, Mark of RTALK here.
Thanks for the references. Unfortunately, some of them seem
dormant
projects, others seem more experimental than production-ready.
It sounds like you are at the place we were four years ago. A mission
critical
application written in
The Java folks will have to answer this, but I have heard that there are thoughts on how to make unsafe safe and portable. You might ask on the jigsaw list.
-Mark
On Aug 15, 2014, at 5:03 AM, Florian Weimer fwei...@redhat.com wrote:
On 08/14/2014 10:15 PM, Mark Roos wrote:
Look
Is there an end-user accessible way of defining anonymous classes
(by
which I mean classes which are kept alive only by explicit
references or
their instances, and not their class loader)?
Searching for the term anonymous classes isn't particularly
revealing
Both the Waratek and IBM multi Tenant JVMs demonstrate that the options of
one app per jvm
or many apps per jvm can be efficient and isolated. But I believe that
both of these require that
objects be serialized in order to be sent between apps. My question was
about avoiding the cost
of this
Thanks for the suggestion on Waratek, not sure how it would address the
process to process
messaging issue. It did lead me to another very interesting read though,
http://osv.io. Again
not an answer for the messaging but something that I have always thought
would be interesting to
try, a
So I updated to b119 and changed some callsite signatures from using
Object[] to Object...
// public static RtCallSite bootStrapSelf(MethodHandles.Lookup
callerLookup, String name, MethodType type, Object[] arg) {
public static RtCallSite bootStrapSelf(MethodHandles.Lookup
callerLookup,
Thanks Christian, that seems to fix it ( the exact math ).
Will pummel it some more.
regards
mark
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
I just got back to my Smalltalk efforts and tried to run some code against
114 ( that worked in 103).
I see lots of these errors and I seem to recall that changes are being
made and wonder if someone
could point me towards the changes I need to make.
java.lang.BootstrapMethodError: call site
I would prefer a spring time event in Europe. I have seen quite enough of
winter in Europe.
regards
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
Just for my learning, what is the use model for this form of method
handle inspection?
Is there some cool technique that this facilitates?
regards
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
From John
Simple example: Suppose you have a tree of GWTs that a clever
implementation compiles into a big hunk of bytecode
Actually that would be my dream, that hotspot is clever and I can just
let it do the work. Is it?
mark___
Duncan suggested:
return the parts that remain (both method handles and bound objects) as I
would guess that would be enough for debugging purposes and resource leak
hunting.
I think that if I could just get a collection of the bound objects in the
chain that
would be enough to do what I want
Hi John,
Looks like its intended to get some better information for the stack
traces?
Any chance that one could walk the GWT chain from a call site in order to
build
a different look up structure or maybe even some specialized code?
Currently I
keep this in the call site but it seems
FYI, I just ran into this method handle library and masters thesis( in
the doc dir).
https://github.com/ericbodden/dynamate
regards
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
It seems like quite a bit of work is going on around improving the
performance of invokeDynamic.
It would be interesting ( at least to me ) to have an in depth discussion
of what is being done and
how I should adjust my usage to get the best performance for a dynamic
language.
I'll buy the
into the same
room to better understand what's working, what's not, and where to go
from here. Consider me in.
I'm sure it would be accepted, so a proposal would probably be a
formality...but do you want to throw something together, Mark?
- Charlie
On Mon, Apr 8, 2013 at 2:03 PM, Mark Roos mr
you guys could meet?
On Mon, Apr 8, 2013 at 9:59 PM, Charles Oliver Nutter head...@headius.com
wrote:
I will volunteer to be an expert.
On Mon, Apr 8, 2013 at 2:53 PM, Mark Roos mr...@roos.com wrote:
I would love to put it together, but my knowledge is minimal. I don't
mind
the
organizing
Ok Charles is one expert, how about some folks doing the jvm
implementation?
Any thoughts on who that could be
regards
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
Thanks for the interest.
I added this workshop to my proposal. Inputs are welcome on how to
make it a good workshop.
mark
Improving the performance of InvokeDynamic
Now that we have some experience with InvokeDynamic its time
to discuss strategies and efforts for performance improvement.
We
I would be interested as well
mark
From: Eric Bodden eric.bod...@ec-spride.de
To: Da Vinci Machine Project mlvm-dev@openjdk.java.net
Date: 02/19/2013 05:39 AM
Subject:Looking for comments on paper draft DynaMate: Simplified
and optimized invokedynamic dispatch
Sent by:
Thanks Charlie
I will give it a spin.
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
From Jochen
How many targets do you usually keep in the chain before dropping?
I currently set the max to 10. As most( 98%) of my callsites are 10 or
less most of the
time there is no effect. I have not looked into if this is too deep for
the inliner or not. I have
been told that between 5
Hi Duncan, Here is what I have been using to profile.
Some notes.
I create all of my Smalltalk methods in an intermediate byte code format
and then use ASM
to create the Java class JIT. Each of my methods results in a single Java
class which may have
more than one method if there are blocks.
I see an interesting discussion here on value types. I assume that at
least part of the
intent is to solve the performance hit by using boxed integers. As such I
was thinking
about how that would affect my Smalltalk implementation.
A simple case for me is the boxing of longs. I use longs
Thanks
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
Charles made an interesting comment
Now what we need is a way to inject new intrinsics into the JVM, so I
can make an asm version of something and tell hotspot no no, use
this, not the JVM bytecode :)
Of course unless one wants to take on the efforts of Zero Assembler or
Grail and write one's
From Raffaello
are java.lang classes better served by the JVM than other classes?
Here's a small experiment.
I created a MyInteger class that exposes the very same
implementation
of Integer.numberOfTrailingZeros(int), copied verbatim.
We did similar micro
From Charlie
The builds there did not work for me on OpenJDK8 for some reason.
I don't have an openJdk 8 fastDebug so I used an jdk7u10 fastDebug from
http://code.google.com/p/openjdk-osx-build/
I used the dylip
hsdis-amd64.dylib from
An aside...can you post your RTALK and Java Hanoi impls? I'm
always
looking for another benchmark to add to my suite.
Not much but here, in order, would be Hanoi in Smalltalk, several integer
types of Java and the
version is java which matches the Rtalk implementation not using
From Charles
then could it simply be that your
indy guard logic and arbitrary precision logic adding all that
overhead? It seems like a lot indeed.
I had not thought about this in a while so perhaps my call site handling
is an issue. I went
for simple in that I use a
I am looking closely at the test portion of my guard with test method
handle.
On entry my call stack has zero or more arguments plus the object I wish
to
test on top. Currently I drop all of the arguments ( leaving the test
object ),
bind the value to compare (reference) with and then attach
From Charles
Mark: Can you post the assembly output for a simple inlined
dynamic
call? It would probably tell us a lot.
OK, so i got a fastDebug build, added printOptoAssembly and have lots of
data.
How do I pick out a simple inlined call?
thanks
Ok got the hsdis to work, looks like asm. Now on to see what is
happening.
thanks
mark
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
Moving along. I tried the printOptoAssembly but that is pretty hard to
follow so
I found a built hsdis dynlib for my mac
http://kenai.com/projects/base-hsdis/downloads/directory/gnu-versions
But I must not have something correct as it reverts to printOpto. Perhaps
cannot
After reading Charles' blog on 'fast' ruby I decided to look at how Rtalk
was
comparing. At the same time I loaded the latest JDK8 just to compare.
First jdk 8 runs (excellent) with some things faster but most slower. But
to
my chagrin Rtalk running FIB(35) is much slower than Charles'
Hi Jim
When you say you are using TaggedArrays for instances are you boxing the
array in another object
(NashObject -) which holds other object properties? In other words
instead of instances being slots
in an object they are locations in an Array which is in a slot in the
object.
As for
Nice to see progress.
I was just thinking about the use model for these in my app and found
three obvious uses:
To hold the temps on the stack frame ( TaggedArray of
TaggedArrays + primitives )
To hold the instance vars of a class
To collect arguments for a method send
I am looking to learn something here that I haven't seen in my code yet.
John mentioned
Suppose you are compiling your favorite high-level language to the
JVM, and you start
running into the various size limits in class files
To which there seemed to be some agreement that this
During the JVM summit I found myself thinking about polymorphic inline
caches and whether ti would be possible to describe one
in such way that was implementation and usage independent. The goal would
be to give the hotspot folks a chance to uber optimize
this form of method lookup.
Some
Hi Rémi
gave it a shot with this launch
java -javaagent:jsr292-backport.jar -agentpath:javaDebug.dylib
ri/experiment2/TestSm
Got this error
C: Unable to locate callback class.
java.lang.NoClassDefFoundError
- klass: 'java/lang/NoClassDefFoundError'
./testBackport: line 3: 38777
Hi Remi
How do I run with the backport? I am using OSX Lion.
regards
mark___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
From John on the HotSpot list
The new Lambda Form framework is about to be integrated. This a key
foundation stone for optimizing dynamic languages. On this foundation, we
want to build a robustly performant and portable implementation of JSR
292, to support our current and future set of
Thanks John, don't jump right in to my report. I'll look into it more and
I really don't want to sidetrack you.
I did run with several flag choices ( server, tiered, debug agent ) and
found
only about a 10% difference after I let hotspot stabilize. I am pretty
sure
I don't have Christian's
FWIW
Everything RTALK works on Stephen's 7/11/2012 build. Thank you Stephen.
While generally faster than 7u2 I do have a strangeness in that when my
target is a chain of methodHandles its much slower then when my target
is a methodHandle-callsite-chain of handles. My second case is where I
From Charile
Any thoughts on this? Does anyone else have need for lighter-weight
name/file/line inspection of the call stack?
Yeah I need it for my debugger and error displays. But I need it for
suspended threads
( my debugging steps ) as well as for exceptions. And for exceptions it
would
Thanks Rémi, good example
is big compared to the code of the generated assembler so the JIT may
decide to not inline something
I assume that changing the maxInline will fix this if its an issue
You have also to figure out how to get two return values from a method
call,
but exceptions are
From Rémi on static analysis for loops
Not having such kind of analysis is almost a crime.
For a language like Smalltalk I was thinking that having such an analysis
would be the work of the gods.
With user overridable methods, reflection and run time code creation I
have only found a
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
Hi Jim
I was wondering if you could post the use case that led you develop the
TaggedArray?
I looked over our Smalltalk app and I could not see an obvious pattern
where mixing
primitives and references in a collection is common.
On a similar note I was curious how you are avoiding the integer
From Charlie
It also doesn't appear to happen with JRuby on the boot
classpath...it happens only when JRuby is loaded in a child
classloader.
That was my experience as well. The only way I found to avoid it was to
put my code into the bootClassPath. I messed with other ideas ( but not
Rémi's)
Hi Jim, You made a comment:
implementation for platforms not supporting TaggedArrays (and JDK
1.7)
Are you saying that a native version fo jdk1.7 is not possible, or just
that you have not got around to it?
regards
mark
___
mlvm-dev
From Jim
It occurred to me on that sleepless Monday night, that the solution for
most dynamic languages could be so much simpler. First, we have to look
at what it is we really need. Ultimately it's about boxing. We want to
avoid allocating memory whenever we need to store a primitive value
Hi Jochen
I was wondering at what depth you would consider a call site to be
megamorphic?
I have done quite a bit of profiling on Smalltalk ( which uses lots of
blocks as iterators)
and rarely see depths 20.
As this depth seems to be time dependent ( at any one time its 3 but
over time it
Hi Dain
This sounds similar to a non local return in smalltalk where some method
in a chain returns to the
starting method. I did this with a throw and a catch based on the invoker
of the chain. Seems to
work for me but I will leave it to the experts to tell you the best way
for your
Hi Jochen
Since I am using a Mac I can get a wide range of builds to try (almost
daily)
http://code.google.com/p/openjdk-osx-build/
For the compiler Christian recommended I try
-XX:-TieredCompilation
which was my problem on jdk8 versions
regards
mark
1 - 100 of 219 matches
Mail list logo