summaryrefslogtreecommitdiff
path: root/ext/objspace
AgeCommit message (Collapse)Author
2018-05-09Rename imemo_alloc with imemo_tmpbufmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16no ID cache in Init functionsnobu
Init functions are called only once, cache is useless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16node.c: Stop double meaning of NODE_FOR by introducing NODE_FOR_MASGNmame
NODE_FOR was used both for "for"-statement itself and for multi-assignment of for-statement (for x, y, in...end). This change separates the two purposes, NODE_FOR for the former, and newly introduced NODE_FOR_MASGN for the latter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09Include ruby/{io,encoding}.h before internal.hkazu
because of r61712 and r61713 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.h: remove NODE_PRELUDEmame
NODE_PRELUDE contains a `BEGIN` node, a main node, and compile_option. This node is assumed that it must be located immediately under the root NODE_SCOPE, but this strange assumption is not so good, IMO. This change removes the assumtion; it integrates the former two nodes by block_append, and moves compile_option into rb_ast_body_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04node.h: add NODE_ONCE instead of reuse of NODE_SCOPEmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21Fix `imemo_name` to dump new imemo typestenderlove
New IMEMO types were introduced, this just fixes the function that converts the type to support the new types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04Remove RNODE cast from NODE utility functionsmame
Now, casting NODE to VALUE is not recommended. This change requires an explicit cast from VALUE to NODE to use the NODE utility functions such as `nd_type`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04Rename imemo_strterm to imemo_parser_strtermmame
Per ko1's request. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04ext/objspace/objspace.c: add imemo_strtermmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31Use NODE_CASE2 if case expressions don't existyui-knk
When NODE_WHEN is compiled by iseq_compile_each0, the node passed to compile_when is NODE_WHEN (not NODE_CASE). So we can not handle the location of NODE_CASE of case statements which don't have case expressions. e.g. : ``` case; when 1; foo; when 2; bar; else baz; end ``` This commit adds NODE_CASE2, and compiles it by iseq_compile_each0. * compile.c (compile_case): Does not call COMPILE_ when NODE_CASE does not have case expressions. * compile.c (compile_case2): Compile NODE_CASE2 by compile_case2. * compile.c (compile_when): Delete an obsoleted function. * compile.c (iseq_compile_each0): Compile NODE_CASE2. * ext/objspace/objspace.c (count_nodes): Add NODE_CASE2 case. * node.c (dump_node, rb_gc_mark_node): Add NODE_CASE2 case. * node.h (node_type): Add NODE_CASE2. * node.h (NEW_CASE2): Add a macro which generates NODE_CASE2. * parse.y: Generate NODE_CASE2 if case expressions don't exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24Removed NODE_OPT_Nnobu
* node.h (NODE_OPT_N): removed. * parse.y (parser_append_options): expand -n option loop to while gets loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22objspace.c: missing typesnobu
* ext/objspace/objspace.c (count_nodes): added recently added node types that were missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22remove NODE_DREGX_ONCEnobu
* node.h (enum node_type): remove NODE_DREGX_ONCE which is not used anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Remove not used node_type NODE_BMETHODyui-knk
* ext/objspace/objspace.c (count_nodes): This node_type has not been used since r24128. * node.c (dump_node): ditto * node.h (node_type, NEW_BMETHOD): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Remove not used node_type NODE_BLOCK_ARGyui-knk
* ext/objspace/objspace.c (count_nodes): This node_type has not been used since r11840. * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_BLOCK_ARG): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Remove not used node_type NODE_TO_ARYyui-knk
* ext/objspace/objspace.c (count_nodes): This node_type has not been used since r13236. * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_TO_ARY): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Remove not used node_type NODE_CVDECLyui-knk
* compile.c (defined_expr0): This node_type has not been used since r11614. * ext/objspace/objspace.c (count_nodes): ditto * node.c (dump_node): ditto * node.h (node_type, NEW_CVDECL): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Remove not used node_type NODE_IASGN2yui-knk
* compile.c (compile_massign_opt, iseq_compile_each0): This node_type has not been used since r11813. * ext/objspace/objspace.c (count_nodes): ditto * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_IASGN2): ditto * parse.y (node_assign_gen): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21imemo_mask (enum) -> IMEMO_MASK (immediate value).ko1
* internal.h: imemo_mask is not a valid imemo type but switch statements show warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Replace NODE_ALLOCA with T_IMEMO (imemo_alloc)mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-27objspace_dump.c: remove unnecessary breaknobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-17ext/objspace/objspace.c: remove unneeded code clones.mame
`setup_hash` have already performed nil check and empty check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-14Fix a class of a returned valueyui-knk
* ext/objspace/object_tracing.c (allocation_sourceline): Fix a class of a returned value. allocation_sourceline returns an integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22ruby tool/update-deps --fixshyouhei
Onigumo 6 (r57045) introduced new onigumo.h header file, which is required from quite much everywhere. This commit adds necessary dependencies. Note: ruby/oniguruma.h now includes onigumo.h, ruby/io.h includes oniguruma.h, ruby/encoding.h also includes oniguruma.h, and internal.h includes encoding.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12ext/objspace: Specify frozen_string_literal: true.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31Add IMEMO type to heap dump output.tenderlove
IMEMO objects have many types. Without this change, we cannot see what types of IMEMO objects are being used when dumping the heap. Adding the type to the IMEMO object will allow us to gather statistics about IMEMO objects being used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-03Add `full` option to `ObjectSpace.dump_all`tenderlove
The `full` option includes all slots (even `T_NONE`) in the JSON output. This is to help with debugging heap fragmentation. Here is an example usage: ```ruby File.open('heap.json', 'w') do |f| ObjectSpace.dump_all(output: f, full: true) end ``` The `heap.json` file contains all slots, including empty slots. [Feature #13001] [ruby-core:78468] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-18objspace.c:: indent [ci skip]yui-knk
* ext/objspace/objspace.c (memsize_of_m): adjust indent of comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-28internal.h: RB_OBJ_BUILTIN_TYPEnobu
* internal.h (RB_OBJ_BUILTIN_TYPE): special-const safe BUILTIN_TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-26[DOC] replace Fixnum with Integer [ci skip]nobu
* numeric.c: [DOC] update document for Integer class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-17objspace_dump.c: dc is no longer used [ci skip]nobu
* ext/objspace/objspace_dump.c (heap_i): remove no longer used variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-16Use JSON lines format for full heap dumps.tenderlove
This commit changes full heap dumps back to using JSON lines format (http://jsonlines.org) so that we can process very large heaps without loading the entire heap in to memory at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-13Use PRIuSIZE format specifier for size_t valuesrhe
Use PRIuSIZE instead of PRIdSIZE. This fixes the exception message shown on too large xmalloc2. This commit also fixes other incorrect use of PRIdSIZE in other functions; though most of them are debug print. * gc.c (heap_extend_pages, get_envparam_size, ruby_malloc_size_overflow, gc_profile_dump_on): Use PRIuSIZE instead of PRIdSIZE as the passed value is size_t, not ssize_t. * iseq.c (get_line_info, rb_iseq_disasm_insn): Ditto. * sprintf.c (rb_str_format): Ditto. * thread_win32.c (native_thread_create): Ditto. * vm.c (get_param): Ditto. * ext/objspace/objspace_dump.c (dump_append_string_content, dump_object): Ditto. * ext/socket/raddrinfo.c (host_str, port_str): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-11ObjectSpace.dump_all: valid JSONnobu
* ext/objspace/objspace_dump.c: generate valid JSON for dump_all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08objspace_dump.c: fix formatnobu
* ext/objspace/objspace_dump.c (dump_append_string_content), (dump_object): fix the format specifiers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08* configure.in: add -Wsuggest-attribute=format and suppress warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-22* variable.c: use uint32_t instead of long to avoid confusion aboutnaruse
the type of ivtbl->numiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-11Update dependencies.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-22vm_core.h: use RUBY_ASSERTnobu
* vm_core.h (VM_ASSERT): use RUBY_ASSERT instead of rb_bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16handle ext/ as r53141naruse
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-19objspace_dump.c: special constnobu
* ext/objspace/objspace_dump.c: support special constant objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-17* ext/objspace/objspace_dump.c (obj_type): add IMEMO types to the heaptenderlove
dump information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21* ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.ko1
[Feature #11158] * symbol.c (rb_sym_immortal_count): added to count immortal symbols. * symbol.h: ditto. * test/objspace/test_objspace.rb: add a test for this method. * NEWS: describe about this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-10objspace.c: use rb_ident_hash_newnobu
* ext/objspace/objspace.c (reachable_objects_from_root): use rb_ident_hash_new instead of funcall Hash#compare_by_id. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21* make rb_iseq_t T_IMEMO object (type is imemo_iseq).ko1
All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data. * compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE). * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq). * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq. * gc.c: check T_IMEMO/iseq. * internal.h: add imemo_type::imemo_iseq. * iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_.... * load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq). * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq). * vm_core.h (GetISeqPtr): removed because it is not T_DATA now. * vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21* ext/objspace/objspace.c (total_i): no need to skip singleton classes.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-21ext/objspace/objspace_dump.c: adjust indentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-20* ext/objspace/objspace_dump.c(dump_object): Return empty JSON object whensorah
passed object is a special const, instead of SEGV. Based patch by Kohei Suzuki (eagletmt). [ruby-core:69692] [Bug #11291] * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18* ext/objspace/objspace.c (count_imemo_objects): support imemo_ment.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e