Browse Prior Art Database

Semidynamic Checking of Domain and Range Constraints on Subroutine Calls and Returns, and the Recovery in some Cases

IP.com Disclosure Number: IPCOM000082728D
Original Publication Date: 1975-Jan-01
Included in the Prior Art Database: 2005-Feb-28
Document File: 2 page(s) / 10K

Publishing Venue

IBM

Related People

Blair, FW: AUTHOR [+2]

Abstract

All present methods of compilation exhibit one of three methods of coping with and utilizing domain and range constraints over subroutine linkages; they are: 1) Doesn't cope. 2) Static program analysis. 3) Dynamic checking.

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

Page 1 of 2

Semidynamic Checking of Domain and Range Constraints on Subroutine Calls and Returns, and the Recovery in some Cases

All present methods of compilation exhibit one of three methods of coping with and utilizing domain and range constraints over subroutine linkages; they are:
1) Doesn't cope.
2) Static program analysis.
3) Dynamic checking.

Each of these methods has its merits and shortcomings known to the programming art. Method 2 is inflexible and 3 is expensive. To these a fourth method is described which is a compromise between the second and third, that is, it is flexible and inexpensive. Assume a calling routine A and a called routine B, not necessarily defined together. The method consists of having associated in the call in A, an encoded description of the arguments that A transmits. This is known at the time that A is defined. Associated with B is a corresponding key which encodes the classes of the arguments that B can accept.

In the process of transfering control from A to B, a simple logical AND operation is sufficient to verify type compatibility of the most frequently used data-types. The encoding scheme proposed provides for the treatment of large numbers of arguments or infrequently used types, by degrading to method 3 in these cases.

A concrete illustration of a possible use of these encodings on an IBM 360 or 370 series computer for the programming language LISP is given below. Function to Function linkage argument type checking.

First, the caller provides a 64-bit field describing the arguments it has prepared. Then the callee has a 64-bit field describing the arguments it expects. The linkage routine then AND's these two fields together. If the result is zero it runs the callee directly; if the result is nonzero it has to do further checking. A quantity is described by an 8-bit field. The bits correspond to the following predicates on the quantity:
1. LIST CELL
2. VECTOR
3. ID
4. FLOAT NUM
5. BIG FIX NUM
6. SMALL (VIRTUAL) INTEGER
7. OTHER
8. ILLEGAL.

The ILLEGAL bit is used to signify nonexistence. Note that the entire domain of value classes present in the LISP language is the direct sum of these 8 subclasses. The sender of a quantity sets up a map wi...