1 / 21

SSCLI (Shared Source Common Language Infrastructure)

SSCLI (Shared Source Common Language Infrastructure). (code name: Rotor). Terms, Abbreviations:. CLI SSCLI CLR = Common Language Runtime ECMA = European Computer Manufacturers Association. History:. Initial goal : COM needed a companion runtime; a core set of modern services

dysis
Download Presentation

SSCLI (Shared Source Common Language Infrastructure)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

  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) • A common type system • different types in different components are represented in a unique way • enables language integration • Execution engine •  virtual machine with garbage collection and exception handling • execution is assisted by code that runs with your own code

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

  9. A factored class library • a “modern” equivalent to C runtime • 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 calledmetadata – 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 Source code Compiler IL & Metadata Class Libraries (IL & Metadata) Class Loader JIT Compiler with optional verification Trusted, pre-JITed code only Call to an uncompiled method Managed Native Code Runtime Engine Execution

  15. Fudamentals Concepts in CLI Specification • 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 <mscorlib.dll> 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<VTPoint*>(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

More Related