public class JProgram extends JNode implements ArrayTypeCreator
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_LITERAL_HOLDER |
static Set<String> |
CODEGEN_TYPES_SET |
List<JClassType> |
codeGenTypes |
static Set<String> |
IMMORTAL_CODEGEN_TYPES_SET |
List<JClassType> |
immortalCodeGenTypes |
static String |
JAVASCRIPTOBJECT |
static Set<String> |
SYNTHETIC_TYPE_NAMES
Types whose entire implementation is synthesized at compile time.
|
JTypeOracle |
typeOracle |
Constructor and Description |
---|
JProgram(MinimalRebuildCache minimalRebuildCache) |
JProgram(MinimalRebuildCache minimalRebuildCache,
boolean hasWholeWorldKnowledge) |
getSourceInfo, setSourceInfo, toSource, toString
public static final String JAVASCRIPTOBJECT
public static final String CLASS_LITERAL_HOLDER
public static final Set<String> SYNTHETIC_TYPE_NAMES
public final List<JClassType> codeGenTypes
public final List<JClassType> immortalCodeGenTypes
public final JTypeOracle typeOracle
public JProgram(MinimalRebuildCache minimalRebuildCache)
public JProgram(MinimalRebuildCache minimalRebuildCache, boolean hasWholeWorldKnowledge)
public boolean isJsTypePrototype(JDeclaredType classType)
public static JExpressionStatement createAssignmentStmt(SourceInfo info, JExpression lhs, JExpression rhs)
public static JLocal createLocal(SourceInfo info, String name, JType type, boolean isFinal, JMethodBody enclosingMethodBody)
public static JParameter createParameter(SourceInfo info, String name, JType type, boolean isFinal, boolean isThis, JMethod enclosingMethod)
public static List<JDeclaredType> deserializeTypes(ObjectInputStream stream) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static boolean isClinit(JMethod method)
public static boolean isTracingEnabled()
public static void serializeTypes(List<JDeclaredType> types, ObjectOutputStream stream) throws IOException
IOException
public boolean isInliningAllowed(JMethod method)
method
.public boolean isDevitualizationAllowed(JMethod method)
MakeCallsStatic
should try to statify method
.public void addPinnedMethod(JMethod method)
public void addEntryMethod(JMethod entryPoint)
public void addIndexedTypeName(String typeName)
public void addReferenceOnlyType(JDeclaredType type)
public void addType(JDeclaredType type)
public JReferenceType generalizeTypes(Collection<? extends JReferenceType> types)
public JReferenceType generalizeTypes(JReferenceType type1, JReferenceType type2)
public List<JArrayType> getAllArrayTypes()
public JExpression createArrayClassLiteralExpression(SourceInfo sourceInfo, JClassLiteral leafTypeClassLiteral, int dimensions)
Note: This version can only be called after ImplementClassLiteralsAsFields
has been
run.
public Map<JReferenceType,JCastMap> getCastMap()
public JCastMap getCastMap(JReferenceType referenceType)
public List<JDeclaredType> getDeclaredTypes()
public int getFragmentCount()
public FragmentPartitioningResult getFragmentPartitioningResult()
public JDeclaredType getFromTypeMap(String qualifiedBinaryOrSourceName)
public Collection<JField> getIndexedFields()
public Collection<JMethod> getIndexedMethods()
public JDeclaredType getIndexedType(String string)
public Collection<JDeclaredType> getIndexedTypes()
public LinkedHashSet<JRunAsync> getInitialAsyncSequence()
public JClassType getJavaScriptObject()
public JBooleanLiteral getLiteralBoolean(boolean value)
public JCharLiteral getLiteralChar(char value)
public JDoubleLiteral getLiteralDouble(double d)
public JFloatLiteral getLiteralFloat(double f)
public JIntLiteral getLiteralInt(int value)
public JLongLiteral getLiteralLong(long value)
public JNullLiteral getLiteralNull()
public JStringLiteral getStringLiteral(SourceInfo sourceInfo, String s)
public List<JDeclaredType> getModuleDeclaredTypes()
public int getNodeCount()
public JField getNullField()
public JMethod getNullMethod()
public String getPropertyProviderRegistratorTypeSourceName()
public int getCommonAncestorFragmentId(int thisFragmentId, int thatFragmentId)
public String getRuntimeRebindRegistratorTypeSourceName()
public Collection<JType> getSubclasses(JType type)
public JArrayType getTypeArray(JType elementType)
public JArrayType getOrCreateArrayType(JType leafType, int dimensions)
getOrCreateArrayType
in interface ArrayTypeCreator
public JClassType getTypeClassLiteralHolder()
public JType getTypeFromJsniRef(String className)
public JClassType getTypeJavaLangClass()
public JClassType getTypeJavaLangEnum()
public JClassType getTypeJavaLangObject()
public JClassType getTypeJavaLangString()
public JNullType getTypeNull()
public JPrimitiveType getTypePrimitiveBoolean()
public JPrimitiveType getTypePrimitiveByte()
public JPrimitiveType getTypePrimitiveChar()
public JPrimitiveType getTypePrimitiveDouble()
public JPrimitiveType getTypePrimitiveFloat()
public JPrimitiveType getTypePrimitiveInt()
public JPrimitiveType getTypePrimitiveLong()
public JPrimitiveType getTypePrimitiveShort()
public JPrimitiveType getTypeVoid()
public void initTypeInfo(Map<JReferenceType,JCastMap> castMapForType)
public boolean isJavaLangString(JType type)
public boolean isReferenceOnly(JDeclaredType type)
public boolean isStaticImpl(JMethod method)
public static JInterfaceType maybeGetJsTypeFromPrototype(JDeclaredType classType)
public JType normalizeJsoType(JType type)
type
.public void putIntoTypeMap(String qualifiedBinaryName, JDeclaredType type)
public void removeStaticImplMapping(JMethod staticImpl)
public void removeReferenceOnlyType(JDeclaredType type)
public void setFragmentPartitioningResult(FragmentPartitioningResult result)
public void setInitialFragmentIdSequence(List<Integer> initialFragmentIdSequence)
public void setInitialAsyncSequence(LinkedHashSet<JRunAsync> initialAsyncSequence)
public void setPropertyProviderRegistratorTypeSourceName(String propertyProviderRegistratorTypeSourceName)
public void setRuntimeRebindRegistratorTypeName(String runtimeRebindRegistratorTypeName)
public JMethod instanceMethodForStaticImpl(JMethod method)
method
is a static impl method, returns the instance method
that method
is the implementation of. Otherwise, returnsnull
.public JReferenceType strongerType(JReferenceType type1, JReferenceType type2)
public void traverse(JVisitor visitor, Context ctx)
JVisitable
traverse
in interface JVisitable
visitor
- the visitor that should traverse this nodectx
- the context of an existing traversalpublic void visitAllTypes(JVisitor visitor)
public void visitModuleTypes(JVisitor visitor)
Copyright © 2018. All rights reserved.