Commit graph

64552 commits

Author SHA1 Message Date
Takashi Kokubun
55866565c2
Combine mjit.h and internal/mjit.h
It's very hard to remember which mjit.h has what.
2020-11-22 20:22:21 -08:00
Nobuyoshi Nakada
afd765f2ee
Initialize UTF-8 encoding first as it is used always now 2020-11-23 09:45:17 +09:00
git
d83aa3c2f5 * 2020-11-23 [ci skip] 2020-11-23 00:11:08 +09:00
Takashi Kokubun
fa1250a506
Stop leaving .c files for JIT compaction in /tmp (#3802)
* Re-generate C files for JIT compaction every time

* Refactor in_jit return logic

* Just write code in a single file

* Add a TODO comment [ci skip]
2020-11-22 07:10:44 -08:00
Nobuyoshi Nakada
175952bf07
NEWS for [Feature #16233] [ci skip] 2020-11-22 23:08:38 +09:00
Nobuyoshi Nakada
82e836dc7d
Use hex-encoded binaries instead of UTF-8
Which UTF-8 char corresponds to the binary representation is
nonsense for other encodings, and just confusing.
2020-11-22 22:51:28 +09:00
Lars Kanis
d403591b34
Add string encoding IBM720 alias CP720 (#3803)
The mapping table is generated from the ICU project:
  https://github.com/unicode-org/icu/blob/master/icu4c/source/data/mappings/ibm-720_P100-1997.ucm

Fixes bug 16233 : https://bugs.ruby-lang.org/issues/16233
2020-11-22 22:23:40 +09:00
aycabta
2d112c346a [ruby/irb] Stop using bang version for #inspect of result
fc1426d34e
2020-11-22 21:00:11 +09:00
Benoit Daloze
afb8aba4af [ruby/irb] Add a fallback for check_code_block that does not depend on implementation-private APIs
* Fixes https://github.com/ruby/irb/issues/133

5eb3ef3293
2020-11-22 21:00:11 +09:00
Nobuhiro IMAI
5218f17737 [ruby/irb] support more body argument for oneliner method definition
2ff1295533
2020-11-22 21:00:11 +09:00
Nobuyoshi Nakada
7c879cbb3f
Suppress a unused-variable warning 2020-11-22 19:10:58 +09:00
Nobuyoshi Nakada
75d48a533d
rubyspec-capiext: Use plain DLDFLAGS without flags for libruby 2020-11-22 19:09:58 +09:00
Takashi Kokubun
7ade7a8603
Clarify the intention of the include guard
This was a leftover of 27d5af59a3.
2020-11-21 23:44:49 -08:00
Takashi Kokubun
9eb34c2c9e
Make c_file / so_file construction consistent
convert_unit_to_func's c_func / so_func construction is unnecessarily
complicated while it's not really safer than what compact_all_jit_code
does. So I changed convert_unit_to_func to be consistent with
compact_all_jit_code.
2020-11-21 22:38:23 -08:00
Takashi Kokubun
e0156bd396
Make sure all threads are scanned on unload_units
This has been a TODO since 79df14c04b. While adcf0316d1 covered the
root_fiber of the initial thread, it didn't cover root_fibers of other
threads. Now it's hooked properly in rb_threadptr_root_fiber_setup.

With regards to "XXX: Is this mjit_cont `mjit_cont_free`d?", when
rb_threadptr_root_fiber_release is called, although I'm not sure when
th->root_fiber is truthy, fiber_free seems to call cont_free and
mjit_cont_free. So mjit_conts of root_fibers seem to be freed properly.
2020-11-21 19:36:55 -08:00
Nobuyoshi Nakada
eb3906c6b8
dist: added DISTOPTS and PKGSDIR 2020-11-22 11:32:22 +09:00
Nobuyoshi Nakada
e9c3de4764
make-snapshot: don't store symlinks by 7z for reproduceable pacakges 2020-11-22 11:30:02 +09:00
Nobuyoshi Nakada
0f51105ece
make-snapshot: measure archiving times 2020-11-22 11:01:17 +09:00
Nobuyoshi Nakada
821aa35c8b
make-snapshot: suppress messages copying cached files unless verbose 2020-11-22 10:59:32 +09:00
Nobuyoshi Nakada
11cd9339a8
make-snapshot: clean autoconf caches for reproduceable packages 2020-11-22 10:49:02 +09:00
git
5512de7603 * 2020-11-22 [ci skip] 2020-11-22 09:10:35 +09:00
Nobuyoshi Nakada
43a9a974e2
[Bug #17021] Make host_* values consistent with target_* 2020-11-21 23:21:52 +09:00
Nobuyoshi Nakada
ece917bab3
Added rubyspec-capiext target
This target builds extensions for rubyspec optional C-API tests.
2020-11-21 23:17:48 +09:00
Takashi Kokubun
a6db9e8d7b
Remove the unused o_file definition
It's calculated inside compile_c_to_so again.
2020-11-21 00:29:52 -08:00
Takashi Kokubun
8750d001c2
Fix wrong #ifdef usages with #if
Apparently #ifdef is always true
2020-11-20 23:48:43 -08:00
Takashi Kokubun
27d5af59a3
Unify some confusing macro usages
_MSC_VER used to be the macro to switch JIT compaction. However, since
d4381d2ceb, the correct macro to switch it was changed from _MSC_VER
to _WIN32. As I didn't properly replace all relevant _MSC_VER usages
to _WIN32, these macros have been used inconsistently.

nobu replaced _WIN32 with USE_HEADER_TRANSFORMATION in 5eb446d12f.
Therefore we had USE_HEADER_TRANSFORMATION and _MSC_VER. This commit
makes sure such inconsistent _MSC_VER usages will be unified to the new
header, also renaming it to USE_JIT_COMPACTION to be more precise about
the requirements. The header transformation itself is not quite relevant
to places changed in this commit.
2020-11-20 23:39:30 -08:00
Jeremy Evans
d645f18f0f Minor fixes to NEWS for String subclass method change [ci skip] 2020-11-20 23:36:46 -08:00
Takashi Kokubun
ed8e552d4d
Shrink the blocking region for compile_compact_jit_code
Isn't setting `in_compact = true` enough to avoid a race condition
between JIT compaction and unload_units? Now I think it is.

This change will make it easier to spend more time on compile_compact_jit_code.
For now it seems to take only 0.0723ms though.
2020-11-20 22:47:54 -08:00
Takashi Kokubun
3f8c60cf09
Remove obsoleted str_new_empty
since 58325daae3.

../string.c:1339:1: warning: ‘str_new_empty’ defined but not used [-Wunused-function]
 1339 | str_new_empty(VALUE str)
      | ^~~~~~~~~~~~~
2020-11-20 22:22:29 -08:00
Takashi Kokubun
0960f56a1d
Eliminate IVC sync between JIT and Ruby threads (#3799)
Thanks to Ractor (https://github.com/ruby/ruby/pull/2888 and https://github.com/ruby/ruby/pull/3662),
inline caches support parallel access now.
2020-11-20 22:18:37 -08:00
Jeremy Evans
4988758e3a Update NEWS for String subclass method change [ci skip] 2020-11-20 16:42:38 -08:00
Jeremy Evans
58325daae3 Make String methods return String instances when called on a subclass instance
This modifies the following String methods to return String instances
instead of subclass instances:

* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each/#each_line
* String#gsub
* String#ljust
* String#lstrip
* String#partition
* String#reverse
* String#rjust
* String#rpartition
* String#rstrip
* String#scrub
* String#slice!
* String#slice/#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ/#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase

This also fixes a bug in String#swapcase where it would return the
receiver instead of a copy of the receiver if the receiver was the
empty string.

Some string methods were left to return subclass instances:

* String#+@
* String#-@

Both of these methods will return the receiver (subclass instance)
in some cases, so it is best to keep the returned class consistent.

Fixes [#10845]
2020-11-20 16:30:23 -08:00
Nobuhiro IMAI
4f5d14eb8c [DOC] Ripper.{lex,tokenize} now always return full tokens. [ci skip] 2020-11-20 15:46:17 -08:00
git
18599b5749 * 2020-11-21 [ci skip] 2020-11-21 08:27:10 +09:00
Jeremy Evans
08686e71d5 Do not allow Module#include to insert modules before the origin in the lookup chain
Module#include should only be able to insert modules after the origin,
otherwise it ends up working like Module#prepend.

This fixes the case where one of the modules in the included module
chain is included in a module that is already prepended to the receiver.

Fixes [Bug #7844]
2020-11-20 15:26:43 -08:00
Nobuyoshi Nakada
1f7b557890
Update expected IRB result 2020-11-20 18:30:05 +09:00
Nobuyoshi Nakada
69d871eeeb
[Feature #17276] Moved raise_errors support to Ripper::Lexer#parse 2020-11-20 17:18:27 +09:00
Nobuyoshi Nakada
fac2498e02 [Bug #11213] let defined?(super) call respond_to_missing? 2020-11-20 16:04:45 +09:00
Kazuhiro NISHIYAMA
4b899f9164 Try to fix download error
1428320660 (step):9:10
```
tool/downloader.rb:243:in `rescue in download': failed to download config.guess (RuntimeError)
OpenURI::HTTPError: 403 Forbidden: https://cdn.jsdelivr.net/gh/gcc-mirror/gcc@master/config.guess
```
2020-11-20 14:18:14 +09:00
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
Nobuhiro IMAI
1800f3fa5c
Ripper.{lex,tokenize} return full tokens even if syntax error
yet another implements [Feature #17276]
2020-11-20 11:44:57 +09:00
git
80d3f21994 * 2020-11-20 [ci skip] 2020-11-20 09:25:12 +09:00
Kevin Murphy
0026f644d7 Document Different Coverage Modes
This commits adds in documentation to illustrate the different modes you
can start coverage with. Examples are provided to show how to start each
of these modes, along with an explanation of the mode and a description
of the output.
2020-11-20 09:24:46 +09:00
Nobuyoshi Nakada
44ad72fa21
Added assertions 2020-11-19 15:41:53 +09:00
Hiroshi SHIBATA
9c1e2a99fc
Update the default gems section in NEWS.md 2020-11-19 15:36:21 +09:00
Jeremy Evans
4a5c42db88 Make RubyVM::InstructionSequence.compile_file use same encoding as load
This switches the internal function from rb_parser_compile_file_path
to rb_parser_load_file, which is the same internal method that
Kernel#load uses.

Fixes [Bug #17308]
2020-11-19 07:12:50 +09:00
git
fee0073726 * 2020-11-19 [ci skip] 2020-11-19 07:11:57 +09:00
Cristian Greco
ce3c9a3437 Fix USE_TRANSIENT_HEAP macro usage in hash.c
Additionally fix some typos in transient heap.
2020-11-19 07:11:36 +09:00