Self-Contained%20CLI%20Assemblies - PowerPoint PPT Presentation

About This Presentation
Title:

Self-Contained%20CLI%20Assemblies

Description:

Compile to native code e.g. CIL front-end. no VM features: gc, sandbox ... Kernel Profile is smallest CLI conforming CLR. Base Class Library (BCL) 145 types ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 16
Provided by: bern141
Category:

less

Transcript and Presenter's Notes

Title: Self-Contained%20CLI%20Assemblies


1
Self-Contained CLI Assemblies
  • Dipl.-Inf. Bernhard Rabe
  • Operating Systems Middleware Group
  • Hasso-Plattner-Institute
  • University of Potsdam

2
Outline
  • Motivation
  • Self-contained Assemblies
  • Micro.NET
  • Adaptive Linking
  • Conclusions

3
Motivation
  • Common Language Infrastructure (CLI) features
  • Loose coupling
  • Dynamic linking is required at load time
  • fusion engine (.dll vs. .exe)
  • Byte code consistency is verifiable
  • Execution behavior depends on Base Class Library
    (BCL) implementation (.NET, Rotor, Mono, )
  • Comprehensive class library
  • High memory requirements of runtime environment

4
C Example
  • public static int Main(string args)
  • Object objnew Object()
  • return 1

5
Dynamic Linking
usercode.exe
mscorlib.dll
newobj 0x0a000001 pop ldc.i4.1 ret
Main
.ctor
6
Micro.NET
  • CLR library independent deployment format
  • Self-contained assemblies
  • IL interpreter for small embedded devices (Lego
    Mindstorm)
  • Micro.NET deals with .NET for resource limited
    systems
  • memory
  • processing power

7
Runtime Memory Footprint
  • Assembly
  • Custom Library assemblies
  • Base Class Library
  • CLR

Self-contained Assembly
8
Self-contained Assemblies
  • No external references
  • BCL independent
  • Fewer memory consumption
  • Metadata of assemblies
  • Reduced startup delay
  • type resolving
  • Optimizations under investigation
  • Whole program analysis
  • Metadata
  • Optimizations without Common Language Runtime
    (CLR) modifications

9
Avoiding Dynamic Linking
  • Compile to native code e.g. CIL front-end
  • no VM features gc, sandbox
  • code verification is challenging
  • platform dependent
  • Reduce the number of assemblies/references
  • combine assemblies
  • Streamlining dynamic linking

10
Adaptive Linking
library
library
usercode.exe
self-contained assembly
Base Class Library
11
Adaptive Linking
  • PERWAPI library based linker tool
  • Combine referenced types into a self-contained
    assembly
  • Types are processed recursively
  • Fine granular linking (type level)
  • Queensland University of Technology (QUT),
    Australia

12
CIL of C example (excerpt)
.class a .method public hidebysig
specialname rtspecialname instance void .ctor()
cil managed .method public hidebysig
static void Main(string args) cil managed
.entrypoint .maxstack 1 newobj
instance void mscorlibSystem.Object.ctor()
pop ldc.i4.1 ret
13
Self-contained (excerpt)
.class Hello .method public hidebysig
specialname rtspecialname instance void .ctor()
cil managed .method public hidebysig
static void Main(string args) cil managed
newobj instance void
System.Object.ctor() .class
System.Object .method public hidebysig
specialname rtspecialname instance void .ctor()
cil managed .method family hidebysig
virtual instance void Finalize() cil managed

14
Results
  • PoCs run on Rotor, Mono, and Portable.NET without
    CLR modfications
  • None CLR portable features
  • internalcall
  • System.ObjectEquals(object obj) .NET vs. Mono
  • runtime
  • pinvokeimpl
  • Necessity for an highly portable BCL
  • Source for Self-contained Assemblies

15
Conclusion
  • Self-contained assemblies
  • .NET on resource constrained systems
  • reduced resource consumption
  • Optimized deployment format for resource limited
    systems
  • No CLR modifications required

16
CLR Memory Footprint
  • Kernel Profile is smallest CLI conforming CLR
  • Base Class Library (BCL)
  • 145 types (ECMA 335 2nd)
  • Runtime library
  • 42 types (ECMA 335 2nd)
  • BCL is embedded in mscorlib.dll
  • mscorlib.dll (? 400Kb Compact Framework 1.0)
  • mscorlib.dll (? 1.6Mb SSCLI 1.0)
Write a Comment
User Comments (0)
About PowerShow.com