SlideShare a Scribd company logo
1 of 38
Download to read offline
1   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot
VM
Krystal Mo
Member of Technical Staff
HotSpot JVM Compiler Team



2   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
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.




3   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Agenda


         Background
         Intrinsic Methods in HotSpot VM
         Intrinsic Methods added in TaobaoJDK
         Experiment: Implement Your Own Intrinsic
         Further Experiment



4   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Agenda


         Background
         Intrinsic Methods in HotSpot VM
         Intrinsic Methods added in TaobaoJDK
         Experiment: Implement Your Own Intrinsic
         Further Experiment



5   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
What is a Intrinsic Method?


           In compiler theory, an intrinsic function is a function available for use in
            a given programming language whose implementation is handled
            specially by the compiler. Typically, it substitutes a sequence of
            automatically generated instructions for the original function call,
            similar to an inline function. Unlike an inline function though, the
            compiler has an intimate knowledge of the intrinsic function and can
            therefore better integrate it and optimize it for the situation. This is also
            called builtin function in many languages.
           (via Wikipedia)


6   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Functions in Native Compilers
        Examples


           Microsoft Visual C/C++ Compiler
                    – __debugbreak()
                                  inserts an “int 3” instruction for breaking into debugger
           GCC
                    – __builtin_ia32_pause()
                                  inserts a “pause” instruction and necessary compiler barriers to prevent
                                      the instruction from floating around




7   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in JVMs


           Specific to JVM implementations
                    – can’t assume a method is intrinsic across JVMs in general
                    – mostly implemented in JVM compilers




8   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in JVMs


           Compatible
                    – appear to be no different from normal Java methods on Java source level;
                            all special handling is done within JVM
                    – can fallback to normal (non-intrinsic) version on JVMs that don’t intrinsify
                            them




9   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in JVMs


            Reliable
                     – are good “anchor” points for JVM optimizations for common code patterns
                     – e.g. java.lang.System.arraycopy()
                                   easier to recognize than matching an explicit array-copying loop




10   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in JVMs


            Extend Java semantics
                     – the same way native methods do, but usually more performant
                                   reliably inlined
                                   no JNI overhead
                     – e.g. sun.misc.Unsafe.compareAndSwapInt() on x86/AMD64
                                   no Java bytecode can express its semantics
                                   without intrinsics: implemented in native via JNI
                                       (Unsafe_CompareAndSwapInt())
                                   with intrinsics: a direct cmpxchg instruction, inlined to caller

11   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Agenda


          Background
          Intrinsic Methods in HotSpot VM
          Intrinsic Methods added in TaobaoJDK
          Experiment: Implement Your Own Intrinsic
          Further Experiment



12   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         What to intrinsify?


            Commonly used public APIs in JDK core library
                     – to speed up common code patterns
                     – so use JDK core library methods whenever you can
                                   they may be better optimized!
            Special internal methods
                     – to implement special semantics
                     – the “secret sauce” to allow more parts of the Java core library be
                             implemented in Java
                     – may be exposed indirectly via ease-of-use APIs, e.g. j.u.c.atomic.*

13   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         How to intrinsify?


            Declare intrinsic methods in vmSymbols
            Implement intrinsic methods in
                     – Interpreter
                                   currently only implements intrinsics for
                                               – some math functions
                                               – a few MethodHandle internals for bootstrapping
                     – Client Compiler (C1)
                     – Server Compiler (C2)


14   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Example: java.lang.System.currentTimeMillis() on Linux


            Interpreter
                     – not intrinsified
                     – java.lang.System.currentTimeMillis() (Java / core library)
                                   (-> through normal JNI call path)
                                   JVM_CurrentTimeMillis() (C++ / HotSpot VM)
                                   os::javaTimeMillis() (C++ / HotSpot VM)
                                   gettimeofday() (C / Linux)




15   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Example: java.lang.System.currentTimeMillis() on Linux


            C1
                     – intrinsified
                     – inlined to caller as a direct call to os::javaTimeMillis()
            C2
                     – same as in C1


            (Intrinsification eliminates JNI overhead in compiled code)



16   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Example: sun.misc.Unsafe.compareAndSwapInt() on x86/AMD64


            Interpreter
                     – not intrinsified
                     – sun.misc.Unsafe.compareAndSwapInt() (Java / core library)
                                   (-> through normal JNI call path)
                                   Unsafe_CompareAndSwapInt() (C++ / HotSpot VM)
                                   Atomic::cmpxchg() (C++ inline asm / HotSpot VM)
                                   lock cmpxchgl




17   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Example: sun.misc.Unsafe.compareAndSwapInt() on x86/AMD64


            C1
                     – intrinsified
                     – inlined into caller as a plain “lock cmpxchgl” instruction
            C2
                     – same as in C1


            (Intrinsification easily leverages special hardware instructions)



18   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Example: java.lang.Math.log() on x86/AMD64


            Interpreter
                     – intrinsified
                     – java.lang.Math.log() (Java / core library)
                                   (-> through special interpreter method entry)
                                   “flog” x87 instruction




19   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Example: java.lang.Math.log() on x86/AMD64


            C1 and C2
                     – intrinsified
                     – inlined into caller as “flog” x87 instruction


            (Intrinsification ignores Java-level implementation)
                     – java.lang.Math.log() is implemented in pure Java in JDK core library
                     – HotSpot VM ignores that implementation on platforms where hardware
                             floating point instructions are available


20   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Other intrinsic methods of interest (on AMD64)


            java.lang.Thread.currentThread()
                     – mov reg, [r15 + java_thread_offset]
            java.lang.String.indexOf()/compareTo()/equals()
                     – use STTNI instructions in SSE4.2
            com.sun.crypto.provider.AESCrypt.encryptBlock()/decryptBlock()
                     – use AES instructions




21   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Find out if you’re using intrinsics in compiled code


            -XX:+PrintCompilation -XX:+PrintInlining
                     – (prepend -XX:+UnlockDiagnosticVMOptions when running on product VM)




22   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Find out if you’re using intrinsics in compiled code: example

                                                     public class Foo {
                                                       private static Object bar() {
                                                         return Thread.currentThread();
                                                       }

                                                            public static void main(String[] args) {
                                                              while (true) { bar(); }
                                                            }
                                                     }




23   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Find out if you’re using intrinsics in compiled code: example



$ java -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand='exclude,Foo,main' 
  -XX:+PrintCompilation -XX:+PrintInlining Foo
CompilerOracle: exclude Foo.main
     50    1     n       java.lang.Thread::currentThread (0 bytes)   (static)
### Excluding compile: static Foo::main
     50    2             Foo::bar (4 bytes)
                            @ 0   java.lang.Thread::currentThread (0 bytes)   (intrinsic)




24   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Find out what intrinsic compiled into


            -XX:+PrintAssembly
                     – (prepend -XX:+UnlockDiagnosticVMOptions when running on product VM)
                     – requires hsdis disassembler plugin




25   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Intrinsic Methods in HotSpot VM
         Find out what intrinsic compiled into: example
               $ java -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand='exclude,Foo,main' 
                 -XX:+PrintAssembly Foo
               ...
                 # {method} 'bar' '()Ljava/lang/Object;' in 'Foo'
                 #           [sp+0x20] (sp of caller)
                 0x00007f91cd061bc0: sub    $0x18,%rsp
                 0x00007f91cd061bc7: mov    %rbp,0x10(%rsp)    ;*synchronization entry
                                                               ; - Foo::bar@-1 (line 3)
                 0x00007f91cd061bcc: mov    0x1b0(%r15),%rax   ;*invokestatic currentThread
                                                               ; - Foo::bar@0 (line 3)
                 0x00007f91cd061bd3: add    $0x10,%rsp
                 0x00007f91cd061bd7: pop    %rbp
                 0x00007f91cd061bd8: test   %eax,0xb7ed422(%rip)        # 0x00007f91d884f000
                                                               ;   {poll_return}
                 0x00007f91cd061bde: retq
                 0x00007f91cd061bdf: hlt




26   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Agenda


          Background
          Intrinsic Methods in HotSpot VM
          Intrinsic Methods added in TaobaoJDK
          Experiment: Implement Your Own Intrinsic
          Further Experiment



27   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Instrinsic Methods Added in TaobaoJDK
         Why make your own custom intrinsic method?


            Make better use of new instructions available on new hardware
                     – In Taobao’s case, new instructions on Westmere/Sandy Bridge
            Eliminate JNI overhead when having to invoke hot native methods
                     – Instead of calling a native method through normal JNI, implement it as an
                             intrinsic method




                                                                                         (this section is material from Taobao;
                                                                                         TaobaoJDK is a custom version of OpenJDK from Taobao)

28   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Instrinsic Methods Added in TaobaoJDK
         A few examples


            TCrc32.xxx
                     – crc32c instruction in SSE4.2
            Unsafe.byteArrayCompare()
                     – byte array comparison via packed compare instructions
            Unsafe.pause()
                     – insert “pause” instruction before backedge of spinlock-like loop
           …



29   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Instrinsic Methods Added in TaobaoJDK
         crc32c


            Used in Hadoop
                     – throughput in TestDFSIO benchmark increased by 40%-180%




30   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
JVM Instrinsics Added in TaobaoJDK
         crc32c




31   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Agenda


          Background
          Intrinsic Methods in HotSpot VM
          Intrinsic Methods added in TaobaoJDK
          Experiment: Implement Your Own Intrinsic
          Further Experiment



32   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Implementing an Intrinsic in C1
         Example


            Implement java.lang.Class.isInstance() intrinsic in C1
                     – https://gist.github.com/rednaxelafx/2830194


            Note: starting point at GraphBuilder::try_inline_intrinsics()




33   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Implementing an Intrinsic in C2
         Example


            Implement a simple intrinsic demo in C2
                     – https://gist.github.com/rednaxelafx/1986224
            Implement a prototype for java.lang.Math.addExact() intrinsic in C2
                     – https://gist.github.com/rednaxelafx/db03ab15ef8b76246b84


            Note: starting point at LibraryCallKit::try_to_inline()




34   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Agenda


          Background
          Intrinsic Methods in HotSpot VM
          Intrinsic Methods added in TaobaoJDK
          Experiment: Implement Your Own Intrinsic
          Further Experiment



35   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Further Experiment
         Introducing Graal


            Experiment with implementing your own language-/library-specific
                intrinsic in HotSpot VM, but don’t want to write C++ or build HotSpot
                VM?
                     – Graal (from Oracle Labs) is the answer to your call!
                                   bytecode-to-native compiler implemented in Java, can be plugged into
                                       HotSpot VM
                                   OpenJDK project page
                                   Graal introduction (from JVM Language Summit 2011)



36   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
Q&A


37   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013
38   Copyright © 2013, Oracle and/or its affiliates. All rights reserved.   02/22/2013

More Related Content

What's hot

JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011Kris Mok
 
Understanding and Improving Code Generation
Understanding and Improving Code GenerationUnderstanding and Improving Code Generation
Understanding and Improving Code GenerationDatabricks
 
OpenJDK トラブルシューティング #javacasual
OpenJDK トラブルシューティング #javacasualOpenJDK トラブルシューティング #javacasual
OpenJDK トラブルシューティング #javacasualYuji Kubota
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
 
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...Databricks
 
JPAのキャッシュを使ったアプリケーション高速化手法
JPAのキャッシュを使ったアプリケーション高速化手法JPAのキャッシュを使ったアプリケーション高速化手法
JPAのキャッシュを使ったアプリケーション高速化手法Chihiro Ito
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
 
Introducing DataFrames in Spark for Large Scale Data Science
Introducing DataFrames in Spark for Large Scale Data ScienceIntroducing DataFrames in Spark for Large Scale Data Science
Introducing DataFrames in Spark for Large Scale Data ScienceDatabricks
 
はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)Masatoshi Tada
 
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~Shinji Takao
 
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccJEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccYujiSoftware
 
なかったらINSERTしたいし、あるならロック取りたいやん?
なかったらINSERTしたいし、あるならロック取りたいやん?なかったらINSERTしたいし、あるならロック取りたいやん?
なかったらINSERTしたいし、あるならロック取りたいやん?ichirin2501
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Databricks
 
Concurrent Mark-Sweep Garbage Collection #jjug_ccc
Concurrent Mark-Sweep Garbage Collection #jjug_cccConcurrent Mark-Sweep Garbage Collection #jjug_ccc
Concurrent Mark-Sweep Garbage Collection #jjug_cccYuji Kubota
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
 
JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)
JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)
JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)Yoshiro Tokumasu
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBrendan Gregg
 
2장. Runtime Data Areas
2장. Runtime Data Areas2장. Runtime Data Areas
2장. Runtime Data Areas김 한도
 
Autoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeAutoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeFlink Forward
 

What's hot (20)

JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 
Understanding and Improving Code Generation
Understanding and Improving Code GenerationUnderstanding and Improving Code Generation
Understanding and Improving Code Generation
 
OpenJDK トラブルシューティング #javacasual
OpenJDK トラブルシューティング #javacasualOpenJDK トラブルシューティング #javacasual
OpenJDK トラブルシューティング #javacasual
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...
 
JPAのキャッシュを使ったアプリケーション高速化手法
JPAのキャッシュを使ったアプリケーション高速化手法JPAのキャッシュを使ったアプリケーション高速化手法
JPAのキャッシュを使ったアプリケーション高速化手法
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
 
Introducing DataFrames in Spark for Large Scale Data Science
Introducing DataFrames in Spark for Large Scale Data ScienceIntroducing DataFrames in Spark for Large Scale Data Science
Introducing DataFrames in Spark for Large Scale Data Science
 
はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)
 
Quarkus入門
Quarkus入門Quarkus入門
Quarkus入門
 
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
 
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccJEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
 
なかったらINSERTしたいし、あるならロック取りたいやん?
なかったらINSERTしたいし、あるならロック取りたいやん?なかったらINSERTしたいし、あるならロック取りたいやん?
なかったらINSERTしたいし、あるならロック取りたいやん?
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
 
Concurrent Mark-Sweep Garbage Collection #jjug_ccc
Concurrent Mark-Sweep Garbage Collection #jjug_cccConcurrent Mark-Sweep Garbage Collection #jjug_ccc
Concurrent Mark-Sweep Garbage Collection #jjug_ccc
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)
JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)
JDK 16 で導入された JEP 396 にご注意!! (JJUG CCC 2021 Spring)
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
2장. Runtime Data Areas
2장. Runtime Data Areas2장. Runtime Data Areas
2장. Runtime Data Areas
 
Autoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeAutoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive Mode
 

Viewers also liked

Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)Kris Mok
 
Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript EngineKris Mok
 
JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesKris Mok
 
Java ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersJava ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersLucas Jellema
 
InvokeDynamic - You Ain't Seen Nothin Yet
InvokeDynamic - You Ain't Seen Nothin YetInvokeDynamic - You Ain't Seen Nothin Yet
InvokeDynamic - You Ain't Seen Nothin YetCharles Nutter
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkCodeOps Technologies LLP
 
JVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir IvanovJVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir IvanovZeroTurnaround
 
HBase: How to get MTTR below 1 minute
HBase: How to get MTTR below 1 minuteHBase: How to get MTTR below 1 minute
HBase: How to get MTTR below 1 minuteHortonworks
 
MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化Jinrong Ye
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 
App server4rp gd - German
App server4rp gd - GermanApp server4rp gd - German
App server4rp gd - GermanCOMMON Europe
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020CEW Georgetown
 
Digitized Student Development, Social Media, and Identity
Digitized Student Development, Social Media, and IdentityDigitized Student Development, Social Media, and Identity
Digitized Student Development, Social Media, and IdentityPaul Brown
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great InfographicsSlideShare
 

Viewers also liked (20)

Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)
 
Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript Engine
 
JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple Languages
 
Concurrecy techdrop
Concurrecy techdropConcurrecy techdrop
Concurrecy techdrop
 
Java ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersJava ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL Developers
 
Marketing_SBI_Booklet_NEW
Marketing_SBI_Booklet_NEWMarketing_SBI_Booklet_NEW
Marketing_SBI_Booklet_NEW
 
InvokeDynamic - You Ain't Seen Nothin Yet
InvokeDynamic - You Ain't Seen Nothin YetInvokeDynamic - You Ain't Seen Nothin Yet
InvokeDynamic - You Ain't Seen Nothin Yet
 
Scalaで実装するGC
Scalaで実装するGCScalaで実装するGC
Scalaで実装するGC
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Java Concurrency by Example
Java Concurrency by ExampleJava Concurrency by Example
Java Concurrency by Example
 
JVM-Reading-ParalleGC
JVM-Reading-ParalleGCJVM-Reading-ParalleGC
JVM-Reading-ParalleGC
 
JVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir IvanovJVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir Ivanov
 
HBase: How to get MTTR below 1 minute
HBase: How to get MTTR below 1 minuteHBase: How to get MTTR below 1 minute
HBase: How to get MTTR below 1 minute
 
MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
App server4rp gd - German
App server4rp gd - GermanApp server4rp gd - German
App server4rp gd - German
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020
 
Digitized Student Development, Social Media, and Identity
Digitized Student Development, Social Media, and IdentityDigitized Student Development, Social Media, and Identity
Digitized Student Development, Social Media, and Identity
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great Infographics
 

Similar to Intrinsic Methods in HotSpot VM

A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.J On The Beach
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterTim Ellison
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8jclingan
 
Ijaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinderIjaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinderijaprr_editor
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the BoxMarcus Hirt
 
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...timfanelli
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllThomas Wuerthinger
 
Bci for Beginners
Bci for BeginnersBci for Beginners
Bci for BeginnersIainLewis
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceTim Ellison
 
TechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance InteroperabilityTechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance InteroperabilityTrivadis
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Shaun Smith
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationFredrik Öhrström
 
Synopsis on online shopping by sudeep singh
Synopsis on online shopping by  sudeep singhSynopsis on online shopping by  sudeep singh
Synopsis on online shopping by sudeep singhSudeep Singh
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java PlatformSivakumar Thyagarajan
 
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...AMD Developer Central
 

Similar to Intrinsic Methods in HotSpot VM (20)

A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8
 
Java 8
Java 8Java 8
Java 8
 
Ijaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinderIjaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinder
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the Box
 
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
 
Hotspot & AOT
Hotspot & AOTHotspot & AOT
Hotspot & AOT
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
 
Bci for Beginners
Bci for BeginnersBci for Beginners
Bci for Beginners
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 
TechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance InteroperabilityTechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance Interoperability
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integration
 
Synopsis on online shopping by sudeep singh
Synopsis on online shopping by  sudeep singhSynopsis on online shopping by  sudeep singh
Synopsis on online shopping by sudeep singh
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
 
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
 

Recently uploaded

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Juan Carlos Gonzalez
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 

Recently uploaded (20)

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 

Intrinsic Methods in HotSpot VM

  • 1. 1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 2. Intrinsic Methods in HotSpot VM Krystal Mo Member of Technical Staff HotSpot JVM Compiler Team 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 3. 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. 3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 4. Agenda  Background  Intrinsic Methods in HotSpot VM  Intrinsic Methods added in TaobaoJDK  Experiment: Implement Your Own Intrinsic  Further Experiment 4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 5. Agenda  Background  Intrinsic Methods in HotSpot VM  Intrinsic Methods added in TaobaoJDK  Experiment: Implement Your Own Intrinsic  Further Experiment 5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 6. What is a Intrinsic Method?  In compiler theory, an intrinsic function is a function available for use in a given programming language whose implementation is handled specially by the compiler. Typically, it substitutes a sequence of automatically generated instructions for the original function call, similar to an inline function. Unlike an inline function though, the compiler has an intimate knowledge of the intrinsic function and can therefore better integrate it and optimize it for the situation. This is also called builtin function in many languages.  (via Wikipedia) 6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 7. Intrinsic Functions in Native Compilers Examples  Microsoft Visual C/C++ Compiler – __debugbreak()  inserts an “int 3” instruction for breaking into debugger  GCC – __builtin_ia32_pause()  inserts a “pause” instruction and necessary compiler barriers to prevent the instruction from floating around 7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 8. Intrinsic Methods in JVMs  Specific to JVM implementations – can’t assume a method is intrinsic across JVMs in general – mostly implemented in JVM compilers 8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 9. Intrinsic Methods in JVMs  Compatible – appear to be no different from normal Java methods on Java source level; all special handling is done within JVM – can fallback to normal (non-intrinsic) version on JVMs that don’t intrinsify them 9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 10. Intrinsic Methods in JVMs  Reliable – are good “anchor” points for JVM optimizations for common code patterns – e.g. java.lang.System.arraycopy()  easier to recognize than matching an explicit array-copying loop 10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 11. Intrinsic Methods in JVMs  Extend Java semantics – the same way native methods do, but usually more performant  reliably inlined  no JNI overhead – e.g. sun.misc.Unsafe.compareAndSwapInt() on x86/AMD64  no Java bytecode can express its semantics  without intrinsics: implemented in native via JNI (Unsafe_CompareAndSwapInt())  with intrinsics: a direct cmpxchg instruction, inlined to caller 11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 12. Agenda  Background  Intrinsic Methods in HotSpot VM  Intrinsic Methods added in TaobaoJDK  Experiment: Implement Your Own Intrinsic  Further Experiment 12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 13. Intrinsic Methods in HotSpot VM What to intrinsify?  Commonly used public APIs in JDK core library – to speed up common code patterns – so use JDK core library methods whenever you can  they may be better optimized!  Special internal methods – to implement special semantics – the “secret sauce” to allow more parts of the Java core library be implemented in Java – may be exposed indirectly via ease-of-use APIs, e.g. j.u.c.atomic.* 13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 14. Intrinsic Methods in HotSpot VM How to intrinsify?  Declare intrinsic methods in vmSymbols  Implement intrinsic methods in – Interpreter  currently only implements intrinsics for – some math functions – a few MethodHandle internals for bootstrapping – Client Compiler (C1) – Server Compiler (C2) 14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 15. Intrinsic Methods in HotSpot VM Example: java.lang.System.currentTimeMillis() on Linux  Interpreter – not intrinsified – java.lang.System.currentTimeMillis() (Java / core library)  (-> through normal JNI call path)  JVM_CurrentTimeMillis() (C++ / HotSpot VM)  os::javaTimeMillis() (C++ / HotSpot VM)  gettimeofday() (C / Linux) 15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 16. Intrinsic Methods in HotSpot VM Example: java.lang.System.currentTimeMillis() on Linux  C1 – intrinsified – inlined to caller as a direct call to os::javaTimeMillis()  C2 – same as in C1  (Intrinsification eliminates JNI overhead in compiled code) 16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 17. Intrinsic Methods in HotSpot VM Example: sun.misc.Unsafe.compareAndSwapInt() on x86/AMD64  Interpreter – not intrinsified – sun.misc.Unsafe.compareAndSwapInt() (Java / core library)  (-> through normal JNI call path)  Unsafe_CompareAndSwapInt() (C++ / HotSpot VM)  Atomic::cmpxchg() (C++ inline asm / HotSpot VM)  lock cmpxchgl 17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 18. Intrinsic Methods in HotSpot VM Example: sun.misc.Unsafe.compareAndSwapInt() on x86/AMD64  C1 – intrinsified – inlined into caller as a plain “lock cmpxchgl” instruction  C2 – same as in C1  (Intrinsification easily leverages special hardware instructions) 18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 19. Intrinsic Methods in HotSpot VM Example: java.lang.Math.log() on x86/AMD64  Interpreter – intrinsified – java.lang.Math.log() (Java / core library)  (-> through special interpreter method entry)  “flog” x87 instruction 19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 20. Intrinsic Methods in HotSpot VM Example: java.lang.Math.log() on x86/AMD64  C1 and C2 – intrinsified – inlined into caller as “flog” x87 instruction  (Intrinsification ignores Java-level implementation) – java.lang.Math.log() is implemented in pure Java in JDK core library – HotSpot VM ignores that implementation on platforms where hardware floating point instructions are available 20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 21. Intrinsic Methods in HotSpot VM Other intrinsic methods of interest (on AMD64)  java.lang.Thread.currentThread() – mov reg, [r15 + java_thread_offset]  java.lang.String.indexOf()/compareTo()/equals() – use STTNI instructions in SSE4.2  com.sun.crypto.provider.AESCrypt.encryptBlock()/decryptBlock() – use AES instructions 21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 22. Intrinsic Methods in HotSpot VM Find out if you’re using intrinsics in compiled code  -XX:+PrintCompilation -XX:+PrintInlining – (prepend -XX:+UnlockDiagnosticVMOptions when running on product VM) 22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 23. Intrinsic Methods in HotSpot VM Find out if you’re using intrinsics in compiled code: example public class Foo { private static Object bar() { return Thread.currentThread(); } public static void main(String[] args) { while (true) { bar(); } } } 23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 24. Intrinsic Methods in HotSpot VM Find out if you’re using intrinsics in compiled code: example $ java -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand='exclude,Foo,main' -XX:+PrintCompilation -XX:+PrintInlining Foo CompilerOracle: exclude Foo.main 50 1 n java.lang.Thread::currentThread (0 bytes) (static) ### Excluding compile: static Foo::main 50 2 Foo::bar (4 bytes) @ 0 java.lang.Thread::currentThread (0 bytes) (intrinsic) 24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 25. Intrinsic Methods in HotSpot VM Find out what intrinsic compiled into  -XX:+PrintAssembly – (prepend -XX:+UnlockDiagnosticVMOptions when running on product VM) – requires hsdis disassembler plugin 25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 26. Intrinsic Methods in HotSpot VM Find out what intrinsic compiled into: example $ java -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand='exclude,Foo,main' -XX:+PrintAssembly Foo ... # {method} 'bar' '()Ljava/lang/Object;' in 'Foo' # [sp+0x20] (sp of caller) 0x00007f91cd061bc0: sub $0x18,%rsp 0x00007f91cd061bc7: mov %rbp,0x10(%rsp) ;*synchronization entry ; - Foo::bar@-1 (line 3) 0x00007f91cd061bcc: mov 0x1b0(%r15),%rax ;*invokestatic currentThread ; - Foo::bar@0 (line 3) 0x00007f91cd061bd3: add $0x10,%rsp 0x00007f91cd061bd7: pop %rbp 0x00007f91cd061bd8: test %eax,0xb7ed422(%rip) # 0x00007f91d884f000 ; {poll_return} 0x00007f91cd061bde: retq 0x00007f91cd061bdf: hlt 26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 27. Agenda  Background  Intrinsic Methods in HotSpot VM  Intrinsic Methods added in TaobaoJDK  Experiment: Implement Your Own Intrinsic  Further Experiment 27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 28. Instrinsic Methods Added in TaobaoJDK Why make your own custom intrinsic method?  Make better use of new instructions available on new hardware – In Taobao’s case, new instructions on Westmere/Sandy Bridge  Eliminate JNI overhead when having to invoke hot native methods – Instead of calling a native method through normal JNI, implement it as an intrinsic method (this section is material from Taobao; TaobaoJDK is a custom version of OpenJDK from Taobao) 28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 29. Instrinsic Methods Added in TaobaoJDK A few examples  TCrc32.xxx – crc32c instruction in SSE4.2  Unsafe.byteArrayCompare() – byte array comparison via packed compare instructions  Unsafe.pause() – insert “pause” instruction before backedge of spinlock-like loop … 29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 30. Instrinsic Methods Added in TaobaoJDK crc32c  Used in Hadoop – throughput in TestDFSIO benchmark increased by 40%-180% 30 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 31. JVM Instrinsics Added in TaobaoJDK crc32c 31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 32. Agenda  Background  Intrinsic Methods in HotSpot VM  Intrinsic Methods added in TaobaoJDK  Experiment: Implement Your Own Intrinsic  Further Experiment 32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 33. Implementing an Intrinsic in C1 Example  Implement java.lang.Class.isInstance() intrinsic in C1 – https://gist.github.com/rednaxelafx/2830194  Note: starting point at GraphBuilder::try_inline_intrinsics() 33 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 34. Implementing an Intrinsic in C2 Example  Implement a simple intrinsic demo in C2 – https://gist.github.com/rednaxelafx/1986224  Implement a prototype for java.lang.Math.addExact() intrinsic in C2 – https://gist.github.com/rednaxelafx/db03ab15ef8b76246b84  Note: starting point at LibraryCallKit::try_to_inline() 34 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 35. Agenda  Background  Intrinsic Methods in HotSpot VM  Intrinsic Methods added in TaobaoJDK  Experiment: Implement Your Own Intrinsic  Further Experiment 35 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 36. Further Experiment Introducing Graal  Experiment with implementing your own language-/library-specific intrinsic in HotSpot VM, but don’t want to write C++ or build HotSpot VM? – Graal (from Oracle Labs) is the answer to your call!  bytecode-to-native compiler implemented in Java, can be plugged into HotSpot VM  OpenJDK project page  Graal introduction (from JVM Language Summit 2011) 36 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 37. Q&A 37 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013
  • 38. 38 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013