Merge branch 'master' into fix_aot
This commit is contained in:
22
bench.ce
22
bench.ce
@@ -417,17 +417,25 @@ function format_ops(ops) {
|
||||
|
||||
// Load a module for benchmarking in the given mode
|
||||
// Returns the module value, or null on failure
|
||||
function load_bench_module(f, package_name, mode) {
|
||||
function resolve_bench_load(f, package_name) {
|
||||
var mod_path = text(f, 0, -3)
|
||||
var use_pkg = package_name ? package_name : fd.realpath('.')
|
||||
var prefix = null
|
||||
var src_path = null
|
||||
var prefix = testlib.get_pkg_dir(package_name)
|
||||
var src_path = prefix + '/' + f
|
||||
return {mod_path, use_pkg, src_path}
|
||||
}
|
||||
|
||||
function load_bench_module_native(f, package_name) {
|
||||
var r = resolve_bench_load(f, package_name)
|
||||
return shop.use_native(r.src_path, r.use_pkg)
|
||||
}
|
||||
|
||||
function load_bench_module(f, package_name, mode) {
|
||||
var r = resolve_bench_load(f, package_name)
|
||||
if (mode == "native") {
|
||||
prefix = testlib.get_pkg_dir(package_name)
|
||||
src_path = prefix + '/' + f
|
||||
return shop.use_native(src_path, use_pkg)
|
||||
return load_bench_module_native(f, package_name)
|
||||
}
|
||||
return shop.use(mod_path, use_pkg)
|
||||
return shop.use(r.mod_path, r.use_pkg)
|
||||
}
|
||||
|
||||
// Collect benchmark functions from a loaded module
|
||||
|
||||
Reference in New Issue
Block a user