1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Revert "Revert "Manage AST NODEs out of GC""

This re-introduces r60485.
This reverts commit 5a176b75b1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2017-10-27 16:44:57 +00:00
parent 15270f48a9
commit e35fe8d11b
10 changed files with 250 additions and 68 deletions

View file

@ -121,10 +121,14 @@ prelude_eval(VALUE code, VALUE name, int line)
FALSE, /* int debug_frozen_string_literal; */
};
NODE *node = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
if (!node) rb_exc_raise(rb_errinfo());
rb_iseq_eval(rb_iseq_new_with_opt(node, name, name, Qnil, INT2FIX(line),
ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
if (!ast->root) {
rb_ast_dispose(ast);
rb_exc_raise(rb_errinfo());
}
rb_iseq_eval(rb_iseq_new_with_opt(ast->root, name, name, Qnil, INT2FIX(line),
NULL, ISEQ_TYPE_TOP, &optimization));
rb_ast_dispose(ast);
}
% end