ptolemy.copernicus.java
Class GiottoPortInliner

java.lang.Object
  extended by ptolemy.copernicus.java.GiottoPortInliner
All Implemented Interfaces:
PortInliner

public class GiottoPortInliner
extends java.lang.Object
implements PortInliner

A class that inlines methods on ports for Giotto models. Ports of Giotto models are represented by an array of locations, one location for each channel. This corresponds to a buffer of length 1.

Since:
Ptolemy II 2.0
Version:
$Id: GiottoPortInliner.java,v 1.35 2006/12/19 18:31:28 cxh Exp $
Author:
Stephen Neuendorffer
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Constructor Summary
GiottoPortInliner(soot.SootClass modelClass, CompositeActor model, java.util.Map options)
          Construct a new transformer
 
Method Summary
 void createBuffers()
          Create communication places for the ports.
 soot.SootField getBufferField(IOPort port, Type type)
           
 soot.SootField getInsideBufferField(IOPort port, Type type)
           
 void initialize()
          Initialize the inliner.
 void inlineBroadcast(soot.jimple.JimpleBody body, soot.jimple.Stmt stmt, soot.jimple.InvokeExpr expr, TypedIOPort port)
          Replace the broadcast invocation in the given box at the given unit in the given body with a circular array reference.
 void inlineGet(soot.jimple.JimpleBody body, soot.jimple.Stmt stmt, soot.ValueBox box, soot.jimple.InvokeExpr expr, TypedIOPort port)
          Replace the get invocation in the given box at the given unit in the given body with an array reference.
 void inlineGetInside(soot.jimple.JimpleBody body, soot.jimple.Stmt stmt, soot.ValueBox box, soot.jimple.InvokeExpr expr, TypedIOPort port)
          Replace the getInside invocation in the given box at the given unit in the given body with a circular array reference.
 void inlineSend(soot.jimple.JimpleBody body, soot.jimple.Stmt stmt, soot.jimple.InvokeExpr expr, TypedIOPort port)
          Replace the send command at the given unit in the given body with a circular array reference.
 void inlineSendInside(soot.jimple.JimpleBody body, soot.jimple.Stmt stmt, soot.jimple.InvokeExpr expr, TypedIOPort port)
          Replace the send command at the given unit in the given body with a circular array reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GiottoPortInliner

public GiottoPortInliner(soot.SootClass modelClass,
                         CompositeActor model,
                         java.util.Map options)
Construct a new transformer

Method Detail

getBufferField

public soot.SootField getBufferField(IOPort port,
                                     Type type)

getInsideBufferField

public soot.SootField getInsideBufferField(IOPort port,
                                           Type type)

initialize

public void initialize()
Initialize the inliner. This inliner does nothing, since it expects the GiottoDirectorInliner to have previously called the CreateBuffers method.

Specified by:
initialize in interface PortInliner

createBuffers

public void createBuffers()
Create communication places for the ports. This method is provided for the use of the GiottoDirectorInliner, since that inliner and this one are closely coordinated, unlike most other domains.


inlineBroadcast

public void inlineBroadcast(soot.jimple.JimpleBody body,
                            soot.jimple.Stmt stmt,
                            soot.jimple.InvokeExpr expr,
                            TypedIOPort port)
Replace the broadcast invocation in the given box at the given unit in the given body with a circular array reference.

Specified by:
inlineBroadcast in interface PortInliner

inlineGet

public void inlineGet(soot.jimple.JimpleBody body,
                      soot.jimple.Stmt stmt,
                      soot.ValueBox box,
                      soot.jimple.InvokeExpr expr,
                      TypedIOPort port)
Replace the get invocation in the given box at the given unit in the given body with an array reference.

Specified by:
inlineGet in interface PortInliner

inlineGetInside

public void inlineGetInside(soot.jimple.JimpleBody body,
                            soot.jimple.Stmt stmt,
                            soot.ValueBox box,
                            soot.jimple.InvokeExpr expr,
                            TypedIOPort port)
Replace the getInside invocation in the given box at the given unit in the given body with a circular array reference.

Specified by:
inlineGetInside in interface PortInliner

inlineSend

public void inlineSend(soot.jimple.JimpleBody body,
                       soot.jimple.Stmt stmt,
                       soot.jimple.InvokeExpr expr,
                       TypedIOPort port)
Replace the send command at the given unit in the given body with a circular array reference.

Specified by:
inlineSend in interface PortInliner

inlineSendInside

public void inlineSendInside(soot.jimple.JimpleBody body,
                             soot.jimple.Stmt stmt,
                             soot.jimple.InvokeExpr expr,
                             TypedIOPort port)
Replace the send command at the given unit in the given body with a circular array reference.

Specified by:
inlineSendInside in interface PortInliner