Skip to content

Commit a63a1c9

Browse files
committed
wip
1 parent 505a5dc commit a63a1c9

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/mono/mono/mini/interp/interp-internals.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ typedef enum {
9797
IMETHOD_CODE_UNKNOWN
9898
} InterpMethodCodeType;
9999

100+
#ifdef HOST_WASM
100101
#define PROFILE_INTERP 1
102+
#else
103+
#define PROFILE_INTERP 0
104+
#endif
101105

102106
#define INTERP_IMETHOD_TAG_1(im) ((gpointer)((mono_u)(im) | 1))
103107
#define INTERP_IMETHOD_IS_TAGGED_1(im) ((mono_u)(im) & 1)

src/mono/mono/mini/interp/interp.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@ reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gp
228228
frame->retval = (stackval*)retval;
229229
frame->state.ip = NULL;
230230
#if PROFILE_INTERP
231+
#ifdef HOST_WASM
231232
frame->timestamp_before_entry = mono_wasm_timestamp();
232-
#endif
233+
#endif /* HOST_WASM */
234+
#endif /* PROFILE_INTERP */
233235
}
234236

235237

@@ -7365,15 +7367,10 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
73657367
g_assert_checked (frame->imethod);
73667368

73677369
#if PROFILE_INTERP
7368-
/*struct timespec time;
7369-
g_assert (clock_gettime (CLOCK_REALTIME, &time) == 0);
7370-
int64_t now = system_time_to_int64 (time.tv_sec, time.tv_nsec);
7371-
int64_t duration = now - frame->timestamp_before_entry;
7372-
char *method_name = mono_method_get_name_full (frame->imethod->method, TRUE, FALSE, MONO_TYPE_NAME_FORMAT_IL);
7373-
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Measure %s %d", method_name, duration);
7374-
g_free (method_name);*/
7370+
#ifdef HOST_WASM
73757371
mono_wasm_measure (frame->imethod->method, frame->timestamp_before_entry);
7376-
#endif
7372+
#endif /* HOST_WASM */
7373+
#endif /* PROFILE_INTERP */
73777374

73787375
if (frame->parent && frame->parent->state.ip) {
73797376
/* Return to the main loop after a non-recursive interpreter call */

src/mono/wasm/runtime/driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ int32_t monoeg_g_hasenv(const char *variable);
7070
void mono_free (void*);
7171
int32_t mini_parse_debug_option (const char *option);
7272
char *mono_method_get_full_name (MonoMethod *method);
73+
char *mono_method_full_name (MonoMethod *method, int signature);
7374

7475
static void mono_wasm_init_finalizer_thread (void);
7576

@@ -1485,5 +1486,5 @@ EMSCRIPTEN_KEEPALIVE int mono_wasm_f64_to_i52 (int64_t *destination, double valu
14851486
//extern const char* mono_method_get_full_name (MonoMethod *method);
14861487

14871488
EMSCRIPTEN_KEEPALIVE const char* mono_wasm_method_get_name (MonoMethod *method) {
1488-
return mono_method_get_full_name(method);
1489+
return mono_method_full_name(method, 0);
14891490
}

src/mono/wasm/runtime/performance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const enum MeasuredBlock {
1717
callCsFunction = "mono.callCsFunction:",
1818
getAssemblyExports = "mono.getAssemblyExports:",
1919
instantiateAsset = "mono.instantiateAsset:",
20-
interp = "mono.interp:",
20+
interp = "interp:",
2121
}
2222

2323
let uniqueId = 0;

0 commit comments

Comments
 (0)