org.aspectj.compiler.base.ast
Class CodeDec

java.lang.Object
  extended byorg.aspectj.compiler.base.CompilerObject
      extended byorg.aspectj.compiler.base.ast.ASTObject
          extended byorg.aspectj.compiler.base.ast.Stmt
              extended byorg.aspectj.compiler.base.ast.Dec
                  extended byorg.aspectj.compiler.base.ast.CodeDec
All Implemented Interfaces:
PossibleSoftThrowable
Direct Known Subclasses:
AdviceDec, ConstructorDec, InitializerDec, MethodDec

public abstract class CodeDec
extends Dec
implements PossibleSoftThrowable


Field Summary
protected  TypeDs _throws
           
protected  CodeBody body
           
protected  Formals formals
           
protected  Modifiers modifiers
           
 
Fields inherited from class org.aspectj.compiler.base.ast.Dec
forcePublic, owner, semanticObject
 
Fields inherited from class org.aspectj.compiler.base.ast.ASTObject
dummySource, parent, sourceLocation
 
Constructor Summary
protected CodeDec(SourceLocation source)
           
  CodeDec(SourceLocation location, Modifiers _modifiers, Formals _formals, TypeDs __throws, CodeBody _body)
           
 
Method Summary
 void addThrows(java.util.Collection throwTypes)
           
 void addThrowsType(Type t)
           
 boolean appearsStaticToCaller()
           
static CodeBody blockToBody(BlockStmt block)
           
 boolean canThrow(Type t)
           
protected  void cgCodeMember(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          generate code for the body.
protected  void cgMember(org.aspectj.compiler.base.bcg.ClassfileBuilder cfb)
          This method takes care of generating code for Member decs.
 void checkSpec()
           
 void cleanup()
           
 void computeMinimalThrows()
           
 boolean conflictsWith(Dec otherDec)
           
 CodeBody getBody()
           
 java.util.Set getCallExprs()
           
 ASTObject getChildAt(int childIndex)
           
 int getChildCount()
           
 java.lang.String getChildNameAt(int childIndex)
           
 java.lang.String getDefaultDisplayName()
           
 java.lang.String getDescriptor()
          return the bytecode type descriptor for the member.
 java.util.Set getEffectivelyFinalFormals()
           
 Formals getFormals()
           
 int getFrameSize()
           
abstract  java.lang.String getId()
           
 Modifiers getModifiers()
           
 java.util.Set getPossibleCheckedExceptions()
          returns the checked exceptions that the context expects could be thrown here guarantees that if x is a member then no subtype(x) is a member XXX figure out what the performance issues are and if we should cache this
 Type getResultType()
           
abstract  TypeD getResultTypeD()
           
 int getStackDelta()
          return the change in stack that would result from invoking this codeDec.
 TypeDs getThrows()
           
 boolean hasThis()
           
 boolean isAlmostApplicable(Exprs params)
           
 boolean isApplicable(Exprs parameters)
           
 boolean isMoreSpecificThan(Dec otherDec)
           
 boolean isSoftThrowable()
           
 ASTObject postCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass w)
           
 ASTObject postScope(ScopeWalker walker)
           
 void preScope(ScopeWalker walker)
           
 void setBody(BlockStmt block)
           
 void setBody(CodeBody _body)
           
 void setChildAt(int childIndex, ASTObject child)
           
 void setFormals(Formals _formals)
           
 void setFrameSize(int frameSize)
           
 void setModifiers(Modifiers _modifiers)
           
 void setSoftThrowable()
           
 void setThrows(TypeDs __throws)
           
protected  void setupFlowWalker(org.aspectj.compiler.base.FlowCheckerPass w)
          set up the flow walker, by adding implicit variables like thisJoinPoint, etc
 void walkAnalysis(org.aspectj.compiler.base.LocalClassPass.AnalysisWalker walker)
           
 void walkCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass w)
           
 void walkFlow(org.aspectj.compiler.base.FlowCheckerPass w)
           
 void walkFrameLoc(org.aspectj.compiler.base.FrameLocPass walker)
           
 void walkInnerInfo(org.aspectj.compiler.base.InnerInfoPass w)
           
 
Methods inherited from class org.aspectj.compiler.base.ast.Dec
addIntroducedFromType, checkOverride, dominates, forcePublic, getBytecodeId, getCorrespondingSemanticObject, getDeclaringType, getKind, getLexicalType, getName, getOutermostLexicalType, getSignatureString, inStaticContext, isAbstract, isAccessible, isAccessible, isDeprecated, isFinal, isInherited, isIntroduced, isLanguageVisible, isMoreAccessibleThan, isPrivate, isProtected, isPublic, isStatic, isSynthetic, lookupDeclaringType, lookupLexicalType, makeBlockScope, makeCorrespondingSemanticObject, postCopy, preCopy, preMove, requireStmt, samePackage, setAllEnclosingTypes, setBytecodeId, setDeclaringType, setDeprecated, setExplicitlyNonSynthetic, setFromLexicalScope, setId, setLanguageVisible, setLexicalType, toShortString, walkForwardReference, writeModifiers, writeNames
 
Methods inherited from class org.aspectj.compiler.base.ast.Stmt
cgStmt, cgTop, completesNormally, isBreakable, isContinuable, isEmpty, mustBeLive, registerLocation, requireBlockStmt, setCompletesNormally
 
Methods inherited from class org.aspectj.compiler.base.ast.ASTObject
addComment, buildAccessMethod, checkNoSharing, clearComment, clearParent, contains, containsTypes, copy, copyWalk, display, fixAccessPost, fixAST, fromSource, getAST, getBeginColumn, getBeginLine, getBytecodeType, getBytecodeTypeDec, getComment, getCompilationUnit, getEnclosingCodeDec, getEnclosingDec, getEndColumn, getEndLine, getEndPosition, getFormalComment, getOutermostBytecodeType, getParent, getSourceDirectoryName, getSourceFile, getSourceFileName, getSourceLocation, getStartPosition, hasLegalProtectedAccess, hasSource, hasSourceLocation, implementMixin, indexOf, isLeaf, makeChild, makeChild, postAssignmentCheck, postFixAST, postImplementMixin, postInnerAccess, postInnerInfo, postLift, postMove, postThreading, preAssignmentCheck, preIntroduction, preLift, preThreading, remove, remove, removeChildAt, replaceWith, setFormalComment, setParent, setParents, setSource, setSourceLocation, setSyntheticSource, showError, showMessage, showTypeError, showWarning, toString, unparse, unparse, walk, walkAssignmentCheck, walkMemberMunger, walkScope
 
Methods inherited from class org.aspectj.compiler.base.CompilerObject
getCompiler, getOptions, getTypeManager, getWorld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiers

protected Modifiers modifiers

formals

protected Formals formals

_throws

protected TypeDs _throws

body

protected CodeBody body
Constructor Detail

CodeDec

public CodeDec(SourceLocation location,
               Modifiers _modifiers,
               Formals _formals,
               TypeDs __throws,
               CodeBody _body)

CodeDec

protected CodeDec(SourceLocation source)
Method Detail

isSoftThrowable

public boolean isSoftThrowable()
Specified by:
isSoftThrowable in interface PossibleSoftThrowable

setSoftThrowable

public void setSoftThrowable()
Specified by:
setSoftThrowable in interface PossibleSoftThrowable

walkFlow

public void walkFlow(org.aspectj.compiler.base.FlowCheckerPass w)
Overrides:
walkFlow in class ASTObject

setupFlowWalker

protected void setupFlowWalker(org.aspectj.compiler.base.FlowCheckerPass w)
set up the flow walker, by adding implicit variables like thisJoinPoint, etc


walkCleanup

public final void walkCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass w)
Overrides:
walkCleanup in class ASTObject

postCleanup

public ASTObject postCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass w)
Overrides:
postCleanup in class ASTObject

walkInnerInfo

public void walkInnerInfo(org.aspectj.compiler.base.InnerInfoPass w)
Overrides:
walkInnerInfo in class ASTObject

blockToBody

public static CodeBody blockToBody(BlockStmt block)

setBody

public void setBody(BlockStmt block)

getId

public abstract java.lang.String getId()
Specified by:
getId in class Dec

getResultTypeD

public abstract TypeD getResultTypeD()

getResultType

public Type getResultType()

canThrow

public boolean canThrow(Type t)

addThrowsType

public void addThrowsType(Type t)

addThrows

public void addThrows(java.util.Collection throwTypes)

getPossibleCheckedExceptions

public java.util.Set getPossibleCheckedExceptions()
returns the checked exceptions that the context expects could be thrown here guarantees that if x is a member then no subtype(x) is a member XXX figure out what the performance issues are and if we should cache this


checkSpec

public void checkSpec()
Overrides:
checkSpec in class ASTObject

appearsStaticToCaller

public boolean appearsStaticToCaller()

hasThis

public boolean hasThis()

isAlmostApplicable

public boolean isAlmostApplicable(Exprs params)
Overrides:
isAlmostApplicable in class Dec

isApplicable

public boolean isApplicable(Exprs parameters)
Overrides:
isApplicable in class Dec

conflictsWith

public boolean conflictsWith(Dec otherDec)
Overrides:
conflictsWith in class Dec

isMoreSpecificThan

public boolean isMoreSpecificThan(Dec otherDec)
Overrides:
isMoreSpecificThan in class Dec

getEffectivelyFinalFormals

public java.util.Set getEffectivelyFinalFormals()

preScope

public void preScope(ScopeWalker walker)
Overrides:
preScope in class ASTObject

postScope

public ASTObject postScope(ScopeWalker walker)
Overrides:
postScope in class ASTObject

computeMinimalThrows

public void computeMinimalThrows()

getCallExprs

public java.util.Set getCallExprs()

cleanup

public void cleanup()
Overrides:
cleanup in class Dec

getFrameSize

public int getFrameSize()

setFrameSize

public void setFrameSize(int frameSize)

walkFrameLoc

public void walkFrameLoc(org.aspectj.compiler.base.FrameLocPass walker)
Overrides:
walkFrameLoc in class ASTObject

walkAnalysis

public void walkAnalysis(org.aspectj.compiler.base.LocalClassPass.AnalysisWalker walker)
Overrides:
walkAnalysis in class ASTObject

cgMember

protected void cgMember(org.aspectj.compiler.base.bcg.ClassfileBuilder cfb)
This method takes care of generating code for Member decs. At this point, we have a number of invariants:

Overrides:
cgMember in class Dec

cgCodeMember

protected void cgCodeMember(org.aspectj.compiler.base.bcg.CodeBuilder cb)
generate code for the body. Assumes there is a body.

Parameters:
cb - the codeBuilder into which to generate code

getDescriptor

public java.lang.String getDescriptor()
return the bytecode type descriptor for the member.

Overrides:
getDescriptor in class Dec

getStackDelta

public int getStackDelta()
return the change in stack that would result from invoking this codeDec. This is the size of the return value minus the size of the argument values (including the implicit this object). It is typically negative for coded members with arguments.

Overrides:
getStackDelta in class Dec

getModifiers

public Modifiers getModifiers()
Specified by:
getModifiers in class Dec

setModifiers

public void setModifiers(Modifiers _modifiers)

getFormals

public Formals getFormals()

setFormals

public void setFormals(Formals _formals)

getThrows

public TypeDs getThrows()

setThrows

public void setThrows(TypeDs __throws)

getBody

public CodeBody getBody()

setBody

public void setBody(CodeBody _body)

getChildAt

public ASTObject getChildAt(int childIndex)
Overrides:
getChildAt in class ASTObject

getChildNameAt

public java.lang.String getChildNameAt(int childIndex)
Overrides:
getChildNameAt in class ASTObject

setChildAt

public void setChildAt(int childIndex,
                       ASTObject child)
Overrides:
setChildAt in class ASTObject

getChildCount

public int getChildCount()
Overrides:
getChildCount in class ASTObject

getDefaultDisplayName

public java.lang.String getDefaultDisplayName()
Overrides:
getDefaultDisplayName in class Dec