<GitHub6>
jruby/master 434e54e Charles Oliver Nutter: CheckLJE currently requires dynscope.
<GitHub6>
jruby/master d5067a2 Charles Oliver Nutter: Fix another IR printing logger issue.
<GitHub6>
jruby/master 7d8b03e Charles Oliver Nutter: Centralize get/put field logic in Instr.interpret....
<GitHub73>
[jruby] headius opened pull request #3906: Kwargs should not need dynamic scope, since we have static handy. (master...fix_kwargs_scoping) https://git.io/vrEjA
donV has joined #jruby
<GitHub163>
[jruby] BanzaiMan created ha-feature-caching (+1 new commit): https://git.io/vrufT
<GitHub163>
jruby/ha-feature-caching 1542933 Hiro Asari: Clean up *.properties file to avoid uploading new cache
skade has quit [Read error: Connection reset by peer]
skade has joined #jruby
CaptainHeavy has joined #jruby
<CaptainHeavy>
Hello :) I'm looking to get all Java classes that extend a particular Java class in jRuby after importing the relevant Java classes. Is this possible and, if so, how?
<CaptainHeavy>
I've been playing around with this for ~ an hour now!
<headius>
CaptainHeavy: unfortunately I don't think there's a way to do that; superclasses don't have references to subclasses on JVM, and we don't eagerly define the Ruby side of every Java class unless we need to
<headius>
it might be possible to use some JVM debugging APIs to browse all loaded classes
<CaptainHeavy>
Hmm, I've managed to get the Java classes imported from the global namespace as symbols
<CaptainHeavy>
Object.constants
<CaptainHeavy>
However, I need to determine which of these are java objects
<CaptainHeavy>
calling .java_object on a Fixnum throws a "No Method Defined" error
<CaptainHeavy>
I realise I'm operating on Symbols
<CaptainHeavy>
I tried constant.method_defined?(:java_object) but no lucjk
liri has joined #jruby
<liri>
hi all,
<CaptainHeavy>
I've also tried using the "Reflections" Java JAR but that complains about a Logger class not being found!
<liri>
Can someone put some light on issue which I am struggling with, namely I have a Java Server, which is able to handle requests containing ruby code which is supposed to be invoked at server side
<liri>
I Use ScriptingContainer, and version of Jruby, 1.7.17
<liri>
before query is invoked I set loadpaths to directory with ruby sources.
<liri>
currently it is ruby 1.9
<liri>
So basically before running code through ScriptingContainer I set loadpaths
<GitHub79>
jruby/master 6bea316 Charles Oliver Nutter: Fix my set mistake.
<GitHub79>
jruby/master b2321a8 Charles Oliver Nutter: Merge pull request #3906 from headius/fix_kwargs_scoping...
<GitHub79>
jruby/master afd1906 Charles Oliver Nutter: Kwargs should not need dynamic scope, since we have static handy.
<GitHub140>
[jruby] headius closed pull request #3906: Kwargs should not need dynamic scope, since we have static handy. (master...fix_kwargs_scoping) https://git.io/vrEjA
<headius>
CaptainHeavy: I guess I don't understand what would be in the PR
<headius>
ah, I should have squashed that
<headius>
oh well
<CaptainHeavy>
headius: Sorry, I meant this could be packaged up as a method, i.e. "getSubTypesOfJavaClass()"
<headius>
oh I see
<headius>
so I originally thought you were asking if you could ask JVM for all subclasses, and I don't believe there's a way to do that
<headius>
we do have a hidden method in JRuby that can get subclasses of any class
<headius>
if you pass true it should be all descendants
<CaptainHeavy>
headius: I get a "NoMethodError" for that!
<CaptainHeavy>
Maybe I need to invoke java_class first...
<CaptainHeavy>
headius: nope!
<headius>
require 'jruby/core_ext'
<liri>
how does jruby handles .so files? I can see that error which I get concerns requiring .so file
<liri>
does it make any difference for me in my investigation ?
<headius>
liri: what kind of .so files?
<chrisseaton>
liri: do you mean a C extension .so file?
<headius>
liri: it sounds like your enviromment may be getting some things confused
<headius>
perhaps you can describe what you're trying to do
<liri>
I got error, that Kerne can't load date_core file, I couldn't find this file at the beginning in ruby sources, but it occured to be in x86_64-linux folder with other .so files.
<headius>
date_core would be coming from CRuby's date library, I believe, as a C extension
<liri>
I included jruby.jar from 9.1.1.0 release
<headius>
you don't want to use any libraries from a non-JRuby install
<liri>
and this error is constantly showing up when I am trying to require 'time'
<liri>
LoadError: no such file to load -- date_core
<liri>
require at /home/ldb/ldb-ruby/lib/ruby-src/rubygems/core_ext/kernel_require.rb:54
<liri>
require at org/jruby/RubyKernel.java:944
<headius>
they'll have dependencies on things that are different or don't exist in JRuby
<CaptainHeavy>
headius: Perfect, thank you!
<headius>
liri: if you want to use JRuby instead of CRuby you should install a full JRuby set up...not just a jar using CRuby libraries
<headius>
but I'm still not clear what your setup is
<liri>
well actually it was configured by colleague of mine, he just downloaded some ruby sources (1.9), and jruby.jar 1.7, jruby.jar is in classpath for java server, and ruby source folder is referenced by scripting container, so it has ruby 1.9 sources in load path.
<liri>
It worked fine till I decided to migrate to ruby 2.X and jruby 9k, I though it would be as simple as downloading jruby.jar (9k) and sources for ruby 2
<headius>
yeah that's not the right setup to use JRuby
<liri>
so what should I start from ?
<liri>
to set it up correctly.
<headius>
go to jruby.org and grab a tarball from there, or use a ruby installed like rvm or ruby-install
<headius>
ruby installer
<headius>
there's a few options but you basically want a full distribution, with all our versions of CRuby's C libraries
<liri>
I installed ruby from repositoried for Cent OS
<headius>
is there no JRuby CentOS package?
<liri>
I will check this out, so when it is done, how should I configure Scriptingcontainer and java server?
<headius>
what do you want to do with that?
<liri>
is there somewhere some README file about what particular files in tarball are for ?
<headius>
do you want a Java sever?
<headius>
server
<headius>
liri: there's some basic getting started docs, examples on the wiki, a few books...
<liri>
I have an app it is server written in Java, and I use ScriptingContainer to run ruby code inside JVM.
<headius>
ok
<headius>
maybe what you really want is jruby-complete.jar
<liri>
I sent ruby code to server, and then it is compiled/parsed by SC, so I can run it
<headius>
I think the problem is you're using jruby.jar which doesn't have "time" or "date" or "rake" or any other Ruby libraries bundled with it
<headius>
so it's picking up whatever's on your system, and that's CRuby stuff
Aethenelle has joined #jruby
<headius>
if you use jruby-complete it should work the way you expect
<liri>
so basically Ihave two options?
<liri>
1) installing JRuby in my OS
<liri>
2) using jruby-complete
<headius>
2 is probably best if you are already using ScriptingContainer and a Java server
<headius>
I misunderstood what you needed
<liri>
and what is the main difference between these jars (complete vs normal?)
<headius>
liri: the complete jar contains a bunch of other libraries most Ruby programs will need
<headius>
date, time, irb, net/http, all that
<liri>
ok so it is better when I want to embed JRuby into application
<headius>
definitely
<liri>
not relying on installed software.
<liri>
what could be the reason for relying on external ruby/jruby installation ?
<headius>
well, mostly devops reasons I guess
<headius>
if you need to use only blessed packages or something
<headius>
but pulling JRuby from maven central is pretty canonical
<liri>
ok, thank you very much I am going to check out this jruby complete, so if I use jruby complete I shouldn't be obliged to set load paths for my scripting container?
<headius>
not unless you want to! :-)
<liri>
because all dependencies are bundled within jruby-complete.jar?
<headius>
al dependencies normally included with Ruby, yes
<liri>
yes, I don't use anything specific, ok, so ma setup was not the best I believe,
<liri>
and it appears that also more problematic when migrating to newer version
<liri>
it looks like it works now like a charm
<liri>
TYVM
<liri>
I removed External Ruby sources installed in OS from loadPath in SC, and I am just using JRuby complete 9K
CaptainHeavy has quit [Remote host closed the connection]
<enebo>
so super and friends at interp level have a boolean for that no map bit
<enebo>
I think worst part of complex is it makes a new ArrayList
<enebo>
although that could easily be changed
<headius>
oh wow
<headius>
heh
<headius>
I do two loops
<headius>
once to collect splatted array sizes and then I allocate exact size I need
<headius>
seems to work
<enebo>
one to count and an exact alloc
<headius>
yeah
<enebo>
so changing complex to that might be helpful but it might not matter either
<headius>
in theory it could be generalized into an indy call path or something some day
<headius>
well, at least there's no additional array and ArrayList
<headius>
plus any along the way when it grows
<enebo>
yeah it definitely is a cost
<enebo>
cost in a slow path execution path but still it can be slightly less clow
<enebo>
hmmm
<enebo>
interpreter does not make an array of arguments initially at all
<enebo>
we can know arg 3 is a s splat but we in theory trade off initial array construction for arraylist in complex case
<enebo>
but we cannot know size of arg 3 without interp’ing the splat
<GitHub108>
[jruby] nirvdrum pushed 1 new commit to master: https://git.io/vrzYP
<GitHub108>
jruby/master ea3d84f Kevin Menard: Revert "[Truffle] Switched from insertion sort to merge sort when sorting arrays > 3 elements."...
vtunka has quit [Quit: Leaving]
<enebo>
although making 2 primtive arrays very well may be faster than one arraylist made into an array
<headius>
I may use an ArrayList too when there's a splat
<enebo>
headius: subbu has an interesting comment in callbase.prepareArgumentsComplex about assumptions of splat
<enebo>
headius: super and call have different assumptions too
bbrowning has quit [Ping timeout: 260 seconds]
bbrowning has joined #jruby
<GitHub151>
[jruby] headius opened issue #3908: IR error in JIT mode MRI suite run https://git.io/vrz3n
grs has quit [Ping timeout: 240 seconds]
<GitHub43>
[jruby] headius opened pull request #3909: ZSuper does not require caller's binding/scope. (master...zsuper_sans_binding) https://git.io/vrzs4
<GitHub99>
[jruby] boberetezeke opened issue #3910: Different handling of default values and Hash splat values than MRI https://git.io/vrzsD
<headius>
enebo: I see why this works...JIT does first pass to evaluate all arguments and then goes back and splats what it needs to
<headius>
at least as far as test:jruby and test:mri that appears to be kosher
<headius>
so it has one array for number of operands and one array for final splatted arg list
<headius>
along the way
<enebo>
headius: but you make an intermediate args array and in simple case that is it and in splat case you count and make a second one
<enebo>
headius: which seems reasonable to me
<headius>
yeah
<headius>
no splat map, done after the first pass
<enebo>
headius: I mean you largely cannot know the size of the splat
<headius>
right
<enebo>
interp though can know since it builds from operands
<headius>
might be interesting to have it speculatively size ArrayList as big as the last splatted call
<enebo>
so interp method could use two primtive arrays in complex case and build up count as it makes first one
<enebo>
headius: buf did you read subbu’s comment
<headius>
seems reasonable that arg list length at a call site is probably not going to vary a lot even with splats
<enebo>
headius: splat will only be first argument in a normal call from IR
<bbrowning>
have there been any reports of memory usage issues with jruby 9.1ish or so? I'm looking at putting out a new TB4 release and hitting some OOM I don't recall hitting before
<headius>
enebo: right
<headius>
I'm saying for supers
<enebo>
headius: so I think we can eval splat get count and then make full size array without making two
<enebo>
headius: yeah for supers it can be anywhere
<enebo>
headius: so I think for super we need special method if we want to do that in interp for ordinary calls
<headius>
if normal calls only have splat at front, the rest of this loop is not really needed either though
<headius>
it can just do the first one, get its count, and prealloc based on the remaining size of the operands
<enebo>
yeah I just said that
<headius>
so the looping to find all splats is super-specific anyway
<enebo>
yep
<headius>
yeah I'm saying this logic is already mostly "special" for super
<enebo>
yeah so does subbus comment
<enebo>
although I do not know if all super subrtypes have their own common supertype
<GitHub166>
[jruby] chrisseaton pushed 1 new commit to truffle-head: https://git.io/vrzPZ
<GitHub166>
jruby/truffle-head 9e9ee2e Chris Seaton: [Truffle] Update Truffle version.
<bbrowning>
is something internal to jruby creating a ton more strings now than say around 9.0.0.0 timeframe? I'm seeing tons of strings in heap dumps
ruurd has joined #jruby
<bbrowning>
java strings
<bbrowning>
I was poking TB4 on travis to see why its build is failing with jruby 9 and it's running OOM. lowering my local heap settings to the same as travis uses I OOM locally too but didn't used to
<bbrowning>
my 512MB heap has about 300MB in ConcurrentHashMap$Nodes with string keys and some JavaClass$INVOKER values
<bbrowning>
it OOMS before even running a single test which is odd
<bbrowning>
headius: looks like the openssl x509 store, oddly enough?
<headius>
well that's pretty weird
<bbrowning>
65MB in one instance of org.jruby.ext.openssl.x509store.X509Object and I have several instances of those
<headius>
is that a key or a value?
<headius>
kares: do you know anything about this?
<bbrowning>
that's the object containing lots of x509store.Certificate objects
<bbrowning>
headius: ahh you were asking how it relates to CHM - I'm digging on that
<bbrowning>
switched from MAT to yourkit because MAT was dying on me
<bbrowning>
so the CHM Node is a RubyModule$ConstantEntry with a value of this X509Store and lots of certs
<headius>
hmmm
pitr-ch has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pitr-ch has joined #jruby
pitr-ch has quit [Read error: Connection reset by peer]
pitr-ch has joined #jruby
tjohnson has joined #jruby
ruurd has quit [Ping timeout: 260 seconds]
bbrowning is now known as bbrowning_away
yfeldblum has joined #jruby
johnsonch is now known as johnsonch_afk
pitr-ch has quit [Ping timeout: 260 seconds]
pitr-ch has joined #jruby
grs has quit [Ping timeout: 244 seconds]
Puffball_ has quit [Ping timeout: 250 seconds]
Puffball has joined #jruby
_whitelogger has joined #jruby
grs has quit [Ping timeout: 276 seconds]
pitr-ch has quit [Read error: Connection reset by peer]
pitr-ch has joined #jruby
donV has joined #jruby
bbrowning_away has quit [Quit: Leaving]
brauliobo has joined #jruby
enebo has quit [Quit: enebo]
e_dub has quit [Quit: ZZZzzz…]
<GitHub179>
[jruby] headius opened pull request #3911: Unify super and call splatting logic in interpreter and JIT. (master...zsuper_splatmap) https://git.io/vrgt7
<headius>
hmm, I don't think we got a bascule friday