<Insert Picture Here> Maxine: A JVM Written in Java

Size: px
Start display at page:

Download "<Insert Picture Here> Maxine: A JVM Written in Java"

Transcription

1

2 <Insert Picture Here> Maxine: A JVM Written in Java Michael Haupt Oracle Labs Potsdam, Germany

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

4 Speaker's Background Technische Universität Darmstadt, Doctoral research, Steamloom (virtual machine support for aspect-oriented programming) 4

5 Speaker's Background Hasso-Plattner-Institut Potsdam, Postdoc, virtual machine architecture disentangling, SOM family, NXTalk Technische Universität Darmstadt, Doctoral research, Steamloom (virtual machine support for aspect-oriented programming) 4

6 Speaker's Background Hasso-Plattner-Institut Potsdam, Postdoc, virtual machine architecture disentangling, SOM family, NXTalk Technische Universität Darmstadt, Doctoral research, Steamloom (virtual machine support for aspect-oriented programming) Oracle Labs, Potsdam, since 2011 Maxine team, virtual machine architecture, multi-language virtual machines, code cache management, JSR292 4

7 Who Needs a JVM? JVM 5

8 Who Needs a JVM? application developers, end users Java Applications JVM 5

9 Who Needs a JVM? application developers, end users researchers Java Applications Dynamic Compiler Garbage Collector Object Layout Runtime Optimisations Concurrent Language Specifics Thread Migration Target Architecture Parallel Tagging Concurrency Abstractions JVM 5

10 Who Needs a JVM? application developers, end users researchers programming language implementers Java, Ruby, Python, Java Smalltalk,... Applications Dynamic Compiler Garbage Collector Object Layout Runtime Optimisations Concurrent Language Specifics Thread Migration Target Architecture Parallel Tagging Concurrency Abstractions JVM 5

11 Who Needs a JVM? application developers, end users researchers programming language implementers Java, Ruby, Python, Java Smalltalk,... Applications Dynamic Compiler Garbage Collector Object Layout Runtime!!!! Optimisations Concurrent Language Specifics Thread Migration Target Architecture Parallel Tagging Concurrency Abstractions JVM 5

12 Who Needs a JVM? application developers, end users researchers programming language implementers Java, Ruby, Python, Java Smalltalk,... Applications Dynamic Compiler Garbage Collector Object Layout Runtime!!!! Optimisations Concurrent Language Specifics Thread Migration Target Architecture Parallel Tagging Concurrency Abstractions J?VM JVM 5

13 Maxine almost 100 % Java use unmodified JDK meta-circularity studies Home page: Source (GPLv2): Mailing list via: 6

14 Maxine almost 100 % Java use unmodified JDK meta-circularity studies supported on 64-bit x86 Solaris, Mac OS X, Linux Virtual Edition: Xen Home page: Source (GPLv2): Mailing list via: 6

15 Maxine almost 100 % Java use unmodified JDK meta-circularity studies supported on 64-bit x86 Solaris, Mac OS X, Linux Virtual Edition: Xen full IDE support (Eclipse, NetBeans) tooling: Inspector Home page: Source (GPLv2): Mailing list via: 6

16 Maxine almost 100 % Java use unmodified JDK meta-circularity studies supported on 64-bit x86 Solaris, Mac OS X, Linux Virtual Edition: Xen full IDE support (Eclipse, NetBeans) tooling: Inspector dynamic compilation only semi-space GC modular architecture Home page: Source (GPLv2): Mailing list via: 6

17 VM Research Group at Oracle Labs Doug Simon Thomas Würthinger Michael Haupt Christian Wimmer Laurent Daynès Mario Wolczko Director Mick Jordan Michael Van De Vanter Home page: Source (GPLv2): Mailing list via: 7

18 Why Java? language reflection annotations JDK rich and powerful API inclusion in VM VM architecture uniform representation same compiler chain ecosystem IDE support tooling 8

19 Bootstrapping Maxine Maxine Source Code 9

20 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Just-in-Time Compilers Memory Manager... others... 9

21 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Boot Image Generator Host VM (HotSpot) 9

22 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Just-in-Time Compilers Memory Manager... others... Boot Image Generator Host VM (HotSpot) 9

23 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Just-in-Time Compilers Memory Manager... others... Boot Image Generator Host VM (HotSpot) 9

24 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Just-in-Time Compilers Memory Manager... others... Boot Image Generator Host VM (HotSpot) 9

25 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Just-in-Time Compilers Memory Manager Maxine Boot Image... others... Boot Image Generator Host VM (HotSpot) 9

26 Bootstrapping Maxine Maxine Source Code javac Maxine Bytecodes Just-in-Time Compilers Memory Manager Maxine Boot Image Boot Loader... others... Boot Image Generator Host VM (HotSpot) 9

27 Maxine Scheme Abstractions Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM 10

28 Maxine Scheme Abstractions interface LayoutScheme Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM 10

29 Maxine Scheme Abstractions interface LayoutScheme interface ReferenceScheme Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM 10

30 Maxine Scheme Abstractions interface HeapScheme interface LayoutScheme interface ReferenceScheme Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM 10

31 Maxine Scheme Abstractions interface HeapScheme interface LayoutScheme interface ReferenceScheme Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM interface MonitorScheme 10

32 Maxine Scheme Abstractions interface HeapScheme interface LayoutScheme interface ReferenceScheme Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM interface MonitorScheme interface RunScheme 10

33 Maxine Scheme Abstractions interface HeapScheme interface LayoutScheme interface ReferenceScheme Dynamic Compilers Garbage Collector Object Layout Runtime Maxine VM interface CompilationBroker interface MonitorScheme interface RunScheme 10

34 Example: ReferenceScheme What you use in Maxine to access a field: int x = Reference.fromJava(obj).readInt(24); field offset (in bytes) is computed by LayoutScheme; we assume a constant offset in this example 11

35 Example: ReferenceScheme What you use in Maxine to access a field: int x = Reference.fromJava(obj).readInt(24); field offset (in bytes) is computed by LayoutScheme; we assume a constant offset in this example Actual call chain after forced inlining Reference ref = MaxineVM.vm.config.referenceScheme.toReference(obj); Pointer ptr = MaxineVM.vm.config.referenceScheme.toOrigin(ref); int x = ptr.readint(24); 11

36 Example: ReferenceScheme What you use in Maxine to access a field: int x = Reference.fromJava(obj).readInt(24); field offset (in bytes) is computed by LayoutScheme; we assume a constant offset in this example Actual call chain after forced inlining Reference ref = MaxineVM.vm.config.referenceScheme.toReference(obj); Pointer ptr = MaxineVM.vm.config.referenceScheme.toOrigin(ref); int x = ptr.readint(24); All fields are so the compiler knows the concrete scheme implementation used: class DirectReferenceScheme implements ReferenceScheme { native Reference toreference(object native Word toorigin(reference ref); 11

37 Example: ReferenceScheme What you use in Maxine to access a field: int x = Reference.fromJava(obj).readInt(24); field offset (in bytes) is computed by LayoutScheme; we assume a constant offset in this example Actual call chain after forced inlining Reference ref = MaxineVM.vm.config.referenceScheme.toReference(obj); Pointer ptr = MaxineVM.vm.config.referenceScheme.toOrigin(ref); int x = ptr.readint(24); All fields are so the compiler knows the concrete scheme implementation used: class DirectReferenceScheme implements ReferenceScheme { native Reference toreference(object native Word toorigin(reference ref); Final machine code: movl [rax + 24], rbx 11

38 Baseline Compiler: T1X job: assemble pre-generated bytecode templates written in Java compiled by optimising compiler at VM build time very small amount of glue assembly 12

39 Baseline Compiler: T1X job: assemble pre-generated bytecode templates written in Java compiled by optimising compiler at VM build time very small amount of glue assembly template code for integer array load static int Object int index) { ArrayAccess.checkIndex(array, index); } return result = ArrayAccess.getInt(array, static void checkindex(object array, int index) { int length = Layout.readArrayLength(Reference.fromJava(array)); if (UnsignedMath.aboveOrEqual(index, length)) { throw Throw.arrayIndexOutOfBoundsException(array, index); } static int getint(object array, int index) { return Layout.getInt(Reference.fromJava(array), index); } 12

40 Baseline Compiler: T1X instantiated template code for integer array load mov rdi, [rsp + 16] mov mov esi, [rsp] rax, rdi movsxd rax, [rax + 16] cmp esi, eax jb call nop mov call nop L1 Throw.indexOutOfBoundsException() rdi, rax MaxRuntimeCalls.runtimeUnwindException L1: movsxd rsi, esi movsxd rax, rdi[rsi * ] addq mov rsp, 0x10 [rsp], eax prologue (loading of operand stack slots) compiled template 8 bytes hub (class pointer) 8 bytes misc (locking, GC) 4 bytes array length 4 bytes alignment epilogue (storing of operand stack slots) 13

41 Inspector 14

42 Optimising Compilers: C1X and Graal C++ C1 / C2 Inline Assembly Compiler Interface Garbage Collector Object Locking Type Information Interpreter Runtime HotSpot VM 15

43 Optimising Compilers: C1X and Graal Java C++ C1 / C2 C1X Inline Assembly Compiler Interface XIR Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime HotSpot VM Runtime Maxine VM 15

44 Optimising Compilers: C1X and Graal Java C++ C1 / C2 C1X Inline Assembly Compiler Interface XIR Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime HotSpot VM Runtime Maxine VM 15

45 Optimising Compilers: C1X and Graal Java C++ C1 / C2 C1X Inline Assembly Compiler Interface XIR Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime HotSpot VM Runtime Maxine VM Graal Snippets Compiler Interface Garbage Collector Object Locking Type Information Interpreter Runtime Graal VM 15

46 Optimising Compilers: C1X and Graal Java C++ C1 / C2 C1X Inline Assembly Compiler Interface XIR Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime HotSpot VM Runtime Maxine VM Graal Snippets Compiler Interface Garbage Collector Object Locking Type Information Interpreter Runtime Graal VM 15

47 Optimising Compilers: C1X and Graal Java C++ C1 / C2 C1X Inline Assembly Compiler Interface XIR Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime HotSpot VM Runtime Maxine VM Graal Graal Snippets Compiler Interface Snippets Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime Graal VM Runtime Maxine VM with Graal 15

48 Optimising Compilers: C1X and Graal Java C++ C1 / C2 C1X Inline Assembly Compiler Interface XIR Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime HotSpot VM Runtime Maxine VM Graal Graal Snippets Compiler Interface Snippets Compiler Interface Garbage Collector Type Information Garbage Collector Type Information Object Locking Interpreter Object Locking T1X Runtime Graal VM Runtime Maxine VM with Graal 15

49 Graal Vision Statement Create an extensible, modular, dynamic, and aggressive compiler using object-oriented and reflective Java programming, a graph-based and visualizable intermediate representation, and Java snippets. -- Thomas Würthinger Collaboration with Johannes-Kepler-Universität Linz, Austria JKU Lukas Stadler, Gilles Duboscq, Christian Häubl, Prof. Hanspeter Mössenböck Home page: Source (GPLv2): Mailing list: graal-dev@openjdk.java.net 16

50 Graal Java Bytecodes Java Bytecode Parser Method Inlining Type Inference Escape Analysis Loop Optimisations VM Lowering Memory Optimisations Architecture Lowering Register Allocation Peephole Optimisations Code Generation Machine Code 17

51 Graal Java Bytecodes Java Bytecode Parser Method Inlining Type Inference Escape Analysis Loop Optimisations VM Lowering Memory Optimisations Architecture Lowering Register Allocation Peephole Optimisations Code Generation Machine Code 17

52 Graal Java Bytecodes Language dependent Language independent VM independent Architecture independent Java Bytecode Parser Method Inlining Type Inference Escape Analysis Loop Optimisations VM Lowering VM dependent Architecture independent Memory Optimisations Architecture Lowering VM dependent Architecture dependent Register Allocation Peephole Optimisations Code Generation Machine Code 17

53 Performance: Maxine/C1X 200% 191% 180% 160% 151% 157% 140% 138% 120% 119% 100% 80% 60% 71% 64% 58% 81% 54% 76% 74% 40% 20% 0% SPECjvm2008 DaCapo peak DaCapo startup SPECjbb2005 SciMark 2.0 JavaGrande Client Maxine/C1X Server 2-socket dual core AMD Opteron 2214, 2.2 GHz, 4 total cores 4 GByte main memory Oracle Enterprise Linux, version e15 18

54 Performance: GraalVM 120% 100% 80% 60% 72% 77% 48% 61% 66% 74% 40% 20% 0% DaCapo Scala-DaCapo SPECjvm2008 Client GraalVM Server Intel(R) Core(TM) 2.67GHz (4 cores) 8 GByte main memory Ubuntu Linux 11.10, kernel

55 Maxine: Code Cache Management T1X C1X Maxine VM 20

56 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() T1X Cache Maxine VM C1X Cache 20

57 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache 20

58 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache 20

59 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache to-space from-space T1X Cache with Semi-Space Memory Management Scheme 20

60 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> m() n() to-space from-space T1X Cache with Semi-Space Memory Management Scheme 20

61 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> m() n() o() to-space from-space T1X Cache with Semi-Space Memory Management Scheme 20

62 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> m() n() to-space from-space T1X Cache with Semi-Space Memory Management Scheme 20

63 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> m() n() from-space to-space from-space to-space T1X Cache with Semi-Space Memory Management Scheme 20

64 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> m() n() from-space to-space from-space to-space T1X Cache with Semi-Space Memory Management Scheme 20

65 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> n() m() from-space to-space from-space to-space T1X Cache with Semi-Space Memory Management Scheme 20

66 Maxine: Code Cache Management T1X C1X m() n() <clinit> o() o() T1X Cache Maxine VM m() C1X Cache <clinit> n() m() o() from-space to-space from-space to-space T1X Cache with Semi-Space Memory Management Scheme 20

67 Code Cache Management: Which Methods are Live? baseline (T1X) method optimised (C1X) method live method o() f() g() p() h() g() t1 call stack f() g() h() i() j() k() l() to-space from-space T1X Cache 21

68 Code Cache Management: Which Methods are Live? baseline (T1X) method optimised (C1X) method live method o() f() g() p() h() g() t1 call stack f() g() h() i() j() k() l() to-space from-space T1X Cache 21

69 Code Cache Management: Which Methods are Live? baseline (T1X) method optimised (C1X) method live method k() o() f() g() p() h() g() t1 call stack f() g() h() i() j() k() l() to-space from-space T1X Cache 21

70 Code Cache Management: Which Methods are Live? baseline (T1X) method optimised (C1X) method live method k() o() f() g() j() p() h() g() t1 call stack f() g() h() i() j() k() l() to-space from-space T1X Cache 21

71 Code Cache Management: Which Methods are Live? baseline (T1X) method optimised (C1X) method live method k() o() f() g() j() p() h() g() t1 call stack f() g() h() i() j() k() l() to-space from-space T1X Cache 21

72 Code Cache Management: Which Methods are Live? baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack live methods methods on stack direct callees of on-stack methods others to protect from eviction freshly compiled, not yet installed invocation counter within optimisation threshold existing type profile f() g() h() i() j() k() l() to-space from-space T1X Cache 21

73 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() o() f() g() j() p() h() g() t1 call stack f() g() h() i() j() k() l() from-space to-space T1X Cache 22

74 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack course of action 1. invalidate unmarked methods (and vtable entries, direct calls) f() g() h() i() j() k() l() from-space to-space T1X Cache 22

75 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack course of action 1. invalidate unmarked methods (and vtable entries, direct calls) f() g() h() j() k() from-space to-space T1X Cache 22

76 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack course of action 1. invalidate unmarked methods (and vtable entries, direct calls) 2. move marked methods (update vtable entries, direct calls) f() g() h() j() k() from-space to-space T1X Cache 22

77 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack course of action 1. invalidate unmarked methods (and vtable entries, direct calls) 2. move marked methods (update vtable entries, direct calls) f() g() h() j() k() from-space T1X Cache to-space 22

78 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack course of action 1. invalidate unmarked methods (and vtable entries, direct calls) 2. move marked methods (update vtable entries, direct calls) 3. patch return addresses f() g() h() j() k() from-space T1X Cache to-space 22

79 Code Cache Management: Eviction baseline (T1X) method optimised (C1X) method live method k() j() o() f() g() p() h() g() t1 call stack course of action 1. invalidate unmarked methods (and vtable entries, direct calls) 2. move marked methods (update vtable entries, direct calls) 3. patch return addresses f() g() h() j() k() from-space T1X Cache to-space 22

80 Where Do Pointers to Machine Code Occur, and How Are They Handled? vtables/itables directly accessible via meta-level API (actors, hubs); invalidate (replace with trampoline calls) or relocate 23

81 Where Do Pointers to Machine Code Occur, and How Are They Handled? vtables/itables direct calls directly accessible via meta-level API (actors, hubs); invalidate (replace with trampoline calls) or relocate directly accessible via target method API (safepoints); invalidate (replace with trampoline calls) or relocate 23

82 Where Do Pointers to Machine Code Occur, and How Are They Handled? vtables/itables direct calls return addresses directly accessible via meta-level API (actors, hubs); invalidate (replace with trampoline calls) or relocate directly accessible via target method API (safepoints); invalidate (replace with trampoline calls) or relocate accessible during stack walking; relocate accordingly 23

83 Where Do Pointers to Machine Code Occur, and How Are They Handled? vtables/itables direct calls return addresses local variables member variables directly accessible via meta-level API (actors, hubs); invalidate (replace with trampoline calls) or relocate directly accessible via target method API (safepoints); invalidate (replace with trampoline calls) or relocate accessible during stack walking; relocate accordingly These might have to be relocated how to determine which Address is a code pointer? 23

84 Where Do Pointers to Machine Code Occur, and How Are They Handled? vtables/itables direct calls return addresses local variables member variables directly accessible via meta-level API (actors, hubs); invalidate (replace with trampoline calls) or relocate directly accessible via target method API (safepoints); invalidate (replace with trampoline calls) or relocate accessible during stack walking; relocate accordingly These might have to be relocated how to determine which Address is a code pointer? 23

85 Tagged Code Pointers Object CodePointer Word Address Offset Pointer Size 24

86 Tagged Code Pointers Object CodePointer Word 63 bits payload (offset from base code address) 1 tag bit Address Offset Pointer Size 24

87 Tagged Code Pointers class CodePointer public static CodePointer from(long value) { if (ishosted()) { return new CodePointer(tag(value)); } return UnsafeCast.asCodePointer(tag(value)); }... } CodePointer Object Word 63 bits payload (offset from base code address) 1 tag bit Address Offset Pointer Size 24

88 Tagged Code Pointers class CodePointer public static CodePointer from(long value) { if (ishosted()) { return new CodePointer(tag(value)); } return UnsafeCast.asCodePointer(tag(value)); }... } CodePointer Object Word 63 bits payload (offset from base code address) 1 tag bit Address public static CodePointer ascodepointer(long value) { return CodePointer.from(value); } Pointer Size 24

89 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return 25

90 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return idealised stack frame layout j o i operands locals arguments 0 <r> return address 25

91 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return idealised stack frame layout j operands locals stack reference map (at instruction 6) 2 1 o i arguments <r> return address 25

92 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return void x(...) {... MyClass o =...; CodePointer cp =...;... } idealised stack frame layout j operands locals stack reference map (at instruction 6) 2 1 o i arguments <r> return address 25

93 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return void x(...) {... MyClass o =...; CodePointer cp =...;... } idealised stack frame layout j operands locals stack reference map (at instruction 6) 2 1 o i arguments <r> return address 25

94 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return void x(...) {... MyClass o =...; CodePointer cp =...;... } idealised stack frame layout GC code eviction j operands locals stack reference map (at instruction 6) 2 1 o i arguments 0 <r> return address stack reference map builder Maxine VM 25

95 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return void x(...) {... MyClass o =...; CodePointer cp =...;... } idealised stack frame layout GC code eviction j operands locals stack reference map (at instruction 6) ignore tagged refs, scan others 2 1 o i arguments 0 <r> return address stack reference map builder Maxine VM 25

96 Stack Reference Maps and Tagged Code Pointers static void m(int i, MyClass o) { int j = 2 * i; o.f(i); } 0: iconst_2 1: iload_0 2: imul 3: istore_2 4: aload_1 5: iload_2 6: invokevirtual <f:(i)v> 9: return void x(...) {... MyClass o =...; CodePointer cp =...;... } idealised stack frame layout GC code eviction j operands locals stack reference map (at instruction 6) ignore tagged refs, scan others regard and relocate only tagged refs 2 1 o i arguments 0 <r> return address stack reference map builder Maxine VM 25

97 <Insert Thank you for your attention. Acknowledgements: these slides are joint work of the VM research group. Home page: Source (GPLv2): Mailing list via: 26

98

<Insert Picture Here>

<Insert Picture Here> 1 2010-0237 The Maxine Inspector: A Specialized Tool for VM Development, Santa Clara, CA Michael L. Van De Vanter Researcher, Oracle Sun Labs The Maxine Project at Oracle Sun Labs:

More information

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 Truffle: A Self-Optimizing Runtime System Christian Wimmer, Thomas Würthinger Oracle Labs Write Your Own Language Current situation How it should be Prototype a new language Parser and language work

More information

<Insert Picture Here> Graal: A quest for the JVM to leverage its own J Doug Simon - Oracle Labs

<Insert Picture Here> Graal: A quest for the JVM to leverage its own J Doug Simon - Oracle Labs Graal: A quest for the JVM to leverage its own J Doug Simon - Oracle Labs JVM Language Summit, 30th July 2012 The following is intended to outline our general product direction. It

More information

1 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

1 Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 Copyright 2012, Oracle and/or its affiliates. All rights reserved. Truffle: A Self-Optimizing Runtime System Thomas Wuerthinger Oracle Labs JVM Language Summit, July 31, 2012 2 Copyright 2012, Oracle

More information

Compact and Efficient Strings for Java

Compact and Efficient Strings for Java Compact and Efficient Strings for Java Christian Häubl, Christian Wimmer, Hanspeter Mössenböck Institute for System Software, Christian Doppler Laboratory for Automated Software Engineering, Johannes Kepler

More information

JVM Continuations. Lukas Stadler. Johannes Kepler University Linz, Austria

JVM Continuations. Lukas Stadler. Johannes Kepler University Linz, Austria JVM Continuations Lukas Stadler Johannes Kepler University Linz, Austria Agenda Continuations Uses for continuations Common implementation techniques Our lazy approach Implementation Summary Continuations

More information

Faster Ruby and JS with Graal/Truffle

Faster Ruby and JS with Graal/Truffle The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 agreement. Faster Ruby and JS with Graal/Truffle Chris Seaton

More information

Copyright 2014 Oracle and/or its affiliates. All rights reserved.

Copyright 2014 Oracle and/or its affiliates. All rights reserved. Copyright 2014 Oracle and/or its affiliates. All rights reserved. On the Quest Towards Fastest (Java) Virtual Machine on the Planet! @JaroslavTulach Oracle Labs Copyright 2015 Oracle and/or its affiliates.

More information

Trace Compilation. Christian Wimmer September 2009

Trace Compilation. Christian Wimmer  September 2009 Trace Compilation Christian Wimmer cwimmer@uci.edu www.christianwimmer.at September 2009 Department of Computer Science University of California, Irvine Background Institute for System Software Johannes

More information

JRuby+Truffle. Why it s important to optimise the tricky parts. Chris Seaton Research Manager Oracle Labs 2 June 2016

JRuby+Truffle. Why it s important to optimise the tricky parts. Chris Seaton Research Manager Oracle Labs 2 June 2016 The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 agreement. JRuby+Truffle Why it s important to optimise the tricky

More information

Compiler construction 2009

Compiler construction 2009 Compiler construction 2009 Lecture 3 JVM and optimization. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int

More information

Code Generation Introduction

Code Generation Introduction Code Generation Introduction i = 0 LF w h i l e i=0 while (i < 10) { a[i] = 7*i+3 i = i + 1 lexer i = 0 while ( i < 10 ) source code (e.g. Scala, Java,C) easy to write Compiler (scalac, gcc) parser type

More information

CSc 453 Interpreters & Interpretation

CSc 453 Interpreters & Interpretation CSc 453 Interpreters & Interpretation Saumya Debray The University of Arizona Tucson Interpreters An interpreter is a program that executes another program. An interpreter implements a virtual machine,

More information

Welcome to the session...

Welcome to the session... Welcome to the session... Copyright 2013, Oracle and/or its affiliates. All rights reserved. 02/22/2013 1 The following is intended to outline our general product direction. It is intended for information

More information

Snippets: Taking the High Road to a Low Level

Snippets: Taking the High Road to a Low Level Snippets: Taking the High Road to a Low Level DOUG SIMON and CHRISTIAN WIMMER, Oracle Labs BERNHARD URBAN, Institute for System Software, Johannes Kepler University Linz, Austria GILLES DUBOSCQ, LUKAS

More information

Truffle A language implementation framework

Truffle A language implementation framework Truffle A language implementation framework Boris Spasojević Senior Researcher VM Research Group, Oracle Labs Slides based on previous talks given by Christian Wimmer, Christian Humer and Matthias Grimmer.

More information

Delft-Java Link Translation Buffer

Delft-Java Link Translation Buffer Delft-Java Link Translation Buffer John Glossner 1,2 and Stamatis Vassiliadis 2 1 Lucent / Bell Labs Advanced DSP Architecture and Compiler Research Allentown, Pa glossner@lucent.com 2 Delft University

More information

JRuby+Truffle. Kevin Menard. Chris Seaton. Benoit Daloze. A tour through a new Ruby Oracle Oracle Labs

JRuby+Truffle. Kevin Menard. Chris Seaton. Benoit Daloze. A tour through a new Ruby Oracle Oracle Labs JRuby+Truffle A tour through a new Ruby implementahon Chris Seaton @ChrisGSeaton Oracle Labs Benoit Daloze @eregontp JKU Linz Kevin Menard @nirvdrum Oracle Labs Ruby logo copyright (c) 2006, Yukihiro Matsumoto,

More information

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder JAVA PERFORMANCE PR SW2 S18 Dr. Prähofer DI Leopoldseder OUTLINE 1. What is performance? 1. Benchmarking 2. What is Java performance? 1. Interpreter vs JIT 3. Tools to measure performance 4. Memory Performance

More information

Compiler Design Spring 2017

Compiler Design Spring 2017 Compiler Design Spring 2017 6.0 Runtime system and object layout Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation 1 Runtime system Some open issues from last time Handling

More information

Optimization Techniques

Optimization Techniques Smalltalk Implementation: Optimization Techniques Prof. Harry Porter Portland State University 1 Optimization Ideas Just-In-Time (JIT) compiling When a method is first invoked, compile it into native code.

More information

SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine p. 1

SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine p. 1 SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine David Bélanger dbelan2@cs.mcgill.ca Sable Research Group McGill University Montreal, QC January 28, 2004 SABLEJIT: A Retargetable

More information

JDK 9/10/11 and Garbage Collection

JDK 9/10/11 and Garbage Collection JDK 9/10/11 and Garbage Collection Thomas Schatzl Senior Member of Technical Staf Oracle JVM Team May, 2018 thomas.schatzl@oracle.com Copyright 2017, Oracle and/or its afliates. All rights reserved. 1

More information

Automatic Object Colocation Based on Read Barriers

Automatic Object Colocation Based on Read Barriers See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/221644818 Automatic Object Colocation Based on Read Barriers Conference Paper September 2006

More information

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler Hiroshi Inoue, Hiroshige Hayashizaki, Peng Wu and Toshio Nakatani IBM Research Tokyo IBM Research T.J. Watson Research Center April

More information

The Z Garbage Collector Scalable Low-Latency GC in JDK 11

The Z Garbage Collector Scalable Low-Latency GC in JDK 11 The Z Garbage Collector Scalable Low-Latency GC in JDK 11 Per Lidén (@perliden) Consulting Member of Technical Staff Java Platform Group, Oracle October 24, 2018 Safe Harbor Statement The following is

More information

Guilt Free Ruby on the JVM

Guilt Free Ruby on the JVM The Ruby logo is Copyright 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 License agreement. Guilt Free Ruby on the JVM Forgetting Conventional

More information

Deriving Code Coverage Information from Profiling Data Recorded for a Trace-based Just-in-time Compiler

Deriving Code Coverage Information from Profiling Data Recorded for a Trace-based Just-in-time Compiler Deriving Code Coverage Information from Profiling Data Recorded for a Trace-based Just-in-time Compiler Christian Häubl Institute for System Software Johannes Kepler University Linz Austria haeubl@ssw.jku.at

More information

Method-Level Phase Behavior in Java Workloads

Method-Level Phase Behavior in Java Workloads Method-Level Phase Behavior in Java Workloads Andy Georges, Dries Buytaert, Lieven Eeckhout and Koen De Bosschere Ghent University Presented by Bruno Dufour dufour@cs.rutgers.edu Rutgers University DCS

More information

Java and C II. CSE 351 Spring Instructor: Ruth Anderson

Java and C II. CSE 351 Spring Instructor: Ruth Anderson Java and C II CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Lab 5 Due TONIGHT! Fri 6/2

More information

CURRICULUM VITAE. DI Dr. Matthias Grimmer Michael-Hainisch-Straße Linz

CURRICULUM VITAE. DI Dr. Matthias Grimmer Michael-Hainisch-Straße Linz CURRICULUM VITAE Full Name Address Date of Birth Citizenship Phone Email Website GitHub DI Dr. Michael-Hainisch-Straße 18 4040 Linz March 2, 1989 Austria (+43) 664 784 21 52 contact@matthiasgrimmer.com

More information

Running class Timing on Java HotSpot VM, 1

Running class Timing on Java HotSpot VM, 1 Compiler construction 2009 Lecture 3. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int s = r + 5; return

More information

The Java Language Implementation

The Java Language Implementation CS 242 2012 The Java Language Implementation Reading Chapter 13, sections 13.4 and 13.5 Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches, pages 1 5. Outline Java virtual

More information

The Z Garbage Collector An Introduction

The Z Garbage Collector An Introduction The Z Garbage Collector An Introduction Per Lidén & Stefan Karlsson HotSpot Garbage Collection Team FOSDEM 2018 Safe Harbor Statement The following is intended to outline our general product direction.

More information

R as a in a Polyglot World

R as a in a Polyglot World R as a Ci@zen in a Polyglot World The promise of the Truffle framework Lukas Stadler, VM Research Group, Oracle Labs user! 2015 2 Safe Harbor Statement The following is intended to provide some insight

More information

Compilation Queuing and Graph Caching for Dynamic Compilers

Compilation Queuing and Graph Caching for Dynamic Compilers Compilation Queuing and Graph Caching for Dynamic Compilers Lukas Stadler Gilles Duboscq Hanspeter Mössenböck Johannes Kepler University Linz, Austria {stadler, duboscq, moessenboeck}@ssw.jku.at Thomas

More information

Oracle R Technologies

Oracle R Technologies Oracle R Technologies R for the Enterprise Mark Hornick, Director, Oracle Advanced Analytics @MarkHornick mark.hornick@oracle.com Safe Harbor Statement The following is intended to outline our general

More information

New Compiler Optimizations in the Java HotSpot Virtual Machine

New Compiler Optimizations in the Java HotSpot Virtual Machine New Compiler Optimizations in the Java HotSpot Virtual Machine Steve Dever Steve Goldman Kenneth Russell Sun Microsystems, Inc. TS-3412 Copyright 2006, Sun Microsystems Inc., All rights reserved. 2006

More information

Java: framework overview and in-the-small features

Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

High-Level Language VMs

High-Level Language VMs High-Level Language VMs Outline Motivation What is the need for HLL VMs? How are these different from System or Process VMs? Approach to HLL VMs Evolutionary history Pascal P-code Object oriented HLL VMs

More information

Roadmap. Java: Assembly language: OS: Machine code: Computer system:

Roadmap. Java: Assembly language: OS: Machine code: Computer system: Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: Computer system: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

Compiling Techniques

Compiling Techniques Lecture 10: Introduction to 10 November 2015 Coursework: Block and Procedure Table of contents Introduction 1 Introduction Overview Java Virtual Machine Frames and Function Call 2 JVM Types and Mnemonics

More information

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1 CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines

More information

Run-time Program Management. Hwansoo Han

Run-time Program Management. Hwansoo Han Run-time Program Management Hwansoo Han Run-time System Run-time system refers to Set of libraries needed for correct operation of language implementation Some parts obtain all the information from subroutine

More information

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017 Introduction to Java Lecture 1 COP 3252 Summer 2017 May 16, 2017 The Java Language Java is a programming language that evolved from C++ Both are object-oriented They both have much of the same syntax Began

More information

02 B The Java Virtual Machine

02 B The Java Virtual Machine 02 B The Java Virtual Machine CS1102S: Data Structures and Algorithms Martin Henz January 22, 2010 Generated on Friday 22 nd January, 2010, 09:46 CS1102S: Data Structures and Algorithms 02 B The Java Virtual

More information

23/02/15. Compile, execute, debug. Advanced Programming THE JAVA PLATFORM

23/02/15. Compile, execute, debug. Advanced Programming THE JAVA PLATFORM Advanced Programming THE JAVA PLATFORM What do you need to run your java application? G: STARTING A JAVA APPLICATION Compile, execute, debug Safari book collection at UNIBZ: Schildt, H. Java the complete

More information

Unrestricted and Safe Dynamic Code Evolution for Java

Unrestricted and Safe Dynamic Code Evolution for Java Unrestricted and Safe Dynamic Code Evolution for Java Thomas Würthinger a, Christian Wimmer b, Lukas Stadler a a Institute for System Software, Christian Doppler Laboratory for Automated Software Engineering,

More information

Building a Compiler with. JoeQ. Outline of this lecture. Building a compiler: what pieces we need? AKA, how to solve Homework 2

Building a Compiler with. JoeQ. Outline of this lecture. Building a compiler: what pieces we need? AKA, how to solve Homework 2 Building a Compiler with JoeQ AKA, how to solve Homework 2 Outline of this lecture Building a compiler: what pieces we need? An effective IR for Java joeq Homework hints How to Build a Compiler 1. Choose

More information

W4118: PC Hardware and x86. Junfeng Yang

W4118: PC Hardware and x86. Junfeng Yang W4118: PC Hardware and x86 Junfeng Yang A PC How to make it do something useful? 2 Outline PC organization x86 instruction set gcc calling conventions PC emulation 3 PC board 4 PC organization One or more

More information

The Z Garbage Collector Low Latency GC for OpenJDK

The Z Garbage Collector Low Latency GC for OpenJDK The Z Garbage Collector Low Latency GC for OpenJDK Per Lidén & Stefan Karlsson HotSpot Garbage Collection Team Jfokus VM Tech Summit 2018 Safe Harbor Statement The following is intended to outline our

More information

Complex, concurrent software. Precision (no false positives) Find real bugs in real executions

Complex, concurrent software. Precision (no false positives) Find real bugs in real executions Harry Xu May 2012 Complex, concurrent software Precision (no false positives) Find real bugs in real executions Need to modify JVM (e.g., object layout, GC, or ISA-level code) Need to demonstrate realism

More information

code://rubinius/technical

code://rubinius/technical code://rubinius/technical /GC, /cpu, /organization, /compiler weeee!! Rubinius New, custom VM for running ruby code Small VM written in not ruby Kernel and everything else in ruby http://rubini.us git://rubini.us/code

More information

Notes of the course - Advanced Programming. Barbara Russo

Notes of the course - Advanced Programming. Barbara Russo Notes of the course - Advanced Programming Barbara Russo a.y. 2014-2015 Contents 1 Lecture 2 Lecture 2 - Compilation, Interpreting, and debugging........ 2 1.1 Compiling and interpreting...................

More information

How Software Executes

How Software Executes How Software Executes CS-576 Systems Security Instructor: Georgios Portokalidis Overview Introduction Anatomy of a program Basic assembly Anatomy of function calls (and returns) Memory Safety Programming

More information

Multi-Level Virtual Machine Debugging using the Java Platform Debugger Architecture

Multi-Level Virtual Machine Debugging using the Java Platform Debugger Architecture Multi-Level Virtual Machine Debugging using the Java Platform Debugger Architecture Thomas Würthinger 1, Michael L. Van De Vanter 2, and Doug Simon 2 1 Institute for System Software Johannes Kepler University

More information

EXAMINATIONS 2014 TRIMESTER 1 SWEN 430. Compiler Engineering. This examination will be marked out of 180 marks.

EXAMINATIONS 2014 TRIMESTER 1 SWEN 430. Compiler Engineering. This examination will be marked out of 180 marks. T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON EXAMINATIONS 2014 TRIMESTER 1 SWEN 430 Compiler Engineering Time Allowed: THREE HOURS Instructions:

More information

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16 1 Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16 Towards JVM Dynamic Languages Toolchain Insert Picture Here Attila

More information

JVM. What This Topic is About. Course Overview. Recap: Interpretive Compilers. Abstract Machines. Abstract Machines. Class Files and Class File Format

JVM. What This Topic is About. Course Overview. Recap: Interpretive Compilers. Abstract Machines. Abstract Machines. Class Files and Class File Format Course Overview What This Topic is About PART I: overview material 1 Introduction 2 Language processors (tombstone diagrams, bootstrapping) 3 Architecture of a compiler PART II: inside a compiler 4 Syntax

More information

NUMA in High-Level Languages. Patrick Siegler Non-Uniform Memory Architectures Hasso-Plattner-Institut

NUMA in High-Level Languages. Patrick Siegler Non-Uniform Memory Architectures Hasso-Plattner-Institut NUMA in High-Level Languages Non-Uniform Memory Architectures Hasso-Plattner-Institut Agenda. Definition of High-Level Language 2. C# 3. Java 4. Summary High-Level Language Interpreter, no directly machine

More information

FTL WebKit s LLVM based JIT

FTL WebKit s LLVM based JIT FTL WebKit s LLVM based JIT Andrew Trick, Apple Juergen Ributzka, Apple LLVM Developers Meeting 2014 San Jose, CA WebKit JS Execution Tiers OSR Entry LLInt Baseline JIT DFG FTL Interpret bytecode Profiling

More information

The Stack & Procedures

The Stack & Procedures The Stack & Procedures CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Homework 2 due

More information

6.035 Project 3: Unoptimized Code Generation. Jason Ansel MIT - CSAIL

6.035 Project 3: Unoptimized Code Generation. Jason Ansel MIT - CSAIL 6.035 Project 3: Unoptimized Code Generation Jason Ansel MIT - CSAIL Quiz Monday 50 minute quiz Monday Covers everything up to yesterdays lecture Lexical Analysis (REs, DFAs, NFAs) Syntax Analysis (CFGs,

More information

Course Overview. PART I: overview material. PART II: inside a compiler. PART III: conclusion

Course Overview. PART I: overview material. PART II: inside a compiler. PART III: conclusion Course Overview PART I: overview material 1 Introduction (today) 2 Language Processors (basic terminology, tombstone diagrams, bootstrapping) 3 The architecture of a Compiler PART II: inside a compiler

More information

Machine-Level Programming III: Procedures

Machine-Level Programming III: Procedures Machine-Level Programming III: Procedures CSE 238/2038/2138: Systems Programming Instructor: Fatma CORUT ERGİN Slides adapted from Bryant & O Hallaron s slides Mechanisms in Procedures Passing control

More information

Self-Optimizing AST Interpreters

Self-Optimizing AST Interpreters Self-Optimizing AST Interpreters Thomas Würthinger Andreas Wöß Lukas Stadler Gilles Duboscq Doug Simon Christian Wimmer Oracle Labs Institute for System Software, Johannes Kepler University Linz, Austria

More information

Field Analysis. Last time Exploit encapsulation to improve memory system performance

Field Analysis. Last time Exploit encapsulation to improve memory system performance Field Analysis Last time Exploit encapsulation to improve memory system performance This time Exploit encapsulation to simplify analysis Two uses of field analysis Escape analysis Object inlining April

More information

Efficient Runtime Tracking of Allocation Sites in Java

Efficient Runtime Tracking of Allocation Sites in Java Efficient Runtime Tracking of Allocation Sites in Java Rei Odaira, Kazunori Ogata, Kiyokuni Kawachiya, Tamiya Onodera, Toshio Nakatani IBM Research - Tokyo Why Do You Need Allocation Site Information?

More information

Debugging at Full Speed

Debugging at Full Speed Oracle Labs Document 2014-0221 Debugging at Full Speed Instrumen)ng Truffle- implemented Programs Michael L. Van De Vanter Oracle Labs, VM Research Group July 30, 2014 2014 JVM Language Summit Santa Clara,

More information

Part VII : Code Generation

Part VII : Code Generation Part VII : Code Generation Code Generation Stack vs Register Machines JVM Instructions Code for arithmetic Expressions Code for variable access Indexed variables Code for assignments Items How to use items

More information

SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE

SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE 1 SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE Tatsuya Hagino hagino@sfc.keio.ac.jp slides URL https://vu5.sfc.keio.ac.jp/sa/ Java Programming Language Java Introduced in 1995 Object-oriented programming

More information

Implementing Higher-Level Languages. Quick tour of programming language implementation techniques. From the Java level to the C level.

Implementing Higher-Level Languages. Quick tour of programming language implementation techniques. From the Java level to the C level. Implementing Higher-Level Languages Quick tour of programming language implementation techniques. From the Java level to the C level. Ahead-of-time compiler compile time C source code C compiler x86 assembly

More information

H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon. School of Electrical Engineering and Computer Science Seoul National University, Korea

H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon. School of Electrical Engineering and Computer Science Seoul National University, Korea H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon School of Electrical Engineering and Computer Science Seoul National University, Korea Android apps are programmed using Java Android uses DVM instead of JVM

More information

Virtual Machine Design

Virtual Machine Design Virtual Machine Design Lecture 4: Multithreading and Synchronization Antero Taivalsaari September 2003 Session #2026: J2MEPlatform, Connected Limited Device Configuration (CLDC) Lecture Goals Give an overview

More information

Hardware-Supported Pointer Detection for common Garbage Collections

Hardware-Supported Pointer Detection for common Garbage Collections 2013 First International Symposium on Computing and Networking Hardware-Supported Pointer Detection for common Garbage Collections Kei IDEUE, Yuki SATOMI, Tomoaki TSUMURA and Hiroshi MATSUO Nagoya Institute

More information

Software Speculative Multithreading for Java

Software Speculative Multithreading for Java Software Speculative Multithreading for Java Christopher J.F. Pickett and Clark Verbrugge School of Computer Science, McGill University {cpicke,clump}@sable.mcgill.ca Allan Kielstra IBM Toronto Lab kielstra@ca.ibm.com

More information

Java Internals. Frank Yellin Tim Lindholm JavaSoft

Java Internals. Frank Yellin Tim Lindholm JavaSoft Java Internals Frank Yellin Tim Lindholm JavaSoft About This Talk The JavaSoft implementation of the Java Virtual Machine (JDK 1.0.2) Some companies have tweaked our implementation Alternative implementations

More information

JSR 292 and companions Rémi Forax FOSDEM'09

JSR 292 and companions Rémi Forax FOSDEM'09 JSR 292 and companions Rémi Forax FOSDEM'09 Da Vinci Mission Prototype (J)VM extensions to run non-java languages efficiently Complete the existing architecture with general purpose extensions New languages

More information

Machine-level Programs Procedure

Machine-level Programs Procedure Computer Systems Machine-level Programs Procedure Han, Hwansoo Mechanisms in Procedures Passing control To beginning of procedure code Back to return point Passing data Procedure arguments Return value

More information

Under the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008

Under the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008 Under the Hood: The Java Virtual Machine Lecture 23 CS2110 Fall 2008 Compiling for Different Platforms Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized

More information

Taming the Java Virtual Machine. Li Haoyi, Chicago Scala Meetup, 19 Apr 2017

Taming the Java Virtual Machine. Li Haoyi, Chicago Scala Meetup, 19 Apr 2017 Taming the Java Virtual Machine Li Haoyi, Chicago Scala Meetup, 19 Apr 2017 Who Am I? Previously: Dropbox Engineering Currently: Bright Technology Services - Data Science, Scala consultancy Fluent Code

More information

Machine Programming 3: Procedures

Machine Programming 3: Procedures Machine Programming 3: Procedures CS61, Lecture 5 Prof. Stephen Chong September 15, 2011 Announcements Assignment 2 (Binary bomb) due next week If you haven t yet please create a VM to make sure the infrastructure

More information

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking ORACLE WHITE PAPER JULY 2017 Disclaimer The following is intended

More information

INVESTIGATING ANDROID BYTECODE EXECUTION ON JAVA VIRTUAL MACHINES

INVESTIGATING ANDROID BYTECODE EXECUTION ON JAVA VIRTUAL MACHINES INVESTIGATING ANDROID BYTECODE EXECUTION ON JAVA VIRTUAL MACHINES A DISSERTATION SUBMITTED TO THE UNIVERSITY OF MANCHESTER FOR THE DEGREE OF MASTER OF SCIENCE IN THE FACULTY OF ENGINEERING AND PHYSICAL

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: February 28, 2018 at 06:32 CS429 Slideset 9: 1 Mechanisms in Procedures

More information

LLVM for a Managed Language What we've learned

LLVM for a Managed Language What we've learned LLVM for a Managed Language What we've learned Sanjoy Das, Philip Reames {sanjoy,preames}@azulsystems.com LLVM Developers Meeting Oct 30, 2015 This presentation describes advanced development work at Azul

More information

Identity-based Access Control

Identity-based Access Control Identity-based Access Control The kind of access control familiar from operating systems like Unix or Windows based on user identities This model originated in closed organisations ( enterprises ) like

More information

Android Internals and the Dalvik VM!

Android Internals and the Dalvik VM! Android Internals and the Dalvik VM! Adam Champion, Andy Pyles, Boxuan Gu! Derived in part from presentations by Patrick Brady, Dan Bornstein, and Dan Morrill from Google (http://source.android.com/documentation)!

More information

Java byte code verification

Java byte code verification Java byte code verification SOS Master Science Informatique U. Rennes 1 Thomas Jensen SOS Java byte code verification 1 / 26 Java security architecture Java: programming applications with code from different

More information

Lecture 4 CIS 341: COMPILERS

Lecture 4 CIS 341: COMPILERS Lecture 4 CIS 341: COMPILERS CIS 341 Announcements HW2: X86lite Available on the course web pages. Due: Weds. Feb. 7 th at midnight Pair-programming project Zdancewic CIS 341: Compilers 2 X86 Schematic

More information

Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition. Carnegie Mellon

Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition. Carnegie Mellon Carnegie Mellon Machine-Level Programming III: Procedures 15-213/18-213/14-513/15-513: Introduction to Computer Systems 7 th Lecture, September 18, 2018 Today Procedures Mechanisms Stack Structure Calling

More information

Buffer Overflow Attack (AskCypert CLaaS)

Buffer Overflow Attack (AskCypert CLaaS) Buffer Overflow Attack (AskCypert CLaaS) ---------------------- BufferOverflow.c code 1. int main(int arg c, char** argv) 2. { 3. char name[64]; 4. printf( Addr;%p\n, name); 5. strcpy(name, argv[1]); 6.

More information

Final Exam. 12 December 2018, 120 minutes, 26 questions, 100 points

Final Exam. 12 December 2018, 120 minutes, 26 questions, 100 points Name: CS520 Final Exam 12 December 2018, 120 minutes, 26 questions, 100 points The exam is closed book and notes. Please keep all electronic devices turned off and out of reach. Note that a question may

More information

Ahead of Time (AOT) Compilation

Ahead of Time (AOT) Compilation Ahead of Time (AOT) Compilation Vaibhav Choudhary (@vaibhav_c) Java Platforms Team https://blogs.oracle.com/vaibhav Copyright 2018, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement

More information

Portable Resource Control in Java The J-SEAL2 Approach

Portable Resource Control in Java The J-SEAL2 Approach Portable Resource Control in Java The J-SEAL2 Approach Walter Binder w.binder@coco.co.at CoCo Software Engineering GmbH Austria Jarle Hulaas Jarle.Hulaas@cui.unige.ch Alex Villazón Alex.Villazon@cui.unige.ch

More information

Machine Program: Procedure. Zhaoguo Wang

Machine Program: Procedure. Zhaoguo Wang Machine Program: Procedure Zhaoguo Wang Requirements of procedure calls? P() { y = Q(x); y++; 1. Passing control int Q(int i) { int t, z; return z; Requirements of procedure calls? P() { y = Q(x); y++;

More information

JSR 292 Cookbook: Fresh Recipes with New Ingredients

JSR 292 Cookbook: Fresh Recipes with New Ingredients JSR 292 Cookbook: Fresh Recipes with New Ingredients John Rose Christian Thalinger Sun Microsystems Overview Got a language cooking on the JVM? JSR 292, a set of major changes to the JVM architecture,

More information

Defining a High-Level Programming Model for Emerging NVRAM Technologies

Defining a High-Level Programming Model for Emerging NVRAM Technologies Defining a High-Level Programming Model for Emerging NVRAM Technologies Thomas Shull, Jian Huang, Josep Torrellas University of Illinois at Urbana-Champaign September 13, 2018 Shull et al. Defining a High-Level

More information

Accelerating Ruby with LLVM

Accelerating Ruby with LLVM Accelerating Ruby with LLVM Evan Phoenix Oct 2, 2009 RUBY RUBY Strongly, dynamically typed RUBY Unified Model RUBY Everything is an object RUBY 3.class # => Fixnum RUBY Every code context is equal RUBY

More information