Yukihiro "Matz" Matsumoto
aa06432776
mruby-array-ext: index should be within mrb_int range
...
Type check is done by `__to_int` method.
2024-08-01 07:34:20 +09:00
Yukihiro "Matz" Matsumoto
a668e6d81e
Merge pull request #6310 from dearblue/ci-extend
2024-07-31 11:09:23 +09:00
Yukihiro "Matz" Matsumoto
eca59ad9ac
Merge pull request #6312 from dearblue/OP_RETURN
2024-07-30 12:04:01 +09:00
Yukihiro "Matz" Matsumoto
3c5baac5c5
mruby-sprintf: fix a bug with negative octals
...
Leading octal digit may be 1, 3, 7 unlike binary or hexadecimal.
2024-07-30 11:33:18 +09:00
Yukihiro "Matz" Matsumoto
ab95e042ca
mruby-bigint (mrb_bint_xor): add fast path with fixnums
2024-07-29 16:44:54 +09:00
Yukihiro "Matz" Matsumoto
b706c89c41
mruby-bigint (mrb_bint_2comp): fix assertion
2024-07-29 16:44:54 +09:00
Yukihiro "Matz" Matsumoto
bf7f14341d
mruby-bigint (mrb_bint_or): add fast path with fixnums
2024-07-29 15:47:19 +09:00
Yukihiro "Matz" Matsumoto
dcf7adeeb7
mruby-bigint: use zero_p()
2024-07-29 15:43:22 +09:00
Yukihiro "Matz" Matsumoto
196c2bd0b9
mruby-bigint (mrb_bint_add): add type cast to stop warnings in C++
2024-07-28 23:29:54 +09:00
Yukihiro "Matz" Matsumoto
081cd0627f
mruby-bigint (mrb_bint_hash): need to get hash from all digits
2024-07-27 18:54:50 +09:00
Yukihiro "Matz" Matsumoto
203a89a3f2
mruby-bigint (zero_p): define a new predicate to check if mpz_t is 0
2024-07-27 18:54:50 +09:00
Yukihiro "Matz" Matsumoto
234a2b10fb
mruby-bigint (mpz_neg): no need to check x != y
2024-07-27 18:54:50 +09:00
Yukihiro "Matz" Matsumoto
811637e99f
mruby-bigint (mrb_bint_2comp): inline mpz_2comp
2024-07-27 18:54:49 +09:00
Yukihiro "Matz" Matsumoto
c218894af9
mruby-bigint: use mp_limb instead of uint32_t
...
Because mp_limb may be uint16_t on some platforms.
2024-07-27 18:54:48 +09:00
Yukihiro "Matz" Matsumoto
a50a2ce148
.gitingore: add entries (.cache, gmon.out, perf.data)
2024-07-27 18:53:55 +09:00
Yukihiro "Matz" Matsumoto
2247e4f355
mruby-bigint (mpz_xor): simplify the code
2024-07-27 18:53:36 +09:00
Yukihiro "Matz" Matsumoto
b573a8430f
mruby-bigint (mpz_or): simplify the code
2024-07-27 18:50:09 +09:00
Yukihiro "Matz" Matsumoto
dea1cc18a6
mruby-bigint (mpz_and): simplify the code
2024-07-27 18:48:01 +09:00
Yukihiro "Matz" Matsumoto
bf081c3d3d
mruby-bigint (mrb_bint_and): further optimization for bint & int
2024-07-25 17:46:36 +09:00
Yukihiro "Matz" Matsumoto
99c078bb6b
mruby-bigint (mrb_bint_2comp): simplify using mpz_2comp()
2024-07-25 16:18:49 +09:00
Yukihiro "Matz" Matsumoto
3d69412ea5
mruby-bigint: Distinguish uzero_p(x) and x->sn == 0
...
The latter is a check for integers that have been set up (and disclosed to the
outer world), while the former is a check for integers that are being worked on.
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
93653dfd4c
mruby-bigint (uzero_p): add fast path
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
4ee7c8e021
mruby-bigint: rename uzero to uzero_p
...
Since uzero() is a predicate, and zero() is a function to assign zero to
mpz_t, it's confusion. Rename predicate uzero() to uzero_p() to follow
mruby naming convention.
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
88536ebe30
mruby-bigint (mpz_xor): support bit-wise xor with negative numbers; #6314
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
ee2eb6c87e
mruby-bigint (mpz_or): support bit-wise or with negative numbers; #6314
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
69a80c94b9
mruby-bigint (mpz_and): support bit-wise and with negative numbers
...
Negative integers are virtually considered as 2's compliment of the
absolute value of the corresponding number. It means `-1` is considered
as infinite sequence of `1` toward msb side. ref #6314
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
e3a459d5b9
mruby-bigint (mrb_bint_and): optimize bint & fixnum operation; ref #6314
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto
c16aba9280
mruby-bigint: remove special handling of Float in bitwise operations
...
CRuby raises TypeError with float numbers as operands; ref #6314
2024-07-25 16:18:47 +09:00
Yukihiro "Matz" Matsumoto
81a9eef591
Merge pull request #6313 from hoshiumiarata/fix_typo_in_opcode_doc
2024-07-24 12:28:52 +09:00
Yukihiro "Matz" Matsumoto
b4ffddebdf
Merge pull request #6314 from hoshiumiarata/optimize_int_even
2024-07-24 08:11:43 +09:00
Hoshiumi Arata
612941dcbc
Add test code for even?/odd?
2024-07-23 21:09:17 +09:00
Hoshiumi Arata
80502b30fb
Optimize even?/odd? for big integers
2024-07-23 21:05:10 +09:00
Hoshiumi Arata
35571df7ea
Update opcode.md: fix wrong column number
2024-07-23 20:25:22 +09:00
Yukihiro "Matz" Matsumoto
bb4a8c2410
Merge pull request #6311 from dearblue/OP_SEND
2024-07-23 11:04:20 +09:00
Yukihiro "Matz" Matsumoto
6a03647fc0
Merge pull request #6309 from dearblue/mrb_type
2024-07-23 07:26:04 +09:00
Yukihiro "Matz" Matsumoto
d2878138d9
mruby-numeric-ext: implement Integer#even? and Integer#odd?
2024-07-23 07:23:13 +09:00
Yukihiro "Matz" Matsumoto
9d709164dc
Merge pull request #6308 from dearblue/vm-catch
2024-07-22 16:29:56 +09:00
Yukihiro "Matz" Matsumoto
f3b570f33a
mruby-enumerator: add test for Enumerable#chunk_while
2024-07-22 13:52:12 +09:00
dearblue
e93226f402
Doubling the call stack when extending it
...
Previously it was "approximately double".
2024-07-21 21:58:18 +09:00
dearblue
748af76ed2
Omit error checking at OP_RETURN, OP_RETURN_BLK and OP_BREAK
...
Clearing errors at the beginning of `mrb_vm_exec()` essentially keeps the mruby VM in a non-error state.
For consistency, functions such as `mrb_funcall()` check for errors when control returns from a C function as a method.
In the case of a tail call, it should return to `mrb_vm_exec()` afterwards, so error checking is performed there.
Instructions issued while `mrb->exc` is non-null should be limited to `OP_EXCEPT`, the jump target of the catch handler table.
2024-07-21 21:58:18 +09:00
dearblue
ce847c1aa9
Added fast-path for positional arguments less than 15 in OP_SEND
2024-07-21 21:58:18 +09:00
dearblue
e76bebe836
Perform pseudo binary search with mrb_type()
2024-07-21 21:58:18 +09:00
dearblue
45007888f5
Assume that MRB_CATCH() has mrb->exc set
...
The caller of `MRB_EXC_THROW()` must be preconfigured.
2024-07-21 21:58:18 +09:00
Yukihiro "Matz" Matsumoto
dcbe2e3eb3
mruby-enumerator: add Enumerable#chunk_while
2024-07-21 20:29:27 +09:00
Yukihiro "Matz" Matsumoto
7d8fc3b35f
Merge pull request #6305 from dearblue/method_missing
...
Protect keyword arguments in `prepare_missing()`
2024-07-20 22:04:50 +09:00
dearblue
890dda79d0
Protect keyword arguments in prepare_missing()
...
Previously, keyword arguments were lost if no positional arguments were passed.
Fixed #6304
2024-07-20 16:25:11 +09:00
Yukihiro "Matz" Matsumoto
3ec6038505
Merge pull request #6299 from mruby/dependabot/github_actions/super-linter/super-linter-6.7.0
...
build(deps): bump super-linter/super-linter from 6.6.0 to 6.7.0
2024-07-20 15:25:20 +09:00
dependabot[bot]
6c4ea4cd10
build(deps): bump super-linter/super-linter from 6.6.0 to 6.7.0
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v6.6.0...v6.7.0 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-07-20 06:16:03 +00:00
Yukihiro "Matz" Matsumoto
9326c514c5
mruby-enum-ext: add Enumerable#each_entry test
2024-07-20 14:20:15 +09:00
Pete Kinnecom
509590c18d
Method missing kwargs test failure:
...
Fail: Method#call with undefined method -- only kwargs (mrbgems: mruby-method)
- Assertion[6]
NoMethodError exception expected, not
Class: <TypeError>
Message: <Array cannot be converted to Hash>
- Assertion[9]
Expected: {:kwarg1=>:val1, :kwarg2=>:val2}
Actual: [:foo]
2024-07-19 20:37:40 +00:00