This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
VES: The Virtual Execution System
NGWS runtime provides an Execution Engine (EE) that creates the Virtual Execution System (VES) needed to implement the Virtual Object System. See the EE Architecture Specification for details of the runtime execution model as seen from a programmer's perspective.
The important components of the VES are:
- An Intermediate Language (IL) that can be easily and effectively targeted by a wide range of compilers. See Intermediate Language (IL)
- Loading managed code (i.e., code written in accordance to VES requirements) including resolving names, performing class layout, and creating stubs needed to transition between managed and unmanaged code. See Loading Managed Code.
- Conversion of IL into native code, including when a method is first invoked (JIT compilation). See Conversion of IL into Native Code.
- Verification of the type safety of methods written in IL as well as the integrity of the metadata describing those methods. See Verification of Implementation Code.
- Services based on stack format: garbage collection of memory containing managed data, and initiation, propagation, and intercepting exceptions. See Services Based on Stack Format.
- Insertion and management of security tests based on code identity, type safety, and administrative (trust management) controls. See Security Services.
- Profiling and debugging services, including mapping native code instruction addresses back to IL addresses and lengthening the lifetime of local variables. See Profiling and Debugging Services.
- Management of threads, contexts, and remoting. See Delegates
- The VES provides the implementation for a set of types known as delegates. Delegates are the object-oriented equivalent of function pointers. Unlike function pointers, delegates are object-oriented, type-safe, and secure. Delegates are created by defining a class that derives from the base type System.Delegate. Each particular type of delegate provides a method named Invoke with appropriate parameters, and each instance of a delegate forwards calls to its Invoke method to a compatible static or instance method on a particular object. The object and method to which it delegates are chosen when the delegate instance is created.
- In addition to an instance constructor and an Invoke method, delegates may optionally have two additional methods: BeginInvoke and EndInvoke. These are used for asynchronous calls and are described in a separate specification.
- While, for the most part, delegates appear to be simply another kind of user defined class, they are tightly controlled. The implementations of the methods are provided by the VES, not user code. Also, the user can specify no additional members; the definition of a delegate is really no more than the signature of the method to which it forwards its calls.
- Proxies, Contexts, and Remoting.