dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] libjit ChangeLog include/jit/jit-function.h jit...


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] libjit ChangeLog include/jit/jit-function.h jit...
Date: Sun, 17 Dec 2006 21:06:26 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    libjit
Changes by:     Klaus Treichel <ktreichel>      06/12/17 21:06:26

Modified files:
        .              : ChangeLog 
        include/jit    : jit-function.h 
        jit            : jit-function.c 

Log message:
        2006-12-17  Klaus Treichel  <address@hidden>
        
                * include/jit/jit-function.h, jit/jit-function.c: Add the 
function
                jit_function_from_vtable_pointer to convert a vtable pointer 
back to the
                jit_function_t.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.285&r2=1.286
http://cvs.savannah.gnu.org/viewcvs/libjit/include/jit/jit-function.h?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-function.c?cvsroot=dotgnu-pnet&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -b -r1.285 -r1.286
--- ChangeLog   28 Nov 2006 20:26:42 -0000      1.285
+++ ChangeLog   17 Dec 2006 21:06:26 -0000      1.286
@@ -1,3 +1,9 @@
+2006-12-17  Klaus Treichel  <address@hidden>
+
+       * include/jit/jit-function.h, jit/jit-function.c: Add the function
+       jit_function_from_vtable_pointer to convert a vtable pointer back to the
+       jit_function_t.
+
 2006-11-29  Aleksey Demakov  <address@hidden>
 
        * jit/jit-reg-alloc.c (save_value): fix bug freeing stack register

Index: include/jit/jit-function.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/libjit/include/jit/jit-function.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- include/jit/jit-function.h  6 Oct 2004 05:43:15 -0000       1.3
+++ include/jit/jit-function.h  17 Dec 2006 21:06:26 -0000      1.4
@@ -59,6 +59,8 @@
 jit_function_t jit_function_from_pc
        (jit_context_t context, void *pc, void **handler) JIT_NOTHROW;
 void *jit_function_to_vtable_pointer(jit_function_t func) JIT_NOTHROW;
+jit_function_t jit_function_from_vtable_pointer
+       (jit_context_t context, void *vtable_pointer) JIT_NOTHROW;
 void jit_function_set_on_demand_compiler
                (jit_function_t func, jit_on_demand_func on_demand) JIT_NOTHROW;
 int jit_function_apply

Index: jit/jit-function.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/libjit/jit/jit-function.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- jit/jit-function.c  26 Nov 2006 20:42:01 -0000      1.23
+++ jit/jit-function.c  17 Dec 2006 21:06:26 -0000      1.24
@@ -1139,6 +1139,34 @@
 }
 
 /*@
+ * @deftypefun jit_function_t jit_function_from_vtable_pointer (jit_context_t 
context, {void *} vtable_pointer)
+ * Convert a vtable_pointer back into a function.  Returns NULL if the
+ * vtable_pointer does not correspond to a function in the specified context.
+ * @end deftypefun
address@hidden/
+jit_function_t jit_function_from_vtable_pointer(jit_context_t context, void 
*vtable_pointer)
+{
+#ifdef JIT_BACKEND_INTERP
+       /* In the interpreted version, the function pointer is used in vtables 
*/
+       jit_function_t func = (jit_function_t)vtable_pinter;
+
+       if(func && func->context == context)
+       {
+               return func;
+       }
+       return 0;
+#else
+       void *cookie;
+       if(!context || !(context->cache))
+       {
+               return 0;
+       }
+       return (jit_function_t)_jit_cache_get_method
+               (context->cache, vtable_pointer, &cookie);
+#endif
+}
+
+/*@
  * @deftypefun void jit_function_set_on_demand_compiler (jit_function_t func, 
jit_on_demand_func on_demand)
  * Specify the C function to be called when @code{func} needs to be
  * compiled on-demand.  This should be set just after the function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]