summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-13%p is not portable accross platforms卜部昌平
This commit fixes compiler error on MSVC. %p on that platform is not suitable to represent a compile-time constant. https://ci.appveyor.com/project/ruby/ruby/builds/34017163/job/vj2a8uk3gwv9yxak#L24381 Notes: Merged: https://github.com/ruby/ruby/pull/3305
2020-07-13add comments卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3305
2020-07-13fix typo卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3305
2020-07-13inline Primitive.cexpr!卜部昌平
We can obtain the verbatim source code of Primitive.cexpr!. Why not paste that content into the JITed program. Notes: Merged: https://github.com/ruby/ruby/pull/3305
2020-07-13precalc invokebuiltin destinations卜部昌平
Noticed that struct rb_builtin_function is a purely compile-time constant. MJIT can eliminate some runtime calculations by statically generate dedicated C code generator for each builtin functions. Notes: Merged: https://github.com/ruby/ruby/pull/3305
2020-07-13* 2020-07-13 [ci skip]git
2020-07-13sync_default_gems.rb: Updated commentsNobuyoshi Nakada
* removed out-of-date and duplicate list * stated that everything synced from github
2020-07-13sync_default_gems.rb: Added `list` subcommandNobuyoshi Nakada
2020-07-13sync_default_gems.rb: Ignore conflicted files in toplevel moreNobuyoshi Nakada
2020-07-12sync_default_gems.rb: Added -e option to edit when conflictedNobuyoshi Nakada
2020-07-12Fixed yday and wday with timezone [Bug #17024]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3312
2020-07-12* 2020-07-12 [ci skip]git
2020-07-12bidecimal: improve tests' independence (#3297)Kenta Murata
Tests depending on the rounding mode must specify the appropriate rounding mode and restore to the original mode at the end. Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-07-11Enhanced RDoc for Array#fill (#3301)Burdette Lamar
* Enhanced RDoc for Array#fill * Update array.c There's one more at 5072. I'll get it. Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-07-11Fixed a comment, wrong binary prefix [ci skip]Nobuyoshi Nakada
2020-07-10Fix missing imemo cases in objspace_dump by refactoringAlan Wu
imemo_callcache and imemo_callinfo were not handled by the `objspace` module and were showing up as "unknown" in the dump. Extract the code for naming imemos and use that in both the GC and the `objspace` module. Notes: Merged: https://github.com/ruby/ruby/pull/3304
2020-07-10Clarify behavior of super in method in module included in refinement [ci skip]Jeremy Evans
Fixes [Bug #16977]
2020-07-11* 2020-07-11 [ci skip]git
2020-07-10Encode ' as &apos; when using encode(xml: :attr)Jeremy Evans
Fixes [Bug #16922] Notes: Merged: https://github.com/ruby/ruby/pull/3177
2020-07-10Show messages around the line when replacing failed in format_changelogKazuhiro NISHIYAMA
2020-07-10Fix an inaccurate comment in test_jitTakashi Kokubun
2020-07-10Make sure vm_call_cfunc uses inlined ccTakashi Kokubun
which is checked by the first guard. When JIT-inlined cc and operand cd->cc are different, the JIT-ed code might wrongly dispatch cd->cc even while class check is done with another cc inlined by JIT. This fixes SEGV on railsbench.
2020-07-10Explicit conversion to boolean to suppress shorten-64-to-32 warningsNobuyoshi Nakada
2020-07-10Fixed another typoNobuyoshi Nakada
2020-07-10Fixed typosNobuyoshi Nakada
2020-07-10vm_push_frame_debug_counter_inc: use branches卜部昌平
Ko1 doesn't like previous code. Notes: Merged: https://github.com/ruby/ruby/pull/3296
2020-07-10vm_push_frame: move assignments around卜部昌平
Struct assignment using a compound literal is more readable than before, to me at least. It seems compilers reorder assignments anyways. Neither speedup nor slowdown is observed on my machine. Notes: Merged: https://github.com/ruby/ruby/pull/3296
2020-07-10RUBY_CONST_ASSERT: use STATIC_ASSERT instead卜部昌平
Static assertions shall be done using STATIC_ASSERT these days. Notes: Merged: https://github.com/ruby/ruby/pull/3296
2020-07-10vm_push_frame: move assertions out of the function卜部昌平
These assertions are purely static. Ned not be checked on-the-fly. Notes: Merged: https://github.com/ruby/ruby/pull/3296
2020-07-10vm_push_frame: hoist out debug codes卜部昌平
Made it a bit readable. Notes: Merged: https://github.com/ruby/ruby/pull/3296
2020-07-10nobody uses the return value of vm_push_frame卜部昌平
Surprised to see such a waste of time in this super duper hot path. Notes: Merged: https://github.com/ruby/ruby/pull/3296
2020-07-09Add instance_methods to class generated by DelegateClassMasataka Pocke Kuwabara
Also, make DelegateClass.instance_method fallback to superclass. Fixes [Bug #16982] Notes: Merged: https://github.com/ruby/ruby/pull/3221 Merged-By: jeremyevans <code@jeremyevans.net>
2020-07-10* 2020-07-10 [ci skip]git
2020-07-09Document that Kernel#load will load relative to current directory [ci skip]Jeremy Evans
Update and format the Kernel#load documentation to separate the three cases (absolute path, explicit relative path, other), and also document that it raises LoadError on failure. Fixes [Bug #16988]
2020-07-09Fix typos [ci skip]Kazuhiro NISHIYAMA
2020-07-09* 2020-07-09 [ci skip]git
2020-07-09Bail out when unsupported coroutine targetNobuyoshi Nakada
2020-07-08Enhanced RDoc for Array (#3282)Burdette Lamar
Methods: reject! reject delete_if zip transpose replace clear Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-07-08Fix build error on Apple silicon macOSWatson
This patch will fix following build error on macOS 11.0 + Xcode 12 beta. ``` $ ./configure $ make V=1 BASERUBY = /Users/watson/.rbenv/shims/ruby --disable=gems CC = clang -fdeclspec LD = ld LDSHARED = clang -fdeclspec -dynamiclib CFLAGS = -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation SOLIBS = -lpthread -ldl -lobjc LANG = ja_JP.UTF-8 LC_ALL = LC_CTYPE = MFLAGS = Apple clang version 12.0.0 (clang-1200.0.22.19) Target: arm64-apple-darwin20.0.0 Thread model: posix InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin clang -fdeclspec -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -o cont.o -c cont.c In file included from cont.c:19: ./coroutine/ucontext/Context.h:32:5: error: 'getcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations] getcontext(&context->state); ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:37:6: note: 'getcontext' has been explicitly marked deprecated here int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ In file included from cont.c:19: ./coroutine/ucontext/Context.h:51:5: error: 'makecontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations] makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context); ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:38:6: note: 'makecontext' has been explicitly marked deprecated here void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHI... ^ In file included from cont.c:19: ./coroutine/ucontext/Context.h:59:5: error: 'swapcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations] swapcontext(&current->state, &target->state); ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:40:6: note: 'swapcontext' has been explicitly marked deprecated here int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_... ^ 3 errors generated. make: *** [cont.o] Error 1 ``` Notes: Merged: https://github.com/ruby/ruby/pull/3289
2020-07-08Hoisted out functions for no name rest argument symbolNobuyoshi Nakada
2020-07-08Constified NODE pointer in ASTNodeDataNobuyoshi Nakada
2020-07-08Added `NODE_SPECIAL_EXCESSIVE_COMMA` info to `ARGS` of ↵manga_osyo
`RubyVM::AbstractSyntaxTree`. Notes: Merged: https://github.com/ruby/ruby/pull/3298
2020-07-08* 2020-07-08 [ci skip]git
2020-07-08gc.c: Cast int literal "1" to bits_tYusuke Endoh
... because shifting by more than 31 bits has undefined behavior (depending upon platform). Coverity Scan found this issue.
2020-07-06Expand heap pages to be exactly 16kbAaron Patterson
This commit expands heap pages to be exactly 16KiB and eliminates the `REQUIRED_SIZE_BY_MALLOC` constant. I believe the goal of `REQUIRED_SIZE_BY_MALLOC` was to make the heap pages consume some multiple of OS page size. 16KiB is convenient because OS page size is typically 4KiB, so one Ruby page is four OS pages. Do not guess how malloc works ============================= We should not try to guess how `malloc` works and instead request (and use) four OS pages. Here is my reasoning: 1. Not all mallocs will store metadata in the same region as user requested memory. jemalloc specifically states[1]: > Information about the states of the runs is stored as a page map at the beginning of each chunk. 2. We're using `posix_memalign` to request memory. This means that the first address must be divisible by the alignment. Our allocation is page aligned, so if malloc is storing metadata *before* the page, then we've already crossed page boundaries. 3. Some allocators like glibc will use the memory at the end of the page. I am able to demonstrate that glibc will return pointers within the page boundary that contains `heap_page_body`[2]. We *expected* the allocation to look like this: ![Expected alignment](https://user-images.githubusercontent.com/3124/85803661-8a81d600-b6fc-11ea-8cb6-7dbdb434a43b.png) But since `heap_page` is allocated immediately after `heap_page_body`[3], instead the layout looks like this: ![Actual alignment](https://user-images.githubusercontent.com/3124/85803714-a1c0c380-b6fc-11ea-8c17-8b37369e17ee.png) This is not optimal because `heap_page` gets allocated immediately after `heap_page_body`. We frequently write to `heap_page`, so the bottom OS page of `heap_page_body` is very likely to be copied. One more object per page ======================== In jemalloc, allocation requests are rounded to the nearest boundary, which in this case is 16KiB[4], so `REQUIRED_SIZE_BY_MALLOC` space is just wasted on jemalloc. On glibc, the space is not wasted, but instead it is very likely to cause page faults. Instead of wasting space or causing page faults, lets just use the space to store one more Ruby object. Using the space to store one more Ruby object will prevent page faults, stop wasting space, decrease memory usage, decrease GC time, etc. 1. https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf 2. https://github.com/ruby/ruby/commit/33390d15e7a6f803823efcb41205167c8b126fbb 3 https://github.com/ruby/ruby/blob/289a28e68f30e879760fd000833b512d506a0805/gc.c#L1757-L1763 4. https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf page 4 Co-authored-by: John Hawthorn <john@hawthorn.email>
2020-07-07* 2020-07-07 [ci skip]git
2020-07-07Get rid of the redundant stat() in rb_check_realpath_internalJean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/3267
2020-07-06Inline builtin struct arefTakashi Kokubun
We don't do this for aset because it might raise a FrozenError. ``` $ benchmark-driver -v --rbenv 'before;after;before --jit;after --jit' benchmark/mjit_struct_aref.yml --repeat-count=4 before: ruby 2.8.0dev (2020-07-06T01:47:11Z master d94ef7c6b6) [x86_64-linux] after: ruby 2.8.0dev (2020-07-06T07:11:51Z master 85425168f4) [x86_64-linux] last_commit=Inline builtin struct aref before --jit: ruby 2.8.0dev (2020-07-06T01:47:11Z master d94ef7c6b6) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-07-06T07:11:51Z master 85425168f4) +JIT [x86_64-linux] last_commit=Inline builtin struct aref Calculating ------------------------------------- before after before --jit after --jit mjit_struct_aref(struct) 34.783M 34.810M 48.321M 58.378M i/s - 40.000M times in 1.149996s 1.149097s 0.827794s 0.685192s Comparison: mjit_struct_aref(struct) after --jit: 58377836.7 i/s before --jit: 48321205.7 i/s - 1.21x slower after: 34809935.5 i/s - 1.68x slower before: 34782736.5 i/s - 1.68x slower ```
2020-07-06Run method_missing in the same execution contextNobuyoshi Nakada
2020-07-06[ruby/bigdecimal] Version 2.0.1Kenta Murata
https://github.com/ruby/bigdecimal/commit/3fa4f2ac67 Notes: Merged: https://github.com/ruby/ruby/pull/3295