comparison libinterp/octave-value/ov.cc @ 31110:670a0d878af1

eliminate WHO arguments from interpreter-private functions * interpreter-private.h, inpterpreter-private.cc (__get_interpreter__, __get_dynamic_loader__, __get_error_system__, __get_gh_manager__, __get_help_system__, __get_input_system__, __get_load_path__, __get_load_save_system__, __get_event_manager__, __get_output_system__, __get_type_info__, __get_symbol_table__, __get_current_scope__, __require_current_scope__, __get_evaluator__, __get_bp_table__, __get_child_list__, __get_cdef_manager__, __get_display_info__, __get_gtk_manager__): Eliminate WHO argument. Previously, it was never displayed by __get_interpreter__. And, as pointed out by Petter Tomner in patch #10216, passing a std::string object could have performance issues. (__get_interpreter__): Eliminate useless call to error. Display message to std::cerr then abort.
author John W. Eaton <jwe@octave.org>
date Wed, 22 Jun 2022 12:48:59 -0400
parents 32d2b6604a9f
children 929c05cf2afa
comparison
equal deleted inserted replaced
31109:90549b20fb28 31110:670a0d878af1
1689 if (m_rep->count == 1) 1689 if (m_rep->count == 1)
1690 { 1690 {
1691 int tthis = this->type_id (); 1691 int tthis = this->type_id ();
1692 int trhs = rhs.type_id (); 1692 int trhs = rhs.type_id ();
1693 1693
1694 octave::type_info& ti 1694 octave::type_info& ti = octave::__get_type_info__ ();
1695 = octave::__get_type_info__ ("octave_value::assign");
1696 1695
1697 f = ti.lookup_assign_op (op, tthis, trhs); 1696 f = ti.lookup_assign_op (op, tthis, trhs);
1698 } 1697 }
1699 1698
1700 if (f) 1699 if (f)
2493 } 2492 }
2494 2493
2495 // Genuine. 2494 // Genuine.
2496 int t = type_id (); 2495 int t = type_id ();
2497 2496
2498 octave::type_info& ti = octave::__get_type_info__ ("non_const_unary_op"); 2497 octave::type_info& ti = octave::__get_type_info__ ();
2499 2498
2500 octave::type_info::non_const_unary_op_fcn f 2499 octave::type_info::non_const_unary_op_fcn f
2501 = ti.lookup_non_const_unary_op (op, t); 2500 = ti.lookup_non_const_unary_op (op, t);
2502 2501
2503 if (f) 2502 if (f)
2556 octave::type_info::non_const_unary_op_fcn f = nullptr; 2555 octave::type_info::non_const_unary_op_fcn f = nullptr;
2557 2556
2558 // Only attempt to operate in-place if this variable is unshared. 2557 // Only attempt to operate in-place if this variable is unshared.
2559 if (m_rep->count == 1) 2558 if (m_rep->count == 1)
2560 { 2559 {
2561 octave::type_info& ti 2560 octave::type_info& ti = octave::__get_type_info__ ();
2562 = octave::__get_type_info__ ("non_const_unary_op");
2563 2561
2564 f = ti.lookup_non_const_unary_op (op, t); 2562 f = ti.lookup_non_const_unary_op (op, t);
2565 } 2563 }
2566 2564
2567 if (f) 2565 if (f)
2841 2839
2842 octave_value 2840 octave_value
2843 binary_op (octave_value::binary_op op, const octave_value& v1, 2841 binary_op (octave_value::binary_op op, const octave_value& v1,
2844 const octave_value& v2) 2842 const octave_value& v2)
2845 { 2843 {
2846 type_info& ti = __get_type_info__ ("binary_op"); 2844 type_info& ti = __get_type_info__ ();
2847 2845
2848 return binary_op (ti, op, v1, v2); 2846 return binary_op (ti, op, v1, v2);
2849 } 2847 }
2850 2848
2851 static octave_value 2849 static octave_value
2935 2933
2936 octave_value 2934 octave_value
2937 binary_op (octave_value::compound_binary_op op, 2935 binary_op (octave_value::compound_binary_op op,
2938 const octave_value& v1, const octave_value& v2) 2936 const octave_value& v1, const octave_value& v2)
2939 { 2937 {
2940 type_info& ti = __get_type_info__ ("binary_op"); 2938 type_info& ti = __get_type_info__ ();
2941 2939
2942 return binary_op (ti, op, v1, v2); 2940 return binary_op (ti, op, v1, v2);
2943 } 2941 }
2944 2942
2945 OCTAVE_NORETURN static void 2943 OCTAVE_NORETURN static void
3022 3020
3023 octave_value 3021 octave_value
3024 cat_op (const octave_value& v1, const octave_value& v2, 3022 cat_op (const octave_value& v1, const octave_value& v2,
3025 const Array<octave_idx_type>& ra_idx) 3023 const Array<octave_idx_type>& ra_idx)
3026 { 3024 {
3027 type_info& ti = __get_type_info__ ("cat_op"); 3025 type_info& ti = __get_type_info__ ();
3028 3026
3029 return cat_op (ti, v1, v2, ra_idx); 3027 return cat_op (ti, v1, v2, ra_idx);
3030 } 3028 }
3031 3029
3032 // Unless the colon operator is used with a class or classdef object, 3030 // Unless the colon operator is used with a class or classdef object,
3487 { 3485 {
3488 tmp1(1) = limit; 3486 tmp1(1) = limit;
3489 tmp1(0) = base; 3487 tmp1(0) = base;
3490 } 3488 }
3491 3489
3492 interpreter& interp = __get_interpreter__ ("colon_op"); 3490 interpreter& interp = __get_interpreter__ ();
3493 3491
3494 symbol_table& symtab = interp.get_symbol_table (); 3492 symbol_table& symtab = interp.get_symbol_table ();
3495 3493
3496 octave_value fcn = symtab.find_function ("colon", tmp1); 3494 octave_value fcn = symtab.find_function ("colon", tmp1);
3497 3495
3628 } 3626 }
3629 3627
3630 octave_value 3628 octave_value
3631 unary_op (octave_value::unary_op op, const octave_value& v) 3629 unary_op (octave_value::unary_op op, const octave_value& v)
3632 { 3630 {
3633 type_info& ti = __get_type_info__ ("unary_op"); 3631 type_info& ti = __get_type_info__ ();
3634 3632
3635 return unary_op (ti, op, v); 3633 return unary_op (ti, op, v);
3636 } 3634 }
3637 3635
3638 OCTAVE_NAMESPACE_END 3636 OCTAVE_NAMESPACE_END