A Microsoft .NET Front-End for GCC - PowerPoint PPT Presentation

About This Presentation
Title:

A Microsoft .NET Front-End for GCC

Description:

primitive data types, enums. classes, attributes (static, ... Future Work. Real-time extensions (Real-Time .Net) interfaces, reflection, exception handling ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 17
Provided by: bern141
Category:
Tags: gcc | net | end | front | martin | microsoft

less

Transcript and Presenter's Notes

Title: A Microsoft .NET Front-End for GCC


1
A Microsoft .NET Front-End for GCC
  • Bernhard Rabe
  • Martin von Löwis
  • Jan Möller
  • Operating Systems Middleware Group
  • Hasso-Plattner-Institute, University of Potsdam

2
Outline
  • Motivation
  • GCC
  • CIL Front-End
  • Targets
  • Internals
  • Example
  • Status
  • Conclusions

3
Vision
  • Extending the reach of Middleware
  • Today
  • What else?

4
GNU Compiler Collection
C
x86 asm
GCC
  • Different programming languages (C, C, Java,
    Ada,)
  • Various (micro)processor architectures (H8300,
    ARM, AVR, i386, )
  • Easy extensibility to new architectures

C
mips asm
RTL
Java
arm asm
Front-ends
Back-ends
5
CIL Front-End
C
x86 asm
.NET Compiler
GCC
C
IL Assembly
h8/300 asm
  • We use the Portable.NET IL libraries to read
    .NET assemblies
  • Transforms IL code into GCC internal tree
    representation
  • memory layout of objects
  • vtables and emits RTL code for each method
  • All .NET concepts except dynamic loading can be
    supported

VB
6
Target platforms
  • Lego Mindstorm Robots
  • Lego.NET
  • RCX 2.0 (Renesas H8/300, 16Bit, 16 Mhz)
  • 32K RAM
  • no floating point support
  • Real-Time Control System
  • Real-Time .Net
  • Windows CE (x86,600 Mhz)
  • Thread support (delegates)
  • (Hard) real-time constraints (Higher Striker)

7
Implementation Internals
  • Runtime system for each supported target
  • Mono application binary interface (ABI)
  • object layout (MonoObject)
  • string and array layout
  • vtable layout
  • method calling convention
  • Floating point support (emulation or hardware if
    available)
  • support only beforefieldinit classes
  • anytime before first access
  • initialization is done at program start

8
excerpt from example.cs
  • cab3 tree nodes
  • ldloc.0
  • ldloc.1
  • ldc.i4.3
  • mul
  • add
  • stloc.2

VAR_DECL LOC0
VAR_DECL LOC1
INTEGER_CST 3
MUL_EXPR
9
excerpt from example.cs
  • cab3 tree nodes
  • ldloc.0
  • ldloc.1
  • ldc.i4.3
  • mul
  • add
  • stloc.2

VAR_DECL LOC0
VAR_DECL LOC1
INTEGER_CST 3
MUL_EXPR
ADD_EXPR
10
excerpt from example.cs
  • cab3 tree nodes
  • ldloc.0
  • ldloc.1
  • ldc.i4.3
  • mul
  • add
  • stloc.2

VAR_DECL LOC0
VAR_DECL LOC1
INTEGER_CST 3
MUL_EXPR
ADD_EXPR
VAR_DECL LOC2
11
excerpt from example.cs
  • cab3 tree nodes
  • ldloc.0
  • ldloc.1
  • ldc.i4.3
  • mul
  • add
  • stloc.2

VAR_DECL LOC0
VAR_DECL LOC1
INTEGER_CST 3
MUL_EXPR
ADD_EXPR
VAR_DECL LOC2
MODIFY_EXPR
12
excerpt from example.cs
  • cab3 tree nodes
  • ldloc.0
  • ldloc.1
  • ldc.i4.3
  • mul
  • add
  • stloc.2

VAR_DECL LOC0
VAR_DECL LOC1
INTEGER_CST 3
MUL_EXPR
ADD_EXPR
VAR_DECL LOC2
MODIFY_EXPR
expand_expr(MODIFY_EXPR) Backend emits assembly
language
13
gcc O2 S example.dll
  • x86 Backend, excerpt from example.s
  • movl 12(ebp), eax eax b
  • leal (eax,eax,2), eax eax eax2eax
  • addl 8(ebp), eax eax a

14
Supported Constructs
  • primitive data types, enums
  • classes, attributes (static, instance),
    properties, inheritance
  • methods (static, instance), parameters, local
    variables and constructors
  • arrays and strings
  • delegates
  • arithmetic operations
  • control flow operations (conditional,
    unconditional branch, switch)

15
Conclusions
  • CIL front-end for GCC
  • Support for target processors not supported
    otherwise (commercial framework, or compact
    framework)
  • Programming Lego Mindstorms Robots
  • http//www.dcl.hpi.uni-potsdam.de/research/lego.NE
    T/
  • Future Work
  • Real-time extensions (Real-Time .Net)
  • interfaces, reflection, exception handling
  • GC

16
  • Questions?
  • gcc_at_hpi.uni-potsdam.de
Write a Comment
User Comments (0)
About PowerShow.com