summaryrefslogtreecommitdiff
path: root/template/prelude.c.tmpl
AgeCommit message (Collapse)Author
2018-07-30reduce copy & pasteshyouhei
We see several occurrence of "diagnostic push/pop" so why not make them macros. Tested on GCC8 / Clang 6. Note that ruby.h is intentionally left untouched because we don't want to introduce new public macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: NUL-terminate ruby_sourcefilenobu
* parse.y (yycompile): in some cases (warning, error, dtrace,...), ruby_sourcefile is expected to be NUL-terminated, so ensure it. * template/prelude.c.tmpl (prelude_name): NUL-terminate to get rid of copying static data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05make rb_iseq_new* accept rb_ast_body_t instead of NODE*mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.h: define rb_ast_body_t and restructure rb_ast_tmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-31prelude.c.tmpl: get rid of warnings on old gccnobu
* template/prelude.c.tmpl: ignore missing-field-initializers on old gcc, e.g. 4.4, which does not support pushing/popping diagnostics. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25prelude.c.tmpl: get rid of errors with old gccnobu
* template/prelude.c.tmpl: moved diagnostic pragmas outside prelude_eval() for very old gcc. [ruby-core:84449] [Bug #14234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25prelude.c.tmpl: static literalsnobu
* template/prelude.c.tmpl (PRELUDE_STR): make string objects with static literals not to copy them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25prelude.c.tmpl: fix optimization optionsnobu
* template/prelude.c.tmpl (prelude_eval): fix optimization options. trace_instruction member has been removed. filled coverage_enabled and debug_level members instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06prelude.c.tmpl: fix line numbernobu
* template/prelude.c.tmpl (Init_prelude): fix line number of preludes. line of prelude_eval is an int, not a VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01prelude.c.tmpl: escape commentsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01prelude.c.tmpl: split prelude codenobu
* template/prelude.c.tmpl: split prelude code into blocks so that each elements do not exceed the string literal size limit in C89. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01revert r60873usa
* template/prelude.c.tmpl (translate): revert r60873 because when some errors or warnings are shown their line numbers are shifted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-21Skip comment linesusa
* template/prelude.c.tmpl (translate): empty (only LF) lines are not necessary. so skip them, but for safety only when they are made from comment line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29* node.h (ast_t): renamed to `rb_ast_t`.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Revert "Revert "Manage AST NODEs out of GC""mame
This re-introduces r60485. This reverts commit 5a176b75b1187cbd3861c387bde65ff66396a07c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Revert "Manage AST NODEs out of GC"mame
This reverts commit 620ba74778bfdbdc34ffbb142d49ce84a0ef58e9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Manage AST NODEs out of GCmame
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
2016-10-18Update comments in prelude.c [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-12prelude.c.tmpl: optimizenobu
* template/prelude.c.tmpl: enable tail call optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26prelude.c.tmpl: workaroundnobu
* template/prelude.c.tmpl: prevent ruby-mode from confusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03prelude.c.tmpl: require_relativenobu
* template/prelude.c.tmpl (Prelude#translate): support for require_relative and comments followed by #. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27prelude.c.tmpl: no preludes, no code.nobu
* template/prelude.c.tmpl: no code if no prelude code is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-25* template/prelude.c.tmpl: Don't expand RbConfig::Config[...].akr
It is not used now. * common.mk: prelude.c and golf_prelude.c doesn't depend on rbconfig. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-19prelude.c.tmpl: strip prefixnobu
* template/prelude.c.tmpl (Prelude#translate): strip VPATH prefix from prelude names, so that srcdir diffrences do not make the generated code diffrent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-11template/prelude.c.tmplnobu
* template/prelude.c.tmpl: move from tool/compile_prelude.rb and expand by generic_erb.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e