Package harpoon.IR.LowQuad

A low-level quadruple-based IR with explicit pointers.

See:
          Description

Class Summary
Code LowQuad.Code is an abstract superclass of codeviews using the components in IR.LowQuad.
DerivationMap<HCE extends HCodeElement> DerivationMap is a simple map-based implementation of common Derivation functionality.
LowQuad The LowQuad interface identifies subclasses of harpoon.IR.Quads.Quad as being members of the LowQuad representation.
LowQuadFactory LowQuadFactory is a trivial subclass of QuadFactory which assigns unique numbers to the Quads and LowQuads in LowQuad form.
LowQuadKind LowQuadKind is an enumerated type for the various kinds of LowQuads.
LowQuadNoSSA The LowQuadNoSSA codeview exposes a lowquad-based representation.
LowQuadSSA The LowQuadSSA codeview exposes a lowquad based representation in SSA form.
LowQuadSSI The LowQuadSSI codeview exposes a lowquad based representation in SSI form.
LowQuadValueVisitor<T> LowQuadValueVisitor is a visitor class for low quads that returns a parameterized value.
LowQuadVisitor LowQuadVisitor is another design pattern.
LQop LQop is an enumerated type for the various kinds of OPER opcodes in LowQuad form.
PAOFFSET PAOFFSET computes the POINTER offset needed to access a given array element.
PARRAY PARRAY converts an array object reference into a POINTER value that can be used to access array elements.
PCALL PCALL objects represent a method pointer dereference and invocation.
PCONST PCONST is an abstract superclass of the LowQuads that encode symbolic offsets or constants for array elements, fields, and methods.
PFCONST PFCONST computes the POINTER constant needed to access a given static field.
PFIELD PFIELD converts an object reference into a POINTER value that can be used to access non-static object fields.
PFOFFSET PFOFFSET computes the POINTER offset needed to access a given non-static field.
PGET PGET represents a POINTER dereference to get a field or array element.
PMCONST PMCONST computes the POINTER constant needed to invoke a given non-virtual method.
PMETHOD PMETHOD converts an object reference into a POINTER value that can be used to invoke object methods.
PMOFFSET PMOFFSET computes the POINTER offset needed to invoke a given virtual method.
POPER POPER is an extended version of harpoon.IR.Quads.OPER, with new opcodes defined in LQop.
PPTR PPTR is an abstract superclass of the LowQuads that convert object references into POINTER types.
PSET PSET represents a POINTER dereference to set a field or array element.
 

Package harpoon.IR.LowQuad Description

A low-level quadruple-based IR with explicit pointers.

Low-quad form allows pointer-based optimizations that are impossible to perform in hi-quad form. As an example, low-quad form allows the optimization of:

void foo(int arr[]) { for (int i=0; i<arr.length; i++) arr[i] = 42; } which is implemented as something like: void foo(int arr[]) { for (int i=0; i<arr.length; i++) *(arr+i) = 42; } to the more efficient: void foo(int arr[]) { for (int *i=arr; i<arr+arr.length; i++) *i = 42; } Note that there is also pointer-scaling going on here which it is difficult to write in C.

Note that a harpoon.Analysis.Maps.Derivation must be maintained in low-quad form to allow compiler-supported garbage collection in the back-end.

Author:
C. Scott Ananian <cananian@alumni.princeton.edu>