Project

General

Profile

Bug #15986 » mjit_debug2.diff

k0kubun (Takashi Kokubun), 07/12/2019 03:48 PM

View differences:

mjit_worker.c
const char *arg;
fprintf(stderr, "Starting process: %s", abspath);
for (i = 0; (arg = argv[i]) != NULL; i++)
fprintf(stderr, " %s", arg);
for (i = 0; (arg = argv[i]) != NULL; i++) {
fprintf(stderr, " `%s`(%p)", arg, (void *)arg);
}
fprintf(stderr, "\n");
}
#ifdef _WIN32
......
};
char **args;
verbose(2, "DEBUG3: so_file:`%s`\n", so_file);
verbose(2, "DEBUG3: so_file ptr:%p\n", (void *)so_file);
options[1] = so_file;
verbose(2, "DEBUG4: so_file:`%s`\n", options[1]);
verbose(2, "DEBUG4: so_file ptr:%p\n", (void *)options[1]);
args = form_args(6, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS,
options, o_files, CC_LIBS, CC_DLDFLAGS_ARGS);
if (args == NULL)
......
so_file = alloca(c_file_len - sizeof(c_ext) + sizeof(so_ext));
memcpy(so_file, c_file, c_file_len - sizeof(c_ext));
memcpy(&so_file[c_file_len - sizeof(c_ext)], so_ext, sizeof(so_ext));
verbose(2, "DEBUG1: so_file:`%s`\n", so_file);
verbose(2, "DEBUG1: so_file ptr:%p\n", (void *)so_file);
sprintf(funcname, "_mjit%d", unit->id);
......
if ((success = compile_c_to_o(c_file, o_file)) != false) {
const char *o_files[2] = { NULL, NULL };
o_files[0] = o_file;
verbose(2, "DEBUG2: so_file:`%s`\n", so_file);
verbose(2, "DEBUG2: so_file ptr:%p\n", (void *)so_file);
success = link_o_to_so(o_files, so_file);
// Always set o_file for compaction. The value is also used for lazy deletion.
test/ruby/test_jit.rb
# Shorthand for normal test cases
def assert_eval_with_jit(script, stdout: nil, success_count:, min_calls: 1, insns: [], uplevel: 3)
out, err = eval_with_jit(script, verbose: 1, min_calls: min_calls)
out, err = eval_with_jit(script, verbose: 2, min_calls: min_calls)
actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size
# Add --jit-verbose=2 logs for cl.exe because compiler's error message is suppressed
# for cl.exe with --jit-verbose=1. See `start_process` in mjit_worker.c.
(8-8/11)