* tutorial/t3.c, tutorial/t4.cpp: recompile manually
instead of using removed recompile functions.
+ * doc/libjit.texi: update tutorial.
+
2007-12-16 Klaus Treichel <ktreichel@web.de>
* configure.in: Add support for multi os archs (like x86_64). Put the
@code{jit_function_compile} and then jump to the newly compiled code.
Upon the second and subsequent calls to the function, @code{libjit}
will bypass the on-demand compiler and call the compiled code directly.
+Note that in case of on-demand compilation @code{libjit} automatically
+locks and unlocks the corresponding context with
+@code{jit_context_build_start} and @code{jit_context_build_end} calls.
Sometimes you may wish to force a commonly used function to
be recompiled, so that you can apply additional optimization.
jit_function_set_on_demand_compiler(function, compile_mul_add);
@end example
-Then, you force the function to be recompiled with a call to
-@code{jit_function_recompile}:
+Once the function is compiled (either on-demand or up-front) its
+intermediate representation built by @code{libjit} is discarded.
+To force the function to be recompiled you need to build it again
+and call @code{jit_function_compile} after that. As always when
+the function is built and compiled manually it is necessary
+to take care of context locking:
@example
-jit_function_recompile(function);
+jit_context_build_start(context);
+jit_function_get_on_demand_compiler(function)(function);
+jit_function_compile(function);
+jit_context_build_end(context);
@end example
After this, any existing references to the function will be redirected
set_recompilable();
@}
+ virtual void build();
+
protected:
virtual jit_type_t create_signature();
- virtual void build();
@};
@end example