22.3   Using the Just-in-time Compiler with HDevEngine/C++

The just-in-time compilation of procedures needs to be enabled in your instance of the HDevEngine class:

    bool exec_compiled = true;
    ...
    HDevEngine my_engine;
    // enable or disable execution of compiled procedures
    my_engine.SetEngineAttribute("execute_procedures_jit_compiled",
                                 exec_compiled ? "true" : "false");

Procedures (and procedures referenced by it) are compiled at the moment a corresponding instance of HDevProcedureCall or HDevProgramCall is created.

You can also explicitly pre-compile all used procedures of a HDevelop program or procedure using the method CompileUsedProcedures of HDevProgram or HDevProcedure, respectively.

In the following example, all used procedures of a procedure call are just-in-time compiled:

    HDevProgram   my_program(program_path.c_str());
    HDevProcedure proc_fib(my_program, "fib");
    ...
    proc_fib.CompileUsedProcedures();