| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* vm_method.c (rb_mod_remove_method): preserve encodings of method
name and class name in error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_make): preserve encodings of
constant names in warning messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* include/ruby/intern.h (rb_disable_super, rb_enable_super): warn
as deprecated at build time, instead of ignoring silently or
warning at runtime only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_make): get rid of storing method
cache, so that the added method will be called later.
[ruby-dev:48691] [Bug #10421]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_make): warn redefinition only for
already defined methods, but not for undefined methods.
[ruby-dev:48691] [Bug #10421]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* vm_method.c (Init_Method): make global method cache size
configurable by environment variable
"RUBY_GLOBAL_METHOD_CACHE_SIZE" [Fix GH-719]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* vm_method.c (GLOBAL_METHOD_CACHE): make a single expression.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_make, remove_method): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
We are not currently avoiding recursion by calling
release_method_definition, so use rb_free_method_entry directly
to make changing code easier in case we change the way
rb_method_entry_t is allocated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* thread.c (rb_thread_variable_set): get rid of inadvertent dynamic
symbol pin-down.
* vm_method.c (obj_respond_to): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
exposing IDs from collectable symbols.
[Bug #10014]
Now, rb_check_id() returns 0 if corresponding symbol is
pinned dynamic symbol.
There is remaining intern_cstr_without_pindown(), it can return
IDs from collectable symbols. We must be careful to use it
(only used in parse.y). I think it should be removed if
it does not have impact for performance.
* parse.y:
add:
* STATIC_SYM2ID()
* STATIC_ID2SYM()
rename:
* rb_pin_dynamic_symbol() -> dsymbol_pindown()
* internal.h:
remove:
* rb_check_id_without_pindown()
* rb_sym2id_without_pindown()
add:
* rb_check_symbol()
* rb_check_symbol_cstr()
* load.c: use rb_check_id() or rb_check_id_cstr().
* object.c: ditto.
* struct.c: ditto.
* thread.c: ditto.
* vm_method.c: ditto.
* string.c (sym_find): use only rb_check_symbol().
* sprintf.c (rb_str_format): use rb_check_symbol_cstr().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* include/ruby/intern.h: constify `argv` parameters.
* include/ruby/ruby.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (basic_obj_respond_to): `priv` is not a VALUE but a
mere flag, so cannot call RTEST() on it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_make): separate selection of IDs to
be private from condition of method to be defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* variable.c (rb_alias_variable): ensure pinned down.
* vm_method.c (rb_method_entry_make): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See this ticket about Symbol GC.
* include/ruby/ruby.h:
Declare few functions.
* rb_sym2id: almost same as old SYM2ID but support dynamic symbols.
* rb_id2sym: almost same as old ID2SYM but support dynamic symbols.
* rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not
pin down a dynamic symbol.
Declare a new struct.
* struct RSymbol: represents a dynamic symbol as object in
Ruby's heaps.
Add few macros.
* STATIC_SYM_P: check a static symbol.
* DYNAMIC_SYM_P: check a dynamic symbol.
* RSYMBOL: cast to RSymbol
* gc.c: declare RSymbol. support T_SYMBOL.
* internal.h: Declare few functions.
* rb_gc_free_dsymbol: free up a dynamic symbol. GC call this
function at a sweep phase.
* rb_str_dynamic_intern: convert a string to a dynamic symbol.
* rb_check_id_without_pindown: not pinning function.
* rb_sym2id_without_pindown: ditto.
* rb_check_id_cstr_without_pindown: ditto.
* string.c (Init_String): String#intern and String#to_sym use
rb_str_dynamic_intern.
* template/id.h.tmpl: use LSB of ID as a flag for determining a
static symbol, so we shift left other ruby_id_types.
* string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to
avoid pinning.
* load.c: use xx_without_pindown function at creating temporary ID
to avoid pinning.
* object.c: ditto.
* sprintf.c: ditto.
* struct.c: ditto.
* thread.c: ditto.
* variable.c: ditto.
* vm_method.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_get_without_cache): fix commit miss.
remove extra !. [Bug #9663]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_get_without_cache): me->klass is 0
for a method aliased in a module. [ruby-core:61636] [Bug #9663]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_get_without_cache): get rid of
infinite recursion at aliases in a subclass and a superclass.
return actually defined class for other than singleton class.
[ruby-core:60431] [Bug #9475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (rb_add_method, rb_attr): cast between pointer and
ID via VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_method_entry_get_without_cache): disable GMC
writing if GMC is disabled
[ruby-core:61218]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a refining method in case the method is private.
[ruby-core:60111] [Bug #9452]
* vm_method.c (make_method_entry_refined): set me->flag of a refined
method entry to NOEX_PUBLIC in case the original method is private
and it is refined as a public method. The original flag is stored
in me->def->body.orig_me, so it's OK to make a refined method
entry public. [ruby-core:60111] [Bug #9452]
* test/ruby/test_refinement.rb: related tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (GLOBAL_METHOD_CACHE_MASK): set from
GLOBAL_METHOD_CACHE_SIZE automatically.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
GLOBAL_METHOD_CACHE_SIZE and GLOBAL_METHOD_CACHE_MASK.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
RB_OBJ_WRITE and RB_OBJ_WRITTEN.
* array.c, class.c, compile.c, hash.c, internal.h, iseq.c,
proc.c, process.c, re.c, string.c, variable.c, vm.c,
vm_eval.c, vm_insnhelper.c, vm_insnhelper.h,
vm_method.c: catch up this change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
Note that rb_method_entry_t::klass is not constified.
We may constify this field.
* test/ruby/test_alias.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* proc.c (method_owner): return the class where alias is defined, not
the class original method is defined.
* vm_method.c (rb_method_entry_make, rb_alias): store the originally
defined class in me. [Bug #7993] [Bug #7842] [Bug #9236]
* vm_method.c (rb_method_entry_get_without_cache): cache included
module but not iclass.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_add_method, rb_alias): rb_method_entry_set()
already clears method cache.
* vm_method.c (rb_export_method): ditto by rb_add_method().
* vm_method.c (set_method_visibility): ditto by rb_export_method().
* vm.c (vm_define_method): ditto by rb_add_method().
* vm.c (m_core_undef_method): ditto by rb_add_method() in rb_undef().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_clear_method_cache_by_class): fire
ruby::method-cache-clear probe on global or klass-level method cache
clear [Bug #9190]
* probes.d (provider ruby): new dtrace probe
* doc/dtrace_probes.rdoc: docs for new probe
* test/dtrace/test_method_cache.rb: test for new probe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
accessor for RCLASS_EXT(klass)->class_serial.
* class.c, vm_insnhelper.c, vm_method.c: Use RCLASS_SERIAL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
vm_insnhelper.c, vm_insnhelper.h, vm_method.c: Rename method_serial
to global_method_state and constant_serial to global_constant_state
after discussion with ko1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes renaming 'vm_state_version_t' to 'rb_serial_t',
'method_state' to 'method_serial', 'seq' to 'class_serial',
'vmstat' to 'constant_serial', etc.
* insns.def: ditto
* internal.h: ditto
* vm.c: ditto
* vm_core.h: ditto
* vm_insnhelper.c: ditto
* vm_insnhelper.h: ditto
* vm_method.c: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
OBJ_WRITTEN() accepts only VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ruby_vm_global_state_version into two separate counters - one for the
global method state and one for the global constant state. This means
changes to constants do not affect method caches, and changes to
methods do not affect constant caches. In particular, this means
inclusions of modules containing constants no longer globally
invalidate the method cache.
* class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c:
rename rb_clear_cache_by_class to rb_clear_method_cache_by_class
* class.c, include/ruby/intern.h, variable.c, vm_method.c: add
rb_clear_constant_cache
* compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in
rb_call_info_struct to method_state
* vm_method.c: rename vmstat field in struct cache_entry to method_state
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
original method of a refined method is undef to avoid SEGV.
* vm_method.c (rb_method_entry_without_refinements): return 0 when
the original method of a refined method is undef to avoid SEGV.
* test/ruby/test_refinement.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
revert last commit to introduce debug prints.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
Thanks charliesome.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* object.c (id_for_attr): avoid inadvertent symbol creation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm_method.c (rb_attr): preserve encoding of the attribute ID in
error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
Type of return value of rb_iseq_first_lineno() is now VALUE.
* vm_insnhelper.c (argument_error): ditto.
* vm_method.c (rb_method_entry_make): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* VALUE rb_iseq_path(VALUE iseqval);
* VALUE rb_iseq_absolute_path(VALUE iseqval);
* VALUE rb_iseq_label(VALUE iseqval);
* VALUE rb_iseq_base_label(VALUE iseqval);
* VALUE rb_iseq_first_lineno(VALUE iseqval);
And new (temporary) function:
* VALUE rb_iseq_klass(VALUE iseqval);
* iseq.c. vm_core.h (int rb_iseq_first_lineno): remove
function `int rb_iseq_first_lineno(const rb_iseq_t *iseq)'.
Use `VALUE rb_iseq_first_lineno(VALUE iseqval)' instead.
* proc.c. vm_insnhelper.c, vm_method.c: catch up this change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
of a refined method is not defined.
* vm_insnhelper.c (rb_method_entry_eq): added NULL check to avoid SEGV.
* test/ruby/test_refinement.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (rb_free_mc_table): ditto
* internal.h (method_cache_entry_t): unused struct
* vm_method.c (verify_method_cache): remove unused variable
* vm_method.c (rb_method_entry): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (obj_free): ditto
* internal.h (struct rb_classext_struct): ditto
* method.h (rb_method_entry): remove ent param
* vm_method.c: restore the global method cache. Per class cache tables
turned out to be far too slow.
[ruby-core:57289] [Bug #8930]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* vm_method.c (rb_resolve_refined_method): constify.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* vm_method.c (rb_add_refined_method_entry): clear cache in the
refined class since refining a method entry is modifying the class.
[ruby-core:57079] [Bug #8880]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* vm.c (rb_next_class_sequence): use ANSI style definition and
prorotype declaration, instead of old-K&R style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
variable.c, vm.c, vm_core.c, vm_insnhelper.c, vm_insnhelper.h,
vm_method.c: Implement class hierarchy method cache invalidation.
[ruby-core:55053] [Feature #8426] [GH-387]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|