[runtime] Add a separate icall for Monitor.Enter(obj,&bool).
[mono.git] / mono / utils / mono-stack-unwinding.h
index b747f2d428f6892c006460ed8dccce2d3d6b1127..cfeb19d31b9f5960698c4925ba8ecb13e711c757 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright 2008-2010 Novell, Inc.
+ * Copyright 2011 Xamarin Inc.
+ */
 #ifndef __MONO_MONO_STACK_UNWINDING_H__
 #define __MONO_MONO_STACK_UNWINDING_H__
 
@@ -15,13 +19,21 @@ typedef enum {
        FRAME_TYPE_DEBUGGER_INVOKE = 1,
        /* Frame for transitioning to native code */
        FRAME_TYPE_MANAGED_TO_NATIVE = 2,
-       FRAME_TYPE_SENTINEL = 3
+       FRAME_TYPE_TRAMPOLINE = 3,
+       FRAME_TYPE_NUM = 4
 } MonoStackFrameType;
 
 typedef enum {
        MONO_UNWIND_NONE = 0x0,
        MONO_UNWIND_LOOKUP_IL_OFFSET = 0x1,
+       /* NOT signal safe */
        MONO_UNWIND_LOOKUP_ACTUAL_METHOD = 0x2,
+       /*
+        * Store the locations where caller-saved registers are saved on the stack in
+        * frame->reg_locations. The pointer is only valid during the call to the unwind
+        * callback.
+        */
+       MONO_UNWIND_REG_LOCATIONS = 0x4,
        MONO_UNWIND_DEFAULT = MONO_UNWIND_LOOKUP_ACTUAL_METHOD,
        MONO_UNWIND_SIGNAL_SAFE = MONO_UNWIND_NONE,
        MONO_UNWIND_LOOKUP_ALL = MONO_UNWIND_LOOKUP_IL_OFFSET | MONO_UNWIND_LOOKUP_ACTUAL_METHOD,
@@ -35,16 +47,22 @@ typedef struct {
        MonoJitInfo *ji;
        /*
         * Same as ji->method.
+        * Not valid if ASYNC_CONTEXT is true.
         */
        MonoMethod *method;
        /*
         * If ji->method is a gshared method, this is the actual method instance.
         * This is only filled if lookup for actual method was requested (MONO_UNWIND_LOOKUP_ACTUAL_METHOD)
+        * Not valid if ASYNC_CONTEXT is true.
         */
        MonoMethod *actual_method;
        /* The domain containing the code executed by this frame */
        MonoDomain *domain;
        gboolean managed;
+       /*
+        * Whenever this frame was loaded in async context.
+        */
+       gboolean async_context;
        int native_offset;
        /*
         * IL offset of this frame.
@@ -53,11 +71,12 @@ typedef struct {
         */
        int il_offset;
 
-       /*The next fields are only usefull for the jit*/
+       /* The next fields are only useful for the jit */
        gpointer lmf;
        guint32 unwind_info_len;
        guint8 *unwind_info;
 
+       mgreg_t **reg_locations;
 } MonoStackFrameInfo;
 
 /*Index into MonoThreadState::unwind_data. */