octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #64677] VM Add support for nested functions


From: Petter T.
Subject: [Octave-bug-tracker] [bug #64677] VM Add support for nested functions
Date: Thu, 14 Sep 2023 18:38:49 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64677>

                 Summary: VM Add support for nested functions
                   Group: GNU Octave
               Submitter: petter
               Submitted: Thu 14 Sep 2023 10:38:47 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 14 Sep 2023 10:38:47 PM UTC By: Petter T. <petter>

Nested functions and functions with nested functions can be evaluated by the
VM.

* libinterp/corefcn/call-stack.cc: Push bytecode frame for nested functions
* libinterp/corefcn/call-stack.h
* libinterp/corefcn/stack-frame.cc: Support saving bytecode frames,
frameoffset ...
* libinterp/corefcn/stack-frame.h
* libinterp/octave-value/ov-fcn-handle.cc: Compile nested function handles
                                           Refactor VM call and is compiled
check.
* libinterp/octave-value/ov-fcn.cc: Refactor compiled check and VM call
* libinterp/octave-value/ov-ref.cc: New ref octave_value_ref_ptr for nested
frames
* libinterp/octave-value/ov-ref.h
* libinterp/octave-value/ov-usr-fcn.cc: Refactor vm call and compiled check
* libinterp/octave-value/ov.h: octave_value_ref_ptr friend to call is_ref()
and ref_rep ()
* libinterp/parse-tree/pt-bytecode-vm.cc: Function caches might be written to
refs
                                          New vm::call () and
vm::maybe_compiled_or_compile ()
                                          Call bytecode for command functions.
* libinterp/parse-tree/pt-bytecode-vm.h
* libinterp/parse-tree/pt-bytecode-walk.cc: Compile nested functions, set up
variables
* libinterp/parse-tree/pt-bytecode-walk.h
* libinterp/parse-tree/pt-bytecode.h: New opcode ENTER_NESTED
* libinterp/parse-tree/pt-eval.cc: Push nested frame, refactor how VM is
called
* libinterp/parse-tree/pt-eval.h
* test/compile/bytecode.tst: Tests added
* test/compile/module.mk
* test/compile/bytecode_nested.m
* test/compile/cdef_bar.m: Self-counting test class








    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Thu 14 Sep 2023 10:38:47 PM UTC  Name: octave_32353.patch  Size: 85KiB  
By: petter

<http://savannah.gnu.org/bugs/download.php?file_id=55141>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64677>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]