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

58827 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 352887b731
Remove YAML::VERSION because it conflicts with Psych::VERSION 2019-11-09 11:08:24 +09:00
Koichi Sasada 21f7cca2c6 initialize kw special local var.
A method which has keyword parameters has an implicit local variable
to specify which keywords are (un)specified.

vm_call_iseq_setup_kwparm_nokwarg() is special function to invoke
a ISeq method without any keyword arguments. However, it should
also initialize the special local var. Without this initialization,
the implicit lvar can points a freed (T_NONE) object.
2019-11-09 10:04:04 +09:00
Hiroshi SHIBATA c5b4d2a259
Promote uri to default gems 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 8c9438d219
Promote yaml to default gems 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 2a0ed5691e
Promote timeout to default gems 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 9a90a4d953
Fixup 368ee984ed52f6abe1fdf8360ad72e6cf1cbfa66 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 5f206cebb9
Promote observer to default gems. But not yet released 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 3d731c3694
Promote readline to default gems named readline-ext 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA fc1d06b25d
Added gemspec for readline gem that is wrapper library for reline and readline extension 2019-11-09 07:32:34 +09:00
Koichi Sasada b5d8849220 Revert "don't embed full-path."
This reverts commit dfac2e9eb3.

It does not work if cwd is different from builddir...
2019-11-09 07:09:01 +09:00
Koichi Sasada dfac2e9eb3 don't embed full-path.
miniruby load *.rb from srcdir. To specify file path,
tool/mk_builtin_loader.rb embed full path of each *.rb file.
However it prevent to pre-generation of required files for tarball.
This patch generate srcdir/*.rb from __FILE__ information.
2019-11-09 06:57:58 +09:00
John Hawthorn 3b6954f8b9 Fix passing actual object_id to finalizer
Previously we were passing the memory_id. This was broken previously if
compaction was run (which changes the memory_id) and now that object_id
is a monotonically increasing number it was always broken.

This commit fixes this by defering removal from the object_id table
until finalizers have run (for objects with finalizers) and also copying
the SEEN_OBJ_ID flag onto the zombie objects.
2019-11-08 12:41:05 -08:00
Yusuke Endoh 9deca1a3b9 Try to fix test-spec failure on macOS
Not sure what is happening, but spec/ruby/security/cve_2018_6914_spec.rb
fails on macOS.
https://github.com/ruby/ruby/runs/294462511#step:10:134

I suspect that the state of a directory is weird immediately after it is
created (not writable or even world writable?).  This change tries to
make sure that ENV["TMPDIR"] is actually used by Dir.tmpdir.
2019-11-09 00:25:28 +09:00
Nobuyoshi Nakada 88b9a0f7fe
Prettify builtin_binary format 2019-11-09 00:21:44 +09:00
git cd706c5216 * 2019-11-09 [ci skip] 2019-11-09 00:04:07 +09:00
Nobuyoshi Nakada 579aa4dc52
Fixed the dependency 2019-11-09 00:03:29 +09:00
Nobuyoshi Nakada 248d0008db
Added pack.rb to BUILTIN_RB_SRCS 2019-11-08 23:59:22 +09:00
Yusuke Endoh a3141e3c76 Rubified the APIs of pack.c 2019-11-08 23:51:51 +09:00
Yusuke Endoh 882179a0ec tool/mk_builtin_loader.rb: check if op is an array or not
The insn array includes not only an array but also some literal objects.
2019-11-08 23:29:50 +09:00
Nobuyoshi Nakada 11e21f1982
Make prefix static 2019-11-08 23:00:36 +09:00
Nobuyoshi Nakada ff2d99406d
Update builtin include files 2019-11-08 22:31:44 +09:00
Nobuyoshi Nakada 7acf7a4f90
Add VPATH to rbinc rule for nmake 2019-11-08 18:49:18 +09:00
卜部昌平 e02b819482 delete cc->aux.inc_sp
Nobody uses it.
2019-11-08 16:38:06 +09:00
Nobuyoshi Nakada 2e29b65109
Add file mode to generated files [ci skip] 2019-11-08 16:37:42 +09:00
Nobuyoshi Nakada 99b1c19be4
builtin.h must be included *AFTER* vm_core.h 2019-11-08 16:31:57 +09:00
Nobuyoshi Nakada 20971799f2
Renamed `load_*.inc` as `*.rbinc` to utilize a suffix rule 2019-11-08 16:30:28 +09:00
aycabta 6e72b72881 Suppress "shadowing outer local variable" warning in 2.5 2019-11-08 16:18:36 +09:00
Koichi Sasada 83c563cfa4 cstr -> bytes
rb_iseq_ibf_load_cstr() accepts bytes, but not NUL-terminate
C string. To make it clear, rename it to _bytes.
2019-11-08 16:16:25 +09:00
Koichi Sasada 0b29662606 fix line break code (fix to LF) 2019-11-08 15:32:01 +09:00
Koichi Sasada 054cb6d389 forget to add gc.rb 2019-11-08 15:29:59 +09:00
Koichi Sasada 8fa41971c2 use builtins for GC.
Define a part of GC in gc.rb.
2019-11-08 15:29:02 +09:00
Koichi Sasada 2eb02dfd3b Stop compiling if type mismatch was found.
If there is a type mismatch between expected builtin function type
and actual function type, C compiler shows warning.

For example, `__builtin_func(1, 2)` expects
`func(rb_ec_t*, VALUE self, VALUE p1, VALUE p2)` function definition.

However, it is easy to overlook "warning" messages. So this patch
changes to stop compiling as an error if there is a mismatch.
2019-11-08 15:29:02 +09:00
Nobuyoshi Nakada 0ad0a8ff58
builtin.h must be included *AFTER* vm_core.h 2019-11-08 14:26:21 +09:00
Nobuyoshi Nakada 61cff5c51c
Removed BOM [ci skip] 2019-11-08 13:21:29 +09:00
Kazuki Tsujimoto cfccd59cb1
Fix typo 2019-11-08 12:44:31 +09:00
卜部昌平 90fc555258 name the result of calccall
This is a pure refactoring for better understanding of what is
happening here.  Should change nothing but readability.
2019-11-08 12:09:01 +09:00
Kazuki Tsujimoto d4da74ea78
Define Struct#deconstruct_keys 2019-11-08 11:37:46 +09:00
卜部昌平 7661150109 revival of __func__
dad2abc69f deleted __func__ but ruby
already use this feature under RUBY_FUNCTION_NAME_STRING macro.
Use it.
2019-11-08 11:12:01 +09:00
卜部昌平 a1a08ac9aa describe vm_cache_check_for_class_serial [ci skip]
Added comments describing what it is.  Requested by ko1.
2019-11-08 10:31:06 +09:00
Koichi Sasada eaa011ffdb Change requirements of BASERUBY.
"BASERUBY: Ruby 1.9.3" test on Travis-CI checks builds on Ruby 1.9.3.
However this version is too old and 46acd0075d requires Ruby 2.2 and
later.
2019-11-08 10:10:37 +09:00
Koichi Sasada 365557f111 Define IO#read/write_nonblock with builtins.
IO#read/write_nonblock methods are defined in prelude.rb with
special private method __read/write_nonblock to reduce keyword
parameters overhead. We can move them into io.rb with builtin
functions.
2019-11-08 10:03:19 +09:00
Koichi Sasada dad2abc69f do not use __func__.
Microsoft Visual Studio 12.0 doesn't support it.
2019-11-08 10:03:19 +09:00
Koichi Sasada 08ff9edb53 fix line break code (fix to LF) 2019-11-08 09:30:11 +09:00
Koichi Sasada 46b9ca6c54 fix type 2019-11-08 09:26:16 +09:00
git 4c00b9e8eb * remove trailing spaces. [ci skip] 2019-11-08 09:09:47 +09:00
Koichi Sasada a47d058ebf use builtin for RubyVM::AbstractSyntaxTree.
Define RubyVM::AbstractSyntaxTree in ast.rb
with __builtin functions.
2019-11-08 09:09:29 +09:00
Koichi Sasada e2a45cb984 use builtin for TracePoint.
Define TracePoint in trace_point.rb and use __builtin_ syntax.
2019-11-08 09:09:29 +09:00
Koichi Sasada 46acd0075d support builtin features with Ruby and C.
Support loading builtin features written in Ruby, which implement
with C builtin functions.
[Feature #16254]

Several features:

(1) Load .rb file at boottime with native binary.

Now, prelude.rb is loaded at boottime. However, this file is contained
into the interpreter as a text format and we need to compile it.
This patch contains a feature to load from binary format.

(2) __builtin_func() in Ruby call func() written in C.

In Ruby file, we can write `__builtin_func()` like method call.
However this is not a method call, but special syntax to call
a function `func()` written in C. C functions should be defined
in a file (same compile unit) which load this .rb file.

Functions (`func` in above example) should be defined with
  (a) 1st parameter: rb_execution_context_t *ec
  (b) rest parameters (0 to 15).
  (c) VALUE return type.
This is very similar requirements for functions used by
rb_define_method(), however `rb_execution_context_t *ec`
is new requirement.

(3) automatic C code generation from .rb files.

tool/mk_builtin_loader.rb creates a C code to load .rb files
needed by miniruby and ruby command. This script is run by
BASERUBY, so *.rb should be written in BASERUBY compatbile
syntax. This script load a .rb file and find all of __builtin_
prefix method calls, and generate a part of C code to export
functions.

tool/mk_builtin_binary.rb creates a C code which contains
binary compiled Ruby files needed by ruby command.
2019-11-08 09:09:29 +09:00
Aaron Patterson dddf5afb79
Add a counter for compaction
Keep track of the number of times the compactor ran.  I would like to
use this as a way to keep track of inline cache reference updates.
2019-11-07 12:46:14 -08:00
git 597ec43543 * 2019-11-08 [ci skip] 2019-11-08 02:31:29 +09:00