Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3071
|
|
Retrying after rescued `require` should try to load the same
library again. [Bug #16607]
Notes:
Merged: https://github.com/ruby/ruby/pull/2879
|
|
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).
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
|
|
Get rid of infinite recursion in expanding a load path to the real
path while loading a transcoder.
Notes:
Merged: https://github.com/ruby/ruby/pull/2714
|
|
TAG_FATAL represents interpreter closing state and ec->errinfo
contains FIXNUM (eTerminateSignal, etc). If we need to change the
state, then errinfo is also changed because TAG_RAISE assumes that
ec->errinfo contains a Exception object.
Without this patch, TAG_FATAL is ignored and no ec->errinfo change
so that it causes critical issue.
[Bug #16177]
|
|
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.
This modifies some internal functions that took a safe level argument
to no longer take the argument.
rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.
One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd. We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
Notes:
Merged: https://github.com/ruby/ruby/pull/2476
|
|
Looking at the list of symbols inside of libruby-static.a, I found
hundreds of functions that are defined, but used from nowhere.
There can be reasons for each of them (e.g. some functions are
specific to some platform, some are useful when debugging, etc).
However it seems the functions deleted here exist for no reason.
This changeset reduces the size of ruby binary from 26,671,456
bytes to 26,592,864 bytes on my machine.
Notes:
Merged: https://github.com/ruby/ruby/pull/2677
|
|
We can check the function pointer passed to rb_define_global_function
like we do so in rb_define_method. It turns out that almost anybody
is misunderstanding the API.
|
|
They lack portability. See also
https://travis-ci.org/shyouhei/ruby/jobs/577164015
|
|
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct. There is only one usage of
MEMO::u3::func in load.c (where void Init_Foobar(vodi) is registered)
so why not just be explicit.
|
|
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct. This commit uses rb_gvar_getter_t /
rb_gvar_setter_t for rb_define_hooked_variable /
rb_define_virtual_variable which revealed lots of function prototype
inconsistencies. Some of them were literally decades old, going back
to dda5dc00cff334cac373096d444a0fd59e716124.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Without this patch, "raise" event invoked twice when raise an
exception in "load"ed script.
This patch by danielwaterworth (Daniel Waterworth).
[Bug #15877]
|
|
|
|
|
|
* load.c (rb_require_internal): make sure in advance that the path
to be loaded shares a fstring, to get rid of dangling path name.
Fixed up 5931857281ce45c1c277aa86d1588119ab00a955. [Bug #16041]
|
|
|
|
* RDoc does not seem to support documenting singleton object methods,
and making $LOAD_PATH a class as a workaround is too weird.
|
|
Moved from RubyVM. [Feature #15903]
|
|
|
|
[Feature #15777]
Closes: https://github.com/ruby/ruby/pull/2173
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* load.c (rb_resolve_feature_path): search the path for already
loaded feature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ruby.c (process_options): script_compiled events are missed on
command line -e or specified file. this commit fix it.
[Bug #15471]
This patch should be backport to Ruby 2.6 branch.
* vm_core.h (rb_exec_event_hook_script_compiled): introduce utility
function to invoke a script_compiled event.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* vm_trace.c: add `script_compiled` event. This event invoked
after script compiling and before evaluating compiled script.
Also the following methods are added:
`TracePoint#compiled_instruction_sequence` method to get compiled
`RubyVM::InstructionSequence` instance.
`TracePoint#compiled_eval_script` method to get compiled script (String)
by *eval methods (return nil if compiling by file).
* vm_trace.c (tracepoint_attr_raised_exception):
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
The former states explicitly that the argument must be a literal,
and can optimize away `strlen` on all compilers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
IMHO, this increases readability, too, since it's not
immediately clear that the object is on the malloc heap
and not a regular Ruby object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Use integer hashsum instead of string as a key in loaded_features_index.
Do not use ruby strings for substring operation, just plain pointer
and length.
[ruby-core:53688]
Co-authored-by: Sokolov Yura aka funny_falcon <funny.falcon@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
This removes the last dependency on rb_mWarning outside of
error.c and allows future commits to mark it static.
Yes, I expect this to slow down the emitting of a warning
message in a cold code path slightly :P
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* eval_intern.h: remove non-`EC_` prefix *_TAG() macros.
Use `EC_` prefix macros explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* load.c (rb_get_expanded_load_path): save cwd cache in OS path
encoding, to get rid of unnecessary conversion and infinite
loading when it needs encoding conversion.
[ruby-dev:50221] [Bug #13863]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* load.c (rb_load_internal0): accepts `ec`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
This re-introduces r60485.
This reverts commit 5a176b75b1187cbd3861c387bde65ff66396a07c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
This reverts commit 620ba74778bfdbdc34ffbb142d49ce84a0ef58e9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
NODEs in AST are no longer objects managed by GC. This change will
remove the restriction imposed by the GC. For example, a NODE can use
more than five words (this is my primary purpose; we want to store the
position data for each NODE, for coverage library), or even a NODE can
have variable length (some kinds of NODEs have unused fields).
To do this, however, we need more work, since Ripper still uses T_NODE
objects managed by the GC.
The life time of NODEs is more obvious than other kinds of objects; they
are created at parsing, and they become disused immediately after
compilation. This change releases all NODEs by a few `xfree`s after
compilation, so performance will be improved a bit. In extreme example,
`eval("x=1;" * 10000000)` runs much faster (40 sec. -> 7.8 sec. on my
machine).
The most important part of this change is `ast_t` struct, which has
three contents: (1) NODE buffer (malloc'ed memory), (2) a reference to
the root NODE, and (3) an array that contains objects that must be
marked during parsing (such as literal objects). Some functions that
had received `NODE*` arguments, must now receive `ast_t*`.
* node.c, node.h: defines `ast_t` struct and related operations.
* gc.c, internal.h: defines `imemo_ast`.
* parse.y: makes `parser_params` struct have a reference to `ast_t`.
Instead of `rb_node_newnode`, use `rb_ast_newnode` to create a NODE.
* iseq.c, load.c, ruby.c, template/prelude.c.tmpl: modifies some
functions to handle `ast_t*` instead of `NODE*`.
* test/ruby/test_gc.rb: ad-hoc fix for a failed test. The test assumes
GC eden is increased at startup by NODE object creation. However,
this change now create no NODE object, so GC eden is not necessarily
increased.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* eval_intern.h:
introduce EC_*_TAG() macros instead of TH_*_TAG() macros.
* TH_PUSH_TAG() -> EC_PUSH_TAG()
* TH_POP_TAG() -> EC_POP_TAG()
* TH_TMPPOP_TAG() -> EC_TMPPOP_TAG()
* TH_REPUSH_TAG() -> EC_REPUSH_TAG()
* TH_EXEC_TAG() -> EC_EXEC_TAG()
* TH_JUMP_TAG() -> EC_JUMP_TAG()
rb_threadptr_tag_state() , rb_ec_tag_jump() also accept `ec` instead of `th`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
to represent execution context [Feature #14038]
* vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer.
There are many code using `th` to represent execution context
(such as cfp, VM stack and so on). To access `ec`, they need to
use `th->ec->...` (adding one indirection) so that we need to
replace them by passing `ec` instead of `th`.
* vm_core.h (GET_EC()): introduced to access current ec. Also
remove `ruby_current_thread` global variable.
* cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of
rb_context_t::thread_value.
* cont.c (ec_set_vm_stack): added to update vm_stack explicitly.
* cont.c (ec_switch): added to switch ec explicitly.
* cont.c (rb_fiber_close): added to terminate fibers explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* vm.c (rb_vm_make_jump_tag_but_local_jump): get rid of fetching
retval when it is not used. it is necessary for local jump
state only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|