1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool
Koichi Sasada a3e6f52c17 rename __builtin_inline!(code) and introduce others.
rename __builtin_inline!(code) to __builtin_cstmt(code).
Also this commit introduce the following inlining C code features.

* __builtin_cstmt!(STMT)

(renamed from __builtin_inline!)

Define a function which run STMT implicitly and call this function at
evatuation time. Note that you need to return some value in STMT.
If there is a local variables (includes method parameters), you can
read these values.

  static VALUE func(ec, self) {
    VALUE x = ...;
    STMT
  }

Usage:
  def double a
    # a is readable from C code.
    __builtin_cstmt! 'return INT2FIX(FIX2INT(a) * 2);'
  end

* __builtin_cexpr!(EXPR)

Define a function which invoke EXPR implicitly like `__builtin_cstmt!`.
Different from cstmt!, which compiled with `return EXPR;`.
(`return` and `;` are added implicitly)

  static VALUE func(ec, self) {
    VALUE x = ...;
    return EXPPR;
  }

Usage:
  def double a
    __builtin_cexpr! 'INT2FIX(FIX2INT(a) * 2)'
  end

* __builtin_cconst!(EXPR)

Define a function which invoke EXPR implicitly like cexpr!.
However, the function is called once at compile time, not evaluated time.
Any local variables are not accessible (because there is no local variable
at compile time).

Usage:
  GCC = __builtin_cconst! '__GNUC__'

* __builtin_cinit!(STMT)

STMT are writtein in auto-generated code.
This code does not return any value.

Usage:

  __builtin_cinit! '#include <zlib.h>'
  def no_compression?
    __builtin_cconst! 'Z_NO_COMPRESSION ? Qtrue : Qfalse'
  end
2019-11-27 03:55:28 +09:00
..
lib Warn on access/modify of $SAFE, and remove effects of modifying $SAFE 2019-11-18 01:00:25 +02:00
m4 typedef rb_jmpbuf_t to void *[5] if __builtin_setjmp is used 2019-09-21 13:24:58 +09:00
ruby_vm Avoid top-level search for nested constant reference from nil in defined? 2019-11-13 15:36:58 +09:00
test use builtin for TracePoint. 2019-11-08 09:09:29 +09:00
actions-commit-info.sh Add commit number of today to notification of GitHub Actions 2019-11-13 14:25:30 +09:00
asm_parse.rb
bisect.sh
build-transcode
checksum.rb
colors
darwin-cc
downloader.rb Use jsDelivr instead of raw.githubusercontent.com 2019-11-22 13:55:59 +09:00
enc-emoji-citrus-gen.rb
enc-emoji4unicode.rb
enc-unicode.rb
eval.rb
expand-config.rb
extlibs.rb
fake.rb
fetch-bundled_gems.rb Use git pull instead of git fetch if master branch 2019-09-04 12:46:26 +09:00
file2lastrev.rb Exit gently if no VCS found but --suppress_not_found is given 2019-09-07 17:26:28 +09:00
format-release format-release uses the result of GitHub Actions 2019-11-12 01:22:59 +09:00
gem-unpack.rb Remove unneeded exec bits from some files 2019-11-09 21:36:30 +09:00
gen_dummy_probes.rb
gen_ruby_tapset.rb
generic_erb.rb
git-refresh
gperf.sed
id2token.rb
ifchange
insns2vm.rb
install-sh
leaked-globals st.c: Use rb_st_* prefix instead of st_* (#2479) 2019-09-22 22:12:18 +09:00
make-snapshot Fix typo [ci skip] 2019-10-08 00:00:24 +09:00
make_hgraph.rb
mdoc2man.rb
merger.rb Add github repo to remove_tag 2019-11-22 19:05:58 +09:00
mjit_archflag.sh
mk_builtin_binary.rb Prettify builtin_binary format 2019-11-09 00:21:44 +09:00
mk_builtin_loader.rb rename __builtin_inline!(code) and introduce others. 2019-11-27 03:55:28 +09:00
mk_call_iseq_optimized.rb more on struct rb_call_data 2019-10-25 12:24:22 +09:00
mkconfig.rb
mkrunnable.rb
node_name.rb
parse.rb
prereq.status
probes_to_wiki.rb
pure_parser.rb Refine error message 2019-08-03 14:20:36 +09:00
rbinstall.rb Remove binary data at installation 2019-11-11 12:20:03 +09:00
rbuninstall.rb
redmine-backporter.rb
release.sh tool/release.sh uses ruby-actions' result 2019-10-22 22:15:52 +09:00
rmdirs
run-gcov.rb
run-lcov.rb
runruby.rb Fix some bundler specs (#2380) 2019-08-20 09:46:31 +09:00
strip-rdoc.rb
sync_default_gems.rb Add sync task for ruby/openssl 2019-11-26 18:26:08 +09:00
test-bundled-gems.rb Do not occupy ARGV by XRUBY command 2019-11-05 08:45:19 +09:00
test-coverage.rb
transcode-tblgen.rb
transform_mjit_header.rb
travis_retry.sh We did not have tool/ before checkout 2019-08-12 14:37:26 +09:00
update-deps Dependents on probes.h need the dummy header too 2019-11-18 23:16:22 +09:00
vtlh.rb
ytab.sed