Граф коммитов

772 Коммитов

Автор SHA1 Сообщение Дата
S-H-GAMELINKS 8cbd5f218b rename 2020-11-20 11:47:47 +09:00
S-H-GAMELINKS c11c25baef fix code 2020-11-20 11:47:47 +09:00
S-H-GAMELINKS d79cdcb113 add flo_prev_or_next func 2020-11-20 11:47:47 +09:00
Kenta Murata f754b42285
numeric.c, range.c: prohibit zero step
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]
2020-10-23 15:26:51 +09:00
Stefan Stüben 8c2e5bbf58 Don't redefine #rb_intern over and over again 2020-10-21 12:45:18 +09:00
Nobuyoshi Nakada dd77796f1c
Hoisted out ensure_cmp which checks the comparison succeeded 2020-10-02 21:30:07 +09:00
Nobuyoshi Nakada 89ca842dcc
Ensure that the comparison succeeded [Bug #17205] 2020-10-02 11:02:45 +09:00
Peter Zhu f7bd9f0750 Fix unsigned int overflow in error message for chr
The error message has an integer overflow because it treats an unsigned int as a signed int.

Before:
```
> 3_000_000_000.chr
-1294967296 out of char range (RangeError)
```

After:
```
> 3_000_000_000.chr
3000000000 out of char range (RangeError)
```

Redmine ticket: https://bugs.ruby-lang.org/issues/17186
2020-09-30 00:31:59 +09:00
S-H-GAMELINKS 9db5d63ece [DOC] Use oracle url instead of sun url
[ci skip]
2020-08-05 08:04:58 +09:00
Kazuhiro NISHIYAMA 946cd6c534
Use https instead of http 2020-07-28 19:51:54 +09:00
卜部昌平 802bcd3ec8 fix MJIT link error 2020-07-13 08:56:18 +09:00
卜部昌平 9721f477c7 inline Primitive.cexpr!
We can obtain the verbatim source code of Primitive.cexpr!.  Why not
paste that content into the JITed program.
2020-07-13 08:56:18 +09:00
卜部昌平 de3e931df7 add UNREACHABLE_RETURN
Not every compilers understand that rb_raise does not return.  When a
function does not end with a return statement, such compilers can issue
warnings.  We would better tell them about reachabilities.
2020-06-29 11:05:41 +09:00
卜部昌平 03354feb6a fix_pow: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea.  Better refactor.
2020-06-29 11:05:41 +09:00
卜部昌平 250189f54f int_pow: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea.  Better refactor.
2020-06-29 11:05:41 +09:00
卜部昌平 bf19820bb3 flo_to_s: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea.  Better refactor.
2020-06-29 11:05:41 +09:00
Takashi Kokubun 0703e01471
Mark some Integer methods as inline (#3264) 2020-06-27 10:07:47 -07:00
Takashi Kokubun 95b0fed371
Make Integer#zero? a separated method and builtin (#3226)
A prerequisite to fix https://bugs.ruby-lang.org/issues/15589 with JIT.
This commit alone doesn't make a significant difference yet, but I thought
this commit should be committed independently.

This method override was discussed in [Misc #16961].
2020-06-20 14:55:09 -07:00
S.H eaf76be087
Remove unused else if statements in int_even_p func (#3220)
* remove else if & rb_funcall

* fix int_even_p impl

* fix rb_int_odd_p implementation
2020-06-16 10:13:54 -07:00
S.H 84160dc29b
Add static modifier for rb_int_ceil & rb_int_floor (#3217) 2020-06-16 17:47:59 +09:00
Yusuke Endoh 42abad2464 numeric.c: optimize `float ** 2` case by fastpath
It would be a relatively frequent case.  It is still slower than
`float * float` because `*` has a dedicated VM instruction (opt_mult),
though.
2020-05-12 02:14:27 +09:00
卜部昌平 9e41a75255 sed -i 's|ruby/impl|ruby/internal|'
To fix build failures.
2020-05-11 09:24:08 +09:00
卜部昌平 d7f4d732c1 sed -i s|ruby/3|ruby/impl|g
This shall fix compile errors.
2020-05-11 09:24:08 +09:00
Nobuyoshi Nakada 5d430c1b34
Added more NORETURN declarations 2020-05-11 00:40:14 +09:00
Yusuke Endoh 1a4f33e84e numeric.c: Remove unreachable code
b cannot be <= 0 here.  Found by Coverity Scan
2020-04-09 09:14:02 +09:00
Nobuyoshi Nakada 11d5a8318d
Suppress C4244 "possible loss of data" warnings 2020-04-08 18:03:46 +09:00
Nobuyoshi Nakada e474c189da
Suppress -Wswitch warnings 2020-04-08 15:13:37 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada 5b287481be
Removed non-RUBY_INTEGER_UNIFICATION code 2020-03-21 16:59:55 +09:00
Jeremy Evans ecef163cf9 Remove Float::ROUNDS
Fixes [Bug #16044]
2020-03-09 06:39:42 -07:00
Nobuyoshi Nakada 1ddc719a56
Check the encoding of `half:` option 2020-01-27 16:12:15 +09:00
卜部昌平 5e22f873ed decouple internal.h headers
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead.  This would significantly
speed up incremental builds.

We take the following inclusion order in this changeset:

1.  "ruby/config.h", where _GNU_SOURCE is defined (must be the very
    first thing among everything).
2.  RUBY_EXTCONF_H if any.
3.  Standard C headers, sorted alphabetically.
4.  Other system headers, maybe guarded by #ifdef
5.  Everything else, sorted alphabetically.

Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
2019-12-26 20:45:12 +09:00
卜部昌平 0958e19ffb add several __has_something macro
With these macros implemented we can write codes just like we can assume
the compiler being clang.  MSC_VERSION_SINCE is defined to implement
those macros, but turned out to be handy for other places.  The -fdeclspec
compiler flag is necessary for clang to properly handle __has_declspec().
2019-12-26 20:45:12 +09:00
卜部昌平 0e8219f591 make functions static
These functions are used from within a compilation unit so we can
make them static, for better binary size.  This changeset reduces
the size of generated ruby binary from 26,590,128 bytes to
26,584,472 bytes on my macihne.
2019-11-19 12:36:19 +09:00
NARUSE, Yui 6aa80d5583 Use FIX2LONG instead of FIX2INT like 26843cbcd0 2019-11-07 18:53:51 +09:00
NARUSE, Yui 26843cbcd0 Use FIX2LONG to avoid unexpected exception
Though it won't happen in the real world in this context, FIX2INT may
raise an exception and it cause to generate extra code.
2019-11-07 18:50:35 +09:00
Nobuyoshi Nakada 59648af296
Suppress keyword argument warning from #step
* numeric.c (num_step): pass the extracted argument from keyword
  argument, not the last argument itself which should have been
  warned already.
2019-09-30 01:17:55 +09:00
Nobuyoshi Nakada 5decf66ab3
Inspect dynamic symbol as well as static symbol 2019-08-25 11:39:20 +09:00
Nobuyoshi Nakada d69ffa4d93
Expanded f_quo 2019-08-10 14:38:30 +09:00
Nobuyoshi Nakada e89d9f3deb
Deprecate Float::ROUNDS, which should not be a constant
[Bug #16044]
2019-08-07 00:02:45 +09:00
Nobuyoshi Nakada 4ea5c5610a
Predefine some IDs 2019-08-03 10:18:39 +09:00
Nobuyoshi Nakada f9a0492b76
Expanded f_ceil 2019-08-02 11:26:58 +09:00
Nobuyoshi Nakada a036a8a038
Adjust styles and indents 2019-07-19 06:35:15 +09:00
Yusuke Endoh 36f2d9bac2 numeric.c (fix_cmp): remove a unreachable return statement 2019-07-14 22:46:34 +09:00
git 9987296b8b * expand tabs. 2019-07-14 17:16:35 +09:00
Yusuke Endoh 934e6b2aeb Prefer `rb_error_arity` to `rb_check_arity` when it can be used 2019-07-14 17:16:19 +09:00
Yusuke Endoh 65e63af377 Make opt_aref instruction support Integer#[]
only when its receiver and the argument are both Integers.

Since 6bedbf4625, Integer#[] has supported a range extraction.
This means that Integer#[] now accepts multiple arguments, which made
the method very slow unfortunately.

This change fixes the performance issue by adding a special handling for
its traditional use case: `num[idx]` where both `num` and `idx` are
Integers.
2019-06-01 13:15:43 +09:00
Hiroshi SHIBATA b72623012d
Update broken URL in Float documentation.
[Misc #15775][ruby-core:92332]
2019-05-04 06:23:25 +09:00
git 555d1dda71 * expand tabs. 2019-04-28 23:42:46 +09:00
Yusuke Endoh 6bedbf4625 numeric.c: Extend Integer#[] to support range arguments
````
0b01001101[2, 4]  #=> 0b0011
0b01001100[2..5]  #=> 0b0011
0b01001100[2...6] #=> 0b0011
    ^^^^
````

[Feature #8842]
2019-04-28 23:40:57 +09:00