changeset 32545:d3f38dfa449a stable

skip a few more code blocks missed in changeset 435cfe35e3c6 * call-stack.cc, call-stack.h, load-path.cc, load-path.h, stack-frame.cc, stack-frame.h, variables.cc, ov-fcn.cc, ov-vm.h, pt-eval.cc, pt-eval.h, pt-tm-const.cc: Skip compilation of more bytecode evaluator code blocks unless OCTAVE_ENABLE_BYTECODE_EVALUATOR is defined.
author John W. Eaton <jwe@octave.org>
date Wed, 06 Dec 2023 16:06:44 -0500
parents 019af368d790
children f561b6a31e02
files libinterp/corefcn/call-stack.cc libinterp/corefcn/call-stack.h libinterp/corefcn/load-path.cc libinterp/corefcn/load-path.h libinterp/corefcn/stack-frame.cc libinterp/corefcn/stack-frame.h libinterp/corefcn/variables.cc libinterp/octave-value/ov-fcn.cc libinterp/octave-value/ov-vm.h libinterp/parse-tree/pt-eval.cc libinterp/parse-tree/pt-eval.h libinterp/parse-tree/pt-tm-const.cc
diffstat 12 files changed, 71 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/call-stack.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/call-stack.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -563,7 +563,11 @@
   std::shared_ptr<stack_frame> frm = m_cs[user_frame];
 
   if (! (frm->is_user_fcn_frame () || frm->is_user_script_frame ()
-         || frm->is_scope_frame () || frm->is_bytecode_fcn_frame()))
+         || frm->is_scope_frame ()
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+         || frm->is_bytecode_fcn_frame()
+#endif
+         ))
     {
       frm = frm->static_link ();
 
@@ -604,7 +608,10 @@
   if (! (frm && (frm->is_user_fcn_frame ()
                  || frm->is_user_script_frame ()
                  || frm->is_scope_frame ()
-                 || frm->is_bytecode_fcn_frame ())))
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+                 || frm->is_bytecode_fcn_frame ()
+#endif
+                 )))
     error ("call_stack::dbupdown: invalid initial frame in call stack!");
 
   // Use index into the call stack to begin the search.  At this point
@@ -640,7 +647,11 @@
       frm = m_cs[xframe];
 
       if (frm->is_user_fcn_frame () || frm->is_user_script_frame ()
-          || frm->is_scope_frame () || frm->is_bytecode_fcn_frame ())
+          || frm->is_scope_frame ()
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+          || frm->is_bytecode_fcn_frame ()
+#endif
+          )
         {
           last_good_frame = xframe;
 
@@ -724,7 +735,11 @@
       std::shared_ptr<stack_frame> frm = m_cs[n];
 
       if (frm->is_user_script_frame () || frm->is_user_fcn_frame ()
-          || frm->is_scope_frame () || frm->is_bytecode_fcn_frame())
+          || frm->is_scope_frame ()
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+          || frm->is_bytecode_fcn_frame()
+#endif
+          )
         {
           if (frm->index () == curr_frame)
             curr_user_frame = frames.size ();
@@ -759,7 +774,11 @@
   for (const auto& frm : frames)
     {
       if (frm->is_user_script_frame () || frm->is_user_fcn_frame ()
-          || frm->is_scope_frame () || frm->is_bytecode_fcn_frame())
+          || frm->is_scope_frame ()
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+          || frm->is_bytecode_fcn_frame()
+#endif
+          )
         {
           retval.push_back (frame_info (frm->fcn_file_name (),
                                         frm->fcn_name (print_subfn),
@@ -797,7 +816,11 @@
   for (const auto& frm : frames)
     {
       if (frm->is_user_script_frame () || frm->is_user_fcn_frame ()
-          || frm->is_scope_frame () || frm->is_bytecode_fcn_frame())
+          || frm->is_scope_frame ()
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+          || frm->is_bytecode_fcn_frame()
+#endif
+          )
         {
           file(k) = frm->fcn_file_name ();
           name(k) = frm->fcn_name (print_subfn);
@@ -1236,11 +1259,13 @@
   m_cs[m_curr_frame]->set_nargout (nargout);
 }
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
 void
 call_stack::set_active_bytecode_ip (int ip)
 {
   m_cs[m_curr_frame]->set_active_bytecode_ip (ip);
 }
+#endif
 
 octave_value call_stack::get_auto_fcn_var (stack_frame::auto_var_type avt) const
 {
--- a/libinterp/corefcn/call-stack.h	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/call-stack.h	Wed Dec 06 16:06:44 2023 -0500
@@ -321,9 +321,11 @@
 
   octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const;
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   void set_active_bytecode_ip (int ip);
+#endif
 
-private:
+ private:
 
   void get_new_frame_index_and_links
   (std::size_t& new_frame_idx, std::shared_ptr<stack_frame>& parent_link,
--- a/libinterp/corefcn/load-path.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/load-path.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -251,7 +251,9 @@
 m_dir_info_list (), m_init_dirs (), m_command_line_path ()
 { }
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
 std::atomic<octave_idx_type> load_path::s_n_updated;
+#endif
 
 void
 load_path::initialize (bool set_initial_path)
@@ -294,7 +296,9 @@
 void
 load_path::clear ()
 {
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   signal_clear_fcn_cache ();
+#endif
 
   m_dir_info_list.clear ();
 
@@ -419,7 +423,9 @@
   // preserve the correct directory ordering for new files that
   // have appeared.
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   signal_clear_fcn_cache ();
+#endif
 
   m_top_level_package.clear ();
 
--- a/libinterp/corefcn/load-path.h	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/load-path.h	Wed Dec 06 16:06:44 2023 -0500
@@ -215,15 +215,19 @@
   static const int OCT_FILE = 2;
   static const int MEX_FILE = 4;
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   static octave_idx_type get_weak_n_updated () { return s_n_updated; }
 
   static void signal_clear_fcn_cache ()
   {
     s_n_updated++;
   }
+#endif
 
 private:
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   static std::atomic<octave_idx_type> s_n_updated;
+#endif
 
   class dir_info
   {
--- a/libinterp/corefcn/stack-frame.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/stack-frame.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -2141,10 +2141,13 @@
 
   octave_value get_auto_fcn_var (auto_var_type avt) const
   {
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
     if (avt != stack_frame::auto_var_type::ARG_NAMES)
       return m_auto_vars.at (avt);
     if (m_parent_link->is_bytecode_fcn_frame ())
       return m_parent_link->get_active_bytecode_call_arg_names ();
+#endif
+
     return m_auto_vars.at (avt);
   }
 
--- a/libinterp/corefcn/stack-frame.h	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/stack-frame.h	Wed Dec 06 16:06:44 2023 -0500
@@ -232,7 +232,9 @@
   virtual bool is_user_script_frame () const { return false; }
   virtual bool is_user_fcn_frame () const { return false; }
   virtual bool is_scope_frame () const { return false; }
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   virtual bool is_bytecode_fcn_frame () const { return false; }
+#endif
 
   virtual void clear_values ();
 
@@ -469,6 +471,7 @@
     install_variable (sym, value, global);
   }
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   virtual octave_value get_active_bytecode_call_arg_names ()
   {
     panic_impossible (); // Only bytecode frame need to implement this
@@ -478,6 +481,7 @@
   {
     panic_impossible (); // Only bytecode frame need to implement this
   }
+#endif
 
   virtual octave_value get_auto_fcn_var (auto_var_type) const = 0;
 
--- a/libinterp/corefcn/variables.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/corefcn/variables.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -1235,10 +1235,12 @@
 
   string_vector argv = args.make_argv ("clear");
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
   // FIXME: This action should probably happen in the functions that
   // are called below, not here.
   // Mark any function cache in use by the VM as invalid
   octave::load_path::signal_clear_fcn_cache ();
+#endif
 
   if (argc == 1)
     {
--- a/libinterp/octave-value/ov-fcn.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/octave-value/ov-fcn.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -40,7 +40,9 @@
 #include "interpreter.h"
 #include "lo-array-errwarn.h"
 
+#if defined (OCTAVE_ENABLE_BYTECODE_INTERPRETER)
 #include "pt-bytecode-walk.h"
+#endif
 
 octave_base_value *
 octave_function::clone () const
--- a/libinterp/octave-value/ov-vm.h	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/octave-value/ov-vm.h	Wed Dec 06 16:06:44 2023 -0500
@@ -31,7 +31,7 @@
 #include "ov.h"
 #include "load-path.h"
 
-
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
 // octave_value_vm is to be used only by the VM
 // and need to have the same bit representation as
 // an octave_value.
@@ -240,3 +240,5 @@
 };
 
 #endif
+
+#endif
--- a/libinterp/parse-tree/pt-eval.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/parse-tree/pt-eval.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -2209,11 +2209,13 @@
   return m_call_stack.get_auto_fcn_var (avt);
 }
 
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
 void
 tree_evaluator::set_active_bytecode_ip (int ip)
 {
   m_call_stack.set_active_bytecode_ip (ip);
 }
+#endif
 
 void
 tree_evaluator::define_parameter_list_from_arg_vector
@@ -4648,8 +4650,10 @@
 {
   std::string file_name = check_autoload_file (nm);
 
+#if defined (OCTAVE_ENABLE_BYTECODE_INTERPRETER)
   // Signal to load path that the function cache is invalid
   octave::load_path::signal_clear_fcn_cache ();
+#endif
 
   m_autoload_map[fcn] = file_name;
 }
@@ -4659,8 +4663,10 @@
 {
   check_autoload_file (nm);
 
+#if defined (OCTAVE_ENABLE_BYTECODE_INTERPRETER)
   // Signal to load path that the function cache is invalid
   octave::load_path::signal_clear_fcn_cache ();
+#endif
 
   // Remove function from symbol table and autoload map.
   symbol_table& symtab = m_interpreter.get_symbol_table ();
--- a/libinterp/parse-tree/pt-eval.h	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/parse-tree/pt-eval.h	Wed Dec 06 16:06:44 2023 -0500
@@ -412,9 +412,11 @@
 
   octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const;
 
-  void set_active_bytecode_ip (int ip);
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+ void set_active_bytecode_ip (int ip);
+#endif
 
-  void define_parameter_list_from_arg_vector
+ void define_parameter_list_from_arg_vector
   (tree_parameter_list *param_list, const octave_value_list& args);
 
   void undefine_parameter_list (tree_parameter_list *param_list);
--- a/libinterp/parse-tree/pt-tm-const.cc	Tue Dec 05 20:57:48 2023 +0100
+++ b/libinterp/parse-tree/pt-tm-const.cc	Wed Dec 06 16:06:44 2023 -0500
@@ -38,7 +38,9 @@
 #include "ovl.h"
 #include "pt-arg-list.h"
 #include "pt-bp.h"
-#include "pt-bytecode-vm.h"
+#if defined (OCTAVE_ENABLE_BYTECODE_EVALUATOR)
+#  include "pt-bytecode-vm.h"
+#endif
 #include "pt-eval.h"
 #include "pt-exp.h"
 #include "pt-mat.h"