Invoke dynamic your api to hotspot

556 views

Published on

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Slides from Tony Arcieri presentation at the Boundary TechTalk Oct 11th 2012
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
556
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Invoke dynamic your api to hotspot

  1. 1. InvokeDynamic Your API for HotSpot Tony Arcieri Boundary October 11th, 2012
  2. 2. Who am I?
  3. 3. Who am I?
  4. 4. Our story begins...
  5. 5. Once upon a time...Java was slow
  6. 6. Anamorphic
  7. 7. AnamorphicStrongTalk
  8. 8. Anamorphic StrongTalk• Optional static typing• Modern garbage collector• JIT compiler
  9. 9. Anamorphic Sun MicrosystemsStrongTalk Java
  10. 10. Anamorphic Sun MicrosystemsStrongTalk Java Stolen legacy!
  11. 11. Anamorphic Sun MicrosystemsStrongTalk Java Stolen legacy!
  12. 12. Anamorphic Sun MicrosystemsStrongTalk Java Stolen legacy!
  13. 13. HotSpot
  14. 14. JIT
  15. 15. Just-In-Time CompilerCompile When Code Runs
  16. 16. JIT Spectrum
  17. 17. JIT SpectrumEager Lazy
  18. 18. JIT SpectrumEager Lazy V8CLR HotSpot HiPE
  19. 19. JIT SpectrumEager Lazy V8CLR HotSpot HiPE Static Optimizations Runtime Optimizations
  20. 20. HotSpot• C1: Client Compiler• C2: Server Compiler
  21. 21. HotSpot• C1: Client Compiler• C2: Server Compiler• -XX:+TieredCompilation
  22. 22. Mixed Mode Profiling JIT
  23. 23. Start by interpretingJVM “emulates” bytecodes in userspace BYTECODE
  24. 24. Locate “hot spots”Using runtime profiling information BYTECODE
  25. 25. Generate machine code Compile JVM bytecode to native ISA after 10,000 calls 1 1 1 1 1 0 0 0 0 0 1 1 BYTECODE 1 1 1 0 0 0 0 0
  26. 26. Optimizations• Inlining methods• Unrolling loops• Eliding locks• Eliminating dead code• Escape analysis
  27. 27. Optimizations• Inlining methods• Unrolling loops• Eliding locks• Eliminating dead code• Escape analysis
  28. 28. InliningCombine and optimize across calls Method 1 CALL Method 2
  29. 29. InliningCombine and optimize across calls Method 1 Method 2
  30. 30. Call SitesWhere the magic happens... CALL
  31. 31. Call Sites• Profile data• Monomorphic inline cache• Polymorphic inline cache
  32. 32. “Shapes”
  33. 33. MonomorphicOnly one type seen at call site A CALL
  34. 34. BimorphicTwo types seen at call site A CALL B
  35. 35. PolymorphicMany types seen at call site A CALLB C
  36. 36. MegamorphicToo many types seen at call site F D A CALL E G B C
  37. 37. Inlining• Measure invocations and branches• Make an educated guess• Inline the code in question• Back out if we guessed wrong
  38. 38. Deopt• Check invariants at a “safe point”• Did we guess wrong?• Revert optimization and try again
  39. 39. JVM Limitations
  40. 40. Made for Java • InvokeVirtual • InvokeInterface • InvokeStatic • InvokeSpecial
  41. 41. Non-Java call sites are opaque to HotSpot Can’t be inlined Method 1 CALL Method 2
  42. 42. Teach HotSpot?See through non-Java call sites Method 1 CALL Method 2
  43. 43. Inline just like Java Method 1 Method 2
  44. 44. What if it worked for any language?
  45. 45. Even Ruby?
  46. 46. InvokeDynamic
  47. 47. InDy
  48. 48. InDy• JSR-292: “Supporting Dynamically Typed Languages on the Java Platform”• Initial version shipped in Java 7• Feeds directly into HotSpot in Java 8
  49. 49. New JVMinstruction
  50. 50. java.lang.invoke
  51. 51. InvokeDynamic
  52. 52. InvokeDynamic
  53. 53. InvokeDynamic
  54. 54. “User defineddata endpoint”
  55. 55. JVM Data Endpoints • Invoke operations • Array element access • Property lookup • And more!
  56. 56. InDy Use Cases• Custom invocation• “Constant” values (e.g. globals, language intrinsics)• Scoped values (e.g. instance variables)
  57. 57. InDyHow does it work?
  58. 58. Pieces of InDy• Bootstrap methods• Call sites• Method handles• Switch points
  59. 59. Bootstrap method
  60. 60. Bootstrap method Wire up the call site
  61. 61. Bootstrap method Your own code!
  62. 62. Bootstrap Method• Called the first time each InDy call site is used• Find MethodHandle to dispatch• Return CallSite object
  63. 63. Call SiteReplaces InDy instruction in bytecode
  64. 64. Call SiteHolds onto a chain of MethodHandles
  65. 65. java.lang.invoke.CallSite • ConstantCallSite: unchangeable • VolatileCallSite: seen coherently across cores • MutableCallSite: may appear different across cores
  66. 66. Any of those can be subclassed
  67. 67. java.lang.invoke.MethodHandle • Directly executable reference to a Java method (i.e. fast-as-Java) • Inlineable by HotSpot • MethodHandles all the way down
  68. 68. Methods are first- class objects
  69. 69. Project Lambda Lambdas for the JVMComing in Java 8! (Summer 2013)
  70. 70. Guarded Invocation
  71. 71. Guarded InvocationMethodHandle.guardWithTest(! MethodHandle test,! MethodHandle target,! MethodHandle fallback)
  72. 72. fallback can rebind the call site Handle new types as they’re seen
  73. 73. SwitchPoints
  74. 74. SwitchPointsSwitchPoint.guardWithTest(! MethodHandle target,! MethodHandle fallback)SwitchPoint.invalidateAll(! SwitchPoint[])
  75. 75. java.lang.invoke.SwitchPoint • Publish events across threads (e.g. blow caches when classes change) • Only event is valid -> invalid • Hooks directly into the HotSpot deoptimizer (no additional branches)
  76. 76. Putting it together
  77. 77. Invocation exampleCallSite: where the call is taking place
  78. 78. Invocation exampleCallSite: where the call is taking place SwitchPoint: did the class change?
  79. 79. Invocation exampleCallSite: where the call is taking place SwitchPoint: did the class change? GuardWithTest: is this the type we bound?
  80. 80. Invocation exampleCallSite: where the call is taking place SwitchPoint: did the class change? GuardWithTest: is this the type we bound? Target: invoke the target method
  81. 81. Invocation exampleCallSite: where the call is taking place SwitchPoint: did the class change? GuardWithTest: is this the type we bound? Target: invoke the target method - or - Rebind: lookup new method and rebuild call site
  82. 82. Invocation exampleCallSite: where the call is taking place SwitchPoint: did the class change? GuardWithTest: is this the type we bound? Target: invoke the target method - or - Rebind: lookup new method and rebuild call site - or - Rebind: lookup potentially changed methods
  83. 83. InDy in the real world
  84. 84. Is it good? To the assembly!
  85. 85. Enabling ASM outputjava -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
  86. 86. Contrived Ruby code def foo; 1; end def invoker; foo; end i = 0 while i < 10000   invoker   i+=1 end
  87. 87. 0x00000001060a1be0: mov %eax,-0x14000(%rsp)  0x00000001060a1be7: push %rbp  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  88. 88. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Stack juggling  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  89. 89. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Is “self” a Ruby object?  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  90. 90. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Same metaclass as before?  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  91. 91. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Store Fixnum “1” for return  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  92. 92. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Note: inside the “foo” method  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  93. 93. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Stack juggling  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  94. 94. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Safe point check  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  95. 95. 0x00000001060a1be0: mov  0x00000001060a1be7: push %eax,-0x14000(%rsp) %rbp Done!  0x00000001060a1be8: sub $0x30,%rsp ;*synchronization entry                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@-1 (line 1)  0x00000001060a1bec: mov 0x8(%rcx),%r10d ; implicit exception: dispatches to 0x00000001060a1c55  0x00000001060a1bf0: cmp $0xfb7aedc9,%r10d ; {oop(org/jruby/RubyObject)}  0x00000001060a1bf7: jne 0x00000001060a1c39  0x00000001060a1bf9: mov %rcx,%r10 ;*checkcast                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@2 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1bfc: mov 0x10(%r10),%ebp ;*getfield metaClass                                                ; - org.jruby.RubyBasicObject::getMetaClass@1 (line 520)                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@5 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c00: cmp $0xfed77602,%ebp ; {oop(a org/jruby/MetaClass)}  0x00000001060a1c06: jne 0x00000001060a1c1e ;*if_acmpne                                                ; - org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass@8 (line 633)                                                ; - java.lang.invoke.MethodHandle::invokeExact@3                                                ; - java.lang.invoke.MethodHandle::invokeExact@5                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)  0x00000001060a1c08: movabs $0x7f6bf4bb0,%rax ;*areturn                                                ; - ruby.__dash_e__::method__0$RUBY$foo@6 (line 1)                                                ; - java.lang.invoke.MethodHandle::invokeExact@6                                                ; - java.lang.invoke.MethodHandle::invokeExact@31                                                ; - java.lang.invoke.MethodHandle::invokeExact@29                                                ; - ruby.__dash_e__::method__1$RUBY$invoker@3 (line 1)                                                ; {oop(a org/jruby/RubyFixnum)}  0x00000001060a1c12: add $0x30,%rsp  0x00000001060a1c16: pop %rbp  0x00000001060a1c17: test %eax,-0xec3c1d(%rip) # 0x00000001051de000                                                ; {poll_return}  0x00000001060a1c1d: retq
  96. 96. Benchmarks
  97. 97. That’s it!
  98. 98. Twitter: @bascule Celluloid: celluloid.io Blog:unlimitednovelty.com

×