Ejemplo n.º 1
0
 @ExplodeLoop
 public void profileArguments(Object[] args) {
   Assumption typesAssumption = profiledArgumentTypesAssumption;
   if (typesAssumption == null) {
     CompilerDirectives.transferToInterpreterAndInvalidate();
     initializeProfiledArgumentTypes(args);
   } else {
     Class<?>[] types = profiledArgumentTypes;
     if (types != null) {
       if (types.length != args.length) {
         CompilerDirectives.transferToInterpreterAndInvalidate();
         typesAssumption.invalidate();
         profiledArgumentTypes = null;
       } else if (typesAssumption.isValid()) {
         for (int i = 0; i < types.length; i++) {
           Class<?> type = types[i];
           Object value = args[i];
           if (type != null && (value == null || value.getClass() != type)) {
             CompilerDirectives.transferToInterpreterAndInvalidate();
             updateProfiledArgumentTypes(args, types);
             break;
           }
         }
       }
     }
   }
 }