summaryrefslogtreecommitdiff
path: root/ext/objspace
AgeCommit message (Collapse)Author
2019-12-31Updated dependencies on internal/warnings.hNobuyoshi Nakada
Needed for `UNALIGNED_MEMBER_ACCESS` using `COMPILER_WARNING_`* macros. Notes: Merged: https://github.com/ruby/ruby/pull/2799
2019-12-26update dependencies卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-26decouple internal.h headers卜部昌平
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
2019-11-18Update dependenciesNobuyoshi Nakada
2019-11-12Revert "Method reference operator"Nobuyoshi Nakada
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b. [Feature #16275]
2019-09-07Rename NODE_ARRAY to NODE_LIST to reflect its actual use casesYusuke Endoh
and NODE_ZARRAY to NODE_ZLIST. NODE_ARRAY is used not only by an Array literal, but also the contents of Hash literals, method call arguments, dynamic string literals, etc. In addition, the structure of NODE_ARRAY is a linked list, not an array. This is very confusing, so I believe `NODE_LIST` is a better name.
2019-08-27st_foreach now free from ANYARGS卜部昌平
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from st_foreach. I strongly believe that this commit should have had come with b0af0592fdd9e9d4e4b863fde006d67ccefeac21, which added extra parameter to st_foreach callbacks.
2019-07-31* expand tabs.git
2019-07-31Use 1 byte hint for ar_table [Feature #15602]Koichi Sasada
On ar_table, Do not keep a full-length hash value (FLHV, 8 bytes) but keep a 1 byte hint from a FLHV (lowest byte of FLHV). An ar_table only contains at least 8 entries, so hints consumes 8 bytes at most. We can store hints in RHash::ar_hint. On 32bit CPU, we use 4 entries ar_table. The advantages: * We don't need to keep FLHV so ar_table only consumes 16 bytes (VALUEs of key and value) * 8 entries = 128 bytes. * We don't need to scan ar_table, but only need to check hints in many cases. Especially we don't need to access ar_table if there is no match entries (in many cases). It will increase memory cache locality. The disadvantages: * This technique can increase `#eql?` time because hints can conflicts (in theory, it conflicts once in 256 times). It can introduce incompatibility if there is a object x where x.eql? returns true even if hash values are different. I believe we don't need to care such irregular case. * We need to re-calculate FLHV if we need to switch from ar_table to st_table (e.g. exceeds 8 entries). It also can introduce incompatibility, on mutating key objects. I believe we don't need to care such irregular case too. Add new debug counters to measure the performance: * artable_hint_hit - hint is matched and eql?#=>true * artable_hint_miss - hint is not matched but eql?#=>false * artable_hint_notfound - lookup counts
2019-07-14Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada
2019-07-14Split RUBY_ASSERT and so on under include/rubyNobuyoshi Nakada
2019-07-08Let struct dump_config in objspace fit in a single cache lineLourens Naudé
Let dump_config boolean members roots and full_heap be bit flags instead Closes: https://github.com/ruby/ruby/pull/2274
2019-04-23* expand tabs.git
2019-04-22T_MOVED can live on the stack, so make sure we can do book keepingAaron Patterson
Unused T_MOVED objects can live on the stack, so we need to make sure that they can be accounted for in book keeping
2019-04-17* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Introduce pattern matching [EXPERIMENTAL]ktsj
[ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-13* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-13fix imemo entry description.ko1
* ext/objspace/objspace.c (count_imemo_objects): `imemo_type_ids` should be match with `enum imemo_type` in internal.h and this patch fix mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-08Removed moving toplevel header since r12501nobu
Moving public headers was 12-years ago, no depend files would expect ruby.h in the top source directory now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31Method reference operatornobu
Introduce the new operator for method reference, `.:`. [Feature #12125] [Feature #13581] [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30support theap for T_HASH. [Feature #14989]ko1
* hash.c, internal.h: support theap for small Hash. Introduce RHASH_ARRAY (li_table) besides st_table and small Hash (<=8 entries) are managed by an array data structure. This array data can be managed by theap. If st_table is needed, then converting array data to st_table data. For st_table using code, we prepare "stlike" APIs which accepts hash value and are very similar to st_ APIs. This work is based on the GSoC achievement by tacinight <tacingiht@gmail.com> and refined by ko1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09ext/objspace/objspace_dump.c: print addresses consistentlynobu
The format addresses are printed in are different if you use `ObjectSpace.dump_all(output: :stdout)` vs. `ObjectSpace.dump_all(output: :string)` (or `ObjectSpace.dump`) due to differences in the underlying `vfprintf` implementation. Use `"%#"PRIxVALUE` to format `VALUE`. Co-authored-by: Ashe Connor <ashe@kivikakk.ee> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09Revert "ext/objspace/objspace_dump.c: print addresses consistently"naruse
This reverts commit r64970. Visual C++ 12.0 doesn't have PRIxPTR. Anyway we have our own vfprintf implementation BSD_vfprintf(). If you want to have portable vfprintf, replace it with BSD_vfprintf like vsnprintf or just use BSD_vfprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08ext/objspace/objspace_dump.c: print addresses consistentlytenderlove
The format addresses are printed in are different if you use `ObjectSpace.dump_all(output: :stdout)` vs. `ObjectSpace.dump_all(output: :string)` (or `ObjectSpace.dump`) due to differences in the underlying `vfprintf` implementation. Use %"PRIxPTR" instead to be consistent across both. Co-authored-by: Ashe Connor <ashe@kivikakk.ee> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07ext/objspace/object_tracing.c (freeobj_i): fix missing assignmentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07object_tracing.c: register TracePoint objectsnobu
* ext/objspace/object_tracing.c (trace_object_allocations_start): to prevent TracePoint objects from GC, register them in the VM, since they are unique per VM. http://ci.rvm.jp/results/trunk-test@ruby-sky3/1291901 * ext/objspace/object_tracing.c (trace_object_allocations_stop): reuse TracePoint objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07ext/objspace/object_tracing.c (freeobj_i): no lookup before deletenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07ext/objspace/object_tracing.c: get rid of aliasing pointersnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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