Hi I’ve read from the JRuby release log here
JRuby 1.7.5 Released — JRuby.org that the invokedynamic
has been disabled since JRuby 1.7.5. However, it still can be enabled
using -Xcompile.invokedynamic=true command.
I’m currently working on a research project in which I need to produce
the java class files explicitly and analyze those invokedynamic commands
in the byte codes. I tried to use a JRuby version later than 1.7.4 and
issued the following command:
jrubyc Xcompile.invokedynamic=true myfile.rb
But I get the following error:
OptionParser::InvalidOption: invalid option:
-Xcompile.invokedynamic=true
complete at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1542
catch at org/jruby/RubyKernel.java:1282
complete at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1540
parse_in_order at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1380
catch at org/jruby/RubyKernel.java:1282
parse_in_order at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1347
order! at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1341
permute! at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1432
parse! at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:1453
compile_argv at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/shared/jruby/compiler.rb:83
initialize at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/1.9/optparse.rb:882
compile_argv at
/Users/x5lai/.rvm/rubies/jruby-1.7.5/lib/ruby/shared/jruby/compiler.rb:35
(root) at /Users/x5lai/.rvm/rubies/jruby-1.7.5/bin/jrubyc:5
Is it that this command flag is only present for the ‘jruby’ command and
not the ‘jrubyc’ command? Is there an equivalent parameter in jrubyc
command that I could turn on the invokedynamic in the byte codes
produced?