aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
Commit message (Collapse)AuthorAgeFilesLines
* variable.c (autoload_sleep_done): avoid needless list_node initnormal2017-05-221-1/+1
| | | | | | | | | | We do not need list_del_init in ensure callbacks, only list_del, since it can only ever be called after list_del_init in autoload_reset. So avoid the needless re-initialization. * variable.c (autoload_sleep_done): s/list_del_init/list_del/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* autoload: always wait on loading threadnormal2017-05-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot assume autoload_provided/rb_feature_provided returning TRUE means it is safe to proceed without waiting. Another thread may call rb_provide_feature before setting the constant (via autoload_const_set). So we must wait until autoload is completed by another thread. Note: this patch was tested with an explicit rb_thread_schedule in rb_provide_feature to make the race condition more apparent as suggested by <s.wanabe@gmail.com>: > --- a/load.c > +++ b/load.c > @@ -563,6 +563,7 @@ rb_provide_feature(VALUE feature) > rb_str_freeze(feature); > > rb_ary_push(features, rb_fstring(feature)); > +rb_thread_schedule(); > features_index_add(feature, INT2FIX(RARRAY_LEN(features)-1)); > reset_loaded_features_snapshot(); > } * variable.c (check_autoload_required): do not assume a provided feature means autoload is complete, always wait if autoload is being performed by another thread. [ruby-core:81105] [Bug #11384] Thanks to <s.wanabe@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: cleanup waitq upon thread deathnormal2017-05-071-8/+32
| | | | | | | | | | | | | * variable.c (autoload_reset): use idempotent list_del_init (autoload_sleep): moved code from rb_autoload_load (autoload_sleep_done): cleanup for use with rb_ensure (rb_autoload_load): ensure list delete happens in case the thread dies during sleep * test/ruby/bug-13526.rb: new script for separate execution * test/ruby/test_autoload.rb (test_bug_13526): new test [ruby-core:81016] [Bug #13526] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add several counters to analyze ivar inline caches.ko12017-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | * debug_counter.h: add (and renamed) several counters: ivar_get_ic_hit ivar_get_ic_miss ivar_get_ic_miss_serial ivar_get_ic_miss_unset ivar_get_ic_miss_noobject ivar_set_ic_hit ivar_set_ic_miss ivar_set_ic_miss_serial ivar_set_ic_miss_unset ivar_set_ic_miss_oorange ivar_set_ic_miss_noobject ivar_get_base ivar_set_base See related source code to know what counters mean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add performance counting mechanism for MRI debug/tuning purpose.ko12017-02-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * How to enable this feature? * define USE_DEBUG_COUNTER as 1. * you can disable to output the result with RUBY_DEBUG_COUNTER_DISABLE environment variable even if USE_DEBUG_COUNTER == 1. * How to add new counter? * add COUNTER(<name>) line on debug_counter.h. * include "debug_counter.h" * insert RB_DEBUG_COUNTER_INC(<name>) line on your favorite place. * counter output example: [RUBY_DEBUG_COUNTER] mc_inline_hit 999 [RUBY_DEBUG_COUNTER] mc_inline_miss 3 [RUBY_DEBUG_COUNTER] mc_global_hit 23 [RUBY_DEBUG_COUNTER] mc_global_miss 273 [RUBY_DEBUG_COUNTER] mc_global_state_miss 3 [RUBY_DEBUG_COUNTER] mc_class_serial_miss 0 [RUBY_DEBUG_COUNTER] mc_cme_complement 0 [RUBY_DEBUG_COUNTER] mc_cme_complement_hit 0 [RUBY_DEBUG_COUNTER] mc_search_super 1384 [RUBY_DEBUG_COUNTER] ivar_get_hit 0 [RUBY_DEBUG_COUNTER] ivar_get_miss 0 [RUBY_DEBUG_COUNTER] ivar_set_hit 0 [RUBY_DEBUG_COUNTER] ivar_set_miss 0 [RUBY_DEBUG_COUNTER] ivar_get 431 [RUBY_DEBUG_COUNTER] ivar_set 465 * mc_... is related to method caching. * ivar_... is related to instance variable accesses. * compare with dtrace/system tap features, there are completely no performacne penalties when it is disabled. * This feature is supported only on __GNUC__ compilers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove deprecated internal featurenobu2017-02-211-60/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: noreturn in GCCnobu2017-02-211-0/+3
| | | | | | | * variable.c (rb_generic_ivar_table): declare as noreturn only in GCC, which does not err on different attributes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove harmful declaration.ko12017-02-201-1/+0
| | | | | | | * variable.c (gen_ivtbl_get): declaration conflict on VC++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Supress warning: function might be candidate for attribute 'noreturn'naruse2017-02-201-1/+1
| | | | | | GCC7 shows it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* DEPRECATED_INTERNAL_FEATUREnobu2017-02-171-2/+1
| | | | | | | | | * error.c (ruby_deprecated_internal_feature): renamed, to explicitly represent deprecation. * internal.h (DEPRECATED_INTERNAL_FEATURE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fatal rb_generic_ivar_tablenobu2017-02-161-0/+8
| | | | | | * variable.c (rb_generic_ivar_table): raise fatal error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fix the condition to cachenobu2017-01-111-4/+19
| | | | | | | | * variable.c (rb_const_set): fix the condition to cache the class path and cache permanent or temporary path corresponding to the outer klass. [ruby-core:79039] [Bug #13120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: resolve permanent name onlynobu2017-01-081-2/+8
| | | | | | | | * variable.c (rb_const_set): resolve and cache class name immediately only if the outer class/module has the name, otherwise just set the ID. [ruby-core:79007] [Bug #13113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: top-level constant look-upnobu2017-01-011-0/+4
| | | | | | | * variable.c (rb_const_search): [EXPERIMENTAL] remove top-level constant look-up. [Feature #11547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Stop reading past the end of `ivptr` arraytenderlove2016-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you have code like this: ```ruby class A def initialize @a = nil @b = nil @c = nil @d = nil @e = nil end end x = A.new y = x.clone 100.times { |z| x.instance_variable_set(:"@foo#{z}", nil) } puts y.inspect ``` `x` and `y` will share `iv_index_tbl` hashes. However, the size of the hash will grow larger than the number if entries in `ivptr` in `y`. Before this commit, `rb_ivar_count` would use the size of the hash to determine how far to read in to the array, but this means that it could read past the end of the array and cause the program to segv [ruby-core:78403] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_deprecate_constantnobu2016-09-091-0/+16
| | | | | | | * variable.c (rb_deprecate_constant): new function to deprecate a constant by the name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fix deprecated constant messagenobu2016-09-091-1/+1
| | | | | | | * variable.c (rb_const_search): warn with the actual class/module name which defines the deprecated constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fix private constant messagenobu2016-09-091-1/+1
| | | | | | | * variable.c (rb_const_search): raise with the actual class/module name which defines the private constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: exclude private constantsnobu2016-07-191-1/+1
| | | | | | | * variable.c (rb_local_constants_i): exclude private constants when excluding inherited constants too. [Bug #12345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: consider lengthnobu2016-06-191-6/+7
| | | | | | | * variable.c (rb_path_to_class): consider the string length instead of a terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_const_searchnobu2016-06-191-3/+13
| | | | | | | * variable.c (rb_path_to_class): search the constant at once instead of checking if defined and then getting it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: check lengthnobu2016-05-301-1/+1
| | | | | | | * variable.c (check_autoload_required): check length first before checking the first byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: hidden constantsnobu2016-05-271-1/+3
| | | | | | | * variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: deprecated constant in classnobu2016-05-151-9/+15
| | | | | | | * vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even in the class context. [ruby-core:75505] [Bug #12382] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fix implicit conversionnobu2016-04-221-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c: use uint32_t instead of long to avoid confusion aboutnaruse2016-04-221-29/+28
| | | | | | the type of ivtbl->numiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c: Added documentation about order of `Module#constants`hsbt2016-03-231-0/+3
| | | | | | [ci skip][Bug #12121][ruby-dev:49505][fix GH-1301] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: matched backrefs onlynobu2016-01-141-5/+15
| | | | | | | * variable.c (rb_f_global_variables): add matched back references only, as well as defiend? operator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: $1..$9 in global_variablesnobu2016-01-141-6/+8
| | | | | | | * variable.c (rb_f_global_variables): add $1..$9 only if $~ is set. fix the condition removed at r14014. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* resolve class name earlier and more consistentlynormal2016-01-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | This further avoids class name resolution issues which came about due to relying on hash table ordering before r53376. Pre-caching the class name when it is never used raises memory use, but the overall gain from moving away from st still gives us a small gain. Reverting r53376 and this patch and testing with "valgrind -v ./ruby -rrdoc -eexit" on x86 (32-bit) shows: before: in use at exit: 1,662,239 bytes in 25,286 blocks total heap usage: 49,514 allocs, 24,228 frees, 6,005,561 bytes allocated after, with this change: in use at exit: 1,646,529 bytes in 24,572 blocks total heap usage: 48,891 allocs, 24,319 frees, 6,003,921 bytes allocated * class.c (Init_class_hierarchy): resolve name for rb_cObject ASAP * object.c (rb_mod_const_set): move name resolution to rb_const_set * variable.c (rb_const_set): do class resolution here [ruby-core:72807] [Bug #11977] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_mod_deprecate_constant): [DOC] addedsho-h2016-01-041-0/+7
| | | | | | | documentation for Module#deprecate_constant. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use id_table for constant tablesnormal2015-12-291-82/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | valgrind 3.9.0 on x86-64 reports a minor reduction in memory usage when loading only RubyGems and RDoc by running: ruby -rrdoc -eexit before: HEAP SUMMARY: in use at exit: 2,913,448 bytes in 27,394 blocks total heap usage: 48,362 allocs, 20,968 frees, 9,034,621 bytes alloc after: HEAP SUMMARY: in use at exit: 2,880,056 bytes in 26,712 blocks total heap usage: 47,791 allocs, 21,079 frees, 9,046,507 bytes alloc * class.c (struct clone_const_arg): adjust for id_table (clone_const): ditto (clone_const_i): ditto (rb_mod_init_copy): ditto (rb_singleton_class_clone_and_attach): ditto (rb_include_class_new): ditto (include_modules_at): ditto * constant.h (rb_free_const_table): ditto * gc.c (free_const_entry_i): ditto (rb_free_const_table): ditto (obj_memsize_of): ditto (mark_const_entry_i): ditto (mark_const_tbl): ditto * internal.h (struct rb_classext_struct): ditto * object.c (rb_mod_const_set): resolve class name on assignment * variable.c (const_update): replace with const_tbl_update (const_tbl_update): new function (fc_i): adjust for id_table (find_class_path): ditto (autoload_const_set): st_update => const_tbl_update (rb_const_remove): adjust for id_table (sv_i): ditto (rb_local_constants_i): ditto (rb_local_constants): ditto (rb_mod_const_at): ditto (rb_mod_const_set): ditto (rb_const_lookup): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (struct ivar_update): rename "extended" to "iv_extended"ngoto2015-12-211-6/+6
| | | | | | | | to avoid name conflict with /usr/include/floatingpoint.h on Solaris. [Bug #11853] [ruby-dev:49448] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make local symbols staticnobu2015-12-081-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce rb_autoload_str to replace rb_autoloadnormal2015-12-061-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_autoload_str may be safer by preventing premature GC. It can also be more efficient by passing a pre-frozen string that can be deduped using rb_fstring. Common autoload callers (e.g. rubygems, rdoc) already use string literals as the file argument. There seems to be no reason to expose rb_autoload_str to the public C API since autoload is not performance-critical. Applications may declare autoloads in Ruby code or via rb_funcall; so merely deprecate rb_autoload without exposing rb_autoload_str to new users. Running: valgrind -v ruby -rrdoc -rubygems -e exit shows a minor memory reduction (32-bit userspace) before: in use at exit: 1,600,621 bytes in 28,819 blocks total heap usage: 55,786 allocs, 26,967 frees, 6,693,790 bytes allocated after: in use at exit: 1,599,778 bytes in 28,789 blocks total heap usage: 55,739 allocs, 26,950 frees, 6,692,973 bytes allocated * include/ruby/intern.h (rb_autoload): deprecate * internal.h (rb_autoload_str): declare * load.c (rb_mod_autoload): use rb_autoload_str * variable.c (rb_autoload): become compatibility wrapper (rb_autoload_str): hoisted out from old rb_autoload [ruby-core:71369] [Feature #11664] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove spurious #define for globalsnormal2015-11-291-74/+53
| | | | | | | | | | Removing the indirection helps me with readability, at least. It doesn't seem like there are many other places in the Ruby code where macros are used like this. [ruby-core:71735] [Feature #11749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_autoload_load): allow recursive callsnormal2015-11-091-0/+3
| | | | | | | | | | * variable.c (rb_autoload_load): allow recursive calls [ruby-core:71345] [Bug #11658] * test/ruby/test_autoload.rb (test_autoload_while_autoloading): new test by: Hiroshi Shirosaki <h.shirosaki@gmail.com> [ruby-core:71390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: suppress a warningnobu2015-11-041-1/+1
| | | | | | | * variable.c (autoload_reset): initialize formally to suppress a warning from container_off_var() by Visual C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove casts for rb_class_ivar_set callersnormal2015-11-021-3/+3
| | | | | | | | | | | | | | Casting any arguments of rb_class_ivar_set to st_data_t is wrong as the function does not take any st_data_t parameters anymore. There's no functional change, as ID, VALUE, and st_data_t are all the same type, but this reduces confusion and improves maintainability for future type changes. * variable.c (find_class_path): remove cast for rb_class_ivar_set (rb_ivar_set): ditto (rb_cvar_set): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_global_tbl): convert to id_tablenormal2015-11-021-19/+19
| | | | | | | | | Mainly this is to reduce casting a tiny amount; and probably nothing depends on the order of globals. Likely no measurable memory usage improvement as globals are not common, but maybe some weird code out there benefits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_source_loc and rb_source_locationnobu2015-10-311-2/+1
| | | | | | | | | * error.c, eval.c, eval_error.c, gc.c, variable.c, vm.c, vm_eval.c, vm_trace.c: use rb_source_loc/rb_source_location instead of combination of rb_sourcefile/rb_sourcefilename and rb_sourceline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_class_ivar_setnobu2015-10-301-4/+4
| | | | | | | * variable.c (rb_class_ivar_set): rename as class specific ivar setter, and st_table is no longer involved. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (generic_ivar_remove): return original valuenormal2015-10-301-4/+4
| | | | | | | | | | | | | This fixes a bug introduced in r50678 ("variable.c: use indices for generic ivars") and does not affect any released version of Ruby * variable.c (generic_ivar_remove): adjust type, set valp (rb_obj_remove_instance_variable): simplify call * test/ruby/test_object.rb (test_remove_instance_variable): expand for implementation details git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_st_insert_id_and_value): reduce argsnormal2015-10-301-6/+5
| | | | | | | | | | | | | | Minor simplification; this will hopefully make future patches for switching to id_table easier-to-review. * internal.h (rb_st_insert_id_and_value): update prototype * variable.c (rb_st_insert_id_and_value): reduce args (find_class_path): adjust call for less args (rb_ivar_set): ditto (rb_cvar_set): ditto * class.c (rb_singleton_class_attached): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: reduce heap usage for autoload_data_inormal2015-10-291-30/+31
| | | | | | | | | | | | | | | | | | | | For the loader (first thread which hits autoload, it is wasteful to have extra elements on the stack. For the lifetime of the process, it is wasteful to waste 2 words for every autoload entry. So this makes full use of existing stack overhead while reducing heap overhead for long-lived autoload_data_i structs. * variable.c (struct autoload_state): usable as wait-queue head (struct autoload_data_i): remove 2 words of overhead (autoload_i_mark): remove marking for thread (autoload_reset): adjust for struct changes (rb_autoload): ditto (rb_autoloading_value): ditto (rb_autoload_load): ditto (const_update): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: additional locking around autoloadnormal2015-10-281-20/+83
| | | | | | | | | | | | [ruby-core:70075] [ruby-core:71239] [Bug #11384] Note: this open-coding locking method may go into rb_mutex/rb_thread_shield types. It is smaller and simpler and based on the wait queue implementation of the Linux kernel. When/if we get rid of GVL, native mutexes may be used as-is. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: receiver in NameErrornobu2015-10-281-1/+1
| | | | | | | | * error.c (rb_name_err_new): store the receiver directly. * error.c (name_err_receiver): return directly stored receiver. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NameError#receiver of uninitialized constantnobu2015-10-281-73/+65
| | | | | | | | | * error.c (name_err_mesg_to_str): quote the name if unprintable. * object.c (check_setter_id): use rb_check_id to convert names. * variable.c (uninitialized_constant): use NameError::message to keep the receiver of uninitialized constant. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fail if frozennobu2015-09-161-0/+1
| | | | | | | * variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: wrap long linesnormal2015-08-041-11/+22
| | | | | | Make code easier to read and hunt for bugs with my tiny terminal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e