org.aspectj.compiler.base.ast
Class CodeDec
java.lang.Object
org.aspectj.compiler.base.CompilerObject
org.aspectj.compiler.base.ast.ASTObject
org.aspectj.compiler.base.ast.Stmt
org.aspectj.compiler.base.ast.Dec
org.aspectj.compiler.base.ast.CodeDec
- All Implemented Interfaces:
- PossibleSoftThrowable
- Direct Known Subclasses:
- AdviceDec, ConstructorDec, InitializerDec, MethodDec
- public abstract class CodeDec
- extends Dec
- implements PossibleSoftThrowable
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.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 |
modifiers
protected Modifiers modifiers
formals
protected Formals formals
_throws
protected TypeDs _throws
body
protected CodeBody body
CodeDec
public CodeDec(SourceLocation location,
Modifiers _modifiers,
Formals _formals,
TypeDs __throws,
CodeBody _body)
CodeDec
protected CodeDec(SourceLocation source)
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:
- implicit return statements are inserted
- all return statements are typechecked, with appropriate
casts inserted, so we know what kind of return bytecode to
generate based on the return stmt rather than on the return
type of the method.
- 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