Package com.google.gwt.dev.jjs.ast

Examples of com.google.gwt.dev.jjs.ast.JCastMap


          && type != program.getTypeJavaLangString()) {
        return;
      }

      // add an entry for me
      castableTypesMap.put(type, new JCastMap(SourceOrigin.UNKNOWN, program.getTypeJavaLangObject(),
          Collections.unmodifiableSet(castableTypes)));
    }
View Full Code Here


      return new JRuntimeTypeReference(sourceInfo, program.getTypeJavaLangObject(),
          (JReferenceType) elementType);
    }

    private JExpression getOrCreateCastMap(SourceInfo sourceInfo, JArrayType arrayType) {
      JCastMap castableTypeMap = program.getCastMap(arrayType);
      if (castableTypeMap == null) {
        return new JCastMap(sourceInfo, program.getTypeJavaLangObject(),
            Collections.<JReferenceType>emptyList());
      }
      return castableTypeMap;
    }
View Full Code Here

  }

  private void assertSourceCastsToTargets(JProgram program, JReferenceType sourceType,
      Set<String> expectedTargetTypeNames) {
    // Gets the castmap for the given source type.
    JCastMap castMap = program.getCastMap(sourceType);

    // Converts the castmap entries to runtime type references.
    List<JRuntimeTypeReference> runtimeTypeReferences = Lists.newArrayList(
        Iterables.filter(castMap.getCanCastToTypes(), JRuntimeTypeReference.class));

    // Makes a set of the names of the runtime type references.
    Set<String> actualTargetTypeNames = Sets.newHashSet(
        Lists.transform(runtimeTypeReferences, new Function<JRuntimeTypeReference, String>() {
            @Override
View Full Code Here

      toStringRef.setQualifier(qualifier);
      return toStringRef;
    }

    private JsExpression generateCastableTypeMap(JClassType x) {
      JCastMap castMap = program.getCastMap(x);
      if (castMap != null) {
        JField castableTypeMapField = program.getIndexedField("Object.castableTypeMap");
        JsName castableTypeMapName = names.get(castableTypeMapField);
        if (castableTypeMapName == null) {
          // Was pruned; this compilation must have no dynamic casts.
View Full Code Here

    replaceTypeIdsVisitor.accept(program.getIndexedType("ClassLiteralHolder"));
    // TODO(rluble): Improve the code so that things are not scattered all over; here cast maps
    // that appear as parameters to soon to be generated
    // {@link JavaClassHierarchySetup::defineClass()} are NOT traversed when traversing the program.
    for (Entry<JReferenceType, JCastMap> entry : program.getCastMap().entrySet()) {
      JCastMap castMap = entry.getValue();
      replaceTypeIdsVisitor.accept(castMap);
    }
  }
View Full Code Here

    this.program = program;
    this.disableCastChecking = disableCastChecking;
  }

  private void createCompleteCastMap(JReferenceType sourceType) {
    castMaps.put(sourceType, new JCastMap(SourceOrigin.UNKNOWN, program.getTypeJavaLangObject(),
        program.typeOracle.getCastableDestinationTypes(sourceType)));
  }
View Full Code Here

    replaceTypeIdsVisitor.accept(program.getIndexedType("ClassLiteralHolder"));
    // TODO(rluble): Improve the code so that things are not scattered all over; here cast maps
    // that appear as parameters to soon to be generated
    // {@link JavaClassHierarchySetup::defineClass()} are NOT traversed when traversing the program.
    for (Entry<JReferenceType, JCastMap> entry : program.getCastMap().entrySet()) {
      JCastMap castMap = entry.getValue();
      replaceTypeIdsVisitor.accept(castMap);
    }

    return typeIdLiteralsByType;
  }
View Full Code Here

    this.program = program;
    this.disableCastChecking = disableCastChecking;
  }

  private void createCompleteCastMap(JReferenceType sourceType) {
    castMaps.put(sourceType, new JCastMap(SourceOrigin.UNKNOWN, program.getTypeJavaLangObject(),
        program.typeOracle.getSuperHierarchyTypes(sourceType)));
  }
View Full Code Here

          && type != program.getTypeJavaLangString()) {
        return;
      }

      // add an entry for me
      castableTypesMap.put(type, new JCastMap(SourceOrigin.UNKNOWN, program.getTypeJavaLangObject(),
          Collections.unmodifiableSet(castableTypes)));
    }
View Full Code Here

      return new JRuntimeTypeReference(sourceInfo, program.getTypeJavaLangObject(),
          (JReferenceTypeelementType);
    }

    private JExpression getOrCreateCastMap(SourceInfo sourceInfo, JArrayType arrayType) {
      JCastMap castableTypeMap = program.getCastMap(arrayType);
      if (castableTypeMap == null) {
        return new JCastMap(sourceInfo, program.getTypeJavaLangObject(),
            Collections.<JReferenceType>emptyList());
      }
      return castableTypeMap;
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.ast.JCastMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.