Browse Prior Art Database

Passing Arguments and Returning Function Values in Global Virtual Registers

IP.com Disclosure Number: IPCOM000009701D
Publication Date: 2002-Sep-11
Document File: 2 page(s) / 23K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method that uses inter-procedural analysis and register allocation on a full program to improve the performance of argument passing. The disclosed method is particularly useful for smaller-sized programs with code space limitations.

This text was extracted from a Microsoft Word document.
This is the abbreviated version, containing approximately 71% of the total text.

Passing Arguments and Returning Function Values in Global Virtual Registers

Disclosed is a method that uses inter-procedural analysis and register allocation on a full program to improve the performance of argument passing. The disclosed method is particularly useful for smaller-sized programs with code space limitations.

Background

Currently, compilers pass arguments to functions on a stack in memory, in specific pre-determined physical registers, or by using a combination of the two.

General Description

The disclosed method assigns one or more global virtual registers to each formal argument of a function (based on argument size), then passes the actual arguments by copying to these registers at each call site (see Figure 1). If the formal argument address is taken or if the function can be called recursively, the argument is passed in virtual registers and the function copies the argument to the stack; in the non-recursive case, the argument is copied to a static memory location.

Advantages

The following are advantages of the disclosed method:

§         The disclosed method obtains better runtime performance.

§         The argument registers of a function do not interfere with each other as they would if fixed registers were used.

§         Copy propagation removes argument copies at the call site when the actual argument value is already in a register.

§         The spilling mechanisms automatically handle argument lists that are too large to pass
in registers.

for each function in the program

� �...