GNU Octave
4.0.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 111 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 144 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_do_until_command(), visit_if_command_list(), visit_postfix_expression(), visit_prefix_expression(), visit_simple_assignment(), visit_switch_command(), and visit_while_command().
|
inline |
|
inline |
|
inline |
Definition at line 1096 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 1146 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 1237 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 1258 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 1112 of file pt-jit.cc.
References vmap.
Referenced by get_variable(), and visit_simple_for_command().
|
private |
Definition at line 1288 of file pt-jit.cc.
References jit_block::append(), jit_factory::create(), and factory.
Referenced by jit_convert(), visit_do_until_command(), visit_simple_for_command(), and visit_while_command().
|
inline |
Definition at line 61 of file pt-jit.h.
Referenced by jit_info::compile(), and jit_function_info::jit_function_info().
|
inline |
Definition at line 63 of file pt-jit.h.
Referenced by jit_info::compile().
|
inline |
Definition at line 65 of file pt-jit.h.
Referenced by jit_info::compile(), and jit_function_info::jit_function_info().
|
inline |
|
private |
Definition at line 1120 of file pt-jit.cc.
References bounds, converting_function, create_variable(), symbol_table::find_function(), symbol_table::find_symbol(), find_variable(), jit_typeinfo::get_any(), symbol_table::symbol_record::is_global(), symbol_table::symbol_record::is_persistent(), octave_value::is_undefined(), 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 69 of file pt-jit.h.
Referenced by jit_info::compile(), and jit_function_info::jit_function_info().
|
private |
Definition at line 1080 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 212 of file pt-jit.h.
Referenced by jit_convert(), and visit_simple_for_command().
|
inlineprivate |
Definition at line 209 of file pt-jit.h.
Referenced by visit_simple_for_command().
|
inlineprivate |
Definition at line 215 of file pt-jit.h.
Referenced by visit_binary_expression().
|
private |
Definition at line 1179 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 229 of file pt-jit.h.
Referenced by jit_convert(), resolve(), visit_binary_expression(), visit_colon_expression(), visit_do_until_command(), visit_if_command_list(), visit_postfix_expression(), visit_prefix_expression(), visit_simple_assignment(), visit_simple_for_command(), visit_statement(), visit_switch_command(), and visit_while_command().
Definition at line 1278 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 256 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 |
|
virtual |
Implements tree_walker.
|
inlinevirtualinherited |
Definition at line 267 of file pt-walk.h.
Referenced by tree_classdef::accept().
|
inlinevirtualinherited |
Definition at line 219 of file pt-walk.h.
Referenced by tree_classdef_attribute::accept().
|
inlinevirtualinherited |
Definition at line 222 of file pt-walk.h.
Referenced by tree_classdef_attribute_list::accept().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Definition at line 255 of file pt-walk.h.
Referenced by tree_classdef_enum::accept().
|
inlinevirtualinherited |
Definition at line 261 of file pt-walk.h.
Referenced by tree_classdef_enum_block::accept().
|
inlinevirtualinherited |
Definition at line 258 of file pt-walk.h.
Referenced by tree_classdef_enum_list::accept().
|
inlinevirtualinherited |
Definition at line 246 of file pt-walk.h.
Referenced by tree_classdef_event::accept().
|
inlinevirtualinherited |
Definition at line 252 of file pt-walk.h.
Referenced by tree_classdef_events_block::accept().
|
inlinevirtualinherited |
Definition at line 249 of file pt-walk.h.
Referenced by tree_classdef_events_list::accept().
|
inlinevirtualinherited |
Definition at line 243 of file pt-walk.h.
Referenced by tree_classdef_methods_block::accept().
|
inlinevirtualinherited |
Definition at line 240 of file pt-walk.h.
Referenced by tree_classdef_methods_list::accept().
|
inlinevirtualinherited |
Definition at line 237 of file pt-walk.h.
Referenced by tree_classdef_properties_block::accept().
|
inlinevirtualinherited |
Definition at line 231 of file pt-walk.h.
Referenced by tree_classdef_property::accept().
|
inlinevirtualinherited |
Definition at line 234 of file pt-walk.h.
Referenced by tree_classdef_property_list::accept().
|
inlinevirtualinherited |
Definition at line 225 of file pt-walk.h.
Referenced by tree_classdef_superclass::accept().
|
inlinevirtualinherited |
Definition at line 228 of file pt-walk.h.
Referenced by tree_classdef_superclass_list::accept().
|
virtual |
Implements tree_walker.
Definition at line 326 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 667 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.
Definition at line 1017 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().
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 514 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 538 of file pt-jit.cc.
References tree_if_command_list::accept(), and tree_if_command::cmd_list().
|
virtual |
Implements tree_walker.
Definition at line 546 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 710 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 728 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 752 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 375 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 773 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 811 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.
Definition at line 836 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(), jit_typeinfo::binary_op(), block, blocks, breaks, tree_switch_case::case_label(), tree_switch_command::case_list(), tree_switch_case::commands(), continues, jit_factory::create(), create_checked(), factory, tree_switch_case::is_default_case(), jit_typeinfo::logically_true(), octave_value::op_eq, jit_block_list::push_back(), octave_base_list< elt_type >::size(), tree_switch_command::switch_value(), and visit().
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
|
virtual |
Implements tree_walker.
Definition at line 955 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 176 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_do_until_command(), visit_identifier(), visit_if_command_list(), visit_simple_for_command(), visit_statement(), visit_switch_command(), and visit_while_command().
|
private |
Definition at line 180 of file pt-jit.h.
Referenced by create_checked_impl(), initialize(), jit_convert(), visit_binary_expression(), visit_do_until_command(), visit_if_command_list(), visit_simple_for_command(), visit_switch_command(), and visit_while_command().
|
private |
Definition at line 160 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 234 of file pt-jit.h.
Referenced by jit_convert(), visit_break_command(), visit_do_until_command(), visit_if_command_list(), visit_simple_for_command(), visit_switch_command(), and visit_while_command().
|
private |
Definition at line 235 of file pt-jit.h.
Referenced by jit_convert(), visit_continue_command(), visit_do_until_command(), visit_if_command_list(), visit_simple_for_command(), visit_switch_command(), and visit_while_command().
|
private |
Definition at line 162 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 182 of file pt-jit.h.
Referenced by resolve(), and visit_identifier().
|
private |
Definition at line 172 of file pt-jit.h.
Referenced by create_variable(), and initialize().
|
private |
Definition at line 167 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_do_until_command(), visit_identifier(), visit_if_command_list(), visit_simple_for_command(), visit_statement(), visit_switch_command(), and visit_while_command().
|
private |
Definition at line 174 of file pt-jit.h.
Referenced by create_checked_impl(), initialize(), jit_convert(), visit_do_until_command(), visit_simple_for_command(), and visit_while_command().
|
private |
Definition at line 185 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 184 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 170 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 165 of file pt-jit.h.
Referenced by get_variable(), and initialize().
|
private |
Definition at line 186 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 188 of file pt-jit.h.
Referenced by create_variable(), find_variable(), jit_convert(), visit_binary_expression(), and visit_simple_for_command().