#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 (const std::string &lhs, jit_value *rhs, bool print, bool artificial=false) |
jit_value * | do_assign (tree_expression *exp, jit_value *rhs, 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 (const symbol_scope &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=nullptr, bool lhs=false) |
jit_value * | visit (tree &tee) |
jit_value * | visit (tree *tee) |
Private Attributes | |
std::vector< std::pair< std::string, bool > > | m_arguments |
jit_block * | m_block |
jit_block_list | m_blocks |
type_bound_vector | m_bounds |
block_list | m_breaks |
block_list | m_continues |
bool | m_converting_function |
std::vector< jit_magic_end::context > | m_end_context |
jit_block * | m_entry_block |
jit_factory | m_factory |
jit_block * | m_final_block |
size_t | m_for_bounds_count |
llvm::Function * | m_function |
size_t | m_iterator_count |
jit_value * | m_result |
symbol_scope | m_scope |
size_t | m_short_count |
variable_map | m_vmap |
|
private |
typedef std::pair<jit_type *, std::string> octave::jit_convert::type_bound |
typedef std::vector<type_bound> octave::jit_convert::type_bound_vector |
typedef std::map<std::string, jit_variable *> octave::jit_convert::variable_map |
Definition at line 164 of file pt-jit.cc.
References octave::__get_current_scope__(), octave::jit_block::append(), octave::jit_factory::create(), create_variable(), initialize(), m_block, m_blocks, m_breaks, m_continues, m_factory, m_final_block, m_vmap, name, octave::jit_variable::name(), next_for_bounds(), octave::jit_block_list::push_back(), and visit().
octave::jit_convert::jit_convert | ( | octave_user_function & | fcn, |
const std::vector< jit_type * > & | args | ||
) |
Definition at line 197 of file pt-jit.cc.
References octave::jit_block::append(), octave::base_list< elt_type >::begin(), octave_user_code::body(), octave::jit_factory::create(), create_variable(), octave::jit_typeinfo::destroy(), octave::base_list< elt_type >::end(), finish_breaks(), octave::base_list< elt_type >::front(), get_variable(), initialize(), octave_user_function::is_special_expr(), m_block, m_blocks, m_breaks, m_continues, m_factory, m_final_block, m_vmap, name, octave::tree_decl_elt::name(), octave_user_function::parameter_list(), octave::jit_block_list::push_back(), octave_user_function::return_list(), retval, octave_user_code::scope(), octave::base_list< elt_type >::size(), octave_user_function::special_expr(), octave::tree_parameter_list::takes_varargs(), visit(), and visit_statement_list().
|
inline |
Definition at line 65 of file pt-jit.h.
Referenced by resolve(), visit_binary_expression(), visit_boolean_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().
Definition at line 1113 of file pt-jit.cc.
References octave::jit_block::append(), octave::jit_factory::create(), m_block, m_blocks, m_factory, m_final_block, octave::jit_block::name(), octave::jit_block_list::push_back(), and octave::jit_error_check::var_error_state.
|
private |
Definition at line 1165 of file pt-jit.cc.
References octave::jit_factory::create(), octave::jit_typeinfo::create_undef(), m_entry_block, m_factory, m_vmap, and octave::jit_block::prepend().
Referenced by jit_convert(), and get_variable().
|
private |
Definition at line 1278 of file pt-jit.cc.
References octave::jit_block::append(), octave::jit_factory::create(), get_variable(), m_block, m_factory, octave::jit_assign::mark_artificial(), name, and octave::jit_typeinfo::print_value().
|
private |
Definition at line 1256 of file pt-jit.cc.
References octave::tree_expression::name(), octave::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 1129 of file pt-jit.cc.
References m_vmap.
Referenced by get_variable(), and visit_simple_for_command().
|
private |
Definition at line 1309 of file pt-jit.cc.
References octave::jit_block::append(), octave::jit_factory::create(), and m_factory.
Referenced by jit_convert(), visit_do_until_command(), visit_simple_for_command(), and visit_while_command().
|
inline |
Definition at line 71 of file pt-jit.h.
Referenced by octave::jit_function_info::jit_function_info(), and octave::jit_info::compile().
|
inline |
Definition at line 73 of file pt-jit.h.
Referenced by octave::jit_info::compile().
|
inline |
Definition at line 75 of file pt-jit.h.
Referenced by octave::jit_function_info::jit_function_info(), and octave::jit_info::compile().
|
inline |
|
private |
Definition at line 1137 of file pt-jit.cc.
References octave::__get_symbol_table__(), create_variable(), octave::symbol_table::find_function(), octave::symbol_scope::find_symbol(), find_variable(), octave::jit_typeinfo::get_any(), octave_value::is_undefined(), m_bounds, m_converting_function, m_scope, and octave::jit_typeinfo::type_of().
Referenced by jit_convert(), do_assign(), resolve(), and visit_identifier().
|
inline |
Definition at line 79 of file pt-jit.h.
Referenced by octave::jit_function_info::jit_function_info(), and octave::jit_info::compile().
|
private |
Definition at line 1097 of file pt-jit.cc.
References octave::jit_factory::create(), m_block, m_blocks, m_entry_block, m_factory, m_final_block, m_for_bounds_count, m_iterator_count, m_scope, m_short_count, octave::jit_block::mark_alive(), octave::jit_block_list::push_back(), and octave::jit_instruction::reset_ids().
Referenced by jit_convert().
|
inlineprivate |
Definition at line 220 of file pt-jit.h.
Referenced by jit_convert(), and visit_simple_for_command().
|
inlineprivate |
Definition at line 217 of file pt-jit.h.
Referenced by visit_simple_for_command().
|
private |
|
inlineprivate |
Definition at line 223 of file pt-jit.h.
Referenced by visit_boolean_expression().
|
private |
Definition at line 1198 of file pt-jit.cc.
References octave::action_container::add_method(), octave::tree_index_expression::arg_lists(), octave::base_list< elt_type >::begin(), create_checked(), octave::base_list< elt_type >::end(), octave::tree_index_expression::expression(), octave::base_list< elt_type >::front(), get_variable(), m_end_context, m_factory, octave::tree_identifier::name(), octave::jit_typeinfo::paren_subsasgn(), octave::jit_typeinfo::paren_subsref(), octave::base_list< elt_type >::size(), octave::tree_index_expression::type_tags(), and visit().
Referenced by do_assign(), and visit_index_expression().
Definition at line 1299 of file pt-jit.cc.
References octave::tree::accept(), m_result, and octave::action_container::protect_var().
Definition at line 237 of file pt-jit.h.
References visit().
Referenced by jit_convert(), resolve(), visit(), visit_binary_expression(), visit_boolean_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().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 311 of file pt-jit.cc.
References octave::jit_typeinfo::binary_op(), create_checked(), octave::tree_binary_expression::lhs(), m_result, octave::tree_binary_expression::op_type(), octave::tree_binary_expression::rhs(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 324 of file pt-jit.cc.
References octave::jit_block::append(), octave::tree_boolean_expression::bool_and, octave::jit_factory::create(), create_checked(), octave::tree_binary_expression::lhs(), octave::jit_typeinfo::logically_true(), m_block, m_blocks, m_factory, m_result, m_vmap, octave::jit_block::name(), next_shortcircut_result(), octave::tree_boolean_expression::op_type(), octave::jit_block_list::push_back(), octave::tree_binary_expression::rhs(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtualinherited |
Definition at line 606 of file pt-walk.cc.
Referenced by octave::tree_classdef::accept().
|
virtualinherited |
Definition at line 526 of file pt-walk.cc.
Referenced by octave::tree_classdef_attribute::accept().
|
virtualinherited |
Definition at line 531 of file pt-walk.cc.
Referenced by octave::tree_classdef_attribute_list::accept().
|
virtualinherited |
Definition at line 601 of file pt-walk.cc.
Referenced by octave::tree_classdef_body::accept().
|
virtualinherited |
Definition at line 586 of file pt-walk.cc.
Referenced by octave::tree_classdef_enum::accept().
|
virtualinherited |
Definition at line 596 of file pt-walk.cc.
Referenced by octave::tree_classdef_enum_block::accept().
|
virtualinherited |
Definition at line 591 of file pt-walk.cc.
Referenced by octave::tree_classdef_enum_list::accept().
|
virtualinherited |
Definition at line 571 of file pt-walk.cc.
Referenced by octave::tree_classdef_event::accept().
|
virtualinherited |
Definition at line 581 of file pt-walk.cc.
Referenced by octave::tree_classdef_events_block::accept().
|
virtualinherited |
Definition at line 576 of file pt-walk.cc.
Referenced by octave::tree_classdef_events_list::accept().
|
virtualinherited |
Definition at line 566 of file pt-walk.cc.
Referenced by octave::tree_classdef_methods_block::accept().
|
virtualinherited |
Definition at line 561 of file pt-walk.cc.
Referenced by octave::tree_classdef_methods_list::accept().
|
virtualinherited |
Definition at line 556 of file pt-walk.cc.
Referenced by octave::tree_classdef_properties_block::accept().
|
virtualinherited |
Definition at line 546 of file pt-walk.cc.
Referenced by octave::tree_classdef_property::accept().
|
virtualinherited |
Definition at line 551 of file pt-walk.cc.
Referenced by octave::tree_classdef_property_list::accept().
|
virtualinherited |
Definition at line 536 of file pt-walk.cc.
Referenced by octave::tree_classdef_superclass::accept().
|
virtualinherited |
Definition at line 541 of file pt-walk.cc.
Referenced by octave::tree_classdef_superclass_list::accept().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 377 of file pt-jit.cc.
References octave::jit_block::append(), octave::tree_colon_expression::base(), octave::jit_factory::create(), octave::tree_colon_expression::increment(), octave::tree_colon_expression::limit(), m_block, m_factory, m_result, octave::jit_typeinfo::make_range(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtualinherited |
Reimplemented in octave::tree_evaluator.
Definition at line 70 of file pt-walk.cc.
References octave::tree_walker::visit_binary_expression().
Referenced by octave::tree_compound_binary_expression::accept().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 705 of file pt-jit.cc.
References octave_value::complex_value(), octave::jit_factory::create(), octave_value::double_value(), octave::jit_typeinfo::get_complex(), octave::jit_typeinfo::get_range(), octave::jit_typeinfo::get_scalar(), m_factory, m_result, octave_value::range_value(), octave::jit_typeinfo::type_of(), and octave::tree_constant::value().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 395 of file pt-jit.cc.
References m_block, and m_continues.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 1033 of file pt-jit.cc.
References octave::tree_statement_list::accept(), octave::jit_block::append(), octave::tree_while_command::body(), octave::tree_while_command::condition(), octave::jit_factory::create(), create_checked(), finish_breaks(), octave::jit_typeinfo::logically_true(), m_block, m_blocks, m_breaks, m_continues, m_factory, m_final_block, octave::action_container::protect_var(), octave::jit_block_list::push_back(), octave::sys::file_ops::tail(), octave::jit_error_check::var_interrupt, and visit().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 560 of file pt-jit.cc.
References octave::jit_block::append(), octave::jit_factory::create(), get_variable(), octave::jit_typeinfo::grab(), m_block, m_end_context, m_factory, m_result, and octave::tree_identifier::name().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 584 of file pt-jit.cc.
References octave::tree_statement_list::accept(), octave::jit_block::append(), octave::base_list< elt_type >::back(), octave::base_list< elt_type >::begin(), octave::tree_if_clause::commands(), octave::tree_if_clause::condition(), octave::jit_factory::create(), create_checked(), octave::base_list< elt_type >::end(), octave::tree_if_clause::is_else_clause(), octave::jit_typeinfo::logically_true(), m_block, m_blocks, m_breaks, m_continues, m_factory, octave::jit_block_list::push_back(), octave::base_list< elt_type >::size(), octave::sys::file_ops::tail(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtualinherited |
Reimplemented in octave::tree_print_code, and octave::tree_evaluator.
Definition at line 521 of file pt-walk.cc.
Referenced by octave::tree_metaclass_query::accept().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
void octave::jit_convert::visit_octave_user_function_header | ( | octave_user_function & | ) |
void octave::jit_convert::visit_octave_user_function_trailer | ( | octave_user_function & | ) |
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 743 of file pt-jit.cc.
References create_checked(), do_assign(), octave::jit_typeinfo::grab(), m_result, octave_value::op_decr, octave_value::op_incr, octave::tree_unary_expression::op_type(), octave::tree_unary_expression::operand(), octave::jit_typeinfo::unary_op(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 761 of file pt-jit.cc.
References create_checked(), do_assign(), m_result, octave_value::op_decr, octave_value::op_incr, octave::tree_unary_expression::op_type(), octave::tree_unary_expression::operand(), octave::jit_typeinfo::unary_op(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 779 of file pt-jit.cc.
References octave_value::assign_op_to_binary_op(), octave::jit_typeinfo::binary_op(), create_checked(), do_assign(), octave::tree_simple_assignment::left_hand_side(), m_result, octave_value::op_asn_eq, octave::tree_simple_assignment::op_type(), octave::tree_simple_assignment::right_hand_side(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 420 of file pt-jit.cc.
References octave::tree_statement_list::accept(), octave::jit_block::append(), octave::jit_typeinfo::binary_op(), octave::tree_simple_for_command::body(), octave::tree_simple_for_command::control_expr(), octave::jit_factory::create(), do_assign(), find_variable(), finish_breaks(), octave::jit_typeinfo::for_check(), octave::jit_typeinfo::for_index(), octave::jit_typeinfo::for_init(), octave::tree_simple_for_command::left_hand_side(), m_block, m_blocks, m_breaks, m_continues, m_factory, m_final_block, m_vmap, next_for_bounds(), next_iterator(), octave_value::op_add, octave::action_container::protect_var(), octave::jit_block_list::push_back(), octave::sys::file_ops::tail(), octave::jit_error_check::var_interrupt, and visit().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 800 of file pt-jit.cc.
References octave::jit_block::append(), octave::tree_statement::command(), octave::jit_factory::create(), do_assign(), octave::tree_statement::expression(), octave::tree_expression::is_assignment_expression(), octave::tree_expression::is_identifier(), m_block, m_factory, m_scope, name, octave::tree_expression::name(), octave::tree_expression::print_result(), octave::jit_typeinfo::print_value(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
Referenced by jit_convert().
|
virtualinherited |
Reimplemented in octave::ctor_analyzer, octave::tree_print_code, and octave::tree_evaluator.
Definition at line 516 of file pt-walk.cc.
Referenced by octave::tree_superclass_ref::accept().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 851 of file pt-jit.cc.
References octave::tree_statement_list::accept(), octave::jit_block::append(), octave::base_list< elt_type >::back(), octave::base_list< elt_type >::begin(), octave::jit_typeinfo::binary_op(), octave::tree_switch_case::case_label(), octave::tree_switch_command::case_list(), octave::tree_switch_case::commands(), octave::jit_factory::create(), create_checked(), octave::tree_switch_case::is_default_case(), octave::jit_typeinfo::logically_true(), m_block, m_blocks, m_breaks, m_continues, m_factory, octave_value::op_eq, octave::jit_block_list::push_back(), octave::base_list< elt_type >::size(), octave::tree_switch_command::switch_value(), octave::sys::file_ops::tail(), and visit().
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 971 of file pt-jit.cc.
References octave::tree_statement_list::accept(), octave::jit_block::append(), octave::tree_while_command::body(), octave::tree_while_command::condition(), octave::jit_factory::create(), create_checked(), finish_breaks(), octave::jit_typeinfo::logically_true(), m_block, m_blocks, m_breaks, m_continues, m_factory, m_final_block, octave::action_container::protect_var(), octave::jit_block_list::push_back(), octave::sys::file_ops::tail(), octave::jit_error_check::var_interrupt, and visit().
|
private |
|
private |
Definition at line 184 of file pt-jit.h.
Referenced by jit_convert(), create_checked_impl(), do_assign(), initialize(), visit_boolean_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 188 of file pt-jit.h.
Referenced by jit_convert(), create_checked_impl(), initialize(), visit_boolean_expression(), visit_do_until_command(), visit_if_command_list(), visit_simple_for_command(), visit_switch_command(), and visit_while_command().
|
private |
Definition at line 168 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 242 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 243 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 170 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 190 of file pt-jit.h.
Referenced by resolve(), and visit_identifier().
|
private |
Definition at line 180 of file pt-jit.h.
Referenced by create_variable(), and initialize().
|
private |
Definition at line 175 of file pt-jit.h.
Referenced by jit_convert(), create_checked_impl(), create_variable(), do_assign(), finish_breaks(), initialize(), resolve(), visit_boolean_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 182 of file pt-jit.h.
Referenced by jit_convert(), create_checked_impl(), initialize(), visit_do_until_command(), visit_simple_for_command(), and visit_while_command().
|
private |
Definition at line 193 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 192 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 178 of file pt-jit.h.
Referenced by visit(), visit_binary_expression(), visit_boolean_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 173 of file pt-jit.h.
Referenced by get_variable(), initialize(), and visit_statement().
|
private |
Definition at line 194 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 196 of file pt-jit.h.
Referenced by jit_convert(), create_variable(), find_variable(), visit_boolean_expression(), and visit_simple_for_command().