Pre-compilation for .NET Generics

نویسندگان

  • Andrew Kennedy
  • Don Syme
چکیده

The Microsoft .NET Common Language Runtime (CLR) supports pre-compilation in order to help avoid the slow application start-up times and unnecessarily high memory usage often associated with virtual machine (VM) execution, However, Version 2 of the .NET Common IL (CIL) also supports generics, i.e. type parameters for data and code, in part implemented using template-expansion techniques, and the use of dynamic compilation for generics would threaten the gains of pre-compilation. We describes techniques to support the pre-compilation of generic CIL code, resulting in the first language implementations to support the combination of dynamic loading, pre-compilation and typeparameterization over unboxed representations. We discuss the load-time techniques used to resolve potential duplication and optimizations based on “preferred pre-compilation modules”. We give performance results relating to code-size, code-duplication and start-up times as observed in our implementation of the techniques, aspects of which have been shipped in recent releases of v2.0 the Microsoft .NET CLR.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Combining Generics, Pre-compilation and Sharing Between Software-Based Processes

We describe problems that have arisen when combining the proposed design for generics for the Microsoft .NET Common Language Runtime (CLR) with two resource-related features supported by the Microsoft CLR implementation: application domains and pre-compilation. Application domains are “software based processes” and the interaction between application domains and generics stems from the fact tha...

متن کامل

Type Safety of Generics for the .NET Common Language Runtime

The Microsoft .NET Common Language Runtime (CLR) offers support for generic types and methods. We develop a mathematical specification for the generics design through a type system and a model for the semantics of a subset of bytecode instructions with generics. We formalize the type-consistency checks performed for the subset by the CLR bytecode verifier. We then prove that adding support for ...

متن کامل

The Cost of Erasure in Java Generics Type System

Java generics, found in versions 1.5 and later, are implemented by generating only one byte code representation of a generic type or method; a compiler maps all the instantiations of a generic type or method to that unique representation via type erasure. The essence of type erasure is the removal during compilation of all information that is related to type parameters and type arguments. From ...

متن کامل

Structural Type Inference in Java-like Languages

In the past we considered type inference for Java with generics and lambdas. Our type inference algorithm determines nominal types in subjection to a given environment. This is a hard restriction as separate compilation of Java classes without relying on type informations of other classes is impossible. In this paper we present a type inference algorithm for a Java-like language, that infers st...

متن کامل

An extended comparative study of language support for generic programming

Many modern programming languages support basic generics, sufficient to implement type-safe polymorphic containers. Some languages have moved beyond this basic support, and in doing so have enabled a broader, more powerful form of generic programming. This paper reports on a comprehensive comparison of facilities for generic programming in eight programming languages: C++, Standard ML, Objectiv...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2005