Cache compression (#234)

This commit is contained in:
Artur Jamro
2019-08-23 16:39:46 -07:00
committed by Dan Gohman
parent f88e92a57c
commit 479592f8c5
7 changed files with 77 additions and 22 deletions

View File

@@ -63,7 +63,7 @@ The translation is dependent on the environment chosen.
The default is a dummy environment that produces placeholder values.
Usage:
wasm2obj [--target TARGET] [-dg] [--cache | --cache-dir=<cache_dir>] [--enable-simd] <file> -o <output>
wasm2obj [--target TARGET] [-dg] [--cache] [--cache-dir=<cache_dir>] [--cache-compression-level=<compr_level>] [--enable-simd] <file> -o <output>
wasm2obj --help | --version
Options:
@@ -74,6 +74,8 @@ Options:
-c, --cache enable caching system, use default cache directory
--cache-dir=<cache_dir>
enable caching system, use specified cache directory
--cache-compression-level=<compr_level>
enable caching system, use custom compression level for new cache, values 1-21
--enable-simd enable proposed SIMD instructions
--version print the Cranelift version
-d, --debug enable debug output on stderr/stdout
@@ -88,6 +90,7 @@ struct Args {
flag_debug: bool,
flag_cache: bool,
flag_cache_dir: Option<String>,
flag_cache_compression_level: Option<i32>,
flag_enable_simd: bool,
}
@@ -115,8 +118,11 @@ fn main() {
}
cache_conf::init(
args.flag_cache || args.flag_cache_dir.is_some(),
args.flag_cache
|| args.flag_cache_dir.is_some()
|| args.flag_cache_compression_level.is_some(),
args.flag_cache_dir.as_ref(),
args.flag_cache_compression_level,
);
let path = Path::new(&args.arg_file);

View File

@@ -64,8 +64,8 @@ including calling the start function if one is present. Additional functions
given with --invoke are then called.
Usage:
wasmtime [-odg] [--enable-simd] [--wasi-c] [--cache | --cache-dir=<cache_dir>] [--preload=<wasm>...] [--env=<env>...] [--dir=<dir>...] [--mapdir=<mapping>...] <file> [<arg>...]
wasmtime [-odg] [--enable-simd] [--wasi-c] [--cache | --cache-dir=<cache_dir>] [--preload=<wasm>...] [--env=<env>...] [--dir=<dir>...] [--mapdir=<mapping>...] --invoke=<fn> <file> [<arg>...]
wasmtime [-odg] [--enable-simd] [--wasi-c] [--cache] [--cache-dir=<cache_dir>] [--cache-compression-level=<compr_level>] [--preload=<wasm>...] [--env=<env>...] [--dir=<dir>...] [--mapdir=<mapping>...] <file> [<arg>...]
wasmtime [-odg] [--enable-simd] [--wasi-c] [--cache] [--cache-dir=<cache_dir>] [--cache-compression-level=<compr_level>] [--env=<env>...] [--dir=<dir>...] [--mapdir=<mapping>...] --invoke=<fn> <file> [<arg>...]
wasmtime --help | --version
Options:
@@ -74,6 +74,8 @@ Options:
-c, --cache enable caching system, use default cache directory
--cache-dir=<cache_dir>
enable caching system, use specified cache directory
--cache-compression-level=<compr_level>
enable caching system, use custom compression level for new cache, values 1-21
-g generate debug information
-d, --debug enable debug output on stderr/stdout
--enable-simd enable proposed SIMD instructions
@@ -94,6 +96,7 @@ struct Args {
flag_optimize: bool,
flag_cache: bool,
flag_cache_dir: Option<String>,
flag_cache_compression_level: Option<i32>,
flag_debug: bool,
flag_g: bool,
flag_enable_simd: bool,
@@ -218,8 +221,11 @@ fn rmain() -> Result<(), Error> {
}
cache_conf::init(
args.flag_cache || args.flag_cache_dir.is_some(),
args.flag_cache
|| args.flag_cache_dir.is_some()
|| args.flag_cache_compression_level.is_some(),
args.flag_cache_dir.as_ref(),
args.flag_cache_compression_level,
);
let mut flag_builder = settings::builder();

View File

@@ -41,7 +41,7 @@ const USAGE: &str = "
Wast test runner.
Usage:
wast [-do] [--enable-simd] [--cache | --cache-dir=<cache_dir>] <file>...
wast [-do] [--enable-simd] [--cache] [--cache-dir=<cache_dir>] [--cache-compression-level=<compr_level>] <file>...
wast --help | --version
Options:
@@ -51,6 +51,8 @@ Options:
-c, --cache enable caching system, use default cache directory
--cache-dir=<cache_dir>
enable caching system, use specified cache directory
--cache-compression-level=<compr_level>
enable caching system, use custom compression level for new cache, values 1-21
-d, --debug enable debug output on stderr/stdout
--enable-simd enable proposed SIMD instructions
";
@@ -63,6 +65,7 @@ struct Args {
flag_optimize: bool,
flag_cache: bool,
flag_cache_dir: Option<String>,
flag_cache_compression_level: Option<i32>,
flag_enable_simd: bool,
}
@@ -83,8 +86,11 @@ fn main() {
}
cache_conf::init(
args.flag_cache || args.flag_cache_dir.is_some(),
args.flag_cache
|| args.flag_cache_dir.is_some()
|| args.flag_cache_compression_level.is_some(),
args.flag_cache_dir.as_ref(),
args.flag_cache_compression_level,
);
let isa_builder = cranelift_native::builder().unwrap_or_else(|_| {