SlideShare una empresa de Scribd logo
1 de 133
Descargar para leer sin conexión
1
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
20 years of Java
Vladimir Ivanov
HotSpot JVM Compiler
Oracle Corp.
Twitter: @iwan0www
OpenJDK: vlivanov
28.11.2015
2
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
20 years of Java (The Platform)
Vladimir Ivanov
HotSpot JVM Compiler
Oracle Corp.
Twitter: @iwan0www
OpenJDK: vlivanov
3
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is
intended for information purposes only, and may not be incorporated into
any contract. It is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing
decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
4
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
About me
1996 2002 2010 20152005
JDK 1.0
Wrote my first
program in Java.
Joined Sun
Microsystems
(SPBDC) to work
on HotSpot JVM Now
Became part of
Oracle Corp.
after acquisition
5
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1991: Project Green
6
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1991: *7 (StarSeven)
Oak programming language
7
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1991: *7 (StarSeven)
Duke
8
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1994: WebRunner/HotJava browser
9
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1995: First release: 1.0a2
10
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Intel Pentium
P54CS, 0.35µm, 200MHz, 66MHz FSB
11
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Sun Enterprise 10000
64 UltraSPARC II CPUs, 400 MHz, 16x4GB RAM
12
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1996: JDK 1.0
§  6 packages
–  java.applet
–  java.awt
–  java.io
–  java.lang
–  java.net
–  java.util
January, 23
§  # of classes
–  java/ 225
–  sun/ 379
13
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1996: picoJava
14
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1997: JDK 1.1
February, 19
15
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1998: J2SE 1.2
December, 8
16
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1999: J2SE, J2ME, J2EE
17
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1999: J2SE, J2ME, J2EE
18
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2000: J2SE 1.3
May, 8
19
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
1998: JCP
20
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2002
February, 6
21
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
First release
1995 1997 2002
Java Releases
1996 1998
JDK 1.0
JDK 1.1
J2SE 1.2
2000
J2SE 1.3
J2SE 1.4
Inner classes
JavaBeans
JDBC
RMI
Reflection
JNI
Swing
JIT compiler
Java Plug-in
Collections
HotSpot JVM
JNDI
Java Sound
JVMDI
JVMPI
Regular Expressions
IPv6 support
Logging
XML, XSLT
Java Web Start
January, 23
February, 19
December, 8
May, 8
February, 6
March
AWT
Network
I/O
22
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2004: J2SE 5.0
September, 30
23
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2004: J2SE 5.0
September, 30
24
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2006: Java SE 6
§  Scripting Language Support (JSR 223)
§  Java Compiler API (JSR 199)
§  Support for pluggable annotations (JSR 269)
§  Numerous performance improvements
–  C1: new linear register allocator
–  C1: IR in SSA form
December, 11
25
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Java SE 6u
§  Escape analysis in C2
–  6u23
§  NUMA GC Enhancements
–  Java SE 6u2
§  Compressed OOPs
–  6u23
§  Tiered compilation
HotSpot Express
26
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2007
May, 8
27
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2007: May
JavaFX 1.0 on December, 2008
28
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
29
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2010
30
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2011: Java SE 7
§  JVM support for dynamic languages (JSR 292)
§  Small language changes
–  e.g. strings in switch, try-with-resources
§  New file I/O library (defined by JSR 203)
July, 28
31
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2014: Java SE 8
§  JSR 335: Language-level support for lambda expressions
§  JSR 223: Project Nashorn, a JavaScript runtime
§  JSR 308: Annotation on Java Types
§  JSR 310: Date and Time API
§  JEP 122: Remove the permanent generation
March, 18
32
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2014: Java SE 8
March, 18
33
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
2016: Java SE 9
ETA: September, 22
Project	
  Jigsaw	
  
Scalability	
  
Performance	
  
Security	
  
http://openjdk.java.net	
  
34
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
Scalability
35
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Java 8
4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
auth
jdbc
jaxpnaming
jaxws
compiler
rowset
xmldsig
crypto
corba
desktop
tools.jre
httpserver
tools
tools.jaxws tools.base
devtools
javafx
prefssctp jx.annotations
instrument
54MB 30 16 11 nashorn
rmi
compact1
JRE
compact3
compact2
JDK
36
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
naming.rmi	
  
base	
  
charsets	
  
se	
  
compact3	
  
compact2	
  
compact1	
  
logging	
   scrip:ng	
  
security.acl	
  
security.sasl 	
  	
  
sql	
  
rmi	
  
xml	
  xml.crypto	
  
prefs	
  desktop	
  
ac:va:on	
  
corba	
  
compiler	
   management	
  
sql.rowset	
  
security.jgss	
  
instrument	
  
naming	
  
xml.ws	
  
xml.soap	
  
xml.bind	
  
annota:ons.common	
  
hBpserver	
  
rmic	
  
javadoc	
  
xml.ws	
  
xml.bind	
  
compiler	
  
hotspot.agent	
  
jconsole	
   jcmd 	
  jdi	
  
aBach	
  
jvmstat	
  
naming	
  
smartcardio	
  
crypto.ec	
  
crypto.pkcs11	
  
hprof.agent	
  
jdwp.agent	
  
localedata	
  
sctp	
  
zipfs	
  
security.auth	
  
scripting.
nashorn
Project Jigsaw
Performance
37
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
tls
logging
auth
jdbc
jta
jaxpnaming
jaxws
compiler
rowset
kerberos
management
xmldsig
crypto
cosnaming
management.iiop
corba
desktop
tools.jre
httpserver
tools
tools.jaxws tools.base
devtools
javafx
prefssctp jx.annotations
nashorn
instrument base
script
rmi
38
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
tls
logging
auth
jdbc
jta
jaxpnaming
jaxws
compiler
rowset
kerberos
management
xmldsig
crypto
cosnaming
management.iiop
corba
desktop
tools.jre
httpserver
tools
tools.jaxws tools.base
devtools
javafx
prefssctp jx.annotations
nashorn
instrument base
script
rmi
39
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
tls
logging
auth
jdbc
jta
jaxpnaming
jaxws
compiler
rowset
kerberos
management
xmldsig
crypto
cosnaming
management.iiop
corba
desktop
tools.jre
httpserver
tools
tools.jaxws tools.base
devtools
javafx
prefssctp jx.annotations
nashorn
instrument base
script
rmi
40
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
crypto
javafx
nashorn
base
script
41
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
jlink
9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
*.jmod
$JRE/bin/java
/ l i b / . . .
*.jar
*.class
JVM image
. j a r
.jmod
Fat binary
42
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
Opportunities for performance improvements
rt.jar
nashorn.jar, jfxrt.jar,
sunjce_provider.jar
myapp.jar
crypto
javafx
nashorn
base
script
43
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
§  Improved class loading architecture
–  fast class lookup
Opportunities for performance improvements
crypto
javafx
nashorn
base
script
44
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
§  Improved class loading architecture
–  fast class lookup
Opportunities for performance improvements
crypto
javafx
nashorn
base
script
45
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
§  Improved class loading architecture
–  fast class lookup
§  Aggressive inlining
Opportunities for performance improvements
crypto
javafx
nashorn
base
script
46
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
§  Improved class loading architecture
–  fast class lookup
§  Aggressive inlining
§  Ahead-Of-Time compilation
Opportunities for performance improvements
crypto
javafx
nashorn
base
script
47
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
§  Improved class loading architecture
–  fast class lookup
§  Aggressive inlining
§  Ahead-Of-Time compilation
§  JVM-specific memory images
–  e.g. Application Class Data Sharing (AppCDS)
Opportunities for performance improvements
crypto
javafx
nashorn
base
script
48
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw
§  Improved class loading architecture
–  fast class lookup
§  Aggressive inlining
§  Ahead-Of-Time compilation
§  JVM-specific memory images
–  e.g. Application Class Data Sharing (AppCDS)
§  Removal of unused fields/methods/classes
Opportunities for performance improvements
crypto
javafx
nashorn
base
script
49
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
sun.*
*.internal.*
17 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Project Jigsaw
Security
50
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
sun.misc.Unsafe?!
17 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Project Jigsaw
Security
51
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
- How many of you have used the Unsafe API?
…
John Rose
JVM Architect, Oracle Corporation
Project Jigsaw & sun.misc.Unsafe
@ JVM Language Summit 2014
52
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
- How many of you have used the Unsafe API?
…
- A lot of you. Gosh, I'm sorry.
John Rose
JVM Architect, Oracle Corporation
Project Jigsaw & sun.misc.Unsafe
@ JVM Language Summit 2014
53
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
54
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JEP 260: Encapsulate Most Internal APIs
§  Replacement exists in JDK 8
–  Encapsulate/remove the method in JDK 9
§  Replacement exists in JDK 9
–  Deprecate in JDK9
§  No replacement exists in JDK 9
–  (For widely used internal API) Leave accessible
55
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Critical Internal APIs
§  sun.misc.Cleaner
§  sun.misc.{Signal,SignalHandler}
§  sun.misc.Unsafe
§  sun.reflect.Reflection::getCallerClass
§  sun.reflect.ReflectionFactory
56
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
sun.misc.Unsafe
Use case Example methods
Concurrency primitives Unsafe.compareAndSwap*
Serialization
Unsafe.allocateInstance
(ReflectionFactory.newConstructorForSerialization)
Efficient memory management,
layout, and access
Unsafe.allocate/freeMemory
Unsafe.get*/put* (and JNI)
Interoperate across the JVM
boundary
Unsafe.get*/put* (and JNI)
57
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
sun.misc.Unsafe
Use case Replacement
Concurrency primitives JEP 193 Variable Handles
Serialization
Reboot JEP 187 Serialization
Improvements
Efficient memory management,
layout, and access
Project Panama, Project Valhalla,
Arrays 2.0, Better GC
Interoperate across the JVM
boundary
Project Panama,
JEP 191 Foreign Function Interface
58
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
sun.misc.Unsafe (JDK 9)
Use case Replacement
Concurrency primitives JEP 193 Variable Handles
Serialization
Reboot JEP 187 Serialization
Improvements
Efficient memory management,
layout, and access
Project Panama, Project Valhalla,
Arrays 2.0, Better GC
Interoperate across the JVM
boundary
Project Panama,
JEP 191 Foreign Function Interface
59
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
60
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JEP 193: Variable Handles
1.  Safe, performant, enhanced atomics
–  access to field and array elements
2.  Fence operations for fine-grained control of memory ordering
–  replacements for Unsafe::{full,store,load}Fence and more
3.  Reachability fence
–  java.lang.ref.Reference::reachabilityFence
61
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Charles Oliver Nutter
JRuby Lead Developer
“The most fundamental change to Java since its
inception.”
Java 7: Method Handles
62
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Method Handles
63
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(1) Variable Handles
§  like method handles for data
–  Abstracts over location
§  static fields, instance fields, arrays, off heap
–  Supports explicit fences and atomic operations
§  Safer than Unsafe, as fast as method handles
64
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Are sun.misc.Unsafe methods really fast?
§  Not necessarily…
–  public native Object allocateInstance(Class<?> cls) throws …;
–  Array index vs raw offset
long[] base = new long[…];
int idx = …; long offset = (((long) idx) << SCALE + OFFSET)
long value = Unsafe.getLong(base, offset);
–  JDK-8078629: “VM should constant fold Unsafe.get*() loads from final fields”
65
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(1) Variable Handles
66
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(2) Memory Fences
a = ?, b = ?
Thread #1 Thread #2
67
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(2) Memory Fences
[a,b] = [0,0], [0,1], [1,0], [1,1]
Thread #1 Thread #2
68
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(2) Memory Fences
Thread #1 Thread #2
[a,b] = [0,0], [0,1], [1,0], [1,1]
69
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(3) Finalization
70
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(3) Premature Finalization
71
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
(3) Premature Finalization
72
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Beyond Java 9
73
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Valhalla
Project Panama
Specialized Generics
Value Types
Foreign Function Interface
Data Layout Control
Arrays 2.0
http://openjdk.java.net	
  
74
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Valhalla
“The hall of valor value”
75
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value-based Class
final	
  class	
  Point	
  {	
  
	
  	
  	
  	
  public	
  final	
  int	
  x;	
  
	
  	
  	
  	
  public	
  final	
  int	
  y;	
  
}	
  
	
  
	
  
@since 8
“Use of identity-sensitive operations
on instances of value-based classes
may have unpredictable effects and
should be avoided.”
ValueBased javadoc
76
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value-based Class
Point[] points =
Arrays
hheader
x y
x y
x y
x y
x y
x y
77
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value-based Class
Point[] points =
Arrays
hheader
x y
x y
x y
x y
x y
x y
for	
  (Point	
  p	
  :	
  points)	
  {	
  
	
  	
  sum	
  +=	
  p.x	
  +	
  p.y;	
  
}	
  
78
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value-based Class
int[]	
  xPoints	
  =	
  
Arrays
hheader
assert(xPoints.length	
  ==	
  yPoints.length);	
  
	
  
for	
  (int	
  i	
  =	
  0;	
  i	
  <	
  xPoints.length;	
  i++)	
  {	
  
	
  	
  sum	
  +=	
  xPoint[i]	
  +	
  yPoint[i];	
  
}	
  
hheader
x x x x x x
y y y y y yint[]	
  yPoints	
  =	
  
79
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value-based Class
int[]	
  points	
  =	
  
Arrays
hheader
assert(points.length	
  %	
  2	
  ==	
  0);	
  
	
  
for	
  (int	
  i	
  =	
  0;	
  i	
  <	
  points.length;	
  i+=2)	
  {	
  
	
  	
  sum	
  +=	
  points[i]	
  +	
  points[i+1];	
  
}	
  
x y x y x y x y x y x y
80
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
“Codes like a class, works like an int!”
John Rose, Brian Goetz, Guy Steele
“State of the Values”
81
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value Types
Arrays
value	
  class	
  Point	
  {	
  
	
  	
  	
  	
  public	
  final	
  int	
  x;	
  
	
  	
  	
  	
  public	
  final	
  int	
  y;	
  
}	
  
Point[]	
  points	
  =	
   hheader x y x y x y x y x y x y
for	
  (Point	
  p	
  :	
  points)	
  {	
  
	
  	
  sum	
  +=	
  points.x	
  +	
  points.y;	
  
}	
  
82
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Motivation
§  Smaller footprint
–  no object header
§  Better locality
–  no dereference
§  Simpler semantics
–  no identity, no aliasing
§  No object allocation
Value Types
83
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value Types
value	
  class	
  Point	
  {	
  
	
  	
  	
  	
  public	
  final	
  int	
  x;	
  
	
  	
  	
  	
  public	
  final	
  int	
  y;	
  
}	
  
	
  
class	
  Rectangle	
  {	
  
	
  	
  	
  	
  public	
  final	
  Point	
  corner1;	
  
	
  	
  	
  	
  public	
  final	
  Point	
  corner2;	
  
}	
  
	
  
Concurrent side effects
x xy yhheader	
  
Rectangle	
  r	
  =	
  	
  
x y
x y
hheader	
  
Rectangle	
  r	
  =	
  	
  
84
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Value Types
value	
  class	
  Point	
  {	
  
	
  	
  	
  	
  public	
  final	
  int	
  x;	
  
	
  	
  	
  	
  public	
  final	
  int	
  y;	
  
}	
  
	
  
class	
  Rectangle	
  {	
  
	
  	
  	
  	
  public	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Point	
  corner1;	
  
	
  	
  	
  	
  public	
  volatile	
  Point	
  corner2;	
  
}	
  
	
  
Concurrent side effects
x xy yhheader	
  
Rectangle	
  r	
  =	
  	
  
x y
x y
hheader	
  
Rectangle	
  r	
  =	
  	
  
85
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Use cases
§  Numerics: complex, decimal, rarely-big-num, etc.
§  Native types: int128_t, vectors, unsigned, safe native pointers
§  Algebraic data: optional (no box), choice-of, unit (no bits)
§  Tuples: multiple-value return! (requires specialization machinery also)
§  Cursors: unboxed iterators, STL-style bounds
§  Flat data: values naturally represent pointer-poor data structures
86
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Selected details
Point[] <:? Object[]
87
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Selected details
Point[] <: Object[]
Point[]	
  points	
  =	
   hheader x y x y x y x y x y x y
88
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
Motivation
ArrayList<Integer>
89
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
Motivation
ArrayList<int>
90
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Objects
§  Object, String, …, MyClass, …,
Integer, Long, …
–  8 primitive types (+ reference)
§  boolean, byte, short, char, int, long,
float, double
vs Primitives
91
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Objects
§  Object, String, …, MyClass, …,
Integer, Long, …
–  8 primitive types (+ reference)
§  boolean, byte, short, char, int, long,
float, double
–  Value types
§  User-defined (!!!)
vs Non-objects
92
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
Motivation
ArrayList<Point>
93
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box<T>	
  	
  {	
  	
  
	
  T	
  	
  	
  	
  	
  	
  val;	
  	
  
	
  
	
  public	
  Box(T	
  	
  	
  	
  	
  	
  val)	
  {	
  this.val	
  =	
  val;	
  }	
  	
  
	
  public	
  T	
  	
  	
  	
  	
  	
  get()	
  	
  	
  	
  {	
  return	
  val;	
  }	
  	
  
}	
  	
  
	
  
94
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box<T>	
  	
  {	
  	
  
	
  T	
  	
  	
  	
  	
  	
  val;	
  	
  
	
  
	
  public	
  Box(T	
  	
  	
  	
  	
  	
  val)	
  {	
  this.val	
  =	
  val;	
  }	
  	
  
	
  public	
  T	
  	
  	
  	
  	
  	
  get()	
  	
  	
  	
  {	
  return	
  val;	
  }	
  	
  
}	
  	
  
	
  
95
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box<Object>	
  	
  {	
  	
  
	
  Object	
  val;	
  	
  
	
  
	
  public	
  Box(Object	
  val)	
  {	
  this.val	
  =	
  val;	
  }	
  	
  
	
  public	
  Object	
  get()	
  	
  	
  	
  {	
  return	
  val;	
  }	
  	
  
}	
  	
  
	
  
96
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box<	
  	
  	
  int>	
  	
  {	
  	
  
	
  int	
  	
  	
  	
  val;	
  	
  
	
  
	
  public	
  Box(int	
  	
  	
  	
  val)	
  {	
  this.val	
  =	
  val;	
  }	
  	
  
	
  public	
  int	
  	
  	
  	
  get()	
  	
  	
  	
  {	
  return	
  val;	
  }	
  	
  
}	
  	
  
	
  
97
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box<any	
  T>	
  	
  {	
  	
  
	
  T	
  	
  	
  	
  	
  	
  val;	
  	
  
	
  
	
  public	
  Box(T	
  	
  	
  	
  	
  	
  val)	
  {	
  this.val	
  =	
  val;	
  }	
  	
  
	
  public	
  T	
  	
  	
  	
  	
  	
  get()	
  	
  	
  	
  {	
  return	
  val;	
  }	
  	
  
}	
  	
  
	
  
98
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box	
  extends	
  Object	
  {	
  	
  
	
  	
  	
  	
  private	
  final	
  Object	
  t;	
  	
  
	
  
	
  	
  	
  	
  public	
  Object	
  get()	
  {	
  	
  
	
  	
  	
  	
  	
  	
  0:	
  aload_0	
  	
  
	
  	
  	
  	
  	
  	
  1:	
  getfield	
  #2	
  //Field	
  t:LObject;	
  	
  
	
  	
  	
  	
  	
  	
  4:	
  areturn	
  
	
  	
  	
  	
  }	
  
}	
  
99
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box	
  extends	
  Object	
  {	
  	
  
	
  	
  	
  	
  private	
  final	
  	
  	
  	
  int	
  t;	
  	
  
	
  
	
  	
  	
  	
  public	
  	
  	
  	
  int	
  get()	
  {	
  	
  
	
  	
  	
  	
  	
  	
  0:	
  aload_0	
  	
  
	
  	
  	
  	
  	
  	
  1:	
  getfield	
  #2	
  //Field	
  t:I;	
  	
  
	
  	
  	
  	
  	
  	
  4:	
  ireturn	
  
	
  	
  	
  	
  }	
  
}	
  
100
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
class	
  Box	
  extends	
  Object	
  {	
  	
  
	
  	
  	
  	
  private	
  final	
  Object*T	
  t;	
  	
  
	
  
	
  	
  	
  	
  public	
  Object*T	
  get()	
  {	
  	
  
	
  	
  	
  	
  	
  	
  0:	
  aload_0	
  	
  
	
  	
  	
  	
  	
  	
  1:	
  getfield	
  #2	
  //Field	
  t:Lobject*T;	
  	
  
	
  	
  	
  	
  	
  	
  4:	
  areturn*T	
  
	
  	
  	
  	
  }	
  
}	
  
101
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
Box<Integer> :> Box
102
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
Box<int> :>? Box
103
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Generic Specialization
Box<int> :> Box
Box<int> :> Box<?>
Box<Object> :> Box<?>
Box :> Box<?>
104
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Panama
“Bridging the gap”
105
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
“If non-Java programmers find some library
useful and easy to access, it should be
similarly accessible to Java programmers.”
John Rose, JVM Architect,
Oracle Corporation
106
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JNI
@since 1.1
107
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JNI
A victim of its own success?
108
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JNI
Usage scenario
109
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JNI
Java:
public class GetPid {
public static native long getpid();
}
C/C++:
get_pid.h:
JNIEXPORT jlong JNICALL Java_GetPid_getpid (JNIEnv *, jclass);
get_pid.c:
jlong JNICALL Java_GetPidJNI_getpid(JNIEnv *env, jclass c) {
return getpid();
}
110
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
JNI: Method Invocation
1.  if (GC_locker::needs_gc())
SharedRuntime::block_for_jni_critical()
2.  transition to thread_in_native
3.  unpack array arguments
4.  call native entry point
Runtime checks before and after native call
1.  call native entry point
2.  check for safepoint in progress
3.  check if any thread suspend flags
are set
–  call into JVM and possibly unlock the
JNI critical if a GC was suppressed
while in the critical native
4.  transition to thread_in_Java
5.  return
111
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
Easier, safer, faster!
112
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
sun.misc.Unsafe
§ Anti-JNI
113
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Unsafe.getUnsafe().
putInt(new Object(), 0, 0)
114
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Unsafe.getUnsafe().
putInt(null, 0, 0)
115
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
Easier, safer, faster!
116
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
pid_t get_pid();
117
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
public	
  interface	
  GetPid	
  {	
  
	
  	
  	
  	
  long	
  getpid();	
  
}	
  
	
  
Easier
118
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
public	
  interface	
  GetPid	
  {	
  
	
  	
  	
  	
  long	
  getpid();	
  
}	
  
	
  
GetPid	
  getpid	
  =	
  Library.load(GetPid.class,	
  “c”	
  /*	
  lib_name	
  */	
  );	
  
Easier
119
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
public	
  interface	
  GetPid	
  {	
  
	
  	
  	
  	
  long	
  getpid();	
  
}	
  
	
  
GetPid	
  getpid	
  =	
  Library.load(GetPid.class,	
  “c”	
  /*lib_name*/	
  );	
  
	
  
getpid.getpid();	
  
Easier
120
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
Faster
callq 0x1057b2eb0 ; getpid entry
121
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
gettimeofday
/*	
  time.h	
  */	
  
	
  
struct	
  {	
  
	
  	
  	
  	
  time_t	
  	
  	
  	
  	
  	
  tv_sec;	
  	
  	
  
	
  	
  	
  	
  suseconds_t	
  tv_usec;	
  	
  
}	
  timeval;	
  
	
  
int	
  gettimeofday(struct	
  timeval*	
  tv,	
  struct	
  timezone*	
  tz);	
  
	
  
	
  
struct	
  {	
  
	
  	
  	
  	
  int	
  tz_minuteswest;	
  	
  	
  
	
  	
  	
  	
  int	
  tz_dsttime;	
  	
  
}	
  timezone;	
  
	
  
122
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
$ jextract time.h
interface	
  Time	
  {	
  
	
  
interface	
  Timeval	
  {	
  
	
  	
  	
  	
  long	
  tv_sec$get();	
  
	
  	
  	
  	
  void	
  tv_sec$set(long);	
  
	
  	
  	
  	
  long	
  tv_usec$get();	
  
	
  	
  	
  	
  void	
  tv_usec$set(long);	
  	
  	
  
}	
  
	
  
int	
  gettimeofday(Timeval,	
  Timezone);	
  
interface	
  Timezone	
  {	
  
	
  	
  	
  	
  long	
  tz_...$get();	
  
	
  	
  	
  	
  void	
  tz_...$set(long);	
  
	
  	
  	
  	
  long	
  tz_...$get();	
  
	
  	
  	
  	
  void	
  tz_...$set(long);	
  	
  	
  
}	
  
	
  
123
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
Runtime
Library	
  lib	
  	
  =	
  Library.create(“c”);	
  
	
  
Time	
  time	
  =	
  lib.create(Time.class);	
  
	
  
Timeval	
  	
  tval	
  =	
  lib.create(Timeval.class);	
  
Timezone	
  tzone	
  =	
  null;	
  
	
  
int	
  res	
  =	
  time.gettimeofday(tval,	
  tzone);	
  
if	
  (res	
  ==	
  0)	
  {	
  
	
  	
  long	
  tv_sec	
  	
  =	
  tval.tv_sec$get();	
  
	
  	
  long	
  tv_usec	
  =	
  tval.tv_usec$get();	
  
}	
  
124
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
Resources
Timeval	
  tval;	
  
try	
  {	
  
	
  	
  tval	
  =	
  lib.create(Timeval.class);	
  
	
  
	
  	
  int	
  res	
  =	
  time.gettimeofday(tval,	
  null);	
  
	
  	
  if	
  (res	
  ==	
  0)	
  {	
  
	
  	
  	
  	
  long	
  tv_sec	
  	
  =	
  tval.tv_sec$get();	
  
	
  	
  	
  	
  long	
  tv_usec	
  =	
  tval.tv_usec$get();	
  
	
  	
  }	
  
}	
  finally	
  {	
  
	
  	
  lib.free(tval);	
  
	
  	
  tval	
  =	
  null;	
  
}	
  
125
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
Resources
try	
  (Timeval	
  tval	
  =	
  lib.create(Timeval.class))	
  {	
  
	
  	
  int	
  res	
  =	
  time.gettimeofday(tval,	
  null);	
  
	
  	
  if	
  (res	
  ==	
  0)	
  {	
  
	
  	
  	
  	
  long	
  tv_sec	
  	
  =	
  tval.tv_sec$get();	
  
	
  	
  	
  	
  long	
  tv_usec	
  =	
  tval.tv_usec$get();	
  
	
  	
  }	
  
}	
  
126
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
§  no crashes
§  no leaks
§  no hangs
§  no privilege escalation
§  no unguarded casts
Safer
127
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Better JNI
128
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Valhalla
http://openjdk.java.net	
  
Project Panama
Specialized Generics
Value Types
Foreign Function Interface
Data Layout Control
Arrays 2.0
129
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Valhalla
http://openjdk.java.net	
  
valhalla-­‐dev@openjdk.java.net	
  
http://hg.openjdk.java.net/valhalla/valhalla	
  
Project Panama panama-­‐dev@openjdk.java.net	
  
http://hg.openjdk.java.net/panama/panama	
  
130
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Duke
1995 2015
131
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
132
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Safe Harbor Statement
The following is intended to outline our general product direction. It is
intended for information purposes only, and may not be incorporated into
any contract. It is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing
decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
133
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Graphic Section Divider

Más contenido relacionado

La actualidad más candente

20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ Osaka20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ OsakaTakashi Ito
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0David Delabassee
 
Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Dmitry Kornilov
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Heather VanCura
 
O Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no JavaO Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no JavaBruno Borges
 
What's new in the Java API for JSON Binding
What's new in the Java API for JSON BindingWhat's new in the Java API for JSON Binding
What's new in the Java API for JSON BindingDmitry Kornilov
 
JSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksJSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksDmitry Kornilov
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8PT.JUG
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOFglassfish
 
GlassFish Roadmap
GlassFish RoadmapGlassFish Roadmap
GlassFish Roadmapglassfish
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015Edward Burns
 
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller Patroklos Papapetrou (Pat)
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015Edward Burns
 

La actualidad más candente (20)

20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ Osaka20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ Osaka
 
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaCro'15 - Java EE 8 - An instant snapshot - David DelabasseeJavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 
Java EE for the Cloud
Java EE for the CloudJava EE for the Cloud
Java EE for the Cloud
 
Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374
 
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David DelabasseeJavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
 
Java Desktop 2019
Java Desktop 2019Java Desktop 2019
Java Desktop 2019
 
O Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no JavaO Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no Java
 
What's new in the Java API for JSON Binding
What's new in the Java API for JSON BindingWhat's new in the Java API for JSON Binding
What's new in the Java API for JSON Binding
 
MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
JSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksJSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworks
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOF
 
GlassFish Roadmap
GlassFish RoadmapGlassFish Roadmap
GlassFish Roadmap
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
Voxxed Days Thessaloniki 2016 - JDK 9 : Big Changes To Make Java Smaller
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015
 

Similar a Владимир Иванов (Oracle): Java: прошлое и будущее

How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesPavel Bucek
 
Java: how to thrive in the changing world
Java: how to thrive in the changing worldJava: how to thrive in the changing world
Java: how to thrive in the changing worldAlexey Fyodorov
 
Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)Logico
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsDavid Delabassee
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessEd Burns
 
JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会Takashi Ito
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsDavid Delabassee
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKWolfgang Weigend
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MorePolyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MoreShaun Smith
 
Java Day Tokyo 2016 feedback at Kumamoto
Java Day Tokyo 2016 feedback at KumamotoJava Day Tokyo 2016 feedback at Kumamoto
Java Day Tokyo 2016 feedback at KumamotoTakashi Ito
 
It's a jdk jungle out there - JDK 11 and OpenJDK 11
It's a jdk jungle out there - JDK 11 and OpenJDK 11It's a jdk jungle out there - JDK 11 and OpenJDK 11
It's a jdk jungle out there - JDK 11 and OpenJDK 11Wolfgang Weigend
 
Java è il linguaggio dell’IoT - Weaver
Java è il linguaggio dell’IoT - WeaverJava è il linguaggio dell’IoT - Weaver
Java è il linguaggio dell’IoT - WeaverCodemotion
 
Huge Enterprise Systems Architecture Design with Java EE
Huge Enterprise Systems Architecture Design with Java EEHuge Enterprise Systems Architecture Design with Java EE
Huge Enterprise Systems Architecture Design with Java EERakuten Group, Inc.
 

Similar a Владимир Иванов (Oracle): Java: прошлое и будущее (20)

How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based Microservices
 
Javantura v6 - Java SE, Today and Tomorrow - Dalibor Topic
Javantura v6 - Java SE, Today and Tomorrow - Dalibor TopicJavantura v6 - Java SE, Today and Tomorrow - Dalibor Topic
Javantura v6 - Java SE, Today and Tomorrow - Dalibor Topic
 
Java: how to thrive in the changing world
Java: how to thrive in the changing worldJava: how to thrive in the changing world
Java: how to thrive in the changing world
 
Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)
 
JDK versions and OpenJDK
JDK versions and OpenJDKJDK versions and OpenJDK
JDK versions and OpenJDK
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with Less
 
JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会
 
Java fx
Java fxJava fx
Java fx
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
 
Java SE Subscription Workshop
Java SE Subscription WorkshopJava SE Subscription Workshop
Java SE Subscription Workshop
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MorePolyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
 
Java Day Tokyo 2016 feedback at Kumamoto
Java Day Tokyo 2016 feedback at KumamotoJava Day Tokyo 2016 feedback at Kumamoto
Java Day Tokyo 2016 feedback at Kumamoto
 
It's a jdk jungle out there - JDK 11 and OpenJDK 11
It's a jdk jungle out there - JDK 11 and OpenJDK 11It's a jdk jungle out there - JDK 11 and OpenJDK 11
It's a jdk jungle out there - JDK 11 and OpenJDK 11
 
Java 101
Java 101Java 101
Java 101
 
Java è il linguaggio dell’IoT - Weaver
Java è il linguaggio dell’IoT - WeaverJava è il linguaggio dell’IoT - Weaver
Java è il linguaggio dell’IoT - Weaver
 
Huge Enterprise Systems Architecture Design with Java EE
Huge Enterprise Systems Architecture Design with Java EEHuge Enterprise Systems Architecture Design with Java EE
Huge Enterprise Systems Architecture Design with Java EE
 

Más de Olga Lavrentieva

15 10-22 altoros-fact_sheet_st_v4
15 10-22 altoros-fact_sheet_st_v415 10-22 altoros-fact_sheet_st_v4
15 10-22 altoros-fact_sheet_st_v4Olga Lavrentieva
 
Сергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive Performance
Сергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive PerformanceСергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive Performance
Сергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive PerformanceOlga Lavrentieva
 
Андрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности CassandraАндрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности CassandraOlga Lavrentieva
 
Brug - Web push notification
Brug  - Web push notificationBrug  - Web push notification
Brug - Web push notificationOlga Lavrentieva
 
Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"
Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"
Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"Olga Lavrentieva
 
Максим Жилинский: "Контейнеры: под капотом"
Максим Жилинский: "Контейнеры: под капотом"Максим Жилинский: "Контейнеры: под капотом"
Максим Жилинский: "Контейнеры: под капотом"Olga Lavrentieva
 
Александр Протасеня: "PayPal. Различные способы интеграции"
Александр Протасеня: "PayPal. Различные способы интеграции"Александр Протасеня: "PayPal. Различные способы интеграции"
Александр Протасеня: "PayPal. Различные способы интеграции"Olga Lavrentieva
 
Сергей Черничков: "Интеграция платежных систем в .Net приложения"
Сергей Черничков: "Интеграция платежных систем в .Net приложения"Сергей Черничков: "Интеграция платежных систем в .Net приложения"
Сергей Черничков: "Интеграция платежных систем в .Net приложения"Olga Lavrentieva
 
Антон Шемерей «Single responsibility principle в руби или почему instanceclas...
Антон Шемерей «Single responsibility principle в руби или почему instanceclas...Антон Шемерей «Single responsibility principle в руби или почему instanceclas...
Антон Шемерей «Single responsibility principle в руби или почему instanceclas...Olga Lavrentieva
 
Егор Воробьёв: «Ruby internals»
Егор Воробьёв: «Ruby internals»Егор Воробьёв: «Ruby internals»
Егор Воробьёв: «Ruby internals»Olga Lavrentieva
 
Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»Olga Lavrentieva
 
Дмитрий Савицкий «Ruby Anti Magic Shield»
Дмитрий Савицкий «Ruby Anti Magic Shield»Дмитрий Савицкий «Ruby Anti Magic Shield»
Дмитрий Савицкий «Ruby Anti Magic Shield»Olga Lavrentieva
 
Сергей Алексеев «Парное программирование. Удаленно»
Сергей Алексеев «Парное программирование. Удаленно»Сергей Алексеев «Парное программирование. Удаленно»
Сергей Алексеев «Парное программирование. Удаленно»Olga Lavrentieva
 
«Почему Spark отнюдь не так хорош»
«Почему Spark отнюдь не так хорош»«Почему Spark отнюдь не так хорош»
«Почему Spark отнюдь не так хорош»Olga Lavrentieva
 
«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»
«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»
«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»Olga Lavrentieva
 
«Практика построения высокодоступного решения на базе Cloud Foundry Paas»
«Практика построения высокодоступного решения на базе Cloud Foundry Paas»«Практика построения высокодоступного решения на базе Cloud Foundry Paas»
«Практика построения высокодоступного решения на базе Cloud Foundry Paas»Olga Lavrentieva
 
«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»Olga Lavrentieva
 
«Обзор возможностей Open cv»
«Обзор возможностей Open cv»«Обзор возможностей Open cv»
«Обзор возможностей Open cv»Olga Lavrentieva
 
«Нужно больше шин! Eventbus based framework vertx.io»
«Нужно больше шин! Eventbus based framework vertx.io»«Нужно больше шин! Eventbus based framework vertx.io»
«Нужно больше шин! Eventbus based framework vertx.io»Olga Lavrentieva
 
«Работа с базами данных с использованием Sequel»
«Работа с базами данных с использованием Sequel»«Работа с базами данных с использованием Sequel»
«Работа с базами данных с использованием Sequel»Olga Lavrentieva
 

Más de Olga Lavrentieva (20)

15 10-22 altoros-fact_sheet_st_v4
15 10-22 altoros-fact_sheet_st_v415 10-22 altoros-fact_sheet_st_v4
15 10-22 altoros-fact_sheet_st_v4
 
Сергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive Performance
Сергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive PerformanceСергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive Performance
Сергей Ковалёв (Altoros): Practical Steps to Improve Apache Hive Performance
 
Андрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности CassandraАндрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности Cassandra
 
Brug - Web push notification
Brug  - Web push notificationBrug  - Web push notification
Brug - Web push notification
 
Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"
Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"
Александр Ломов: "Reactjs + Haskell + Cloud Foundry = Love"
 
Максим Жилинский: "Контейнеры: под капотом"
Максим Жилинский: "Контейнеры: под капотом"Максим Жилинский: "Контейнеры: под капотом"
Максим Жилинский: "Контейнеры: под капотом"
 
Александр Протасеня: "PayPal. Различные способы интеграции"
Александр Протасеня: "PayPal. Различные способы интеграции"Александр Протасеня: "PayPal. Различные способы интеграции"
Александр Протасеня: "PayPal. Различные способы интеграции"
 
Сергей Черничков: "Интеграция платежных систем в .Net приложения"
Сергей Черничков: "Интеграция платежных систем в .Net приложения"Сергей Черничков: "Интеграция платежных систем в .Net приложения"
Сергей Черничков: "Интеграция платежных систем в .Net приложения"
 
Антон Шемерей «Single responsibility principle в руби или почему instanceclas...
Антон Шемерей «Single responsibility principle в руби или почему instanceclas...Антон Шемерей «Single responsibility principle в руби или почему instanceclas...
Антон Шемерей «Single responsibility principle в руби или почему instanceclas...
 
Егор Воробьёв: «Ruby internals»
Егор Воробьёв: «Ruby internals»Егор Воробьёв: «Ruby internals»
Егор Воробьёв: «Ruby internals»
 
Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»
 
Дмитрий Савицкий «Ruby Anti Magic Shield»
Дмитрий Савицкий «Ruby Anti Magic Shield»Дмитрий Савицкий «Ruby Anti Magic Shield»
Дмитрий Савицкий «Ruby Anti Magic Shield»
 
Сергей Алексеев «Парное программирование. Удаленно»
Сергей Алексеев «Парное программирование. Удаленно»Сергей Алексеев «Парное программирование. Удаленно»
Сергей Алексеев «Парное программирование. Удаленно»
 
«Почему Spark отнюдь не так хорош»
«Почему Spark отнюдь не так хорош»«Почему Spark отнюдь не так хорош»
«Почему Spark отнюдь не так хорош»
 
«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»
«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»
«Cassandra data modeling – моделирование данных для NoSQL СУБД Cassandra»
 
«Практика построения высокодоступного решения на базе Cloud Foundry Paas»
«Практика построения высокодоступного решения на базе Cloud Foundry Paas»«Практика построения высокодоступного решения на базе Cloud Foundry Paas»
«Практика построения высокодоступного решения на базе Cloud Foundry Paas»
 
«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»
 
«Обзор возможностей Open cv»
«Обзор возможностей Open cv»«Обзор возможностей Open cv»
«Обзор возможностей Open cv»
 
«Нужно больше шин! Eventbus based framework vertx.io»
«Нужно больше шин! Eventbus based framework vertx.io»«Нужно больше шин! Eventbus based framework vertx.io»
«Нужно больше шин! Eventbus based framework vertx.io»
 
«Работа с базами данных с использованием Sequel»
«Работа с базами данных с использованием Sequel»«Работа с базами данных с использованием Sequel»
«Работа с базами данных с использованием Sequel»
 

Último

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Último (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Владимир Иванов (Oracle): Java: прошлое и будущее

  • 1. 1 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 20 years of Java Vladimir Ivanov HotSpot JVM Compiler Oracle Corp. Twitter: @iwan0www OpenJDK: vlivanov 28.11.2015
  • 2. 2 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 20 years of Java (The Platform) Vladimir Ivanov HotSpot JVM Compiler Oracle Corp. Twitter: @iwan0www OpenJDK: vlivanov
  • 3. 3 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. 4 Copyright © 2015, Oracle and/or its affiliates. All rights reserved About me 1996 2002 2010 20152005 JDK 1.0 Wrote my first program in Java. Joined Sun Microsystems (SPBDC) to work on HotSpot JVM Now Became part of Oracle Corp. after acquisition
  • 5. 5 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1991: Project Green
  • 6. 6 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1991: *7 (StarSeven) Oak programming language
  • 7. 7 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1991: *7 (StarSeven) Duke
  • 8. 8 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1994: WebRunner/HotJava browser
  • 9. 9 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1995: First release: 1.0a2
  • 10. 10 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Intel Pentium P54CS, 0.35µm, 200MHz, 66MHz FSB
  • 11. 11 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Sun Enterprise 10000 64 UltraSPARC II CPUs, 400 MHz, 16x4GB RAM
  • 12. 12 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1996: JDK 1.0 §  6 packages –  java.applet –  java.awt –  java.io –  java.lang –  java.net –  java.util January, 23 §  # of classes –  java/ 225 –  sun/ 379
  • 13. 13 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1996: picoJava
  • 14. 14 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1997: JDK 1.1 February, 19
  • 15. 15 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1998: J2SE 1.2 December, 8
  • 16. 16 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1999: J2SE, J2ME, J2EE
  • 17. 17 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1999: J2SE, J2ME, J2EE
  • 18. 18 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2000: J2SE 1.3 May, 8
  • 19. 19 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 1998: JCP
  • 20. 20 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2002 February, 6
  • 21. 21 Copyright © 2015, Oracle and/or its affiliates. All rights reserved First release 1995 1997 2002 Java Releases 1996 1998 JDK 1.0 JDK 1.1 J2SE 1.2 2000 J2SE 1.3 J2SE 1.4 Inner classes JavaBeans JDBC RMI Reflection JNI Swing JIT compiler Java Plug-in Collections HotSpot JVM JNDI Java Sound JVMDI JVMPI Regular Expressions IPv6 support Logging XML, XSLT Java Web Start January, 23 February, 19 December, 8 May, 8 February, 6 March AWT Network I/O
  • 22. 22 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2004: J2SE 5.0 September, 30
  • 23. 23 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2004: J2SE 5.0 September, 30
  • 24. 24 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2006: Java SE 6 §  Scripting Language Support (JSR 223) §  Java Compiler API (JSR 199) §  Support for pluggable annotations (JSR 269) §  Numerous performance improvements –  C1: new linear register allocator –  C1: IR in SSA form December, 11
  • 25. 25 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Java SE 6u §  Escape analysis in C2 –  6u23 §  NUMA GC Enhancements –  Java SE 6u2 §  Compressed OOPs –  6u23 §  Tiered compilation HotSpot Express
  • 26. 26 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2007 May, 8
  • 27. 27 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2007: May JavaFX 1.0 on December, 2008
  • 28. 28 Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 29. 29 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2010
  • 30. 30 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2011: Java SE 7 §  JVM support for dynamic languages (JSR 292) §  Small language changes –  e.g. strings in switch, try-with-resources §  New file I/O library (defined by JSR 203) July, 28
  • 31. 31 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2014: Java SE 8 §  JSR 335: Language-level support for lambda expressions §  JSR 223: Project Nashorn, a JavaScript runtime §  JSR 308: Annotation on Java Types §  JSR 310: Date and Time API §  JEP 122: Remove the permanent generation March, 18
  • 32. 32 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2014: Java SE 8 March, 18
  • 33. 33 Copyright © 2015, Oracle and/or its affiliates. All rights reserved 2016: Java SE 9 ETA: September, 22 Project  Jigsaw   Scalability   Performance   Security   http://openjdk.java.net  
  • 34. 34 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw Scalability
  • 35. 35 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Java 8 4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. auth jdbc jaxpnaming jaxws compiler rowset xmldsig crypto corba desktop tools.jre httpserver tools tools.jaxws tools.base devtools javafx prefssctp jx.annotations instrument 54MB 30 16 11 nashorn rmi compact1 JRE compact3 compact2 JDK
  • 36. 36 Copyright © 2015, Oracle and/or its affiliates. All rights reserved naming.rmi   base   charsets   se   compact3   compact2   compact1   logging   scrip:ng   security.acl   security.sasl     sql   rmi   xml  xml.crypto   prefs  desktop   ac:va:on   corba   compiler   management   sql.rowset   security.jgss   instrument   naming   xml.ws   xml.soap   xml.bind   annota:ons.common   hBpserver   rmic   javadoc   xml.ws   xml.bind   compiler   hotspot.agent   jconsole   jcmd  jdi   aBach   jvmstat   naming   smartcardio   crypto.ec   crypto.pkcs11   hprof.agent   jdwp.agent   localedata   sctp   zipfs   security.auth   scripting. nashorn Project Jigsaw Performance
  • 37. 37 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw 4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. tls logging auth jdbc jta jaxpnaming jaxws compiler rowset kerberos management xmldsig crypto cosnaming management.iiop corba desktop tools.jre httpserver tools tools.jaxws tools.base devtools javafx prefssctp jx.annotations nashorn instrument base script rmi
  • 38. 38 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw 4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. tls logging auth jdbc jta jaxpnaming jaxws compiler rowset kerberos management xmldsig crypto cosnaming management.iiop corba desktop tools.jre httpserver tools tools.jaxws tools.base devtools javafx prefssctp jx.annotations nashorn instrument base script rmi
  • 39. 39 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw 4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. tls logging auth jdbc jta jaxpnaming jaxws compiler rowset kerberos management xmldsig crypto cosnaming management.iiop corba desktop tools.jre httpserver tools tools.jaxws tools.base devtools javafx prefssctp jx.annotations nashorn instrument base script rmi
  • 40. 40 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw 4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. crypto javafx nashorn base script
  • 41. 41 Copyright © 2015, Oracle and/or its affiliates. All rights reserved jlink 9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. *.jmod $JRE/bin/java / l i b / . . . *.jar *.class JVM image . j a r .jmod Fat binary
  • 42. 42 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw Opportunities for performance improvements rt.jar nashorn.jar, jfxrt.jar, sunjce_provider.jar myapp.jar crypto javafx nashorn base script
  • 43. 43 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw §  Improved class loading architecture –  fast class lookup Opportunities for performance improvements crypto javafx nashorn base script
  • 44. 44 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw §  Improved class loading architecture –  fast class lookup Opportunities for performance improvements crypto javafx nashorn base script
  • 45. 45 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw §  Improved class loading architecture –  fast class lookup §  Aggressive inlining Opportunities for performance improvements crypto javafx nashorn base script
  • 46. 46 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw §  Improved class loading architecture –  fast class lookup §  Aggressive inlining §  Ahead-Of-Time compilation Opportunities for performance improvements crypto javafx nashorn base script
  • 47. 47 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw §  Improved class loading architecture –  fast class lookup §  Aggressive inlining §  Ahead-Of-Time compilation §  JVM-specific memory images –  e.g. Application Class Data Sharing (AppCDS) Opportunities for performance improvements crypto javafx nashorn base script
  • 48. 48 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Jigsaw §  Improved class loading architecture –  fast class lookup §  Aggressive inlining §  Ahead-Of-Time compilation §  JVM-specific memory images –  e.g. Application Class Data Sharing (AppCDS) §  Removal of unused fields/methods/classes Opportunities for performance improvements crypto javafx nashorn base script
  • 49. 49 Copyright © 2015, Oracle and/or its affiliates. All rights reserved sun.* *.internal.* 17 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Project Jigsaw Security
  • 50. 50 Copyright © 2015, Oracle and/or its affiliates. All rights reserved sun.misc.Unsafe?! 17 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Project Jigsaw Security
  • 51. 51 Copyright © 2015, Oracle and/or its affiliates. All rights reserved - How many of you have used the Unsafe API? … John Rose JVM Architect, Oracle Corporation Project Jigsaw & sun.misc.Unsafe @ JVM Language Summit 2014
  • 52. 52 Copyright © 2015, Oracle and/or its affiliates. All rights reserved - How many of you have used the Unsafe API? … - A lot of you. Gosh, I'm sorry. John Rose JVM Architect, Oracle Corporation Project Jigsaw & sun.misc.Unsafe @ JVM Language Summit 2014
  • 53. 53 Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 54. 54 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JEP 260: Encapsulate Most Internal APIs §  Replacement exists in JDK 8 –  Encapsulate/remove the method in JDK 9 §  Replacement exists in JDK 9 –  Deprecate in JDK9 §  No replacement exists in JDK 9 –  (For widely used internal API) Leave accessible
  • 55. 55 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Critical Internal APIs §  sun.misc.Cleaner §  sun.misc.{Signal,SignalHandler} §  sun.misc.Unsafe §  sun.reflect.Reflection::getCallerClass §  sun.reflect.ReflectionFactory
  • 56. 56 Copyright © 2015, Oracle and/or its affiliates. All rights reserved sun.misc.Unsafe Use case Example methods Concurrency primitives Unsafe.compareAndSwap* Serialization Unsafe.allocateInstance (ReflectionFactory.newConstructorForSerialization) Efficient memory management, layout, and access Unsafe.allocate/freeMemory Unsafe.get*/put* (and JNI) Interoperate across the JVM boundary Unsafe.get*/put* (and JNI)
  • 57. 57 Copyright © 2015, Oracle and/or its affiliates. All rights reserved sun.misc.Unsafe Use case Replacement Concurrency primitives JEP 193 Variable Handles Serialization Reboot JEP 187 Serialization Improvements Efficient memory management, layout, and access Project Panama, Project Valhalla, Arrays 2.0, Better GC Interoperate across the JVM boundary Project Panama, JEP 191 Foreign Function Interface
  • 58. 58 Copyright © 2015, Oracle and/or its affiliates. All rights reserved sun.misc.Unsafe (JDK 9) Use case Replacement Concurrency primitives JEP 193 Variable Handles Serialization Reboot JEP 187 Serialization Improvements Efficient memory management, layout, and access Project Panama, Project Valhalla, Arrays 2.0, Better GC Interoperate across the JVM boundary Project Panama, JEP 191 Foreign Function Interface
  • 59. 59 Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 60. 60 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JEP 193: Variable Handles 1.  Safe, performant, enhanced atomics –  access to field and array elements 2.  Fence operations for fine-grained control of memory ordering –  replacements for Unsafe::{full,store,load}Fence and more 3.  Reachability fence –  java.lang.ref.Reference::reachabilityFence
  • 61. 61 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Charles Oliver Nutter JRuby Lead Developer “The most fundamental change to Java since its inception.” Java 7: Method Handles
  • 62. 62 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Method Handles
  • 63. 63 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (1) Variable Handles §  like method handles for data –  Abstracts over location §  static fields, instance fields, arrays, off heap –  Supports explicit fences and atomic operations §  Safer than Unsafe, as fast as method handles
  • 64. 64 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Are sun.misc.Unsafe methods really fast? §  Not necessarily… –  public native Object allocateInstance(Class<?> cls) throws …; –  Array index vs raw offset long[] base = new long[…]; int idx = …; long offset = (((long) idx) << SCALE + OFFSET) long value = Unsafe.getLong(base, offset); –  JDK-8078629: “VM should constant fold Unsafe.get*() loads from final fields”
  • 65. 65 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (1) Variable Handles
  • 66. 66 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (2) Memory Fences a = ?, b = ? Thread #1 Thread #2
  • 67. 67 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (2) Memory Fences [a,b] = [0,0], [0,1], [1,0], [1,1] Thread #1 Thread #2
  • 68. 68 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (2) Memory Fences Thread #1 Thread #2 [a,b] = [0,0], [0,1], [1,0], [1,1]
  • 69. 69 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (3) Finalization
  • 70. 70 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (3) Premature Finalization
  • 71. 71 Copyright © 2015, Oracle and/or its affiliates. All rights reserved (3) Premature Finalization
  • 72. 72 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Beyond Java 9
  • 73. 73 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Valhalla Project Panama Specialized Generics Value Types Foreign Function Interface Data Layout Control Arrays 2.0 http://openjdk.java.net  
  • 74. 74 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Valhalla “The hall of valor value”
  • 75. 75 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value-based Class final  class  Point  {          public  final  int  x;          public  final  int  y;   }       @since 8 “Use of identity-sensitive operations on instances of value-based classes may have unpredictable effects and should be avoided.” ValueBased javadoc
  • 76. 76 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value-based Class Point[] points = Arrays hheader x y x y x y x y x y x y
  • 77. 77 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value-based Class Point[] points = Arrays hheader x y x y x y x y x y x y for  (Point  p  :  points)  {      sum  +=  p.x  +  p.y;   }  
  • 78. 78 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value-based Class int[]  xPoints  =   Arrays hheader assert(xPoints.length  ==  yPoints.length);     for  (int  i  =  0;  i  <  xPoints.length;  i++)  {      sum  +=  xPoint[i]  +  yPoint[i];   }   hheader x x x x x x y y y y y yint[]  yPoints  =  
  • 79. 79 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value-based Class int[]  points  =   Arrays hheader assert(points.length  %  2  ==  0);     for  (int  i  =  0;  i  <  points.length;  i+=2)  {      sum  +=  points[i]  +  points[i+1];   }   x y x y x y x y x y x y
  • 80. 80 Copyright © 2015, Oracle and/or its affiliates. All rights reserved “Codes like a class, works like an int!” John Rose, Brian Goetz, Guy Steele “State of the Values”
  • 81. 81 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value Types Arrays value  class  Point  {          public  final  int  x;          public  final  int  y;   }   Point[]  points  =   hheader x y x y x y x y x y x y for  (Point  p  :  points)  {      sum  +=  points.x  +  points.y;   }  
  • 82. 82 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Motivation §  Smaller footprint –  no object header §  Better locality –  no dereference §  Simpler semantics –  no identity, no aliasing §  No object allocation Value Types
  • 83. 83 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value Types value  class  Point  {          public  final  int  x;          public  final  int  y;   }     class  Rectangle  {          public  final  Point  corner1;          public  final  Point  corner2;   }     Concurrent side effects x xy yhheader   Rectangle  r  =     x y x y hheader   Rectangle  r  =    
  • 84. 84 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Value Types value  class  Point  {          public  final  int  x;          public  final  int  y;   }     class  Rectangle  {          public                    Point  corner1;          public  volatile  Point  corner2;   }     Concurrent side effects x xy yhheader   Rectangle  r  =     x y x y hheader   Rectangle  r  =    
  • 85. 85 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Use cases §  Numerics: complex, decimal, rarely-big-num, etc. §  Native types: int128_t, vectors, unsigned, safe native pointers §  Algebraic data: optional (no box), choice-of, unit (no bits) §  Tuples: multiple-value return! (requires specialization machinery also) §  Cursors: unboxed iterators, STL-style bounds §  Flat data: values naturally represent pointer-poor data structures
  • 86. 86 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Selected details Point[] <:? Object[]
  • 87. 87 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Selected details Point[] <: Object[] Point[]  points  =   hheader x y x y x y x y x y x y
  • 88. 88 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization Motivation ArrayList<Integer>
  • 89. 89 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization Motivation ArrayList<int>
  • 90. 90 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Objects §  Object, String, …, MyClass, …, Integer, Long, … –  8 primitive types (+ reference) §  boolean, byte, short, char, int, long, float, double vs Primitives
  • 91. 91 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Objects §  Object, String, …, MyClass, …, Integer, Long, … –  8 primitive types (+ reference) §  boolean, byte, short, char, int, long, float, double –  Value types §  User-defined (!!!) vs Non-objects
  • 92. 92 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization Motivation ArrayList<Point>
  • 93. 93 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box<T>    {      T            val;        public  Box(T            val)  {  this.val  =  val;  }      public  T            get()        {  return  val;  }     }      
  • 94. 94 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box<T>    {      T            val;        public  Box(T            val)  {  this.val  =  val;  }      public  T            get()        {  return  val;  }     }      
  • 95. 95 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box<Object>    {      Object  val;        public  Box(Object  val)  {  this.val  =  val;  }      public  Object  get()        {  return  val;  }     }      
  • 96. 96 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box<      int>    {      int        val;        public  Box(int        val)  {  this.val  =  val;  }      public  int        get()        {  return  val;  }     }      
  • 97. 97 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box<any  T>    {      T            val;        public  Box(T            val)  {  this.val  =  val;  }      public  T            get()        {  return  val;  }     }      
  • 98. 98 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box  extends  Object  {            private  final  Object  t;              public  Object  get()  {                0:  aload_0                1:  getfield  #2  //Field  t:LObject;                4:  areturn          }   }  
  • 99. 99 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box  extends  Object  {            private  final        int  t;              public        int  get()  {                0:  aload_0                1:  getfield  #2  //Field  t:I;                4:  ireturn          }   }  
  • 100. 100 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization class  Box  extends  Object  {            private  final  Object*T  t;              public  Object*T  get()  {                0:  aload_0                1:  getfield  #2  //Field  t:Lobject*T;                4:  areturn*T          }   }  
  • 101. 101 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization Box<Integer> :> Box
  • 102. 102 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization Box<int> :>? Box
  • 103. 103 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Generic Specialization Box<int> :> Box Box<int> :> Box<?> Box<Object> :> Box<?> Box :> Box<?>
  • 104. 104 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Panama “Bridging the gap”
  • 105. 105 Copyright © 2015, Oracle and/or its affiliates. All rights reserved “If non-Java programmers find some library useful and easy to access, it should be similarly accessible to Java programmers.” John Rose, JVM Architect, Oracle Corporation
  • 106. 106 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JNI @since 1.1
  • 107. 107 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JNI A victim of its own success?
  • 108. 108 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JNI Usage scenario
  • 109. 109 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JNI Java: public class GetPid { public static native long getpid(); } C/C++: get_pid.h: JNIEXPORT jlong JNICALL Java_GetPid_getpid (JNIEnv *, jclass); get_pid.c: jlong JNICALL Java_GetPidJNI_getpid(JNIEnv *env, jclass c) { return getpid(); }
  • 110. 110 Copyright © 2015, Oracle and/or its affiliates. All rights reserved JNI: Method Invocation 1.  if (GC_locker::needs_gc()) SharedRuntime::block_for_jni_critical() 2.  transition to thread_in_native 3.  unpack array arguments 4.  call native entry point Runtime checks before and after native call 1.  call native entry point 2.  check for safepoint in progress 3.  check if any thread suspend flags are set –  call into JVM and possibly unlock the JNI critical if a GC was suppressed while in the critical native 4.  transition to thread_in_Java 5.  return
  • 111. 111 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI Easier, safer, faster!
  • 112. 112 Copyright © 2015, Oracle and/or its affiliates. All rights reserved sun.misc.Unsafe § Anti-JNI
  • 113. 113 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Unsafe.getUnsafe(). putInt(new Object(), 0, 0)
  • 114. 114 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Unsafe.getUnsafe(). putInt(null, 0, 0)
  • 115. 115 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI Easier, safer, faster!
  • 116. 116 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI pid_t get_pid();
  • 117. 117 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI public  interface  GetPid  {          long  getpid();   }     Easier
  • 118. 118 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI public  interface  GetPid  {          long  getpid();   }     GetPid  getpid  =  Library.load(GetPid.class,  “c”  /*  lib_name  */  );   Easier
  • 119. 119 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI public  interface  GetPid  {          long  getpid();   }     GetPid  getpid  =  Library.load(GetPid.class,  “c”  /*lib_name*/  );     getpid.getpid();   Easier
  • 120. 120 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI Faster callq 0x1057b2eb0 ; getpid entry
  • 121. 121 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI gettimeofday /*  time.h  */     struct  {          time_t            tv_sec;              suseconds_t  tv_usec;     }  timeval;     int  gettimeofday(struct  timeval*  tv,  struct  timezone*  tz);       struct  {          int  tz_minuteswest;              int  tz_dsttime;     }  timezone;    
  • 122. 122 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI $ jextract time.h interface  Time  {     interface  Timeval  {          long  tv_sec$get();          void  tv_sec$set(long);          long  tv_usec$get();          void  tv_usec$set(long);       }     int  gettimeofday(Timeval,  Timezone);   interface  Timezone  {          long  tz_...$get();          void  tz_...$set(long);          long  tz_...$get();          void  tz_...$set(long);       }    
  • 123. 123 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI Runtime Library  lib    =  Library.create(“c”);     Time  time  =  lib.create(Time.class);     Timeval    tval  =  lib.create(Timeval.class);   Timezone  tzone  =  null;     int  res  =  time.gettimeofday(tval,  tzone);   if  (res  ==  0)  {      long  tv_sec    =  tval.tv_sec$get();      long  tv_usec  =  tval.tv_usec$get();   }  
  • 124. 124 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI Resources Timeval  tval;   try  {      tval  =  lib.create(Timeval.class);        int  res  =  time.gettimeofday(tval,  null);      if  (res  ==  0)  {          long  tv_sec    =  tval.tv_sec$get();          long  tv_usec  =  tval.tv_usec$get();      }   }  finally  {      lib.free(tval);      tval  =  null;   }  
  • 125. 125 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI Resources try  (Timeval  tval  =  lib.create(Timeval.class))  {      int  res  =  time.gettimeofday(tval,  null);      if  (res  ==  0)  {          long  tv_sec    =  tval.tv_sec$get();          long  tv_usec  =  tval.tv_usec$get();      }   }  
  • 126. 126 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI §  no crashes §  no leaks §  no hangs §  no privilege escalation §  no unguarded casts Safer
  • 127. 127 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Better JNI
  • 128. 128 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Valhalla http://openjdk.java.net   Project Panama Specialized Generics Value Types Foreign Function Interface Data Layout Control Arrays 2.0
  • 129. 129 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Project Valhalla http://openjdk.java.net   valhalla-­‐dev@openjdk.java.net   http://hg.openjdk.java.net/valhalla/valhalla   Project Panama panama-­‐dev@openjdk.java.net   http://hg.openjdk.java.net/panama/panama  
  • 130. 130 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Duke 1995 2015
  • 131. 131 Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 132. 132 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 133. 133 Copyright © 2015, Oracle and/or its affiliates. All rights reserved Graphic Section Divider