} else if (strncmp (argv [i], "-O=", 3) == 0) {
opt = parse_optimizations (argv [i] + 3);
} else if (strcmp (argv [i], "--gc=sgen") == 0) {
-#if HAVE_BOEHM_GC
- GString *path = g_string_new (argv [0]);
- g_string_append (path, "-sgen");
- argv [0] = path->str;
- execvp (path->str, argv);
-#endif
+ if (!strcmp (mono_gc_get_gc_name (), "boehm")) {
+ GString *path = g_string_new (argv [0]);
+ g_string_append (path, "-sgen");
+ argv [0] = path->str;
+ execvp (path->str, argv);
+ }
} else if (strcmp (argv [i], "--gc=boehm") == 0) {
-#if HAVE_SGEN_GC
- char *copy = g_strdup (argv [0]);
- char *p = strstr (copy, "-sgen");
- if (p == NULL){
- fprintf (stderr, "Error, this process is not named mono-sgen and the command line option --boehm was passed");
- exit (1);
+ if (!strcmp (mono_gc_get_gc_name (), "sgen")) {
+ char *copy = g_strdup (argv [0]);
+ char *p = strstr (copy, "-sgen");
+ if (p == NULL){
+ fprintf (stderr, "Error, this process is not named mono-sgen and the command line option --boehm was passed");
+ exit (1);
+ }
+ *p = 0;
+ argv [0] = p;
+ execvp (p, argv);
}
- *p = 0;
- argv [0] = p;
- execvp (p, argv);
-#endif
} else if (strcmp (argv [i], "--config") == 0) {
if (i +1 >= argc){
fprintf (stderr, "error: --config requires a filename argument\n");
type_from_op (ins, NULL, NULL);
return ins;
-#if !defined(MONO_ARCH_EMULATE_MUL_DIV) && !defined(HAVE_MOVING_COLLECTOR)
- } else if (strcmp (cmethod->name, "InternalGetHashCode") == 0) {
+#if !defined(MONO_ARCH_EMULATE_MUL_DIV)
+ } else if (strcmp (cmethod->name, "InternalGetHashCode") == 0 && !mono_gc_is_moving ()) {
int dreg = alloc_ireg (cfg);
int t1 = alloc_ireg (cfg);
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
-#ifndef HAVE_MOVING_COLLECTOR
+ EMIT_NEW_PCONST (cfg, *sp, *((gpointer *)addr));
+ type_to_eval_stack_type ((cfg), field->type, *sp);
+ sp++;
+ break;
case MONO_TYPE_STRING:
case MONO_TYPE_OBJECT:
case MONO_TYPE_CLASS:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
-#endif
- EMIT_NEW_PCONST (cfg, *sp, *((gpointer *)addr));
- type_to_eval_stack_type ((cfg), field->type, *sp);
- sp++;
+ if (!mono_gc_is_moving ()) {
+ EMIT_NEW_PCONST (cfg, *sp, *((gpointer *)addr));
+ type_to_eval_stack_type ((cfg), field->type, *sp);
+ sp++;
+ } else {
+ is_const = FALSE;
+ }
break;
case MONO_TYPE_I8:
case MONO_TYPE_U8:
register_icall (mono_get_native_calli_wrapper, "mono_get_native_calli_wrapper", "ptr ptr ptr ptr", FALSE);
register_icall (mono_resume_unwind, "mono_resume_unwind", "void", TRUE);
-#ifdef HAVE_WRITE_BARRIERS
register_icall (mono_gc_wbarrier_value_copy_bitmap, "mono_gc_wbarrier_value_copy_bitmap", "void ptr ptr int int", FALSE);
-#endif
#endif