Skip to content

Status of this project. #3

Open

Description

@Arcachofo

Hi, great project!

What is the status of this project?
Is it usable?

Activity

  1. Programier commented on Apr 23, 2024

    @Programier
    Owner

    Hello!
    The project is not finished yet, there are still ideas for improvement. In addition, I do not exclude the presence of problems and bugs. In general, the project can already be used, but you need to be prepared for possible bugs. Therefore, if you suddenly encounter a problem, open a issue with a description of the situation where the problem occurs.

  2. Arcachofo commented on Apr 23, 2024

    @Arcachofo
    Author

    Thanks.
    I will try it and let you know.

    Any hints to compile it?
    Seems to need c++20, isn't it?

  3. Arcachofo commented on Apr 24, 2024

    @Arcachofo
    Author

    I could compile it.
    with the simplest "Hello world" scripts it works ok:

    `
    void main()
    {
        print("Hello there");
    }
    `
    
    `
    ./asjit hello.cpp
    =================================================================
    Begin compile function 'main'
      1: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      2: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      3: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      4: asBC_PGA        ( 98 with size = 3,     IMPLEMENTED) -> [1577650952, 21862]
      5: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [104]
      6: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [63, 0]
      7: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      8: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [63, 0]
      9: asBC_RET        ( 10 with size = 1,     IMPLEMENTED) -> []
    End of compile function 'main'
    =================================================================
    
    Hello there
    Exec time: 0 milliseconds
    `
    

    But with test/example.cpp I get a segfault.
    Maybe I didn't compile it correctly, or wrong AngelScript version...

    `
    ./asjit example.cpp
    =================================================================
    Begin compile function 'main'
      1: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      2: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      3: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      4: asBC_PGA        ( 98 with size = 3,     IMPLEMENTED) -> [1312167992, 22047]
      5: asBC_CALL       (  9 with size = 2,     IMPLEMENTED) -> [107]
      6: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [63, 0]
      7: asBC_FREE       ( 65 with size = 3,     IMPLEMENTED) -> [1312149440, 22047]
      8: asBC_STOREOBJ   ( 67 with size = 1,     IMPLEMENTED) -> []
      9: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     10: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [115, 0]
     11: asBC_PGA        ( 98 with size = 3,     IMPLEMENTED) -> [1312167992, 22047]
     12: asBC_CALL       (  9 with size = 2,     IMPLEMENTED) -> [107]
     13: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [173, 0]
     14: asBC_FREE       ( 65 with size = 3,     IMPLEMENTED) -> [1312149440, 22047]
     15: asBC_STOREOBJ   ( 67 with size = 1,     IMPLEMENTED) -> []
     16: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     17: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [225, 0]
     18: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     19: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     20: asBC_CALLINTF   (139 with size = 2,     IMPLEMENTED) -> [111]
     21: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [291, 0]
     22: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     23: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [104]
     24: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [346, 0]
     25: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     26: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [21]
     27: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [401, 0]
     28: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     29: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [401, 0]
     30: asBC_PGA        ( 98 with size = 3,     IMPLEMENTED) -> [1312170200, 22047]
     31: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     32: asBC_CALLINTF   (139 with size = 2,     IMPLEMENTED) -> [110]
     33: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [470, 0]
     34: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     35: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [470, 0]
     36: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     37: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     38: asBC_CALLINTF   (139 with size = 2,     IMPLEMENTED) -> [111]
     39: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [536, 0]
     40: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     41: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [104]
     42: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [591, 0]
     43: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     44: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [21]
     45: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [646, 0]
     46: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     47: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [646, 0]
     48: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     49: asBC_RefCpyV    (186 with size = 3,     IMPLEMENTED) -> [1312149440, 22047]
     50: asBC_PopPtr     (  0 with size = 1,     IMPLEMENTED) -> []
     51: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     52: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [702, 0]
     53: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     54: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     55: asBC_CALLINTF   (139 with size = 2,     IMPLEMENTED) -> [111]
     56: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [768, 0]
     57: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     58: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [104]
     59: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [823, 0]
     60: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
     61: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [21]
     62: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [878, 0]
     63: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     64: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [878, 0]
     65: asBC_FREE       ( 65 with size = 3,     IMPLEMENTED) -> [1312149440, 22047]
     66: asBC_FREE       ( 65 with size = 3,     IMPLEMENTED) -> [1312149440, 22047]
     67: asBC_RET        ( 10 with size = 1,     IMPLEMENTED) -> []
    End of compile function 'main'
    =================================================================
    
    =================================================================
    Begin compile function 'Example'
      1: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      2: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      3: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      4: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
      5: asBC_ADDSi      ( 79 with size = 2,     IMPLEMENTED) -> [134217742]
      6: asBC_ALLOC      ( 64 with size = 4,     IMPLEMENTED) -> [1312090768, 22047, 19]
      7: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [82, 0]
      8: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      9: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [82, 0]
     10: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     11: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
     12: asBC_ADDSi      ( 79 with size = 2,     IMPLEMENTED) -> [134217742]
     13: asBC_RDSPtr     ( 49 with size = 1,     IMPLEMENTED) -> []
     14: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [22]
     15: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [195, 0]
     16: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     17: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [195, 0]
     18: asBC_RET        ( 10 with size = 1,     IMPLEMENTED) -> []
    End of compile function 'Example'
    =================================================================
    
    =================================================================
    Begin compile function 'Example'
      1: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      2: asBC_PSF        (  4 with size = 1,     IMPLEMENTED) -> []
      3: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
      4: asBC_ALLOC      ( 64 with size = 4,     IMPLEMENTED) -> [1312149440, 22047, 106]
      5: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [70, 0]
      6: asBC_LOADOBJ    ( 66 with size = 1,     IMPLEMENTED) -> []
      7: asBC_RET        ( 10 with size = 1,     IMPLEMENTED) -> []
    End of compile function 'Example'
    =================================================================
    
    =================================================================
    Begin compile function 'set_msg'
      1: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      2: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      3: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      4: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
      5: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
      6: asBC_ADDSi      ( 79 with size = 2,     IMPLEMENTED) -> [134217742]
      7: asBC_RDSPtr     ( 49 with size = 1,     IMPLEMENTED) -> []
      8: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [22]
      9: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [118, 0]
     10: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
     11: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [118, 0]
     12: asBC_RET        ( 10 with size = 1,     IMPLEMENTED) -> []
    End of compile function 'set_msg'
    =================================================================
    
    =================================================================
    Begin compile function 'get_msg'
      1: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      2: asBC_SUSPEND    ( 63 with size = 1,     IMPLEMENTED) -> []
      3: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [5, 0]
      4: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
      5: asBC_ADDSi      ( 79 with size = 2,     IMPLEMENTED) -> [134217742]
      6: asBC_RDSPtr     ( 49 with size = 1,     IMPLEMENTED) -> []
      7: asBC_PshVPtr    ( 48 with size = 1,     IMPLEMENTED) -> []
      8: asBC_CALLSYS    ( 61 with size = 2,     IMPLEMENTED) -> [20]
      9: asBC_JitEntry   (175 with size = 3,     IMPLEMENTED) -> [118, 0]
     10: asBC_RET        ( 10 with size = 1,     IMPLEMENTED) -> []
    End of compile function 'get_msg'
    =================================================================
    
    Empty
    Segmentation fault (core dumped)
    `
    
  4. Programier commented on Apr 24, 2024

    @Programier
    Owner

    Please tell me the platform (Windows, Linux, Android?) and architecture (x86_64 or arm64) on which the code was run?

  5. Arcachofo commented on Apr 24, 2024

    @Arcachofo
    Author

    Linux x86_64

  6. Programier commented on Apr 24, 2024

    @Programier
    Owner

    Just compiled the project. g++ compiler (GCC) 13.2.1 20240316, AngelScript version 2.36.1.
    The project started without errors. Maybe you are using a different version of Angelscript?

  7. Arcachofo commented on Apr 24, 2024

    @Arcachofo
    Author

    Just compiled the project. g++ compiler (GCC) 13.2.1 20240316, AngelScript version 2.36.1. The project started without errors. Maybe you are using a different version of Angelscript?

    Yes, I'm using an older version: 2.35.1
    I will try with 2.36.1


    I comment here my experience in case it can be useful for somebody:

    I got something working in my Qt app, but found some challenges.
    Main problem is that Qt emit macro collides with asmjit's emit function.
    I tried the solution described in this post and could compile:
    error-when-using-asmjit-within-a-qt-gui-application

    But my app crashes in some cases, exactly when emitting a signal.
    I got "paranoid" with the emit issue and renamed everything containing "emit" to "jitEmit" or similar in asmjit, functions, class names and everything...
    But my app still crashes in some cases.

    The scripts works ok, the crash happens later when the program returns to Qt events loop, and always related with a button "clicked" signal or something like that.
    No idea of what could be the problem.

    Another minor issue is that I'm using C++11 and got an error in a std::set which does not implement "contains()" method.
    So I just iterated through the std::set to find the item.
    With this minor change I could compile with C++11

    std::set<unsigned int>& skip_it; skip_it.contains(index)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions