## RubyConfBR 2012 # what's new on JRuby 1.7? ### [@qmx](http://twitter.com/qmx) - [blog.qmx.me](http://blog.qmx.me)
# whoami

(we're hiring)

dynjs
# disclaimer
# JRuby 1.7
## the # biggest ### release
# EVAR
![charlie](assets/img/headius.jpg)
# numb3rs

> 80

unique contributors

> 3200

commits

> 700

closed issues

~ 2.666...

issues closed

daily

# goodies
# invokedynamic

1 + 2

is 1 an integer?

NO

					> 1.class
=> Fixnum
					

OO

taken to the next level

1+2

						1.+(2)
					

1+2

						1.send(:+, 2)
					

message passing <3

IRubyObject x; // 1 IRubyObject y; // 2

IRubyObject?

everything is an object

what about classes?

						{:methods => {:+ => ...}}
					

hashmap!

calling a

method

z = x.callMethod(context, "+", y);

calling a method

  1. get the object
  2. lookup the method
  3. call it
  4. profit

methods are

Objects!

lookup a method?

DynamicMethod

seems legit

Java

Virtual Machine

requires

ALL THE TYPES

during compilation

it's all about

method invocation

## hash lookups are # fast

what about a tight loop

of 1M lookups?

# problem?

now we can teach

the JVM

on how to reach the DynamicMethod instance we want

and avoid the 2nd

lookup

Ruby

inconstants

WTF?

inconstants

						A_CONSTANT = 3
A_CONSTANT = 4
warning: already initialized constant A_CONSTANT
>> A_CONSTANT
=> 4
					

WAT?

if you do your job

constants will be fast

## invokedynamic is # awesome
# \#fail
## current status # waiting
# \**sighs**
# IR
![dragon book](assets/img/compilers.jpg)
# WAT?
class Duck def quack lol = 3 puts 'quaaack' end end x = Duck.new x.quack
%self = recv_self line_num(0) %v_0 = def_class(Duck, module, nil, duck.rb) [DEAD-RESULT]%v_1 = process_module_body(%v_0) line_num(6) %v_0 = search_const(Duck, scope, no-private-consts=false) %v_1 = call(NORMAL, 'new', %v_0, []){0O} %v_0 = call(NORMAL, 'quack', %v_1, []){0O} return(%v_0)
![](assets/img/static_into_dynamic.jpg)
# Dataflow Analysis
# Dead-Code Elimination
# Static Single Assignment Form
# Reaching Definition
# Constant Propagation
# IO

encoding

(almost)

fixed

# FFI

@wmeissner

wiring via

invokedynamic

inlinable!

# concurrency

better locking strategy

MOAR

throughput

future

when?

late September

J1(ish)

what's next?

JRuby will get a new version

JRuby 10000

JRuby 9k1

mistery

JRuby is

awesome

you know why?

because

YOU

are awesome!

contribute!

![](assets/img/kitten.jpg)

always bet on

JRuby

# thanks!