[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Differences OOC <-> [Bra95]



[this is a copy of the file frontend/doc/Differences]

#	$Id: Differences,v 1.1 1995/12/17 12:20:44 oberon1 Exp $

This file lists the mayor differences between the code generated by
the OOC front-end and [Bra95].  I hope that it is fairly complete.
In the absence of proper documentation the file frontend/Opcode.Mod
serves as further reference.  

* new: variable $store (create, delete, access, aliasing)
Pseudo variable that represents the space that is resp. may be shared
by nonlocal variables, heap objects, and variable parameters.  $store
is always relative to a procedure or module block, created at the
beginning of the block and deleted at its end.  $store is never part
of an enter or exit instruction.  It is used to model aliasing effects
(see below).

* new: (access|update)-(heap|nonlocal|var-param) 
Used to get around the aliasing problem.  There are three kinds of
potentially alising vars: heap objects, nonlocal variables, and
variable parameters.  Every access or update of a variable that may
alias with another is modelled as an access/update of the pseudo
variable $store (this is very similar to access/update of record
fields).  A later optimization step has to remove as many refernces to
$store as possible and introduce the may-alias instructions that
Brandis uses.

* different format of `call'
The first operand of a call is the address of the called procedure,
the second operand is the proc's formal parameter list.  Note that
`call' is also used for type-bound procedures and that the formal
parameter list does not include the receiver.

* new: reclaim
Mirrors the collect instruction.  While collect forces the operands
into memory, reclaim retrieves the variable's value from memory.  Note
that $store is operand of the collect instruction and result of
reclaim.  Both collect and reclaim only operate on local variables
and $store, all other kinds of variables are handled implicitly by
$store. 

* new: trap instruction, variable $trap
$trap is an additional pseudo variable that is used like $exit and
$return.  HALT, ASSERT, and certain run-time checks (missing ELSE,
missing RETURN) set this variable to TRUE, and all following
statements are guarded against ~$trap.  

* new: CASE guards, merges, and gates
The CASE statements introcudes a new variant of resp. guard, merge,
and gate.  A case guard (Opcode.guardCase resp. "is-member:") is a
selection value followed by a list of ranges. The ranges are sorted in
ascending order, multiple single elements are merged into ranges as
far as possible.  The predicate associated with the guard holds iff
the selection values is contained in one of the ranges.  Note that
there is no distinction of a CASE's ELSE clause on GSA level because
the ELSE body is also guarded by a `is-member:' whose range is the
complement of the union of ranges of all CASE labels.  
  A `merge-case' can have an arbitrary number of operands, all other
merges have two operands.  Therefore gates associated with a
`merge-case' have also arbitrary many operands (if the merge has n
opnds, then the gate has n+1).