]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
2007-02-10 Klaus Treichel <ktreichel@web.de>
authorKlaus Treichel <ktreichel@web.de>
Sat, 10 Feb 2007 19:12:28 +0000 (19:12 +0000)
committerKlaus Treichel <ktreichel@web.de>
Sat, 10 Feb 2007 19:12:28 +0000 (19:12 +0000)
* jit/jit-function.c: Use the on-demand compilation driver in
jit_function_apply too. Return the functions' entry point if the
function is allready compiled in jit_function_compile_entry.

ChangeLog
jit/jit-function.c

index 51f67afe805286bd95b3d27d187ac260a560e106..81c9e624e910adc7214a14923aa24ea37780f9ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-10  Klaus Treichel  <ktreichel@web.de>
+
+       * jit/jit-function.c: Use the on-demand compilation driver in
+       jit_function_apply too. Return the functions' entry point if the
+       function is allready compiled in jit_function_compile_entry.
+
 2007-02-04  Aleksey Demakov  <ademakov@gmail.com>
 
        * include/jit/jit-common.h, include/jit/jit-context.h,
index e166398dddd73eee867d83a902c5e7519ca901ee..1896fc426e088a3d3b80a31d0986364ffb35831f 100644 (file)
@@ -910,6 +910,7 @@ jit_function_compile_entry(jit_function_t func, void **entry_point)
        if(func->is_compiled && !(func->builder))
        {
                /* The function is already compiled, and we don't need to recompile */
+               *entry_point = func->entry_point;
                return 1;
        }
        if(!(func->builder))
@@ -1423,6 +1424,9 @@ int jit_function_apply_vararg
        (jit_function_t func, jit_type_t signature, void **args, void *return_area)
 {
        struct jit_backtrace call_trace;
+#if defined(jit_redirector_size)
+       jit_on_demand_driver_func on_demand_driver;
+#endif
        void *entry;
        jit_jmp_buf jbuf;
 
@@ -1457,7 +1461,16 @@ int jit_function_apply_vararg
        }
        else
        {
+#if defined(jit_redirector_size)
+               on_demand_driver = func->context->on_demand_driver;
+               if(!on_demand_driver)
+               {
+                       on_demand_driver = _jit_function_compile_on_demand;
+               }
+               entry = (*on_demand_driver)(func);
+#else
                entry = _jit_function_compile_on_demand(func);
+#endif
        }
 
        /* Get the default signature if necessary */