comparison libinterp/parse-tree/pt-eval.h @ 27210:bd684aad1821

eliminate some direct access to call stack in legacy class and function objects * pt-eval.h, pt-eval.cc (tree_evaluator::push_stack_frame, tree_evaluator::pop_stack_frame, tree_evaluator::is_class_method_executing, tree_evaluator::is_class_constructor_executing): New functions. * ov-class.cc (octave_class::get_current_method_class, octave_class::in_class_method, Fclass, Fsuperiorto, Finferiorto): Eliminate direct access to call stack. * ov-builtin.cc (octave_builtin::call): Likewise. * ov-fcn-handle.cc (octave_fcn_handle::call, octave_fcn_handle::push_closure_context, make_fcn_handle): Likewise. * ov-mex-fcn.cc (octave_mex_function::call): Likewise.
author John W. Eaton <jwe@octave.org>
date Mon, 01 Apr 2019 21:33:22 +0000
parents 5b40cf4896f0
children 8c27802a76c4
comparison
equal deleted inserted replaced
27209:ac92aa74fa1a 27210:bd684aad1821
464 464
465 profiler& get_profiler (void) { return m_profiler; } 465 profiler& get_profiler (void) { return m_profiler; }
466 466
467 call_stack& get_call_stack (void) { return m_call_stack; } 467 call_stack& get_call_stack (void) { return m_call_stack; }
468 468
469 void push_stack_frame (const symbol_scope& scope);
470
471 void push_stack_frame (octave_user_function *fcn,
472 unwind_protect *up_frame,
473 stack_frame *closure_frames = nullptr);
474
475 void push_stack_frame (octave_user_script *script,
476 unwind_protect *up_frame);
477
478 void push_stack_frame (octave_function *fcn);
479
480 void pop_stack_frame (void);
481
469 const stack_frame& get_current_stack_frame (void) const 482 const stack_frame& get_current_stack_frame (void) const
470 { 483 {
471 return m_call_stack.get_current_stack_frame (); 484 return m_call_stack.get_current_stack_frame ();
472 } 485 }
473 486
512 525
513 void goto_base_frame (void); 526 void goto_base_frame (void);
514 527
515 void restore_frame (size_t n); 528 void restore_frame (size_t n);
516 529
517 bool goto_frame_relative (int n, bool verbose = false); 530 std::string get_dispatch_class (void) const;
531
532 void set_dispatch_class (const std::string& class_name);
533
534 bool is_class_method_executing (std::string& dispatch_class) const;
535
536 bool is_class_constructor_executing (std::string& dispatch_class) const;
518 537
519 std::list<stack_frame *> 538 std::list<stack_frame *>
520 backtrace_frames (octave_idx_type& curr_user_frame) const; 539 backtrace_frames (octave_idx_type& curr_user_frame) const;
521 540
522 std::list<stack_frame *> backtrace_frames () const; 541 std::list<stack_frame *> backtrace_frames () const;
523
524 std::string get_dispatch_class (void) const;
525
526 void set_dispatch_class (const std::string& class_name);
527 542
528 octave_map backtrace (octave_idx_type& curr_user_frame, 543 octave_map backtrace (octave_idx_type& curr_user_frame,
529 bool print_subfn = true) const; 544 bool print_subfn = true) const;
530 545
531 octave_map backtrace (); 546 octave_map backtrace ();