SUMMARY A widespread practice to implement a flexible array is to consider the storage area into two parts: the used area, which is already available for read/write operations, and the supply area, which is used in case of enlargement of the array. The main purpose of the supply area is to avoid as much as possible the reallocation of the whole storage area in case of enlargement. As the supply area is not used by the application, the main idea of the paper is to convey the information to the garbage collector, making it possible to avoid completely the marking of the supply area. We also present a simple method to analyze the types of objects, which are stored in an array as well as the possible presence of NULL values within the array. This allows us to better specialize the work of the garbage collector when marking the used area, and also, by transitivity, to improve overall results for type analysis of all expressions of the source code. After introducing several abstract data types, which represent the main arrays concerned by our technique (i.e., zero or variable indexing, circular arrays and hash maps), we measure its impact during the bootstrap of two compilers whose libraries are equipped with these abstract data types. We then measure, on various software products we have not written, the frequency of certain habits of manipulation of arrays, to assess the validity of our approach. Copyright {\copyright} 2014 John Wiley \& Sons, Ltd.
翻译:摘要 实现灵活数组的一种常见做法是将存储区域划分为两部分:已用区域(可用于读写操作)与备用区域(用于数组扩容场景)。备用区域的主要目的是尽可能避免扩容时对整个存储区域的重新分配。由于应用程序并不使用备用区域,本文的核心思想是将该信息传递给垃圾回收器,从而完全避免对备用区域的标记操作。我们还提出了一种简单方法,用于分析数组中存储的对象类型以及数组中可能存在的空值。这使得我们能够更好地专化垃圾回收器对已用区域的标记工作,并通过传递性,改善源代码所有表达式的类型分析整体结果。在介绍了代表本技术所涉及主要数组类型的若干抽象数据类型(即零索引与变索引数组、循环数组及哈希映射)之后,我们测量了在搭载这些抽象数据类型的库的两个编译器引导过程中的影响。随后,我们在非自主研发的多款软件产品上,测量了某些数组操作习惯的出现频率,以评估我们方法的有效性。版权 © 2014 John Wiley & Sons, Ltd.