1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/ruby
mame 620ba74778 Manage AST NODEs out of GC
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
2017-10-27 15:59:02 +00:00
..
enc fix UTF-32 valid_encoding? 2017-03-09 02:04:10 +00:00
allpairs.rb
beginmainend.rb
bug-11928.rb
bug-13526.rb variable.c: cleanup waitq upon thread death 2017-05-07 04:26:37 +00:00
lbtest.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
marshaltestlib.rb
sentence.rb
test_alias.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_argf.rb io.c: encoding of ARGF.inplace_mode 2017-10-10 12:30:42 +00:00
test_arity.rb
test_array.rb Fixed misspelling words. 2017-10-22 11:27:06 +00:00
test_assignment.rb
test_autoload.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_backtrace.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_basicinstructions.rb
test_beginendblock.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_bignum.rb numeric.c: use NUM2DBL 2017-09-22 03:05:02 +00:00
test_call.rb test_call.rb: refine test_safe_call 2017-10-02 11:43:36 +00:00
test_case.rb
test_class.rb Fixed misspelling words. 2017-10-22 11:27:06 +00:00
test_clone.rb
test_comparable.rb
test_complex.rb freeze Complex and Rational 2017-10-19 10:58:08 +00:00
test_complex2.rb
test_complexrational.rb get rid of ambiguous parentheses warnings 2016-11-29 16:06:54 +00:00
test_condition.rb
test_const.rb test for [Feature #11547] 2017-01-01 09:17:10 +00:00
test_continuation.rb
test_defined.rb parse.y: primary should not be 0 2017-08-22 13:21:18 +00:00
test_dir.rb Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]" 2017-10-27 08:40:40 +00:00
test_dir_m17n.rb High Sierra's APFS cannot use invalid filenames [Bug #13816] 2017-08-15 21:33:43 +00:00
test_econv.rb
test_encoding.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_enum.rb range.c: check if exclude_end? is defined 2017-10-25 01:40:15 +00:00
test_enumerator.rb
test_env.rb test_env.rb: fix one-off bug 2017-10-26 07:36:23 +00:00
test_eval.rb fix return in toplevel rescue/ensure 2017-06-27 06:57:34 +00:00
test_exception.rb error.c: infinite recursion at Warning#warn 2017-10-13 01:34:52 +00:00
test_fiber.rb make root fiber at switching. 2017-10-26 14:38:22 +00:00
test_file.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_file_exhaustive.rb added workaround for APFS file format. 2017-09-14 05:04:38 +00:00
test_fixnum.rb
test_flip.rb test_flip.rb: r56316 2016-11-16 05:25:53 +00:00
test_float.rb numeric.c: fix for small number 2017-05-27 01:26:31 +00:00
test_fnmatch.rb Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]" 2017-10-27 08:40:40 +00:00
test_gc.rb Manage AST NODEs out of GC 2017-10-27 15:59:02 +00:00
test_hash.rb Add arity check into Hash#flatten 2017-10-22 00:38:05 +00:00
test_ifunless.rb
test_integer.rb numeric.c: use NUM2DBL 2017-09-22 03:05:02 +00:00
test_integer_comb.rb
test_io.rb test_io.rb: skip writev test 2017-10-25 12:31:30 +00:00
test_io_m17n.rb io.c: textmode if newline decorator 2017-07-14 10:53:35 +00:00
test_iseq.rb test/ruby/test_iseq.rb: Skip test_safe_call_chain if Coverage is running. 2017-09-25 00:09:44 +00:00
test_iterator.rb check break target correctly. 2017-06-08 04:13:51 +00:00
test_keyword.rb compile.c: fix KW_SPLAT flag condition 2017-08-10 00:50:45 +00:00
test_lambda.rb vm_args.c: arity check of lambda 2017-03-19 01:11:12 +00:00
test_lazy_enumerator.rb enumerator.c: fix nested maps 2017-06-10 10:26:32 +00:00
test_literal.rb literal symbol by intern 2017-09-17 09:28:58 +00:00
test_m17n.rb refine a warning message. 2017-03-02 23:33:06 +00:00
test_m17n_comb.rb
test_marshal.rb Rename RbConfig::Limits as RbConfig::LIMITS 2017-04-06 02:10:40 +00:00
test_math.rb
test_metaclass.rb
test_method.rb proc.c: super_method of included method 2017-10-06 05:55:11 +00:00
test_mixed_unicode_escapes.rb
test_module.rb * test/ruby/test_module.rb: Method tables are not guaranteed to be 2016-11-14 19:27:24 +00:00
test_not.rb
test_notimp.rb apply timeout scale 2017-05-27 02:01:41 +00:00
test_numeric.rb no longer rescue exceptions of #coerce in Integer#step 2017-04-25 11:42:31 +00:00
test_object.rb object.c: fix conversion failure message 2017-09-15 02:01:59 +00:00
test_objectspace.rb
test_optimization.rb Lazy Proc allocation for block parameters 2017-10-24 11:13:49 +00:00
test_pack.rb pack.c: unpack "M" may be ASCII only 2017-09-29 08:00:47 +00:00
test_parse.rb parse.y: workaround for warnings 2017-10-22 01:37:36 +00:00
test_path.rb
test_pipe.rb
test_primitive.rb
test_proc.rb * proc.c (get_local_variable_ptr): return found env ptr. Returned env 2017-06-12 02:20:09 +00:00
test_process.rb process.c: null byte at initgroups 2017-10-11 06:16:03 +00:00
test_rand.rb random.c: ensure initialized 2017-07-19 03:16:58 +00:00
test_range.rb range.c: use rb_check_funcall 2017-10-25 05:23:54 +00:00
test_rational.rb freeze Complex and Rational 2017-10-19 10:58:08 +00:00
test_rational2.rb
test_readpartial.rb
test_refinement.rb test_refinement.rb: test for r59946 2017-10-01 02:24:11 +00:00
test_regexp.rb re.c: options for sub-regexp 2017-08-11 02:05:24 +00:00
test_require.rb load.c: real path to load 2017-09-21 07:29:20 +00:00
test_rubyoptions.rb Test for r60396 2017-10-24 11:24:19 +00:00
test_rubyvm.rb
test_settracefunc.rb TracePoint#enable, #disable: Don't yield any argument. [Bug #14057] 2017-10-26 06:58:09 +00:00
test_signal.rb remove ruby_kill() introduced for [Bug #7951]. 2017-06-12 04:52:25 +00:00
test_sleep.rb
test_sprintf.rb error.c: KeyError#receiver and KeyError#key 2017-09-18 08:05:53 +00:00
test_sprintf_comb.rb
test_string.rb Fix a target method of a test 2017-10-22 07:04:00 +00:00
test_stringchar.rb
test_struct.rb * test/ruby/test_module.rb: Method tables are not guaranteed to be 2016-11-14 19:27:24 +00:00
test_super.rb vm_eval.c: follow the original class 2016-10-29 00:39:16 +00:00
test_symbol.rb Suppress warning: method redefined; discarding old == 2017-07-03 08:08:29 +00:00
test_syntax.rb Fixed misspelling words. 2017-10-22 11:27:06 +00:00
test_system.rb
test_thread.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_threadgroup.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_time.rb Time#at receives 3rd argument which specifies the unit of 2nd argument [Feature #13919] 2017-09-25 06:20:10 +00:00
test_time_tz.rb
test_trace.rb test_exception.rb: test_machine_stackoverflow_by_trace 2017-05-10 06:38:30 +00:00
test_transcode.rb Fix typo in comment 2017-10-21 23:32:57 +00:00
test_undef.rb
test_unicode_escape.rb parse.y: relax spaces 2016-12-02 02:47:11 +00:00
test_variable.rb Fix typos 2016-12-06 12:49:46 +00:00
test_vm_dump.rb skip unless PLATFORM is darwin. 2017-09-01 02:09:02 +00:00
test_weakmap.rb
test_whileuntil.rb
test_yield.rb vm_args.c: arity check of lambda 2017-03-19 01:11:12 +00:00
ut_eof.rb