* src/vm/jit/codegen-common.cpp: Some minor adaption to allow above change.
* src/vm/options.c (opt_TraceBuiltinCalls): Added new tracer option.
* src/vm/options.h (opt_TraceBuiltinCalls): Likewise.
/* print the call-trace if necesarry */
/* BEFORE: filling the local reference table */
- if (opt_TraceJavaCalls)
+ if (opt_TraceJavaCalls || opt_TraceBuiltinCalls)
trace_java_call_enter(m, arg_regs, arg_stack);
# endif
#endif
/* print the call-trace if necesarry */
/* AFTER: unwrapping the return value */
- if (opt_TraceJavaCalls)
+ if (opt_TraceJavaCalls || opt_TraceBuiltinCalls)
trace_java_call_exit(m, ret_regs);
# endif
#endif
s4 i;
s4 pos;
- /* We don't trace builtin functions here because the argument
- passing happens via the native ABI and does not fit these
- functions. */
-
- if (method_is_builtin(m))
- return;
+ /* We can only trace "slow" builtin functions (those with a stub)
+ * here, because the argument passing of "fast" ones happens via
+ * the native ABI and does not fit these functions. */
+ if (method_is_builtin(m)) {
+ if (!opt_TraceBuiltinCalls)
+ return;
+ }
+ else {
+ if (!opt_TraceJavaCalls)
+ return;
#if defined(ENABLE_DEBUG_FILTER)
- if (!show_filters_test_verbosecall_enter(m))
- return;
+ if (!show_filters_test_verbosecall_enter(m))
+ return;
#endif
+ }
#if defined(ENABLE_VMLOG)
vmlog_cacao_enter_method(m);
s4 pos;
imm_union val;
- /* We don't trace builtin functions here because the argument
- passing happens via the native ABI and does not fit these
- functions. */
-
- if (method_is_builtin(m))
- return;
+ /* We can only trace "slow" builtin functions (those with a stub)
+ * here, because the argument passing of "fast" ones happens via
+ * the native ABI and does not fit these functions. */
+ if (method_is_builtin(m)) {
+ if (!opt_TraceBuiltinCalls)
+ return;
+ }
+ else {
+ if (!opt_TraceJavaCalls)
+ return;
#if defined(ENABLE_DEBUG_FILTER)
- if (!show_filters_test_verbosecall_exit(m))
- return;
+ if (!show_filters_test_verbosecall_exit(m))
+ return;
#endif
+ }
#if defined(ENABLE_VMLOG)
vmlog_cacao_leave_method(m);
#if defined(ENABLE_REPLACEMENT)
int opt_TestReplacement = 0;
#endif
+int opt_TraceBuiltinCalls = 0;
int opt_TraceCompilerCalls = 0;
int opt_TraceExceptions = 0;
int opt_TraceHPI = 0;
OPT_ProfileMemoryUsageGNUPlot,
OPT_RegallocSpillAll,
OPT_TestReplacement,
+ OPT_TraceBuiltinCalls,
OPT_TraceCompilerCalls,
OPT_TraceExceptions,
OPT_TraceHPI,
#if defined(ENABLE_REPLACEMENT)
{ "TestReplacement", OPT_TestReplacement, OPT_TYPE_BOOLEAN, "activate all replacement points during code generation" },
#endif
+ { "TraceBuiltinCalls", OPT_TraceBuiltinCalls, OPT_TYPE_BOOLEAN, "trace calls to VM builtin functions" },
{ "TraceCompilerCalls", OPT_TraceCompilerCalls, OPT_TYPE_BOOLEAN, "trace JIT compiler calls" },
{ "TraceExceptions", OPT_TraceExceptions, OPT_TYPE_BOOLEAN, "trace Exception throwing" },
{ "TraceHPI", OPT_TraceHPI, OPT_TYPE_BOOLEAN, "Trace Host Porting Interface (HPI)" },
break;
#endif
+ case OPT_TraceBuiltinCalls:
+ opt_TraceBuiltinCalls = enable;
+ break;
+
case OPT_TraceCompilerCalls:
opt_TraceCompilerCalls = enable;
break;
#if defined(ENABLE_REPLACEMENT)
extern int opt_TestReplacement;
#endif
+extern int opt_TraceBuiltinCalls;
extern int opt_TraceCompilerCalls;
extern int opt_TraceExceptions;
extern int opt_TraceHPI;