Lazily compute the synthetic marker hash.

This CL attempts to remove the regression in b/227625392. Local
reproduction is not stable yet the only real change in the range
is the hash computation itself.

This also adds a version flag to run_benchmark.py

Bug: b/227625392
Change-Id: I99be7cb15e4a44ea2eb1c84079d28c94448f4ec3
diff --git a/tools/compiledump.py b/tools/compiledump.py
index a7809ac..9f3d1b0 100755
--- a/tools/compiledump.py
+++ b/tools/compiledump.py
@@ -287,12 +287,12 @@
         args.append('-D' + name + '=' + value)
   return args
 
-def download_distribution(args, version, temp):
+def download_distribution(version, nolib, temp):
   if version == 'main':
-    return utils.R8_JAR if args.nolib else utils.R8LIB_JAR
+    return utils.R8_JAR if nolib else utils.R8LIB_JAR
   if version == 'source':
     return '%s:%s' % (utils.BUILD_JAVA_MAIN_DIR, utils.ALL_DEPS_JAR)
-  name = 'r8.jar' if args.nolib else 'r8lib.jar'
+  name = 'r8.jar' if nolib else 'r8lib.jar'
   source = archive.GetUploadDestination(version, name, is_hash(version))
   dest = os.path.join(temp, 'r8.jar')
   utils.download_file_from_cloud_storage(source, dest)
@@ -367,7 +367,7 @@
     out = determine_output(args, temp)
     min_api = determine_min_api(args, build_properties)
     classfile = determine_class_file(args, build_properties)
-    jar = args.r8_jar if args.r8_jar else download_distribution(args, version, temp)
+    jar = args.r8_jar if args.r8_jar else download_distribution(version, args.nolib, temp)
     if ':' not in jar and not os.path.exists(jar):
       error("Distribution does not exist: " + jar)
     wrapper_dir = prepare_wrapper(jar, temp, jdkhome)