Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/pt-eval.cc @ 15310:b055fc077224
allow jit compiler to be enabled at run-time
* pt-jit.h, pt-jit.cc (Venable_jit_debug, Venable_jit_compiler):
New variables.
(Fenable_jit_debug, Fenable_jit_compiler): New functions.
(jit_info::compile): Make JIT debugging info conditional on
Venable_jit_debug.
* pt-eval.cc (tree_evaluator::visit_simple_for_command,
tree_evaluator::visit_while_command): Make JIT compiling conditional
on Venable_jit_compiler.
* octave.cc (no_jit_compiler_option, jit_debug_option):
New file-scope variables.
(JIT_DEBUG_OPTION, NO_JIT_COMPILER_OPTION): New option macros.
(log_opts): Add --jit_debug and --no-jit-compiler options.
(octave_process_command_line): Handle JIT_DEBUG_OPTION and
NO_JIT_COMPILER_OPTION.
(octave_initialize_interpreter): Handle jit_debug_option and
no_jit_compiler_option.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 06 Sep 2012 01:33:08 -0400 |
parents | c16357c4bdbb |
children | 3f43e9d6d86e |
comparison
equal
deleted
inserted
replaced
15309:c398dde4d409 | 15310:b055fc077224 |
---|---|
42 #include "pt-all.h" | 42 #include "pt-all.h" |
43 #include "pt-eval.h" | 43 #include "pt-eval.h" |
44 #include "symtab.h" | 44 #include "symtab.h" |
45 #include "unwind-prot.h" | 45 #include "unwind-prot.h" |
46 | 46 |
47 #if HAVE_LLVM | |
48 //FIXME: This should be part of tree_evaluator | 47 //FIXME: This should be part of tree_evaluator |
49 #include "pt-jit.h" | 48 #include "pt-jit.h" |
49 | |
50 #if HAVE_LLVM | |
50 static tree_jit jiter; | 51 static tree_jit jiter; |
51 #endif | 52 #endif |
52 | 53 |
53 static tree_evaluator std_evaluator; | 54 static tree_evaluator std_evaluator; |
54 | 55 |
308 tree_expression *expr = cmd.control_expr (); | 309 tree_expression *expr = cmd.control_expr (); |
309 | 310 |
310 octave_value rhs = expr->rvalue1 (); | 311 octave_value rhs = expr->rvalue1 (); |
311 | 312 |
312 #if HAVE_LLVM | 313 #if HAVE_LLVM |
313 if (jiter.execute (cmd, rhs)) | 314 if (Venable_jit_compiler && jiter.execute (cmd, rhs)) |
314 return; | 315 return; |
315 #endif | 316 #endif |
316 | 317 |
317 if (error_state || rhs.is_undefined ()) | 318 if (error_state || rhs.is_undefined ()) |
318 return; | 319 return; |
1045 { | 1046 { |
1046 if (error_state) | 1047 if (error_state) |
1047 return; | 1048 return; |
1048 | 1049 |
1049 #if HAVE_LLVM | 1050 #if HAVE_LLVM |
1050 if (jiter.execute (cmd)) | 1051 if (Venable_jit_compiler && jiter.execute (cmd)) |
1051 return; | 1052 return; |
1052 #endif | 1053 #endif |
1053 | 1054 |
1054 unwind_protect frame; | 1055 unwind_protect frame; |
1055 | 1056 |