static int
inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **sp,
- guchar *ip, guint real_offset, GList *dont_inline, gboolean inline_allways)
+ guchar *ip, guint real_offset, GList *dont_inline, gboolean inline_always)
{
MonoInst *ins, *rvar = NULL;
MonoMethodHeader *cheader;
g_assert (cfg->exception_type == MONO_EXCEPTION_NONE);
#if (MONO_INLINE_CALLED_LIMITED_METHODS)
- if ((! inline_allways) && ! check_inline_called_method_name_limit (cmethod))
+ if ((! inline_always) && ! check_inline_called_method_name_limit (cmethod))
return 0;
#endif
#if (MONO_INLINE_CALLER_LIMITED_METHODS)
- if ((! inline_allways) && ! check_inline_caller_method_name_limit (cfg->method))
+ if ((! inline_always) && ! check_inline_caller_method_name_limit (cfg->method))
return 0;
#endif
cheader = mono_method_get_header (cmethod);
if (cheader == NULL || mono_loader_get_last_error ()) {
+ MonoLoaderError *error = mono_loader_get_last_error ();
+
if (cheader)
mono_metadata_free_mh (cheader);
+ if (inline_always && error)
+ mono_cfg_set_exception (cfg, error->exception_type);
+
mono_loader_clear_error ();
return 0;
}
cfg->ret_var_set = prev_ret_var_set;
cfg->inline_depth --;
- if ((costs >= 0 && costs < 60) || inline_allways) {
+ if ((costs >= 0 && costs < 60) || inline_always) {
if (cfg->verbose_level > 2)
printf ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
!disable_inline && mono_method_check_inlining (cfg, cmethod) &&
!g_list_find (dont_inline, cmethod)) {
int costs;
- gboolean allways = FALSE;
+ gboolean always = FALSE;
if ((cmethod->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
(cmethod->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
/* Prevent inlining of methods that call wrappers */
INLINE_FAILURE;
cmethod = mono_marshal_get_native_wrapper (cmethod, check_for_pending_exc, FALSE);
- allways = TRUE;
+ always = TRUE;
}
- if ((costs = inline_method (cfg, cmethod, fsig, sp, ip, cfg->real_offset, dont_inline, allways))) {
+ if ((costs = inline_method (cfg, cmethod, fsig, sp, ip, cfg->real_offset, dont_inline, always))) {
ip += 5;
cfg->real_offset += 5;
bblock = cfg->cbb;
iargs [0] = sp [0];
costs = inline_method (cfg, mono_castclass, mono_method_signature (mono_castclass),
- iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ CHECK_CFG_EXCEPTION;
g_assert (costs > 0);
ip += 5;
iargs [0] = sp [0];
costs = inline_method (cfg, mono_isinst, mono_method_signature (mono_isinst),
- iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ CHECK_CFG_EXCEPTION;
g_assert (costs > 0);
ip += 5;
costs = inline_method (cfg, mono_castclass, mono_method_signature (mono_castclass),
iargs, ip, cfg->real_offset, dont_inline, TRUE);
-
+ CHECK_CFG_EXCEPTION;
g_assert (costs > 0);
ip += 5;
if (cfg->opt & MONO_OPT_INLINE || cfg->compile_aot) {
costs = inline_method (cfg, stfld_wrapper, mono_method_signature (stfld_wrapper),
iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ CHECK_CFG_EXCEPTION;
g_assert (costs > 0);
cfg->real_offset += 5;
if (cfg->opt & MONO_OPT_INLINE || cfg->compile_aot) {
costs = inline_method (cfg, wrapper, mono_method_signature (wrapper),
iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ CHECK_CFG_EXCEPTION;
bblock = cfg->cbb;
g_assert (costs > 0);
NEW_BBLOCK (cfg, dont_throw);
/*
- * Currently, we allways rethrow the abort exception, despite the
+ * Currently, we always rethrow the abort exception, despite the
* fact that this is not correct. See thread6.cs for an example.
* But propagating the abort exception is more important than
* getting the sematics right.