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

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

[Octave-bug-tracker] [bug #64674] VM Add support for scripts


From: Petter T.
Subject: [Octave-bug-tracker] [bug #64674] VM Add support for scripts
Date: Thu, 14 Sep 2023 18:32:02 -0400 (EDT)

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

                 Summary: VM Add support for scripts
                   Group: GNU Octave
               Submitter: petter
               Submitted: Thu 14 Sep 2023 10:31:59 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:31:59 PM UTC By: Petter T. <petter>

The patch adds support for executing scripts in the VM. When a VM script frame
is pushed, the VM steals the variables it needs from parent stacks, and puts a
reference type value in its place. When exiting the script frame, the value is
restored.

* libinterp/corefcn/call-stack.cc: push() script frame
* libinterp/corefcn/call-stack.h: New overload for push()
* libinterp/corefcn/compile.cc: Accept scripts compiling
* libinterp/corefcn/stack-frame.cc: Follow 'refs', assoc frames
* libinterp/corefcn/stack-frame.h: New functions, signatures
* libinterp/octave-value/ov-ref.cc: New ref class 'octave_value_ref_vmlocal'
* libinterp/octave-value/ov-ref.h:
* libinterp/octave-value/ov-usr-fcn.cc: Move functionality to parent class
                                        for scripts and functions.
                                        Auto-compile scripts.
* libinterp/octave-value/ov-usr-fcn.h:
* libinterp/octave-value/ov.h: Make ov and scope_stack_frame friends to call
                               is_ref().
* libinterp/parse-tree/pt-bytecode-vm.cc: New opcodes for entering and
                                          exiting scripts.
* libinterp/parse-tree/pt-bytecode-walk.cc: Compile scripts
* libinterp/parse-tree/pt-bytecode-walk.h:
* libinterp/parse-tree/pt-bytecode.h: New opcodes
* libinterp/parse-tree/pt-eval.cc: Execute scripts in VM, push frames
* libinterp/parse-tree/pt-eval.h:

Updated tests for scripts:
  * test/compile/bytecode_scripts.m: Added
  * test/compile/script1.m: Added
  * test/compile/script11.m: Added
  * test/compile/script2.m: Added
  * test/compile/script3.m: Added
  * test/compile/bytecode.tst: Updated
  * test/compile/module.mk: Include new files








    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Thu 14 Sep 2023 10:31:59 PM UTC  Name: octave_32350.patch  Size: 52KiB  
By: petter

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

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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