





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of Compiler Design are: Optimizations, Software Application, Development, Maintenance, Resource Intensive, Standardization, Platforms, Substantial Rewriting, Development Environment, Paradigms
Typology: Slides
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















Software application development and maintenanceare time and resource intensive Lack of standardization among platforms Porting is cumbersome, requires substantial rewriting ofprograms Need for a development environment enabling fasterand easier development Two paradigms Component software Virtual machine based execution
Simulated in software Provides developers with useful run-timeservices independent of host hardware Absolves developers from dealing with platform-specific issues while porting applications This model enables increased developer efficiency,shorter development cycles, and higher levels ofscalabilitity and extensibility
Checks security violations by components Components can be dynamically loaded andlinked Provides automatic memory management andgarbage collection Provides architecture-independent interfacefor exception handling
Run-time overheads due to extra layer ofsoftware Dynamic loading, garbage collection, securitychecks, are all expensive Instruction interpretation overheads are thehighest Unacceptably slow in high-performanceenvironments Just-In-Time Compilation is a good solution
Intermediate code is converted to native codeon the fly Units are compiled just before their first use Compiled code is cached and reused for lateruses
Code generation time adds to executionoverheads
Lowest level – simplest optimizations Highest level – most expensive optimizations Hotness of a method determines the level Very hot methods being very few, overheadsof expensive optimizations are not felt andexecution speed improves for futureinvocations Hot methods are found by on-line profiling
The VM controls profiling and optimizations Profiles drive the optimizations No more the developer’s burden Profiling adds its own overheads May negate benefits of optimization Accuracy of profiling can be reduced resulting inreduced overheads This may also reduce the effectiveness ofoptimizations Tradeoff (accuracy v/s overheads)
Common Language Infrastructure (CLI) Standardized specification of a virtualexecution environment Defines an environment where componentscreated in several HLLs can interact in asecure and well-defined manner, irrespectiveof the platform on which the environmentruns CLI-consistent compilers generate a
Common Language Infrastructure (CLI) CIL is a platform independent stack-based instructionset incorporates features from both object-oriented andprocedural programming domains At the heart of any implementation of CLI is thecommon language runtime (CLR) CLR is responsible for loading components and managingtheir execution CLR provides exeception handling, garbage collection,thread management, remoting and type safety services
Exec Mgr JIT Cmplr 1 JIT Mgr 1^ Code Mgr 1 JIT Mgr 2 JIT Cmplr 2 Code Mgr 2 Baseline JIT Our JIT
ROTOR has a baseline JIT compiler Performs JIT compilation and IL code typeverification Each incorporates a JIT manager, a codemanager and a JIT code generator Several such JIT compilers can be included inROTOR Execution manager controls JIT compilers
We extend the CLR with an optimizing JIT compiler Two levels of profile-guided recompilation First level based on a sampling profiler Second level based on edge and call-graph profiling Profiler interface available
Profilers Recompilation Controller Optimizing JIT Compiler Subsystem Profile Database Baseline JIT Compiler Native Code Extended CLR