Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0-preview5] Revert "[mono][interp] Add tiering within interpreter (#68823)" #69866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ set(interp_sources
interp/interp-intrins.c
interp/mintops.h
interp/mintops.c
interp/transform.c
interp/tiering.h
interp/tiering.c)
interp/transform.c)
set(interp_stub_sources
interp-stubs.c)

Expand Down
6 changes: 3 additions & 3 deletions src/mono/mono/mini/ee.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef __MONO_EE_H__
#define __MONO_EE_H__

#define MONO_EE_API_VERSION 0x17
#define MONO_EE_API_VERSION 0x16

typedef struct _MonoInterpStackIter MonoInterpStackIter;

Expand All @@ -38,7 +38,7 @@ typedef gpointer MonoInterpFrameHandle;
MONO_EE_CALLBACK (void, get_resume_state, (const MonoJitTlsData *jit_tls, gboolean *has_resume_state, MonoInterpFrameHandle *interp_frame, gpointer *handler_ip)) \
MONO_EE_CALLBACK (gboolean, run_finally, (StackFrameInfo *frame, int clause_index, gpointer handler_ip, gpointer handler_ip_end)) \
MONO_EE_CALLBACK (gboolean, run_filter, (StackFrameInfo *frame, MonoException *ex, int clause_index, gpointer handler_ip, gpointer handler_ip_end)) \
MONO_EE_CALLBACK (gboolean, run_clause_with_il_state, (gpointer il_state, int clause_index, MonoObject *ex, gboolean *filtered)) \
MONO_EE_CALLBACK (gboolean, run_clause_with_il_state, (gpointer il_state, int clause_index, gpointer handler_ip, gpointer handler_ip_end, MonoObject *ex, gboolean *filtered, MonoExceptionEnum clause_type)) \
MONO_EE_CALLBACK (void, frame_iter_init, (MonoInterpStackIter *iter, gpointer interp_exit_data)) \
MONO_EE_CALLBACK (gboolean, frame_iter_next, (MonoInterpStackIter *iter, StackFrameInfo *frame)) \
MONO_EE_CALLBACK (MonoJitInfo*, find_jit_info, (MonoMethod *method)) \
Expand All @@ -63,7 +63,7 @@ typedef gpointer MonoInterpFrameHandle;
MONO_EE_CALLBACK (void, jit_info_foreach, (InterpJitInfoFunc func, gpointer user_data)) \
MONO_EE_CALLBACK (gboolean, sufficient_stack, (gsize size)) \
MONO_EE_CALLBACK (void, entry_llvmonly, (gpointer res, gpointer *args, gpointer imethod)) \
MONO_EE_CALLBACK (gpointer, get_interp_method, (MonoMethod *method)) \
MONO_EE_CALLBACK (gpointer, get_interp_method, (MonoMethod *method, MonoError *error)) \
MONO_EE_CALLBACK (MonoJitInfo*, compile_interp_method, (MonoMethod *method, MonoError *error)) \

typedef struct _MonoEECallbacks {
Expand Down
5 changes: 3 additions & 2 deletions src/mono/mono/mini/interp-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ stub_run_filter (StackFrameInfo *frame, MonoException *ex, int clause_index, gpo
}

static gboolean
stub_run_clause_with_il_state (gpointer il_state, int clause_index, MonoObject *ex, gboolean *filtered)
stub_run_clause_with_il_state (gpointer il_state, int clause_index, gpointer handler_ip, gpointer handler_ip_end, MonoObject *ex,
gboolean *filtered, MonoExceptionEnum clause_type)
{
g_assert_not_reached ();
}
Expand Down Expand Up @@ -239,7 +240,7 @@ stub_entry_llvmonly (gpointer res, gpointer *args, gpointer imethod)
}

static gpointer
stub_get_interp_method (MonoMethod *method)
stub_get_interp_method (MonoMethod *method, MonoError *error)
{
g_assert_not_reached ();
return NULL;
Expand Down
29 changes: 4 additions & 25 deletions src/mono/mono/mini/interp/interp-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,9 @@ typedef enum {

#define PROFILE_INTERP 0

#define INTERP_IMETHOD_TAG_1(im) ((gpointer)((mono_u)(im) | 1))
#define INTERP_IMETHOD_IS_TAGGED_1(im) ((mono_u)(im) & 1)
#define INTERP_IMETHOD_UNTAG_1(im) ((InterpMethod*)((mono_u)(im) & ~1))

#define INTERP_IMETHOD_TAG_UNBOX(im) INTERP_IMETHOD_TAG_1(im)
#define INTERP_IMETHOD_IS_TAGGED_UNBOX(im) INTERP_IMETHOD_IS_TAGGED_1(im)
#define INTERP_IMETHOD_UNTAG_UNBOX(im) INTERP_IMETHOD_UNTAG_1(im)
#define INTERP_IMETHOD_TAG_UNBOX(im) ((gpointer)((mono_u)(im) | 1))
#define INTERP_IMETHOD_IS_TAGGED_UNBOX(im) ((mono_u)(im) & 1)
#define INTERP_IMETHOD_UNTAG_UNBOX(im) ((InterpMethod*)((mono_u)(im) & ~1))

/*
* Structure representing a method transformed for the interpreter
Expand Down Expand Up @@ -148,25 +144,8 @@ struct InterpMethod {
#ifdef ENABLE_EXPERIMENT_TIERED
MiniTieredCounter tiered_counter;
#endif
gint32 entry_count;
InterpMethod *optimized_imethod;
// This data is used to resolve native offsets from unoptimized method to native offsets
// in the optimized method. We rely on keys identifying a certain logical execution point
// to be equal between unoptimized and optimized method. In unoptimized method we map from
// native_offset to a key and in optimized_method we map from key to a native offset.
//
// The logical execution points that are being tracked are some basic block starts (in this
// case we don't need any tracking in the unoptimized method, just the mapping from bbindex
// to its native offset) and call handler returns. Call handler returns store the return ip
// on the stack so once we tier up the method we need to update these to IPs in the optimized
// method. The key for a call handler is its index, in appearance order in the IL, multiplied
// by -1. (So we don't collide with basic block indexes)
//
// Since we have both positive and negative keys in this array, we use G_MAXINTRE as terminator.
int *patchpoint_data;
unsigned int init_locals : 1;
unsigned int vararg : 1;
unsigned int optimized : 1;
unsigned int needs_thread_attach : 1;
#if PROFILE_INTERP
long calls;
Expand Down Expand Up @@ -286,7 +265,7 @@ void
mono_interp_transform_init (void);

InterpMethod *
mono_interp_get_imethod (MonoMethod *method);
mono_interp_get_imethod (MonoMethod *method, MonoError *error);

void
mono_interp_print_code (InterpMethod *imethod);
Expand Down
Loading