GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "pt-jit.h"
Public Types | |
typedef std::pair< jit_type *, std::string > | type_bound |
typedef std::vector< type_bound > | type_bound_vector |
typedef std::map< std::string, jit_variable * > | variable_map |
Private Types | |
typedef std::list< jit_block * > | block_list |
Private Member Functions | |
jit_call * | create_checked_impl (jit_call *ret) |
jit_variable * | create_variable (const std::string &vname, jit_type *type, bool isarg=true) |
jit_value * | do_assign (tree_expression *exp, jit_value *rhs, bool artificial=false) |
jit_value * | do_assign (const std::string &lhs, jit_value *rhs, bool print, bool artificial=false) |
jit_variable * | find_variable (const std::string &vname) const |
void | finish_breaks (jit_block *dest, const block_list &lst) |
jit_variable * | get_variable (const std::string &vname) |
void | initialize (symbol_table::scope_id s) |
std::string | next_for_bounds (bool inc=true) |
std::string | next_iterator (bool inc=true) |
std::string | next_name (const char *prefix, size_t &count, bool inc) |
std::string | next_shortcircut_result (bool inc=true) |
jit_instruction * | resolve (tree_index_expression &exp, jit_value *extra_arg=0, bool lhs=false) |
jit_value * | visit (tree *tee) |
jit_value * | visit (tree &tee) |
Private Attributes | |
std::vector< std::pair < std::string, bool > > | arguments |
jit_block * | block |
jit_block_list | blocks |
type_bound_vector | bounds |
block_list | breaks |
block_list | continues |
bool | converting_function |
std::vector < jit_magic_end::context > | end_context |
jit_block * | entry_block |
jit_factory | factory |
jit_block * | final_block |
size_t | for_bounds_count |
llvm::Function * | function |
size_t | iterator_count |
jit_value * | result |
symbol_table::scope_id | scope |
size_t | short_count |
variable_map | vmap |
|
private |
typedef std::pair<jit_type *, std::string> jit_convert::type_bound |
typedef std::vector<type_bound> jit_convert::type_bound_vector |
typedef std::map<std::string, jit_variable *> jit_convert::variable_map |
Definition at line 98 of file pt-jit.cc.
References jit_block::append(), block, blocks, breaks, continues, jit_factory::create(), create_variable(), symbol_table::current_scope(), factory, final_block, initialize(), jit_variable::name(), next_for_bounds(), jit_block_list::push_back(), visit(), and vmap.
jit_convert::jit_convert | ( | octave_user_function & | fcn, |
const std::vector< jit_type * > & | args | ||
) |
Definition at line 131 of file pt-jit.cc.
References jit_block::append(), block, blocks, octave_user_function::body(), breaks, continues, jit_factory::create(), create_variable(), jit_typeinfo::destroy(), factory, final_block, finish_breaks(), octave_base_list< elt_type >::front(), get_variable(), initialize(), octave_user_function::is_special_expr(), tree_decl_elt::name(), octave_user_function::parameter_list(), jit_block_list::push_back(), octave_user_function::return_list(), octave_user_function::scope(), octave_base_list< elt_type >::size(), octave_user_function::special_expr(), tree_parameter_list::takes_varargs(), visit(), visit_statement_list(), and vmap.
|
inline |
Definition at line 58 of file pt-jit.h.
Referenced by resolve(), visit_binary_expression(), visit_if_command_list(), visit_postfix_expression(), visit_prefix_expression(), visit_simple_assignment(), and visit_while_command().
|
inline |
|
inline |
|
inline |
Definition at line 920 of file pt-jit.cc.
References jit_block::append(), block, blocks, jit_factory::create(), factory, final_block, jit_block::name(), jit_block_list::push_back(), and jit_error_check::var_error_state.
|
private |
Definition at line 967 of file pt-jit.cc.
References jit_factory::create(), jit_typeinfo::create_undef(), entry_block, factory, jit_block::prepend(), and vmap.
Referenced by get_variable(), and jit_convert().
|
private |
Definition at line 1058 of file pt-jit.cc.
References tree_expression::name(), tree_expression::print_result(), and resolve().
Referenced by visit_postfix_expression(), visit_prefix_expression(), visit_simple_assignment(), visit_simple_for_command(), and visit_statement().
|
private |
Definition at line 1079 of file pt-jit.cc.
References jit_block::append(), block, jit_factory::create(), factory, get_variable(), jit_assign::mark_artificial(), and jit_typeinfo::print_value().
|
private |
Definition at line 936 of file pt-jit.cc.
References vmap.
Referenced by get_variable(), and visit_simple_for_command().
|
private |
Definition at line 1109 of file pt-jit.cc.
References jit_block::append(), jit_factory::create(), and factory.
Referenced by jit_convert(), visit_simple_for_command(), and visit_while_command().
|
inline |
Definition at line 66 of file pt-jit.h.
Referenced by jit_info::compile(), and jit_function_info::jit_function_info().
|
inline |
Definition at line 68 of file pt-jit.h.
Referenced by jit_info::compile().
|
inline |
Definition at line 70 of file pt-jit.h.
Referenced by jit_info::compile(), and jit_function_info::jit_function_info().
|
inline |
|
private |
Definition at line 944 of file pt-jit.cc.
References bounds, converting_function, create_variable(), symbol_table::find_symbol(), find_variable(), jit_typeinfo::get_any(), symbol_table::symbol_record::is_global(), symbol_table::symbol_record::is_persistent(), scope, jit_typeinfo::type_of(), and symbol_table::symbol_record::varval().
Referenced by do_assign(), jit_convert(), resolve(), and visit_identifier().
|
inline |
Definition at line 74 of file pt-jit.h.
Referenced by jit_info::compile(), and jit_function_info::jit_function_info().
|
private |
Definition at line 904 of file pt-jit.cc.
References block, blocks, jit_factory::create(), entry_block, factory, final_block, for_bounds_count, iterator_count, jit_block::mark_alive(), jit_block_list::push_back(), jit_instruction::reset_ids(), scope, and short_count.
Referenced by jit_convert().
|
inlineprivate |
Definition at line 215 of file pt-jit.h.
Referenced by jit_convert(), and visit_simple_for_command().
|
inlineprivate |
Definition at line 212 of file pt-jit.h.
Referenced by visit_simple_for_command().
|
inlineprivate |
Definition at line 218 of file pt-jit.h.
Referenced by visit_binary_expression().
|
private |
Definition at line 1000 of file pt-jit.cc.
References action_container::add_method(), tree_index_expression::arg_lists(), octave_base_list< elt_type >::begin(), create_checked(), octave_base_list< elt_type >::end(), end_context, tree_index_expression::expression(), factory, get_variable(), tree_identifier::name(), jit_typeinfo::paren_subsasgn(), jit_typeinfo::paren_subsref(), octave_base_list< elt_type >::size(), tree_index_expression::type_tags(), and visit().
Referenced by do_assign(), and visit_index_expression().
Definition at line 232 of file pt-jit.h.
References visit().
Referenced by jit_convert(), resolve(), visit(), visit_binary_expression(), visit_colon_expression(), visit_if_command_list(), visit_postfix_expression(), visit_prefix_expression(), visit_simple_assignment(), visit_simple_for_command(), visit_statement(), and visit_while_command().
Definition at line 1099 of file pt-jit.cc.
References tree::accept(), action_container::protect_var(), and result.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 243 of file pt-jit.cc.
References jit_block::append(), jit_typeinfo::binary_op(), block, blocks, tree_boolean_expression::bool_and, jit_factory::create(), create_checked(), factory, tree_binary_expression::lhs(), jit_typeinfo::logically_true(), jit_block::name(), next_shortcircut_result(), octave_value::num_binary_ops, tree_binary_expression::op_type(), tree_boolean_expression::op_type(), jit_block_list::push_back(), result, tree_binary_expression::rhs(), visit(), and vmap.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 313 of file pt-jit.cc.
References jit_block::append(), tree_colon_expression::base(), block, jit_factory::create(), factory, tree_colon_expression::increment(), tree_colon_expression::limit(), jit_typeinfo::make_range(), result, and visit().
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 655 of file pt-jit.cc.
References octave_value::complex_value(), jit_factory::create(), octave_value::double_value(), factory, jit_typeinfo::get_complex(), jit_typeinfo::get_range(), jit_typeinfo::get_scalar(), octave_value::range_value(), result, tree_constant::rvalue1(), and jit_typeinfo::type_of().
|
virtual |
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 501 of file pt-jit.cc.
References jit_block::append(), block, jit_factory::create(), end_context, factory, get_variable(), jit_typeinfo::grab(), tree_identifier::has_magic_end(), tree_identifier::name(), and result.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 525 of file pt-jit.cc.
References tree_if_command_list::accept(), and tree_if_command::cmd_list().
|
virtual |
Implements tree_walker.
Definition at line 533 of file pt-jit.cc.
References tree_statement_list::accept(), jit_block::append(), octave_base_list< elt_type >::back(), octave_base_list< elt_type >::begin(), block, blocks, breaks, tree_if_clause::commands(), tree_if_clause::condition(), continues, jit_factory::create(), create_checked(), octave_base_list< elt_type >::end(), factory, tree_if_clause::is_else_clause(), jit_typeinfo::logically_true(), jit_block_list::push_back(), octave_base_list< elt_type >::size(), and visit().
|
virtual |
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
void jit_convert::visit_octave_user_function_header | ( | octave_user_function & | ) |
void jit_convert::visit_octave_user_function_trailer | ( | octave_user_function & | ) |
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 692 of file pt-jit.cc.
References create_checked(), do_assign(), jit_typeinfo::grab(), octave_value::op_decr, octave_value::op_incr, tree_unary_expression::op_type(), tree_unary_expression::operand(), result, jit_typeinfo::unary_op(), and visit().
|
virtual |
Implements tree_walker.
Definition at line 710 of file pt-jit.cc.
References create_checked(), do_assign(), octave_value::op_decr, octave_value::op_incr, tree_unary_expression::op_type(), tree_unary_expression::operand(), result, jit_typeinfo::unary_op(), and visit().
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 734 of file pt-jit.cc.
References octave_value::assign_op_to_binary_op(), jit_typeinfo::binary_op(), create_checked(), do_assign(), tree_simple_assignment::left_hand_side(), octave_value::op_asn_eq, tree_simple_assignment::op_type(), result, tree_simple_assignment::right_hand_side(), and visit().
|
virtual |
Implements tree_walker.
Definition at line 362 of file pt-jit.cc.
References tree_statement_list::accept(), jit_block::append(), jit_typeinfo::binary_op(), block, blocks, tree_simple_for_command::body(), breaks, continues, tree_simple_for_command::control_expr(), jit_factory::create(), do_assign(), factory, final_block, find_variable(), finish_breaks(), jit_typeinfo::for_check(), jit_typeinfo::for_index(), jit_typeinfo::for_init(), tree_simple_for_command::left_hand_side(), next_for_bounds(), next_iterator(), octave_value::op_add, action_container::protect_var(), jit_block_list::push_back(), jit_error_check::var_interrupt, visit(), and vmap.
|
virtual |
Implements tree_walker.
Definition at line 755 of file pt-jit.cc.
References jit_block::append(), block, tree_statement::command(), jit_factory::create(), do_assign(), tree_statement::expression(), factory, tree_expression::is_assignment_expression(), tree_expression::is_identifier(), tree_expression::name(), tree_expression::print_result(), jit_typeinfo::print_value(), and visit().
|
virtual |
Implements tree_walker.
Definition at line 793 of file pt-jit.cc.
References tree_statement::accept(), octave_base_list< elt_type >::begin(), and octave_base_list< elt_type >::end().
Referenced by jit_convert().
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 836 of file pt-jit.cc.
References tree_statement_list::accept(), jit_block::append(), block, blocks, tree_while_command::body(), breaks, tree_while_command::condition(), continues, jit_factory::create(), create_checked(), factory, final_block, finish_breaks(), jit_typeinfo::logically_true(), action_container::protect_var(), jit_block_list::push_back(), jit_error_check::var_interrupt, and visit().
|
private |
|
private |
Definition at line 179 of file pt-jit.h.
Referenced by create_checked_impl(), do_assign(), initialize(), jit_convert(), visit_binary_expression(), visit_break_command(), visit_colon_expression(), visit_continue_command(), visit_identifier(), visit_if_command_list(), visit_simple_for_command(), visit_statement(), and visit_while_command().
|
private |
Definition at line 183 of file pt-jit.h.
Referenced by create_checked_impl(), initialize(), jit_convert(), visit_binary_expression(), visit_if_command_list(), visit_simple_for_command(), and visit_while_command().
|
private |
Definition at line 163 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 237 of file pt-jit.h.
Referenced by jit_convert(), visit_break_command(), visit_if_command_list(), visit_simple_for_command(), and visit_while_command().
|
private |
Definition at line 238 of file pt-jit.h.
Referenced by jit_convert(), visit_continue_command(), visit_if_command_list(), visit_simple_for_command(), and visit_while_command().
|
private |
Definition at line 165 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 185 of file pt-jit.h.
Referenced by resolve(), and visit_identifier().
|
private |
Definition at line 175 of file pt-jit.h.
Referenced by create_variable(), and initialize().
|
private |
Definition at line 170 of file pt-jit.h.
Referenced by create_checked_impl(), create_variable(), do_assign(), finish_breaks(), initialize(), jit_convert(), resolve(), visit_binary_expression(), visit_colon_expression(), visit_constant(), visit_identifier(), visit_if_command_list(), visit_simple_for_command(), visit_statement(), and visit_while_command().
|
private |
Definition at line 177 of file pt-jit.h.
Referenced by create_checked_impl(), initialize(), jit_convert(), visit_simple_for_command(), and visit_while_command().
|
private |
Definition at line 188 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 187 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 173 of file pt-jit.h.
Referenced by visit(), visit_binary_expression(), visit_colon_expression(), visit_constant(), visit_identifier(), visit_index_expression(), visit_postfix_expression(), visit_prefix_expression(), and visit_simple_assignment().
|
private |
Definition at line 168 of file pt-jit.h.
Referenced by get_variable(), and initialize().
|
private |
Definition at line 189 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 191 of file pt-jit.h.
Referenced by create_variable(), find_variable(), jit_convert(), visit_binary_expression(), and visit_simple_for_command().