An error occurred fetching the project authors.
  1. 01 Feb, 2021 1 commit
    • Yukihiro "Matz" Matsumoto's avatar
      Allow more than 256 child `irep`; fix #5310 · d759a735
      Yukihiro "Matz" Matsumoto authored
      We have introduced following new instructions.
      
       * `OP_LAMBDA16`
       * `OP_BLOCK16`
       * `OP_METHOD16`
       * `OP_EXEC16`
      
      Each instruction uses 16 bits operand for `reps` index. Since new
      instructions are added, `mruby/c` VM should be updated.
      
      Due to new instructions, dump format compatibility is lost, we have
      increased `RITE_BINARY_MAJOR_VER`.
      
      In addition, we have decreased the size of `refcnt` in `mrb_irep` from
      `uint32_t` to `uint16_t`, which is reasonably big enough.
      d759a735
  2. 31 Jan, 2021 2 commits
  3. 28 Jan, 2021 2 commits
  4. 26 Jan, 2021 1 commit
  5. 25 Jan, 2021 1 commit
  6. 22 Jan, 2021 1 commit
    • Yukihiro "Matz" Matsumoto's avatar
      Minimize the changes in #5277 · dc51d89a
      Yukihiro "Matz" Matsumoto authored
      Instead of including `mruby/presym.h` everywhere, we provided the
      fallback `mruby/presym.inc` under `include/mruby` directory, and specify
      `-I<build-dir>/include` before `-I<top-dir>/include` in `presym.rake`.
      So even when someone drops `-I<build-dir>/include` in compiler options,
      it just compiles without failure.
      dc51d89a
  7. 16 Jan, 2021 1 commit
    • dearblue's avatar
      Fixed stack position of return value; ref #5272 · 414a61a9
      dearblue authored
      When I `#call` the "proc" object created by the `mrb_proc_new_cfunc()` function from Ruby space, the return value did not go into the correct stack position.
      This can destroy the calling variable.
      
      This issue is now caused by #5272. sorry.
      414a61a9
  8. 11 Jan, 2021 1 commit
  9. 10 Jan, 2021 3 commits
    • dearblue's avatar
      Unified `pc` and `err` of `mrb_callinfo` · ced89c25
      dearblue authored
      This enhances self-containment.
      
      - Changed the `mrb_callinfo::pc` field to point to itself.
        Previously it indicated the return destination of the previous call level.
        `mrb_callinfo::pc` will now hold the address to its own `proc->body.irep->iseq`.
      - Removed `mrb_callinfo::err` field.
        This is because `mrb_callinfo::pc - 1` is semantically the same as the previous `err`.
      - The `pc0` and `pc_save` variables in `mrb_vm_exec()` are no longer needed and have been deleted.
      - It removes the argument because `cipush()` doesn't need to save the previous `pc`.
      ced89c25
    • dearblue's avatar
      Changes `stackent` to `stack` of `mrb_callinfo` · 16baea06
      dearblue authored
      This enhances self-containment.
      
      Previously `mrb_context::stack` had the current call level stack, but now it owns it.
      The `mrb_context::stack` field, which is no longer needed, will be removed.
      16baea06
    • dearblue's avatar
      Unified `target_class` and `env` of `mrb_callinfo` · 58e94427
      dearblue authored
      If there is `env`, `env->c` means `target_class`.
      58e94427
  10. 06 Jan, 2021 1 commit
  11. 02 Jan, 2021 1 commit
  12. 13 Dec, 2020 1 commit
  13. 02 Dec, 2020 1 commit
  14. 30 Nov, 2020 1 commit
  15. 29 Nov, 2020 1 commit
  16. 26 Nov, 2020 1 commit
    • Yukihiro "Matz" Matsumoto's avatar
      Make `OP_JMP*` operand address to be relative. · 7150c675
      Yukihiro "Matz" Matsumoto authored
      Jump target address is `operand (16bit)` + `address of next instruction`.
      
      In addition, `ilen` was made `uint32_t` so that `iseq` length limitation
      of 65536 is removed. Only jump target address should be within signed
      16bit (-32768 .. 32767).
      7150c675
  17. 21 Nov, 2020 3 commits
  18. 16 Nov, 2020 1 commit
    • KOBAYASHI Shuji's avatar
      Avoid undefined behavior · 7c470e25
      KOBAYASHI Shuji authored
      ### ASAN report (`MRB_INT32`)
      
        ```console
        $ bin/mruby -ve '-0x40000000'
        mruby 3.0.0preview (2020-10-16)
        00001 NODE_SCOPE:
        00001   NODE_BEGIN:
        00001     NODE_NEGATE:
        00001       NODE_INT 40000000 base 16
        irep 0x6070000001e0 nregs=2 nlocals=1 pools=0 syms=0 reps=0 iseq=9
        file: -e
        /mruby/src/codedump.c:173:49: runtime error: left shift of 49152 by 16 places cannot be represented in type 'int'
        SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mruby/src/codedump.c:173:49 in
            1 000 OP_LOADI32	R1	-1073741824
            1 006 OP_RETURN	R1
            1 008 OP_STOP
      
        /mruby/src/vm.c:1138:7: runtime error: left shift of 49152 by 16 places cannot be represented in type 'mrb_int' (aka 'int')
        SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mruby/src/vm.c:1138:7 in
        ```
      7c470e25
  19. 14 Nov, 2020 1 commit
  20. 13 Nov, 2020 1 commit
    • KOBAYASHI Shuji's avatar
      Change name and usage of presym macros · 89f59148
      KOBAYASHI Shuji authored
      To be also able to build mruby without presym in the future. However,
      `MRB_QSYM` has been removed and changed as follows:
      
      ### Example
      
      |       Type                | Symbol |  Previous Style  |   New Style    |
      |---------------------------|--------|------------------|----------------|
      | Operator                  | &      | MRB_QSYM(and)    | MRB_OPSYM(and) |
      | Class Variable            | @@foo  | MRB_QSYM(00_foo) | MRB_CVSYM(foo) |
      | Instance Variable         | @foo   | MRB_QSYM(0_foo)  | MRB_IVSYM(foo) |
      | Method with Bang          | foo!   | MRB_QSYM(foo_b)  | MRB_SYM_B(foo) |
      | Method with Question mark | foo?   | MRB_QSYM(foo_p)  | MRB_SYM_Q(foo) |
      | Mmethod with Equal        | foo=   | MRB_QSYM(foo_e)  | MRB_SYM_E(foo) |
      
      This change makes it possible to define, for example, `MRB_IVSYM(foo)` as
      `mrb_intern_lit(mrb, "@" "foo")`, which is useful if we support building
      without presym in the future.
      89f59148
  21. 06 Nov, 2020 1 commit
  22. 04 Nov, 2020 1 commit
  23. 03 Nov, 2020 1 commit
  24. 22 Oct, 2020 1 commit
    • dearblue's avatar
      Prohibit array changes by "a"/"*" specifier of `mrb_get_args()` · f0a64329
      dearblue authored
      The "a"/"*" specifier of the `mrb_get_args()` function will now return `const mrb_value *`.
      This is because it is difficult for the caller to check if it is an array object and write-barrier if necessary.
      And it requires calling `mrb_ary_modify()` on the unmodified array object, which is also difficult (this is similar to #5087).
      f0a64329
  25. 12 Oct, 2020 10 commits