Safely Abstracting Memory Layouts

Modern architectures require applications to make effective use of caches to achieve high performance and hide memory latency. This in turn requires careful consideration of placement of data in memory to exploit spatial locality, leverage hardware prefetching and conserve memory bandwidth. In unmanaged languages like C++, memory optimisations are common, but at the cost of losing object abstraction and memory safety. In managed languages like Java and C#, the abstract view of memory and proliferation of moving compacting garbage collection does not provide enough control over placement and layout. We have proposed SHAPES, a type-driven abstract placement specification that can be integrated with object-oriented languages to enable memory optimisations. SHAPES preserves both memory and object abstraction. In this paper, we formally specify the SHAPES semantics and describe its memory safety model.

[1]  Zhong Shao Flexible representation analysis , 1997, ICFP '97.

[2]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA 2009.

[3]  James Noble,et al.  Ownership types for flexible alias protection , 1998, OOPSLA '98.

[4]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 1999, OOPSLA '99.

[5]  Dave Clarke,et al.  Ownership Types: A Survey , 2013, Aliasing in Object-Oriented Programming.

[6]  Sally A. McKee,et al.  Hitting the memory wall: implications of the obvious , 1995, CARN.

[7]  Jan Vitek,et al.  Loci: Simple Thread-Locality for Java , 2009, ECOOP.

[8]  Martin Odersky,et al.  Automating ad hoc data representation transformations , 2015, OOPSLA.

[9]  Perry Cheng,et al.  The garbage collection advantage: improving program locality , 2004, OOPSLA.

[10]  Vikram S. Adve,et al.  Automatic pool allocation: improving performance by controlling data structure layout in the heap , 2005, PLDI '05.

[11]  Xavier Leroy,et al.  Unboxed objects and polymorphic typing , 1992, POPL '92.

[12]  Milind Kulkarni,et al.  Data structure-aware heap partitioning , 2017, CC.

[13]  Sophia Drossopoulou,et al.  You can have it all: abstraction and good cache performance , 2017, Onward!.

[14]  Sophia Drossopoulou,et al.  Behavioural types for non-uniform memory accesses , 2015, PLACES.

[15]  Frank Pfenning,et al.  A type theory for memory allocation and data layout , 2003, POPL '03.

[16]  Guy L. Steele,et al.  The Java Language Specification, Java SE 8 Edition , 2013 .

[17]  Chris Lattner,et al.  Data Structure Analysis: A Fast and Scalable Context-Sensitive Heap Analysis , 2003 .

[18]  Peter Thiemann,et al.  Unboxed values and polymorphic typing revisited , 1995, FPCA '95.

[19]  Chandra Krintz,et al.  Cache-conscious data placement , 1998, ASPLOS VIII.