#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 (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 |
Definition at line 137 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, next_for_bounds(), octave::jit_block_list::push_back(), string, var, and visit().
octave::jit_convert::jit_convert | ( | octave_user_function & | fcn, |
const std::vector< jit_type *> & | args | ||
) |
Definition at line 171 of file pt-jit.cc.
References octave::jit_block::append(), octave::jit_factory::create(), create_variable(), octave::jit_typeinfo::destroy(), fcn, finish_breaks(), octave::base_list< elt_type >::front(), get_variable(), i, initialize(), m_block, m_blocks, m_breaks, m_continues, m_factory, m_final_block, m_vmap, octave::tree_decl_elt::name(), name, octave::jit_block_list::push_back(), retval, octave_function::scope(), octave::base_list< elt_type >::size(), string, octave::tree_parameter_list::takes_varargs(), visit(), and visit_statement_list().
|
inline |
Definition at line 71 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 1120 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 1172 of file pt-jit.cc.
References octave::jit_factory::create(), octave::jit_typeinfo::create_undef(), m_entry_block, m_factory, m_vmap, octave::jit_block::prepend(), type, and var.
Referenced by get_variable(), and jit_convert().
|
private |
Definition at line 1263 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 1285 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, octave::jit_typeinfo::print_value(), and var.
|
private |
Definition at line 1136 of file pt-jit.cc.
References m_vmap.
Referenced by get_variable(), and visit_simple_for_command().
|
private |
Definition at line 1316 of file pt-jit.cc.
References b, 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 77 of file pt-jit.h.
Referenced by octave::jit_info::compile(), and octave::jit_function_info::jit_function_info().
|
inline |
Definition at line 79 of file pt-jit.h.
Referenced by octave::jit_info::compile().
|
inline |
Definition at line 81 of file pt-jit.h.
Referenced by octave::jit_info::compile(), and octave::jit_function_info::jit_function_info().
|
inline |
|
private |
Definition at line 1144 of file pt-jit.cc.
References octave::__get_symbol_table__(), create_variable(), octave::symbol_scope::current_context(), octave::symbol_table::find_function(), octave::symbol_table::find_symbol(), find_variable(), octave::jit_typeinfo::get_any(), octave::symbol_record::is_global(), octave::symbol_record::is_persistent(), m_bounds, m_converting_function, m_scope, type, octave::jit_typeinfo::type_of(), val, and octave::symbol_record::varval().
Referenced by do_assign(), jit_convert(), resolve(), and visit_identifier().
|
inline |
Definition at line 85 of file pt-jit.h.
Referenced by octave::jit_info::compile(), and octave::jit_function_info::jit_function_info().
|
private |
Definition at line 1104 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(), octave::jit_instruction::reset_ids(), and s.
Referenced by jit_convert().
|
inlineprivate |
Definition at line 230 of file pt-jit.h.
Referenced by jit_convert(), and visit_simple_for_command().
|
inlineprivate |
Definition at line 227 of file pt-jit.h.
Referenced by visit_simple_for_command().
|
private |
|
inlineprivate |
Definition at line 233 of file pt-jit.h.
Referenced by visit_boolean_expression().
|
private |
Definition at line 1205 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(), frame, get_variable(), id, m_end_context, m_factory, object, octave::jit_typeinfo::paren_subsasgn(), octave::jit_typeinfo::paren_subsref(), octave::base_list< elt_type >::size(), string, type, octave::tree_index_expression::type_tags(), and visit().
Referenced by do_assign(), and visit_index_expression().
Definition at line 247 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().
Definition at line 1306 of file pt-jit.cc.
References octave::tree::accept(), frame, m_result, and octave::action_container::protect_var().
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 285 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 298 of file pt-jit.cc.
References octave::jit_block::append(), octave::tree_boolean_expression::bool_and, octave::jit_factory::create(), create_checked(), done, 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(), string, and visit().
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
inlinevirtualinherited |
Definition at line 294 of file pt-walk.h.
Referenced by octave::tree_classdef::accept().
|
inlinevirtualinherited |
Definition at line 246 of file pt-walk.h.
Referenced by octave::tree_classdef_attribute::accept().
|
inlinevirtualinherited |
Definition at line 249 of file pt-walk.h.
Referenced by octave::tree_classdef_attribute_list::accept().
|
inlinevirtualinherited |
Definition at line 291 of file pt-walk.h.
Referenced by octave::tree_classdef_body::accept().
|
inlinevirtualinherited |
Definition at line 282 of file pt-walk.h.
Referenced by octave::tree_classdef_enum::accept().
|
inlinevirtualinherited |
Definition at line 288 of file pt-walk.h.
Referenced by octave::tree_classdef_enum_block::accept().
|
inlinevirtualinherited |
Definition at line 285 of file pt-walk.h.
Referenced by octave::tree_classdef_enum_list::accept().
|
inlinevirtualinherited |
Definition at line 273 of file pt-walk.h.
Referenced by octave::tree_classdef_event::accept().
|
inlinevirtualinherited |
Definition at line 279 of file pt-walk.h.
Referenced by octave::tree_classdef_events_block::accept().
|
inlinevirtualinherited |
Definition at line 276 of file pt-walk.h.
Referenced by octave::tree_classdef_events_list::accept().
|
inlinevirtualinherited |
Definition at line 270 of file pt-walk.h.
Referenced by octave::tree_classdef_methods_block::accept().
|
inlinevirtualinherited |
Definition at line 267 of file pt-walk.h.
Referenced by octave::tree_classdef_methods_list::accept().
|
inlinevirtualinherited |
Definition at line 264 of file pt-walk.h.
Referenced by octave::tree_classdef_properties_block::accept().
|
inlinevirtualinherited |
Definition at line 258 of file pt-walk.h.
Referenced by octave::tree_classdef_property::accept().
|
inlinevirtualinherited |
Definition at line 261 of file pt-walk.h.
Referenced by octave::tree_classdef_property_list::accept().
|
inlinevirtualinherited |
Definition at line 252 of file pt-walk.h.
Referenced by octave::tree_classdef_superclass::accept().
|
inlinevirtualinherited |
Definition at line 255 of file pt-walk.h.
Referenced by octave::tree_classdef_superclass_list::accept().
|
virtual |
Implements octave::tree_walker.
Definition at line 351 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 |
Implements octave::tree_walker.
|
virtualinherited |
Reimplemented in octave::tree_evaluator.
Definition at line 40 of file pt-walk.cc.
References octave::tree_walker::visit_binary_expression().
Referenced by octave::tree_compound_binary_expression::accept().
|
virtual |
Implements octave::tree_walker.
Definition at line 687 of file pt-jit.cc.
References octave_value::complex_value(), octave::jit_factory::create(), octave_value::double_value(), dv, 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 |
Implements octave::tree_walker.
Definition at line 369 of file pt-jit.cc.
References m_block, and m_continues.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 1040 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(), frame, 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 |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 534 of file pt-jit.cc.
References octave::jit_block::append(), octave::jit_factory::create(), get_variable(), octave::jit_typeinfo::grab(), octave::tree_identifier::has_magic_end(), m_block, m_end_context, m_factory, m_result, octave::tree_identifier::name(), and var.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 558 of file pt-jit.cc.
References octave::tree_if_command_list::accept(), and octave::tree_if_command::cmd_list().
|
virtual |
Implements octave::tree_walker.
Definition at line 566 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(), i, 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 |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements 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 |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 731 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 |
Implements octave::tree_walker.
Definition at line 749 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 |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 773 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 |
Implements octave::tree_walker.
Definition at line 394 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(), frame, 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(), string, octave::sys::file_ops::tail(), octave::jit_error_check::var_interrupt, and visit().
|
virtual |
Implements octave::tree_walker.
Definition at line 794 of file pt-jit.cc.
References octave::jit_block::append(), octave::tree_statement::command(), octave::jit_factory::create(), octave::symbol_scope::current_context(), do_assign(), octave::tree_statement::expression(), octave::tree_expression::is_assignment_expression(), octave::tree_expression::is_identifier(), m_block, m_factory, m_scope, octave::tree_expression::name(), name, octave::tree_expression::print_result(), octave::jit_typeinfo::print_value(), and visit().
|
virtual |
Implements octave::tree_walker.
Definition at line 833 of file pt-jit.cc.
References octave::tree_statement::accept(), octave::base_list< elt_type >::begin(), and octave::base_list< elt_type >::end().
Referenced by jit_convert().
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 858 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(), i, 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(), value, and visit().
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
|
virtual |
Implements octave::tree_walker.
Definition at line 978 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(), frame, 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 194 of file pt-jit.h.
Referenced by create_checked_impl(), do_assign(), initialize(), jit_convert(), 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 198 of file pt-jit.h.
Referenced by create_checked_impl(), initialize(), jit_convert(), 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 178 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 252 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 253 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 180 of file pt-jit.h.
Referenced by get_variable().
|
private |
Definition at line 200 of file pt-jit.h.
Referenced by resolve(), and visit_identifier().
|
private |
Definition at line 190 of file pt-jit.h.
Referenced by create_variable(), and initialize().
|
private |
Definition at line 185 of file pt-jit.h.
Referenced by create_checked_impl(), create_variable(), do_assign(), finish_breaks(), initialize(), jit_convert(), 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 192 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 203 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 202 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 188 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 183 of file pt-jit.h.
Referenced by get_variable(), initialize(), and visit_statement().
|
private |
Definition at line 204 of file pt-jit.h.
Referenced by initialize().
|
private |
Definition at line 206 of file pt-jit.h.
Referenced by create_variable(), find_variable(), jit_convert(), visit_boolean_expression(), and visit_simple_for_command().