Browse Prior Art Database

An Object Layout for Architectures with Strict Alignment Requirements

IP.com Disclosure Number: IPCOM000015296D
Original Publication Date: 2001-Oct-13
Included in the Prior Art Database: 2003-Jun-20
Document File: 2 page(s) / 62K

Publishing Venue

IBM

Abstract

A class declaration includes zero or more member declarations and optionally but typically specifies its direct superclass. Given a class declaration, the object layout determines how its zero or more instance fields are placed in memory.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 61% of the total text.

Page 1 of 2

An Object Layout for Architectures with Strict Alignment Requirements

   A class declaration includes zero or more member declarations and optionally but typically specifies its direct superclass. Given a class declaration, the object layout determines how its zero or more instance fields are placed in memory.

The object layout must satisfy two constraints, inheritance constraint and alignment constraint. The former requires the layout of a class to be completely based on the layout of its superclass, while the latter requires each instance field to be put in memory according to the architectural alignment constraint defined by its data type.

The conventional layout of a class allocates a memory region for its own instance members next to the memory region for its superclass, thereby satisfying the inheritance constraint. Within the memory region, it places its own instance members in the declaration order, with pads where necessary, thereby meeting the alignment constraint.

We propose a new method which allows a highly space-efficient layout. Given the declaration of a class, it performs the following steps;

(1) Sort the instance fields of the class in the decreasing order of alignment constraints. Let the resulting list be FL.

(2) Sort the pads in the layout of the superclass in the deceasing order of the size. Let the resulting list be PL.

(3) For each instance field in FL, search PL for a pad which is smaller than or equal to the size of the instance field. If f...