debase-ruby_core_source 0.10.10 → 0.10.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -3
- data/debase-ruby_core_source.gemspec +4 -4
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/builtin.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/list/list.h +788 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/debug_counter.h +457 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/dln.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/eval_intern.h +323 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/gc.h +140 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/hrtime.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id.h +290 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns_info.inc +8983 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bits.h +566 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compar.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compile.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/cont.h +25 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/dir.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enc.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/encoding.h +28 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enum.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enumerator.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/error.h +124 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/eval.h +33 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/file.h +39 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/fixnum.h +185 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/hash.h +241 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/inits.h +51 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/io.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/load.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/loadpath.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/math.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/missing.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/numeric.h +255 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/proc.h +33 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/process.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/random.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/range.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/rational.h +71 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/re.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/sanitizers.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/scheduler.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/signal.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/string.h +140 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/struct.h +154 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/symbol.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/thread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/time.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/transcode.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/util.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/variable.h +84 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/iseq.h +305 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/method.h +245 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit.h +220 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit_compile.inc +8240 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node.h +484 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node_name.inc +210 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/parse.h +211 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regint.h +938 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_pthread.h +115 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_win32.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/variable.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/version.h +89 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm.inc +5355 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_callinfo.h +456 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_core.h +2023 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_exec.h +196 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_insnhelper.h +257 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/builtin.h +84 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/list/list.h +788 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/darray.h +198 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/debug_counter.h +469 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/dln.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/eval_intern.h +335 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/gc.h +141 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/hrtime.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/id.h +293 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/insns_info.inc +9063 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/array.h +113 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bits.h +565 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/class.h +196 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compar.h +49 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compile.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compilers.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/cont.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/dir.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enc.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/encoding.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enum.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enumerator.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/error.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/eval.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/file.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/fixnum.h +184 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/gc.h +186 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/hash.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/inits.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/io.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/load.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/loadpath.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/math.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/missing.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/numeric.h +271 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/proc.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/process.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/random.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/range.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/rational.h +72 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/re.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/sanitizers.h +190 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/serial.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/signal.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/static_assert.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/string.h +141 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/struct.h +153 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/symbol.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/thread.h +53 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/time.h +34 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/transcode.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/util.h +27 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/variable.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/vm.h +133 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/warnings.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal.h +109 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/iseq.h +322 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/method.h +253 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit.h +231 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit_compile.inc +8322 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/node.h +510 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/node_name.inc +208 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/parse.h +214 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ractor_core.h +346 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regint.h +942 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/revision.h +2 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_assert.h +14 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_pthread.h +115 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_win32.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/variable.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/version.h +88 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm.inc +5470 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_callinfo.h +487 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_core.h +2107 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_debug.h +124 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_exec.h +197 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_insnhelper.h +265 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_sync.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_asm.h +408 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_codegen.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_core.h +307 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_iface.h +38 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +235 -14
@@ -0,0 +1,136 @@
|
|
1
|
+
|
2
|
+
#ifndef RUBY_VM_SYNC_H
|
3
|
+
#define RUBY_VM_SYNC_H
|
4
|
+
|
5
|
+
#include "vm_debug.h"
|
6
|
+
#include "debug_counter.h"
|
7
|
+
|
8
|
+
#if USE_RUBY_DEBUG_LOG
|
9
|
+
#define LOCATION_ARGS const char *file, int line
|
10
|
+
#define LOCATION_PARAMS file, line
|
11
|
+
#define APPEND_LOCATION_ARGS , const char *file, int line
|
12
|
+
#define APPEND_LOCATION_PARAMS , file, line
|
13
|
+
#else
|
14
|
+
#define LOCATION_ARGS void
|
15
|
+
#define LOCATION_PARAMS
|
16
|
+
#define APPEND_LOCATION_ARGS
|
17
|
+
#define APPEND_LOCATION_PARAMS
|
18
|
+
#endif
|
19
|
+
|
20
|
+
bool rb_vm_locked_p(void);
|
21
|
+
void rb_vm_lock_body(LOCATION_ARGS);
|
22
|
+
void rb_vm_unlock_body(LOCATION_ARGS);
|
23
|
+
|
24
|
+
struct rb_ractor_struct;
|
25
|
+
void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS);
|
26
|
+
void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS);
|
27
|
+
void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS);
|
28
|
+
void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS);
|
29
|
+
void rb_vm_barrier(void);
|
30
|
+
|
31
|
+
#if RUBY_DEBUG
|
32
|
+
// GET_VM()
|
33
|
+
#include "vm_core.h"
|
34
|
+
#endif
|
35
|
+
|
36
|
+
RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
|
37
|
+
|
38
|
+
static inline bool
|
39
|
+
rb_multi_ractor_p(void)
|
40
|
+
{
|
41
|
+
if (LIKELY(ruby_single_main_ractor)) {
|
42
|
+
// 0 on boot time.
|
43
|
+
RUBY_ASSERT(GET_VM()->ractor.cnt <= 1);
|
44
|
+
return false;
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
// multi-ractor mode can run ractor.cnt == 1
|
48
|
+
return true;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
static inline void
|
53
|
+
rb_vm_lock(const char *file, int line)
|
54
|
+
{
|
55
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock);
|
56
|
+
|
57
|
+
if (rb_multi_ractor_p()) {
|
58
|
+
rb_vm_lock_body(LOCATION_PARAMS);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
static inline void
|
63
|
+
rb_vm_unlock(const char *file, int line)
|
64
|
+
{
|
65
|
+
if (rb_multi_ractor_p()) {
|
66
|
+
rb_vm_unlock_body(LOCATION_PARAMS);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
static inline void
|
71
|
+
rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
|
72
|
+
{
|
73
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock_enter);
|
74
|
+
|
75
|
+
if (rb_multi_ractor_p()) {
|
76
|
+
rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
static inline void
|
81
|
+
rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line)
|
82
|
+
{
|
83
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb);
|
84
|
+
|
85
|
+
if (rb_multi_ractor_p()) {
|
86
|
+
rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
static inline void
|
91
|
+
rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
|
92
|
+
{
|
93
|
+
if (rb_multi_ractor_p()) {
|
94
|
+
rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
static inline void
|
99
|
+
rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
|
100
|
+
{
|
101
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr);
|
102
|
+
rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
|
103
|
+
}
|
104
|
+
|
105
|
+
static inline void
|
106
|
+
rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
|
107
|
+
{
|
108
|
+
rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS);
|
109
|
+
}
|
110
|
+
|
111
|
+
#define RB_VM_LOCKED_P() rb_vm_locked_p()
|
112
|
+
|
113
|
+
#define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__)
|
114
|
+
#define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__)
|
115
|
+
|
116
|
+
#define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__)
|
117
|
+
#define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__)
|
118
|
+
#define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__)
|
119
|
+
#define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__)
|
120
|
+
|
121
|
+
#define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev);
|
122
|
+
#define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); }
|
123
|
+
|
124
|
+
#define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__)
|
125
|
+
#define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev);
|
126
|
+
#define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV(&_lev); }
|
127
|
+
|
128
|
+
#if RUBY_DEBUG > 0
|
129
|
+
void ASSERT_vm_locking(void);
|
130
|
+
void ASSERT_vm_unlocking(void);
|
131
|
+
#else
|
132
|
+
#define ASSERT_vm_locking()
|
133
|
+
#define ASSERT_vm_unlocking()
|
134
|
+
#endif
|
135
|
+
|
136
|
+
#endif // RUBY_VM_SYNC_H
|
@@ -0,0 +1,243 @@
|
|
1
|
+
/* -*- C -*- */
|
2
|
+
|
3
|
+
/* This is an auto-generated file and is a part of the programming language
|
4
|
+
* Ruby. The person who created a program to generate this file (``I''
|
5
|
+
* hereafter) would like to refrain from defining licensing of this generated
|
6
|
+
* source code.
|
7
|
+
*
|
8
|
+
* This file consists of many small parts of codes copyrighted by each author,
|
9
|
+
* not only the ``I'' person. Those original authors agree with some
|
10
|
+
* open-source license. I believe that the license we agree is the condition
|
11
|
+
* mentioned in the file COPYING. It states "4. You may modify and include
|
12
|
+
* the part of the software into any other software ...". But the problem is,
|
13
|
+
* the license never makes it clear if such modified parts still remain in the
|
14
|
+
* same license, or not. The fact that we agree with the source code's
|
15
|
+
* licensing terms does not automatically define that of generated ones. This
|
16
|
+
* is the reason why this file is under an unclear situation. All what I know
|
17
|
+
* is that above provision guarantees this file to exist.
|
18
|
+
*
|
19
|
+
* Please let me hesitate to declare something about this nuanced contract. I
|
20
|
+
* am not in the position to take over other authors' license to merge into my
|
21
|
+
* one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday
|
22
|
+
* it might turn out to be okay to say this file is under a license. I wish
|
23
|
+
* the situation would become more clear in the future. */
|
24
|
+
/*******************************************************************/
|
25
|
+
/*******************************************************************/
|
26
|
+
/*******************************************************************/
|
27
|
+
/**
|
28
|
+
This file is for threaded code.
|
29
|
+
|
30
|
+
----
|
31
|
+
This file is auto generated by insns2vm.rb
|
32
|
+
DO NOT TOUCH!
|
33
|
+
|
34
|
+
If you want to fix something, you must edit "tool/ruby_vm/views/vmtc.inc.erb"
|
35
|
+
or tool/insns2vm.rb
|
36
|
+
*/
|
37
|
+
|
38
|
+
static const void *const insns_address_table[] = {
|
39
|
+
LABEL_PTR(nop),
|
40
|
+
LABEL_PTR(getlocal),
|
41
|
+
LABEL_PTR(setlocal),
|
42
|
+
LABEL_PTR(getblockparam),
|
43
|
+
LABEL_PTR(setblockparam),
|
44
|
+
LABEL_PTR(getblockparamproxy),
|
45
|
+
LABEL_PTR(getspecial),
|
46
|
+
LABEL_PTR(setspecial),
|
47
|
+
LABEL_PTR(getinstancevariable),
|
48
|
+
LABEL_PTR(setinstancevariable),
|
49
|
+
LABEL_PTR(getclassvariable),
|
50
|
+
LABEL_PTR(setclassvariable),
|
51
|
+
LABEL_PTR(getconstant),
|
52
|
+
LABEL_PTR(setconstant),
|
53
|
+
LABEL_PTR(getglobal),
|
54
|
+
LABEL_PTR(setglobal),
|
55
|
+
LABEL_PTR(putnil),
|
56
|
+
LABEL_PTR(putself),
|
57
|
+
LABEL_PTR(putobject),
|
58
|
+
LABEL_PTR(putspecialobject),
|
59
|
+
LABEL_PTR(putstring),
|
60
|
+
LABEL_PTR(concatstrings),
|
61
|
+
LABEL_PTR(tostring),
|
62
|
+
LABEL_PTR(toregexp),
|
63
|
+
LABEL_PTR(intern),
|
64
|
+
LABEL_PTR(newarray),
|
65
|
+
LABEL_PTR(newarraykwsplat),
|
66
|
+
LABEL_PTR(duparray),
|
67
|
+
LABEL_PTR(duphash),
|
68
|
+
LABEL_PTR(expandarray),
|
69
|
+
LABEL_PTR(concatarray),
|
70
|
+
LABEL_PTR(splatarray),
|
71
|
+
LABEL_PTR(newhash),
|
72
|
+
LABEL_PTR(newrange),
|
73
|
+
LABEL_PTR(pop),
|
74
|
+
LABEL_PTR(dup),
|
75
|
+
LABEL_PTR(dupn),
|
76
|
+
LABEL_PTR(swap),
|
77
|
+
LABEL_PTR(reverse),
|
78
|
+
LABEL_PTR(topn),
|
79
|
+
LABEL_PTR(setn),
|
80
|
+
LABEL_PTR(adjuststack),
|
81
|
+
LABEL_PTR(defined),
|
82
|
+
LABEL_PTR(checkmatch),
|
83
|
+
LABEL_PTR(checkkeyword),
|
84
|
+
LABEL_PTR(checktype),
|
85
|
+
LABEL_PTR(defineclass),
|
86
|
+
LABEL_PTR(definemethod),
|
87
|
+
LABEL_PTR(definesmethod),
|
88
|
+
LABEL_PTR(send),
|
89
|
+
LABEL_PTR(opt_send_without_block),
|
90
|
+
LABEL_PTR(opt_str_freeze),
|
91
|
+
LABEL_PTR(opt_nil_p),
|
92
|
+
LABEL_PTR(opt_str_uminus),
|
93
|
+
LABEL_PTR(opt_newarray_max),
|
94
|
+
LABEL_PTR(opt_newarray_min),
|
95
|
+
LABEL_PTR(invokesuper),
|
96
|
+
LABEL_PTR(invokeblock),
|
97
|
+
LABEL_PTR(leave),
|
98
|
+
LABEL_PTR(throw),
|
99
|
+
LABEL_PTR(jump),
|
100
|
+
LABEL_PTR(branchif),
|
101
|
+
LABEL_PTR(branchunless),
|
102
|
+
LABEL_PTR(branchnil),
|
103
|
+
LABEL_PTR(opt_getinlinecache),
|
104
|
+
LABEL_PTR(opt_setinlinecache),
|
105
|
+
LABEL_PTR(once),
|
106
|
+
LABEL_PTR(opt_case_dispatch),
|
107
|
+
LABEL_PTR(opt_plus),
|
108
|
+
LABEL_PTR(opt_minus),
|
109
|
+
LABEL_PTR(opt_mult),
|
110
|
+
LABEL_PTR(opt_div),
|
111
|
+
LABEL_PTR(opt_mod),
|
112
|
+
LABEL_PTR(opt_eq),
|
113
|
+
LABEL_PTR(opt_neq),
|
114
|
+
LABEL_PTR(opt_lt),
|
115
|
+
LABEL_PTR(opt_le),
|
116
|
+
LABEL_PTR(opt_gt),
|
117
|
+
LABEL_PTR(opt_ge),
|
118
|
+
LABEL_PTR(opt_ltlt),
|
119
|
+
LABEL_PTR(opt_and),
|
120
|
+
LABEL_PTR(opt_or),
|
121
|
+
LABEL_PTR(opt_aref),
|
122
|
+
LABEL_PTR(opt_aset),
|
123
|
+
LABEL_PTR(opt_aset_with),
|
124
|
+
LABEL_PTR(opt_aref_with),
|
125
|
+
LABEL_PTR(opt_length),
|
126
|
+
LABEL_PTR(opt_size),
|
127
|
+
LABEL_PTR(opt_empty_p),
|
128
|
+
LABEL_PTR(opt_succ),
|
129
|
+
LABEL_PTR(opt_not),
|
130
|
+
LABEL_PTR(opt_regexpmatch2),
|
131
|
+
LABEL_PTR(invokebuiltin),
|
132
|
+
LABEL_PTR(opt_invokebuiltin_delegate),
|
133
|
+
LABEL_PTR(opt_invokebuiltin_delegate_leave),
|
134
|
+
LABEL_PTR(getlocal_WC_0),
|
135
|
+
LABEL_PTR(getlocal_WC_1),
|
136
|
+
LABEL_PTR(setlocal_WC_0),
|
137
|
+
LABEL_PTR(setlocal_WC_1),
|
138
|
+
LABEL_PTR(putobject_INT2FIX_0_),
|
139
|
+
LABEL_PTR(putobject_INT2FIX_1_),
|
140
|
+
LABEL_PTR(trace_nop),
|
141
|
+
LABEL_PTR(trace_getlocal),
|
142
|
+
LABEL_PTR(trace_setlocal),
|
143
|
+
LABEL_PTR(trace_getblockparam),
|
144
|
+
LABEL_PTR(trace_setblockparam),
|
145
|
+
LABEL_PTR(trace_getblockparamproxy),
|
146
|
+
LABEL_PTR(trace_getspecial),
|
147
|
+
LABEL_PTR(trace_setspecial),
|
148
|
+
LABEL_PTR(trace_getinstancevariable),
|
149
|
+
LABEL_PTR(trace_setinstancevariable),
|
150
|
+
LABEL_PTR(trace_getclassvariable),
|
151
|
+
LABEL_PTR(trace_setclassvariable),
|
152
|
+
LABEL_PTR(trace_getconstant),
|
153
|
+
LABEL_PTR(trace_setconstant),
|
154
|
+
LABEL_PTR(trace_getglobal),
|
155
|
+
LABEL_PTR(trace_setglobal),
|
156
|
+
LABEL_PTR(trace_putnil),
|
157
|
+
LABEL_PTR(trace_putself),
|
158
|
+
LABEL_PTR(trace_putobject),
|
159
|
+
LABEL_PTR(trace_putspecialobject),
|
160
|
+
LABEL_PTR(trace_putstring),
|
161
|
+
LABEL_PTR(trace_concatstrings),
|
162
|
+
LABEL_PTR(trace_tostring),
|
163
|
+
LABEL_PTR(trace_toregexp),
|
164
|
+
LABEL_PTR(trace_intern),
|
165
|
+
LABEL_PTR(trace_newarray),
|
166
|
+
LABEL_PTR(trace_newarraykwsplat),
|
167
|
+
LABEL_PTR(trace_duparray),
|
168
|
+
LABEL_PTR(trace_duphash),
|
169
|
+
LABEL_PTR(trace_expandarray),
|
170
|
+
LABEL_PTR(trace_concatarray),
|
171
|
+
LABEL_PTR(trace_splatarray),
|
172
|
+
LABEL_PTR(trace_newhash),
|
173
|
+
LABEL_PTR(trace_newrange),
|
174
|
+
LABEL_PTR(trace_pop),
|
175
|
+
LABEL_PTR(trace_dup),
|
176
|
+
LABEL_PTR(trace_dupn),
|
177
|
+
LABEL_PTR(trace_swap),
|
178
|
+
LABEL_PTR(trace_reverse),
|
179
|
+
LABEL_PTR(trace_topn),
|
180
|
+
LABEL_PTR(trace_setn),
|
181
|
+
LABEL_PTR(trace_adjuststack),
|
182
|
+
LABEL_PTR(trace_defined),
|
183
|
+
LABEL_PTR(trace_checkmatch),
|
184
|
+
LABEL_PTR(trace_checkkeyword),
|
185
|
+
LABEL_PTR(trace_checktype),
|
186
|
+
LABEL_PTR(trace_defineclass),
|
187
|
+
LABEL_PTR(trace_definemethod),
|
188
|
+
LABEL_PTR(trace_definesmethod),
|
189
|
+
LABEL_PTR(trace_send),
|
190
|
+
LABEL_PTR(trace_opt_send_without_block),
|
191
|
+
LABEL_PTR(trace_opt_str_freeze),
|
192
|
+
LABEL_PTR(trace_opt_nil_p),
|
193
|
+
LABEL_PTR(trace_opt_str_uminus),
|
194
|
+
LABEL_PTR(trace_opt_newarray_max),
|
195
|
+
LABEL_PTR(trace_opt_newarray_min),
|
196
|
+
LABEL_PTR(trace_invokesuper),
|
197
|
+
LABEL_PTR(trace_invokeblock),
|
198
|
+
LABEL_PTR(trace_leave),
|
199
|
+
LABEL_PTR(trace_throw),
|
200
|
+
LABEL_PTR(trace_jump),
|
201
|
+
LABEL_PTR(trace_branchif),
|
202
|
+
LABEL_PTR(trace_branchunless),
|
203
|
+
LABEL_PTR(trace_branchnil),
|
204
|
+
LABEL_PTR(trace_opt_getinlinecache),
|
205
|
+
LABEL_PTR(trace_opt_setinlinecache),
|
206
|
+
LABEL_PTR(trace_once),
|
207
|
+
LABEL_PTR(trace_opt_case_dispatch),
|
208
|
+
LABEL_PTR(trace_opt_plus),
|
209
|
+
LABEL_PTR(trace_opt_minus),
|
210
|
+
LABEL_PTR(trace_opt_mult),
|
211
|
+
LABEL_PTR(trace_opt_div),
|
212
|
+
LABEL_PTR(trace_opt_mod),
|
213
|
+
LABEL_PTR(trace_opt_eq),
|
214
|
+
LABEL_PTR(trace_opt_neq),
|
215
|
+
LABEL_PTR(trace_opt_lt),
|
216
|
+
LABEL_PTR(trace_opt_le),
|
217
|
+
LABEL_PTR(trace_opt_gt),
|
218
|
+
LABEL_PTR(trace_opt_ge),
|
219
|
+
LABEL_PTR(trace_opt_ltlt),
|
220
|
+
LABEL_PTR(trace_opt_and),
|
221
|
+
LABEL_PTR(trace_opt_or),
|
222
|
+
LABEL_PTR(trace_opt_aref),
|
223
|
+
LABEL_PTR(trace_opt_aset),
|
224
|
+
LABEL_PTR(trace_opt_aset_with),
|
225
|
+
LABEL_PTR(trace_opt_aref_with),
|
226
|
+
LABEL_PTR(trace_opt_length),
|
227
|
+
LABEL_PTR(trace_opt_size),
|
228
|
+
LABEL_PTR(trace_opt_empty_p),
|
229
|
+
LABEL_PTR(trace_opt_succ),
|
230
|
+
LABEL_PTR(trace_opt_not),
|
231
|
+
LABEL_PTR(trace_opt_regexpmatch2),
|
232
|
+
LABEL_PTR(trace_invokebuiltin),
|
233
|
+
LABEL_PTR(trace_opt_invokebuiltin_delegate),
|
234
|
+
LABEL_PTR(trace_opt_invokebuiltin_delegate_leave),
|
235
|
+
LABEL_PTR(trace_getlocal_WC_0),
|
236
|
+
LABEL_PTR(trace_getlocal_WC_1),
|
237
|
+
LABEL_PTR(trace_setlocal_WC_0),
|
238
|
+
LABEL_PTR(trace_setlocal_WC_1),
|
239
|
+
LABEL_PTR(trace_putobject_INT2FIX_0_),
|
240
|
+
LABEL_PTR(trace_putobject_INT2FIX_1_),
|
241
|
+
};
|
242
|
+
|
243
|
+
ASSERT_VM_INSTRUCTION_SIZE(insns_address_table);
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#ifndef RUBY_ADDR2LINE_H
|
2
|
+
#define RUBY_ADDR2LINE_H
|
3
|
+
/**********************************************************************
|
4
|
+
|
5
|
+
addr2line.h -
|
6
|
+
|
7
|
+
$Author$
|
8
|
+
|
9
|
+
Copyright (C) 2010 Shinichiro Hamaji
|
10
|
+
|
11
|
+
**********************************************************************/
|
12
|
+
|
13
|
+
#if (defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H))
|
14
|
+
|
15
|
+
void
|
16
|
+
rb_dump_backtrace_with_lines(int num_traces, void **traces);
|
17
|
+
|
18
|
+
#endif /* USE_ELF */
|
19
|
+
|
20
|
+
#endif /* RUBY_ADDR2LINE_H */
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#ifndef BUILTIN_H_INCLUDED
|
2
|
+
#define BUILTIN_H_INCLUDED
|
3
|
+
|
4
|
+
// invoke
|
5
|
+
|
6
|
+
struct rb_builtin_function {
|
7
|
+
// for invocation
|
8
|
+
const void * const func_ptr;
|
9
|
+
const int argc;
|
10
|
+
|
11
|
+
// for load
|
12
|
+
const int index;
|
13
|
+
const char * const name;
|
14
|
+
|
15
|
+
// for jit
|
16
|
+
void (*compiler)(FILE *, long, unsigned, bool);
|
17
|
+
};
|
18
|
+
|
19
|
+
#define RB_BUILTIN_FUNCTION(_i, _name, _fname, _arity, _compiler) {\
|
20
|
+
.name = #_name, \
|
21
|
+
.func_ptr = (void *)_fname, \
|
22
|
+
.argc = _arity, \
|
23
|
+
.index = _i, \
|
24
|
+
.compiler = _compiler, \
|
25
|
+
}
|
26
|
+
|
27
|
+
void rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table);
|
28
|
+
|
29
|
+
#ifndef rb_execution_context_t
|
30
|
+
typedef struct rb_execution_context_struct rb_execution_context_t;
|
31
|
+
#define rb_execution_context_t rb_execution_context_t
|
32
|
+
#endif
|
33
|
+
|
34
|
+
/* The following code is generated by the following Ruby script:
|
35
|
+
|
36
|
+
16.times{|i|
|
37
|
+
args = (i > 0 ? ', ' : '') + (0...i).map{"VALUE"}.join(', ')
|
38
|
+
puts "static inline void rb_builtin_function_check_arity#{i}(VALUE (*f)(rb_execution_context_t *ec, VALUE self#{args})){}"
|
39
|
+
}
|
40
|
+
*/
|
41
|
+
|
42
|
+
static inline void rb_builtin_function_check_arity0(VALUE (*f)(rb_execution_context_t *ec, VALUE self)){}
|
43
|
+
static inline void rb_builtin_function_check_arity1(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE)){}
|
44
|
+
static inline void rb_builtin_function_check_arity2(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE)){}
|
45
|
+
static inline void rb_builtin_function_check_arity3(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE)){}
|
46
|
+
static inline void rb_builtin_function_check_arity4(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE)){}
|
47
|
+
static inline void rb_builtin_function_check_arity5(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
48
|
+
static inline void rb_builtin_function_check_arity6(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
49
|
+
static inline void rb_builtin_function_check_arity7(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
50
|
+
static inline void rb_builtin_function_check_arity8(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
51
|
+
static inline void rb_builtin_function_check_arity9(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
52
|
+
static inline void rb_builtin_function_check_arity10(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
53
|
+
static inline void rb_builtin_function_check_arity11(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
54
|
+
static inline void rb_builtin_function_check_arity12(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
55
|
+
static inline void rb_builtin_function_check_arity13(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
56
|
+
static inline void rb_builtin_function_check_arity14(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
57
|
+
static inline void rb_builtin_function_check_arity15(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
|
58
|
+
|
59
|
+
PUREFUNC(VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index));
|
60
|
+
VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index);
|
61
|
+
|
62
|
+
// __builtin_inline!
|
63
|
+
|
64
|
+
PUREFUNC(static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index));
|
65
|
+
|
66
|
+
static inline VALUE
|
67
|
+
rb_vm_lvar(rb_execution_context_t *ec, int index)
|
68
|
+
{
|
69
|
+
#if defined(VM_CORE_H_EC_DEFINED) && VM_CORE_H_EC_DEFINED
|
70
|
+
return ec->cfp->ep[index];
|
71
|
+
#else
|
72
|
+
return rb_vm_lvar_exposed(ec, index);
|
73
|
+
#endif
|
74
|
+
}
|
75
|
+
|
76
|
+
// dump/load
|
77
|
+
|
78
|
+
struct builtin_binary {
|
79
|
+
const char *feature; // feature name
|
80
|
+
const unsigned char *bin; // binary by ISeq#to_binary
|
81
|
+
size_t bin_size;
|
82
|
+
};
|
83
|
+
|
84
|
+
#endif // BUILTIN_H_INCLUDED
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
|
2
|
+
#ifndef CCAN_BUILD_ASSERT_H
|
3
|
+
#define CCAN_BUILD_ASSERT_H
|
4
|
+
|
5
|
+
/**
|
6
|
+
* BUILD_ASSERT - assert a build-time dependency.
|
7
|
+
* @cond: the compile-time condition which must be true.
|
8
|
+
*
|
9
|
+
* Your compile will fail if the condition isn't true, or can't be evaluated
|
10
|
+
* by the compiler. This can only be used within a function.
|
11
|
+
*
|
12
|
+
* Example:
|
13
|
+
* #include <stddef.h>
|
14
|
+
* ...
|
15
|
+
* static char *foo_to_char(struct foo *foo)
|
16
|
+
* {
|
17
|
+
* // This code needs string to be at start of foo.
|
18
|
+
* BUILD_ASSERT(offsetof(struct foo, string) == 0);
|
19
|
+
* return (char *)foo;
|
20
|
+
* }
|
21
|
+
*/
|
22
|
+
#define BUILD_ASSERT(cond) \
|
23
|
+
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
|
24
|
+
|
25
|
+
/**
|
26
|
+
* BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
|
27
|
+
* @cond: the compile-time condition which must be true.
|
28
|
+
*
|
29
|
+
* Your compile will fail if the condition isn't true, or can't be evaluated
|
30
|
+
* by the compiler. This can be used in an expression: its value is "0".
|
31
|
+
*
|
32
|
+
* Example:
|
33
|
+
* #define foo_to_char(foo) \
|
34
|
+
* ((char *)(foo) \
|
35
|
+
* + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
|
36
|
+
*/
|
37
|
+
#define BUILD_ASSERT_OR_ZERO(cond) \
|
38
|
+
(sizeof(char [1 - 2*!(cond)]) - 1)
|
39
|
+
|
40
|
+
#endif /* CCAN_BUILD_ASSERT_H */
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
|
2
|
+
#ifndef CCAN_CHECK_TYPE_H
|
3
|
+
#define CCAN_CHECK_TYPE_H
|
4
|
+
|
5
|
+
/**
|
6
|
+
* check_type - issue a warning or build failure if type is not correct.
|
7
|
+
* @expr: the expression whose type we should check (not evaluated).
|
8
|
+
* @type: the exact type we expect the expression to be.
|
9
|
+
*
|
10
|
+
* This macro is usually used within other macros to try to ensure that a macro
|
11
|
+
* argument is of the expected type. No type promotion of the expression is
|
12
|
+
* done: an unsigned int is not the same as an int!
|
13
|
+
*
|
14
|
+
* check_type() always evaluates to 0.
|
15
|
+
*
|
16
|
+
* If your compiler does not support typeof, then the best we can do is fail
|
17
|
+
* to compile if the sizes of the types are unequal (a less complete check).
|
18
|
+
*
|
19
|
+
* Example:
|
20
|
+
* // They should always pass a 64-bit value to _set_some_value!
|
21
|
+
* #define set_some_value(expr) \
|
22
|
+
* _set_some_value((check_type((expr), uint64_t), (expr)))
|
23
|
+
*/
|
24
|
+
|
25
|
+
/**
|
26
|
+
* check_types_match - issue a warning or build failure if types are not same.
|
27
|
+
* @expr1: the first expression (not evaluated).
|
28
|
+
* @expr2: the second expression (not evaluated).
|
29
|
+
*
|
30
|
+
* This macro is usually used within other macros to try to ensure that
|
31
|
+
* arguments are of identical types. No type promotion of the expressions is
|
32
|
+
* done: an unsigned int is not the same as an int!
|
33
|
+
*
|
34
|
+
* check_types_match() always evaluates to 0.
|
35
|
+
*
|
36
|
+
* If your compiler does not support typeof, then the best we can do is fail
|
37
|
+
* to compile if the sizes of the types are unequal (a less complete check).
|
38
|
+
*
|
39
|
+
* Example:
|
40
|
+
* // Do subtraction to get to enclosing type, but make sure that
|
41
|
+
* // pointer is of correct type for that member.
|
42
|
+
* #define container_of(mbr_ptr, encl_type, mbr) \
|
43
|
+
* (check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
|
44
|
+
* ((encl_type *) \
|
45
|
+
* ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
|
46
|
+
*/
|
47
|
+
#if HAVE_TYPEOF
|
48
|
+
#define check_type(expr, type) \
|
49
|
+
((typeof(expr) *)0 != (type *)0)
|
50
|
+
|
51
|
+
#define check_types_match(expr1, expr2) \
|
52
|
+
((typeof(expr1) *)0 != (typeof(expr2) *)0)
|
53
|
+
#else
|
54
|
+
#include "ccan/build_assert/build_assert.h"
|
55
|
+
/* Without typeof, we can only test the sizes. */
|
56
|
+
#define check_type(expr, type) \
|
57
|
+
BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
|
58
|
+
|
59
|
+
#define check_types_match(expr1, expr2) \
|
60
|
+
BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
|
61
|
+
#endif /* HAVE_TYPEOF */
|
62
|
+
|
63
|
+
#endif /* CCAN_CHECK_TYPE_H */
|