code: private LookupResult tryAsLoaderClassOrScript(String name, CompilationUnit compilationUnit) {
          GroovyClassLoader loader = compilationUnit.getClassLoader();
  
          Map<String, Boolean> options = compilationUnit.configuration.getOptimizationOptions();
          boolean useAsm = !Boolean.FALSE.equals(options.get("asmResolving"));
          boolean useClassLoader = !Boolean.FALSE.equals(options.get("classLoaderResolving"));
  
          LookupResult result = useAsm ? findDecompiled(name, compilationUnit, loader) : null;
          if (result != null) {
              return result;
          }
  
          if (!useClassLoader) {
              return tryAsScript(name, compilationUnit, null);
          }
  
          return findByClassLoading(name, compilationUnit, loader);
      }
docs: This method is used to realize the lookup of a class using the compilation
  unit class loader. Should no class be found we fall back to a script lookup.
  If a class is found we check if there is also a script and maybe use that
  one in case it is newer.<p/>
  
  Two class search strategies are possible: by ASM decompilation or by usual Java classloading.
  The latter is slower but is unavoidable for scripts executed in dynamic environments where
  the referenced classes might only be available in the classloader, not on disk.