Presentation is loading. Please wait.

Presentation is loading. Please wait.

SSCLI (Shared Source Common Language Infrastructure) (code name: Rotor)

Similar presentations


Presentation on theme: "SSCLI (Shared Source Common Language Infrastructure) (code name: Rotor)"— Presentation transcript:

1 SSCLI (Shared Source Common Language Infrastructure) (code name: Rotor)

2 Terms, Abbreviations: CLI SSCLI CLR = Common Language Runtime ECMA = European Computer Manufacturers Association

3 History: Initial goal: COM needed a companion runtime; a core set of modern services Final product:a complete, general-purpose virtual execution engine Standardization effort: ECMA 5 years later

4 What is CLI? (first view) approach to building software that enables code from many independent sources to coexist and interoperate safely; a virtual computational model that can be brought up safely within existing host environments and can expose the native capabilities of these environments directly;

5 SSCLI and CLR VS.NET Common Language Runtime System System.Data (ADO.NET)System.Xml Design ADO Adapters SQL Globalization Diagnostics Configuration Collections Resources Reflection Net IO Threading Text ServiceProcess SecurityRuntime InteropServices Remoting Serialization XPath XSLT Serialization System.Drawing JIT GC MSIL App Domain Loader Common Type SystemClass Loader System.Web Configuration SessionState Caching Security System.Web.Services Description Protocols UI HtmlControls WebControls Discovery C# VC/MC++ Imaging Drawing2D Text Printing JScript VB Operating System or Platform Abstraction Layer Boot Loader SyncThreads Networking TimersFilesystem System.WinForms DesignComponentModel Debugger Designers SDK Tools CorDBG ILAsm ILDbDump SN ILDAsm MetaInfo PEVerify ECMA-335

6 SSCLI vs.NET Framework (CLR) JIT and garbage collector replaced with more portable, approachable implementations Windows-specific features not included: COM interoperability, WinForms, other integration also not included: ADO.NET, enterprise services, NGEN (JIT-ahead), ASP.NET

7 What is CLI? (second view) 1.A common type system different types in different components are represented in a unique way enables language integration 2.Execution engine  virtual machine with garbage collection and exception handling execution is assisted by code that runs with your own code

8 3.Integral security system with verification malicious component cannot run ! cannot hurt other components 4.File format PE/COFF format with extensions (executable format) an extensible metadata system – file implementing a type is saved 5.Intermediate language CLI – a way independent of processor to represent behavior

9 6.A factored class library a “modern” equivalent to C runtime 7.Access to underlying platform PAL = Platform Adaptation Layer interoperability between languages

10 SSCLI include: JScript compiler – shows dynamic techniques (in C#) C# compiler – shows nearly all runtime features IL Assembler – shows low-level API implementation and use

11 CLI is: –a standard specification for a virtual execution environment –a data-driven architecture data are called metadata – used by developer tools to describe behavior of software, has in- memory characteristics CLI execution engine uses metadata to enable components from different sources to be loaded together safely

12 Assemblies (abstract types + behavior) executables are loaded + validated comp. metadata is loaded in isolation comp. types are verified, laid out + compiled exec.engine uses data on stack + heap to maintain control of the code that has tailored for the local OS+processor

13 Conclusion: CLI resembles the traditional toolchain of compiler, linker and loader as it performs in-memory layout, compilation, symbolic resolution

14 Execution scheme of.NET Compiler Source code IL & Metadata Class Loader Class Libraries (IL & Metadata) JIT Compiler with optional verification Managed Native Code Trusted, pre-JITed code only Execution Call to an uncompiled method Runtime Engine

15 Fudamentals Concepts in CLI Specification 1.Types: describe fields and properties that hold data + methods and events that describe behavior strong typed = each variable, object a.s.o. has a type

16 .NET common type system

17 Unique representation of data types must be adopted CLR (CLI) type system is divided into two subsystems: –Value types –Reference types Ma jor distinction: value types have no concept of identity; –Value type is a sequence of bits in memory –Reference type is a combination of a location, its identity, and a sequence of bits.

18 Value types Many inbuilt data types are value types, but not limited to that; Are often allocated on the run time stack, but can be allocated to headp also (data member of an object type) User-defined structures and classes can be value types and can contain: –methods (both class and instance) –fields (both class and instance) –properties –events

19 not possible to have a value type inherit from another value type; in.NET Framework terminology, value type is sealed for all value types, there exists a corresponding object type = boxed type. Values of any value type can be boxed and unboxed: –boxing a value type – copies the data from the value into an object with a corresponding boxed type, allocated on the garbage-collection heap; –unboxing a value type – copies the data from the boxed object into a value why? : have benefits of object types (may support interface types)

20 Example: #using using namespace System; _value public class VTPoint {public:int m_x, m_y; }; int main(void) { VTPoint a;// on stack VTPoint *ptr = new VTPoint();// on heap – illegal! _box VTPoint *VTptr = _box(a)// box VTptr->m_x = 42; VTPoint b = *dynamic_cast (VTptr);// unbox b.m_y = 42; Console::Writeline(b.m_x); Console::Writeline(b.m_y); }

21 Shared source CLI: http://msdn.microsoft.com/net/sscli ECMA specs: http://msdn.microsoft.com/net/ecma Microsoft commercial C# and CLR SDK http://msdn.microsoft.com/downloads Shared source info: http://www.microsoft.com/sharedsource http://www.microsoft.com/windows/embedded/ce


Download ppt "SSCLI (Shared Source Common Language Infrastructure) (code name: Rotor)"

Similar presentations


Ads by Google