public GraphBuilderConfiguration withDebugInfoMode(DebugInfoMode newDebugInfoMode) {
   ResolvedJavaType[] newSkippedExceptionTypes =
       skippedExceptionTypes == EMPTY
           ? EMPTY
           : Arrays.copyOf(skippedExceptionTypes, skippedExceptionTypes.length);
   return new GraphBuilderConfiguration(
       eagerResolving,
       omitAllExceptionEdges,
       newDebugInfoMode,
       newSkippedExceptionTypes,
       doLivenessAnalysis);
 }
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj instanceof BytecodeFrame && super.equals(obj)) {
     BytecodeFrame that = (BytecodeFrame) obj;
     // @formatter:off
     if (this.duringCall == that.duringCall
         && this.rethrowException == that.rethrowException
         && this.numLocals == that.numLocals
         && this.numLocks == that.numLocks
         && this.numStack == that.numStack
         && Arrays.equals(this.values, that.values)) {
       return true;
     }
     // @formatter:off
     return true;
   }
   return false;
 }
示例#3
0
    private static JavaMethodProfile createMethodProfile(
        RawItemProfile<ResolvedJavaMethod> profile) {
      if (profile.entries <= 0 || profile.totalCount <= 0) {
        return null;
      }

      ProfiledMethod[] pmethods = new ProfiledMethod[profile.entries];
      double totalProbability = 0.0;
      for (int i = 0; i < profile.entries; i++) {
        double p = profile.counts[i];
        p = p / profile.totalCount;
        totalProbability += p;
        pmethods[i] = new ProfiledMethod(profile.items[i], p);
      }

      Arrays.sort(pmethods);

      double notRecordedMethodProbability =
          profile.entries < config.methodProfileWidth
              ? 0.0
              : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
      assert notRecordedMethodProbability == 0 || profile.entries == config.methodProfileWidth;
      return new JavaMethodProfile(notRecordedMethodProbability, pmethods);
    }
示例#4
0
    private static JavaTypeProfile createTypeProfile(
        TriState nullSeen, RawItemProfile<ResolvedJavaType> profile) {
      if (profile.entries <= 0 || profile.totalCount <= 0) {
        return null;
      }

      ProfiledType[] ptypes = new ProfiledType[profile.entries];
      double totalProbability = 0.0;
      for (int i = 0; i < profile.entries; i++) {
        double p = profile.counts[i];
        p = p / profile.totalCount;
        totalProbability += p;
        ptypes[i] = new ProfiledType(profile.items[i], p);
      }

      Arrays.sort(ptypes);

      double notRecordedTypeProbability =
          profile.entries < config.typeProfileWidth
              ? 0.0
              : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
      assert notRecordedTypeProbability == 0 || profile.entries == config.typeProfileWidth;
      return new JavaTypeProfile(nullSeen, notRecordedTypeProbability, ptypes);
    }