ass6

1
Hemanth M 2013503064 System Software Internals Assignment 6 Comprehensive comparison between JVM and CLI: JVM – Java Virtual Machine CLI – Common Language Infrastructure CLI implementations and JVM implementations couldn’t be more different. While at first glance they appear very similar, they both have an intermediate language and they both use a JIT, the similarities seem to end there. CLI implementations have been designed to apply classic compiler optimizations using code analysis techniques just like those found in a typical C++ compiler. For example their approach for method inlining is very simple. They also JIT all code once on first use. They can do this as most of the CLI languages have been designed for compilation using classic analysis techniques. JVMs, on the other hand, use runtime knowledge to decide what to optimize. Rather than using the classic techniques they guess a lot (e.g. on whether a method can be inlined) and they have to keep these guesses around in case they load a class that invalidates them. They also have different levels of optimizations that they perform, saving the most aggressive for code that is getting used the most (i.e. the hotspots). They use these approaches as the class loading rules in java make the application of code analysis techniques virtually impossible. So which is better?, I think the jury is still out, and they both have strong supporters. However, CLI implementations have one big advantage over JVMs. As they rely on classic static analysis CLI modules can be ahead of time compiled to native binaries. This brings many advantages such as improved startup and better memory sharing between processes, the latter being a key requirement if multiple applications are being run on a single workstation. As such, the forthcoming language level changes for Java modularity along with the corresponding changes to the runtime provide a unique opportunity. They could be designed as a static module system like the one in the CLI. To do this they would need to change the classloading rules for classes in modules, but this would allow JVM implementations to ahead of time compile java modules to native code bringing all the advantages I mentioned above. ===

Upload: hemanth

Post on 03-Dec-2015

215 views

Category:

Documents


2 download

DESCRIPTION

my assessment document

TRANSCRIPT

Page 1: Ass6

Hemanth M2013503064

System Software InternalsAssignment 6

Comprehensive comparison between JVM and CLI:

JVM – Java Virtual MachineCLI – Common Language Infrastructure

CLI implementations and JVM implementations couldn’t be more different. While at first glance they appear very similar, they both have an intermediate language and they both use a JIT, the similarities seem to end there.

CLI implementations have been designed to apply classic compiler optimizations using code analysis techniques just like those found in a typical C++ compiler.

For example their approach for method inlining is very simple. They also JIT all code onceon first use. They can do this as most of the CLI languages have been designed for compilation using classic analysis techniques.

JVMs, on the other hand, use runtime knowledge to decide what to optimize. Rather than using the classic techniques they guess a lot (e.g. on whether a method can be inlined) and they have to keep these guesses around in case they load a class that invalidates them. They also have different levels of optimizations that they perform, saving the most aggressive for code that is getting used the most (i.e. the hotspots). They use these approaches as the class loading rules in java make the application of code analysis techniques virtually impossible.

So which is better?, I think the jury is still out, and they both have strong supporters.

However, CLI implementations have one big advantage over JVMs. As they rely on classicstatic analysis CLI modules can be ahead of time compiled to native binaries. This brings many advantages such as improved startup and better memory sharing between processes, the latter being a key requirement if multiple applications are being run on a single workstation.

As such, the forthcoming language level changes for Java modularity along with the corresponding changes to the runtime provide a unique opportunity. They could be designed as a static module system like the one in the CLI. To do this they would need to change the classloading rules for classes in modules, but this would allow JVM implementations to ahead of time compile java modules to native code bringing all the advantages I mentioned above.

===