debase-ruby_core_source 0.10.7 → 0.10.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/Rakefile +6 -3
- data/debase-ruby_core_source.gemspec +2 -1
- data/lib/debase/ruby_core_source.rb +0 -1
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/builtin.h +78 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/constant.h +0 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/debug_counter.h +21 -9
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/eval_intern.h +1 -3
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/gc.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/hrtime.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/id.h +1 -3
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/insns.inc +6 -2
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/insns_info.inc +1471 -1888
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/internal.h +106 -91
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/iseq.h +5 -5
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/method.h +1 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/mjit.h +3 -5
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/mjit_compile.inc +768 -872
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/node.h +4 -11
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/node_name.inc +0 -2
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/parse.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regenc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regint.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regparse.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/revision.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ruby_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ruby_atomic.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/symbol.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/thread_pthread.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/transient_heap.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/variable.h +9 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/version.h +4 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm.inc +604 -407
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_call_iseq_optimized.inc +49 -49
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_core.h +42 -29
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_insnhelper.h +16 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_opts.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vmtc.inc +6 -2
- 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.h +107 -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/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-2.7.0-preview2 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optunifs.inc +0 -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/version.rb +1 -1
- metadata +181 -57
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +0 -2
@@ -0,0 +1,116 @@
|
|
1
|
+
#ifndef RUBY_DEBUG_H
|
2
|
+
#define RUBY_DEBUG_H
|
3
|
+
/**********************************************************************
|
4
|
+
|
5
|
+
vm_debug.h - YARV Debug function interface
|
6
|
+
|
7
|
+
$Author$
|
8
|
+
created at: 04/08/25 02:33:49 JST
|
9
|
+
|
10
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
11
|
+
|
12
|
+
**********************************************************************/
|
13
|
+
|
14
|
+
#include "ruby/ruby.h"
|
15
|
+
#include "node.h"
|
16
|
+
|
17
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
18
|
+
|
19
|
+
#define dpv(h,v) ruby_debug_print_value(-1, 0, (h), (v))
|
20
|
+
#define dp(v) ruby_debug_print_value(-1, 0, "", (v))
|
21
|
+
#define dpi(i) ruby_debug_print_id(-1, 0, "", (i))
|
22
|
+
#define dpn(n) ruby_debug_print_node(-1, 0, "", (n))
|
23
|
+
|
24
|
+
VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v);
|
25
|
+
ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id);
|
26
|
+
NODE *ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node);
|
27
|
+
int ruby_debug_print_indent(int level, int debug_level, int indent_level);
|
28
|
+
void ruby_debug_gc_check_func(void);
|
29
|
+
void ruby_set_debug_option(const char *str);
|
30
|
+
|
31
|
+
RUBY_SYMBOL_EXPORT_END
|
32
|
+
|
33
|
+
#if RUBY_DEVEL
|
34
|
+
#ifndef USE_RUBY_DEBUG_LOG
|
35
|
+
#define USE_RUBY_DEBUG_LOG 0
|
36
|
+
#endif
|
37
|
+
#else
|
38
|
+
// disable on !RUBY_DEVEL
|
39
|
+
#ifdef USE_RUBY_DEBUG_LOG
|
40
|
+
#undef USE_RUBY_DEBUG_LOG
|
41
|
+
#endif
|
42
|
+
#endif
|
43
|
+
|
44
|
+
/* RUBY_DEBUG_LOG: Logging debug information mechanism
|
45
|
+
*
|
46
|
+
* This feature provides a mechanism to store logging information
|
47
|
+
* to a file, stderr or memory space with simple macros.
|
48
|
+
*
|
49
|
+
* The following information will be stored.
|
50
|
+
* * (1) __FILE__, __LINE__ in C
|
51
|
+
* * (2) __FILE__, __LINE__ in Ruby
|
52
|
+
* * (3) __func__ in C (message title)
|
53
|
+
* * (4) given string with sprintf format
|
54
|
+
* * (5) Thread number (if multiple threads are running)
|
55
|
+
*
|
56
|
+
* This feature is enabled only USE_RUBY_DEBUG_LOG is enabled.
|
57
|
+
* Release version should not enable it.
|
58
|
+
*
|
59
|
+
* Running with the `RUBY_DEBUG_LOG` environment variable enables
|
60
|
+
* this feature.
|
61
|
+
*
|
62
|
+
* # logging into a file
|
63
|
+
* RUBY_DEBUG_LOG=/path/to/file STDERR
|
64
|
+
*
|
65
|
+
* # logging into STDERR
|
66
|
+
* RUBY_DEBUG_LOG=stderr
|
67
|
+
*
|
68
|
+
* # logging into memory space (check with a debugger)
|
69
|
+
* # It will help if the timing is important.
|
70
|
+
* RUBY_DEBUG_LOG=mem
|
71
|
+
*
|
72
|
+
* RUBY_DEBUG_LOG_FILTER environment variable can specify the filter string.
|
73
|
+
* If "(3) __func__ in C (message title)" contains the specified string, the
|
74
|
+
* information will be stored (example: RUBY_DEBUG_LOG_FILTER=str will enable
|
75
|
+
* only on str related information).
|
76
|
+
*
|
77
|
+
* In a MRI source code, you can use the following macros:
|
78
|
+
* * RUBY_DEBUG_LOG(fmt, ...): Above (1) to (4) will be logged.
|
79
|
+
* * RUBY_DEBUG_LOG2(file, line, fmt, ...):
|
80
|
+
* Same as RUBY_DEBUG_LOG(), but (1) will be replaced with given file, line.
|
81
|
+
*/
|
82
|
+
|
83
|
+
extern enum ruby_debug_log_mode {
|
84
|
+
ruby_debug_log_disabled = 0x00,
|
85
|
+
ruby_debug_log_memory = 0x01,
|
86
|
+
ruby_debug_log_stderr = 0x02,
|
87
|
+
ruby_debug_log_file = 0x04,
|
88
|
+
} ruby_debug_log_mode;
|
89
|
+
|
90
|
+
void ruby_debug_log(const char *file, int line, const char *func_name, const char *fmt, ...);
|
91
|
+
void ruby_debug_log_print(unsigned int n);
|
92
|
+
bool ruby_debug_log_filter(const char *func_name);
|
93
|
+
|
94
|
+
// convenient macro to log even if the USE_RUBY_DEBUG_LOG macro is not specified.
|
95
|
+
// You can use this macro for temporary usage (you should not commit it).
|
96
|
+
#define _RUBY_DEBUG_LOG(fmt, ...) ruby_debug_log(__FILE__, __LINE__, __func__, fmt, __VA_ARGS__)
|
97
|
+
|
98
|
+
#if USE_RUBY_DEBUG_LOG
|
99
|
+
|
100
|
+
#define RUBY_DEBUG_LOG(fmt, ...) do { \
|
101
|
+
if (ruby_debug_log_mode && ruby_debug_log_filter(__func__)) \
|
102
|
+
ruby_debug_log(__FILE__, __LINE__, __func__, fmt, __VA_ARGS__); \
|
103
|
+
} while (0)
|
104
|
+
|
105
|
+
#define RUBY_DEBUG_LOG2(file, line, fmt, ...) do { \
|
106
|
+
if (ruby_debug_log_mode && ruby_debug_log_filter(__func__)) \
|
107
|
+
ruby_debug_log(file, line, __func__, fmt, __VA_ARGS__); \
|
108
|
+
} while (0)
|
109
|
+
|
110
|
+
#else
|
111
|
+
// do nothing
|
112
|
+
#define RUBY_DEBUG_LOG(fmt, ...)
|
113
|
+
#define RUBY_DEBUG_LOG2(file, line, fmt, ...)
|
114
|
+
#endif // USE_RUBY_DEBUG_LOG
|
115
|
+
|
116
|
+
#endif /* RUBY_DEBUG_H */
|
@@ -0,0 +1,196 @@
|
|
1
|
+
#ifndef RUBY_VM_EXEC_H
|
2
|
+
#define RUBY_VM_EXEC_H
|
3
|
+
/**********************************************************************
|
4
|
+
|
5
|
+
vm.h -
|
6
|
+
|
7
|
+
$Author$
|
8
|
+
created at: 04/01/01 16:56:59 JST
|
9
|
+
|
10
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
11
|
+
|
12
|
+
**********************************************************************/
|
13
|
+
|
14
|
+
typedef long OFFSET;
|
15
|
+
typedef unsigned long lindex_t;
|
16
|
+
typedef VALUE GENTRY;
|
17
|
+
typedef rb_iseq_t *ISEQ;
|
18
|
+
|
19
|
+
#if VMDEBUG > 0
|
20
|
+
#define debugs printf
|
21
|
+
#define DEBUG_ENTER_INSN(insn) \
|
22
|
+
rb_vmdebug_debug_print_pre(ec, GET_CFP(), GET_PC());
|
23
|
+
|
24
|
+
#if OPT_STACK_CACHING
|
25
|
+
#define SC_REGS() , reg_a, reg_b
|
26
|
+
#else
|
27
|
+
#define SC_REGS()
|
28
|
+
#endif
|
29
|
+
|
30
|
+
#define DEBUG_END_INSN() \
|
31
|
+
rb_vmdebug_debug_print_post(ec, GET_CFP() SC_REGS());
|
32
|
+
|
33
|
+
#else
|
34
|
+
|
35
|
+
#define debugs
|
36
|
+
#define DEBUG_ENTER_INSN(insn)
|
37
|
+
#define DEBUG_END_INSN()
|
38
|
+
#endif
|
39
|
+
|
40
|
+
#define throwdebug if(0)printf
|
41
|
+
/* #define throwdebug printf */
|
42
|
+
|
43
|
+
#ifndef USE_INSNS_COUNTER
|
44
|
+
#define USE_INSNS_COUNTER 0
|
45
|
+
#endif
|
46
|
+
|
47
|
+
/************************************************/
|
48
|
+
#if defined(DISPATCH_XXX)
|
49
|
+
error !
|
50
|
+
/************************************************/
|
51
|
+
#elif OPT_CALL_THREADED_CODE
|
52
|
+
|
53
|
+
#define LABEL(x) insn_func_##x
|
54
|
+
#define ELABEL(x)
|
55
|
+
#define LABEL_PTR(x) &LABEL(x)
|
56
|
+
|
57
|
+
#define INSN_ENTRY(insn) \
|
58
|
+
static rb_control_frame_t * \
|
59
|
+
FUNC_FASTCALL(LABEL(insn))(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp) {
|
60
|
+
|
61
|
+
#define END_INSN(insn) return reg_cfp;}
|
62
|
+
|
63
|
+
#define NEXT_INSN() return reg_cfp;
|
64
|
+
|
65
|
+
#define START_OF_ORIGINAL_INSN(x) /* ignore */
|
66
|
+
#define DISPATCH_ORIGINAL_INSN(x) return LABEL(x)(ec, reg_cfp);
|
67
|
+
|
68
|
+
/************************************************/
|
69
|
+
#elif OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE
|
70
|
+
/* threaded code with gcc */
|
71
|
+
|
72
|
+
#define LABEL(x) INSN_LABEL_##x
|
73
|
+
#define ELABEL(x) INSN_ELABEL_##x
|
74
|
+
#define LABEL_PTR(x) RB_GNUC_EXTENSION(&&LABEL(x))
|
75
|
+
|
76
|
+
#define INSN_ENTRY_SIG(insn) \
|
77
|
+
if (0) fprintf(stderr, "exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \
|
78
|
+
(reg_pc - reg_cfp->iseq->body->iseq_encoded), \
|
79
|
+
(reg_cfp->pc - reg_cfp->iseq->body->iseq_encoded), \
|
80
|
+
RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \
|
81
|
+
rb_iseq_line_no(reg_cfp->iseq, reg_pc - reg_cfp->iseq->body->iseq_encoded)); \
|
82
|
+
if (USE_INSNS_COUNTER) vm_insns_counter_count_insn(BIN(insn));
|
83
|
+
|
84
|
+
#define INSN_DISPATCH_SIG(insn)
|
85
|
+
|
86
|
+
#define INSN_ENTRY(insn) \
|
87
|
+
LABEL(insn): \
|
88
|
+
INSN_ENTRY_SIG(insn); \
|
89
|
+
|
90
|
+
/**********************************/
|
91
|
+
#if OPT_DIRECT_THREADED_CODE
|
92
|
+
|
93
|
+
/* for GCC 3.4.x */
|
94
|
+
#define TC_DISPATCH(insn) \
|
95
|
+
INSN_DISPATCH_SIG(insn); \
|
96
|
+
RB_GNUC_EXTENSION_BLOCK(goto *(void const *)GET_CURRENT_INSN()); \
|
97
|
+
;
|
98
|
+
|
99
|
+
#else
|
100
|
+
/* token threaded code */
|
101
|
+
|
102
|
+
/* dispatcher */
|
103
|
+
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3
|
104
|
+
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
|
105
|
+
__asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr))
|
106
|
+
|
107
|
+
#else
|
108
|
+
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
|
109
|
+
/* do nothing */
|
110
|
+
#endif
|
111
|
+
#define TC_DISPATCH(insn) \
|
112
|
+
DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \
|
113
|
+
INSN_DISPATCH_SIG(insn); \
|
114
|
+
RB_GNUC_EXTENSION_BLOCK(goto *insns_address_table[GET_CURRENT_INSN()]); \
|
115
|
+
rb_bug("tc error");
|
116
|
+
|
117
|
+
#endif /* OPT_DIRECT_THREADED_CODE */
|
118
|
+
|
119
|
+
#define END_INSN(insn) \
|
120
|
+
DEBUG_END_INSN(); \
|
121
|
+
TC_DISPATCH(insn);
|
122
|
+
|
123
|
+
#define INSN_DISPATCH() \
|
124
|
+
TC_DISPATCH(__START__) \
|
125
|
+
{
|
126
|
+
|
127
|
+
#define END_INSNS_DISPATCH() \
|
128
|
+
rb_bug("unknown insn: %"PRIdVALUE, GET_CURRENT_INSN()); \
|
129
|
+
} /* end of while loop */ \
|
130
|
+
|
131
|
+
#define NEXT_INSN() TC_DISPATCH(__NEXT_INSN__)
|
132
|
+
|
133
|
+
#define START_OF_ORIGINAL_INSN(x) start_of_##x:
|
134
|
+
#define DISPATCH_ORIGINAL_INSN(x) goto start_of_##x;
|
135
|
+
|
136
|
+
/************************************************/
|
137
|
+
#else /* no threaded code */
|
138
|
+
/* most common method */
|
139
|
+
|
140
|
+
#define INSN_ENTRY(insn) \
|
141
|
+
case BIN(insn):
|
142
|
+
|
143
|
+
#define END_INSN(insn) \
|
144
|
+
DEBUG_END_INSN(); \
|
145
|
+
break;
|
146
|
+
|
147
|
+
#define INSN_DISPATCH() \
|
148
|
+
while (1) { \
|
149
|
+
switch (GET_CURRENT_INSN()) {
|
150
|
+
|
151
|
+
#define END_INSNS_DISPATCH() \
|
152
|
+
default: \
|
153
|
+
SDR(); \
|
154
|
+
rb_bug("unknown insn: %ld", GET_CURRENT_INSN()); \
|
155
|
+
} /* end of switch */ \
|
156
|
+
} /* end of while loop */ \
|
157
|
+
|
158
|
+
#define NEXT_INSN() goto first
|
159
|
+
|
160
|
+
#define START_OF_ORIGINAL_INSN(x) start_of_##x:
|
161
|
+
#define DISPATCH_ORIGINAL_INSN(x) goto start_of_##x;
|
162
|
+
|
163
|
+
#endif
|
164
|
+
|
165
|
+
#define VM_SP_CNT(ec, sp) ((sp) - (ec)->vm_stack)
|
166
|
+
|
167
|
+
#ifdef MJIT_HEADER
|
168
|
+
#define THROW_EXCEPTION(exc) do { \
|
169
|
+
ec->errinfo = (VALUE)(exc); \
|
170
|
+
EC_JUMP_TAG(ec, ec->tag->state); \
|
171
|
+
} while (0)
|
172
|
+
#else
|
173
|
+
#if OPT_CALL_THREADED_CODE
|
174
|
+
#define THROW_EXCEPTION(exc) do { \
|
175
|
+
ec->errinfo = (VALUE)(exc); \
|
176
|
+
return 0; \
|
177
|
+
} while (0)
|
178
|
+
#else
|
179
|
+
#define THROW_EXCEPTION(exc) return (VALUE)(exc)
|
180
|
+
#endif
|
181
|
+
#endif
|
182
|
+
|
183
|
+
#define SCREG(r) (reg_##r)
|
184
|
+
|
185
|
+
#define VM_DEBUG_STACKOVERFLOW 0
|
186
|
+
|
187
|
+
#if VM_DEBUG_STACKOVERFLOW
|
188
|
+
#define CHECK_VM_STACK_OVERFLOW_FOR_INSN CHECK_VM_STACK_OVERFLOW
|
189
|
+
#else
|
190
|
+
#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin)
|
191
|
+
#endif
|
192
|
+
|
193
|
+
#define INSN_LABEL2(insn, name) INSN_LABEL_ ## insn ## _ ## name
|
194
|
+
#define INSN_LABEL(x) INSN_LABEL2(NAME_OF_CURRENT_INSN, x)
|
195
|
+
|
196
|
+
#endif /* RUBY_VM_EXEC_H */
|
@@ -0,0 +1,257 @@
|
|
1
|
+
#ifndef RUBY_INSNHELPER_H
|
2
|
+
#define RUBY_INSNHELPER_H
|
3
|
+
/**********************************************************************
|
4
|
+
|
5
|
+
insnhelper.h - helper macros to implement each instructions
|
6
|
+
|
7
|
+
$Author$
|
8
|
+
created at: 04/01/01 15:50:34 JST
|
9
|
+
|
10
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
11
|
+
|
12
|
+
**********************************************************************/
|
13
|
+
|
14
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
15
|
+
|
16
|
+
RUBY_EXTERN VALUE ruby_vm_const_missing_count;
|
17
|
+
RUBY_EXTERN rb_serial_t ruby_vm_global_constant_state;
|
18
|
+
RUBY_EXTERN rb_serial_t ruby_vm_class_serial;
|
19
|
+
|
20
|
+
RUBY_SYMBOL_EXPORT_END
|
21
|
+
|
22
|
+
#if VM_COLLECT_USAGE_DETAILS
|
23
|
+
#define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn)
|
24
|
+
#define COLLECT_USAGE_OPERAND(insn, n, op) vm_collect_usage_operand((insn), (n), ((VALUE)(op)))
|
25
|
+
|
26
|
+
#define COLLECT_USAGE_REGISTER(reg, s) vm_collect_usage_register((reg), (s))
|
27
|
+
#else
|
28
|
+
#define COLLECT_USAGE_INSN(insn) /* none */
|
29
|
+
#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */
|
30
|
+
#define COLLECT_USAGE_REGISTER(reg, s) /* none */
|
31
|
+
#endif
|
32
|
+
|
33
|
+
/**********************************************************/
|
34
|
+
/* deal with stack */
|
35
|
+
/**********************************************************/
|
36
|
+
|
37
|
+
#define PUSH(x) (SET_SV(x), INC_SP(1))
|
38
|
+
#define TOPN(n) (*(GET_SP()-(n)-1))
|
39
|
+
#define POPN(n) (DEC_SP(n))
|
40
|
+
#define POP() (DEC_SP(1))
|
41
|
+
#define STACK_ADDR_FROM_TOP(n) (GET_SP()-(n))
|
42
|
+
|
43
|
+
/**********************************************************/
|
44
|
+
/* deal with registers */
|
45
|
+
/**********************************************************/
|
46
|
+
|
47
|
+
#define VM_REG_CFP (reg_cfp)
|
48
|
+
#define VM_REG_PC (VM_REG_CFP->pc)
|
49
|
+
#define VM_REG_SP (VM_REG_CFP->sp)
|
50
|
+
#define VM_REG_EP (VM_REG_CFP->ep)
|
51
|
+
|
52
|
+
#define RESTORE_REGS() do { \
|
53
|
+
VM_REG_CFP = ec->cfp; \
|
54
|
+
} while (0)
|
55
|
+
|
56
|
+
#if VM_COLLECT_USAGE_DETAILS
|
57
|
+
enum vm_regan_regtype {
|
58
|
+
VM_REGAN_PC = 0,
|
59
|
+
VM_REGAN_SP = 1,
|
60
|
+
VM_REGAN_EP = 2,
|
61
|
+
VM_REGAN_CFP = 3,
|
62
|
+
VM_REGAN_SELF = 4,
|
63
|
+
VM_REGAN_ISEQ = 5
|
64
|
+
};
|
65
|
+
enum vm_regan_acttype {
|
66
|
+
VM_REGAN_ACT_GET = 0,
|
67
|
+
VM_REGAN_ACT_SET = 1
|
68
|
+
};
|
69
|
+
|
70
|
+
#define COLLECT_USAGE_REGISTER_HELPER(a, b, v) \
|
71
|
+
(COLLECT_USAGE_REGISTER((VM_REGAN_##a), (VM_REGAN_ACT_##b)), (v))
|
72
|
+
#else
|
73
|
+
#define COLLECT_USAGE_REGISTER_HELPER(a, b, v) (v)
|
74
|
+
#endif
|
75
|
+
|
76
|
+
/* PC */
|
77
|
+
#define GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, VM_REG_PC))
|
78
|
+
#define SET_PC(x) (VM_REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x))))
|
79
|
+
#define GET_CURRENT_INSN() (*GET_PC())
|
80
|
+
#define GET_OPERAND(n) (GET_PC()[(n)])
|
81
|
+
#define ADD_PC(n) (SET_PC(VM_REG_PC + (n)))
|
82
|
+
#define JUMP(dst) (SET_PC(VM_REG_PC + (dst)))
|
83
|
+
|
84
|
+
/* frame pointer, environment pointer */
|
85
|
+
#define GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, VM_REG_CFP))
|
86
|
+
#define GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, VM_REG_EP))
|
87
|
+
#define SET_EP(x) (VM_REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x))))
|
88
|
+
#define GET_LEP() (VM_EP_LEP(GET_EP()))
|
89
|
+
|
90
|
+
/* SP */
|
91
|
+
#define GET_SP() (COLLECT_USAGE_REGISTER_HELPER(SP, GET, VM_REG_SP))
|
92
|
+
#define SET_SP(x) (VM_REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
|
93
|
+
#define INC_SP(x) (VM_REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
|
94
|
+
#define DEC_SP(x) (VM_REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
|
95
|
+
#define SET_SV(x) (*GET_SP() = rb_ractor_confirm_belonging(x))
|
96
|
+
/* set current stack value as x */
|
97
|
+
|
98
|
+
/* instruction sequence C struct */
|
99
|
+
#define GET_ISEQ() (GET_CFP()->iseq)
|
100
|
+
|
101
|
+
/**********************************************************/
|
102
|
+
/* deal with variables */
|
103
|
+
/**********************************************************/
|
104
|
+
|
105
|
+
#define GET_PREV_EP(ep) ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03))
|
106
|
+
|
107
|
+
/**********************************************************/
|
108
|
+
/* deal with values */
|
109
|
+
/**********************************************************/
|
110
|
+
|
111
|
+
#define GET_SELF() (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self))
|
112
|
+
|
113
|
+
/**********************************************************/
|
114
|
+
/* deal with control flow 2: method/iterator */
|
115
|
+
/**********************************************************/
|
116
|
+
|
117
|
+
/* set fastpath when cached method is *NOT* protected
|
118
|
+
* because inline method cache does not care about receiver.
|
119
|
+
*/
|
120
|
+
|
121
|
+
static inline void
|
122
|
+
CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enabled)
|
123
|
+
{
|
124
|
+
if (LIKELY(enabled)) {
|
125
|
+
vm_cc_call_set(cc, func);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
#define GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL])
|
130
|
+
|
131
|
+
/**********************************************************/
|
132
|
+
/* deal with control flow 3: exception */
|
133
|
+
/**********************************************************/
|
134
|
+
|
135
|
+
|
136
|
+
/**********************************************************/
|
137
|
+
/* deal with stack canary */
|
138
|
+
/**********************************************************/
|
139
|
+
|
140
|
+
#if VM_CHECK_MODE > 0
|
141
|
+
#define SETUP_CANARY(cond) \
|
142
|
+
VALUE *canary = 0; \
|
143
|
+
if (cond) { \
|
144
|
+
canary = GET_SP(); \
|
145
|
+
SET_SV(vm_stack_canary); \
|
146
|
+
} \
|
147
|
+
else {\
|
148
|
+
SET_SV(Qfalse); /* cleanup */ \
|
149
|
+
}
|
150
|
+
#define CHECK_CANARY(cond, insn) \
|
151
|
+
if (cond) { \
|
152
|
+
if (*canary == vm_stack_canary) { \
|
153
|
+
*canary = Qfalse; /* cleanup */ \
|
154
|
+
} \
|
155
|
+
else { \
|
156
|
+
vm_canary_is_found_dead(insn, *canary); \
|
157
|
+
} \
|
158
|
+
}
|
159
|
+
#else
|
160
|
+
#define SETUP_CANARY(cond) if (cond) {} else {}
|
161
|
+
#define CHECK_CANARY(cond, insn) if (cond) {(void)(insn);}
|
162
|
+
#endif
|
163
|
+
|
164
|
+
/**********************************************************/
|
165
|
+
/* others */
|
166
|
+
/**********************************************************/
|
167
|
+
|
168
|
+
#ifndef MJIT_HEADER
|
169
|
+
#define CALL_SIMPLE_METHOD() do { \
|
170
|
+
rb_snum_t x = leaf ? INSN_ATTR(width) : 0; \
|
171
|
+
rb_snum_t y = attr_width_opt_send_without_block(0); \
|
172
|
+
rb_snum_t z = x - y; \
|
173
|
+
ADD_PC(z); \
|
174
|
+
DISPATCH_ORIGINAL_INSN(opt_send_without_block); \
|
175
|
+
} while (0)
|
176
|
+
#endif
|
177
|
+
|
178
|
+
#define PREV_CLASS_SERIAL() (ruby_vm_class_serial)
|
179
|
+
#define NEXT_CLASS_SERIAL() (++ruby_vm_class_serial)
|
180
|
+
#define GET_GLOBAL_CONSTANT_STATE() (ruby_vm_global_constant_state)
|
181
|
+
#define INC_GLOBAL_CONSTANT_STATE() (++ruby_vm_global_constant_state)
|
182
|
+
|
183
|
+
static inline struct vm_throw_data *
|
184
|
+
THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, int st)
|
185
|
+
{
|
186
|
+
struct vm_throw_data *obj = (struct vm_throw_data *)rb_imemo_new(imemo_throw_data, val, (VALUE)cf, 0, 0);
|
187
|
+
obj->throw_state = st;
|
188
|
+
return obj;
|
189
|
+
}
|
190
|
+
|
191
|
+
static inline VALUE
|
192
|
+
THROW_DATA_VAL(const struct vm_throw_data *obj)
|
193
|
+
{
|
194
|
+
VM_ASSERT(THROW_DATA_P(obj));
|
195
|
+
return obj->throw_obj;
|
196
|
+
}
|
197
|
+
|
198
|
+
static inline const rb_control_frame_t *
|
199
|
+
THROW_DATA_CATCH_FRAME(const struct vm_throw_data *obj)
|
200
|
+
{
|
201
|
+
VM_ASSERT(THROW_DATA_P(obj));
|
202
|
+
return obj->catch_frame;
|
203
|
+
}
|
204
|
+
|
205
|
+
static inline int
|
206
|
+
THROW_DATA_STATE(const struct vm_throw_data *obj)
|
207
|
+
{
|
208
|
+
VM_ASSERT(THROW_DATA_P(obj));
|
209
|
+
return obj->throw_state;
|
210
|
+
}
|
211
|
+
|
212
|
+
static inline int
|
213
|
+
THROW_DATA_CONSUMED_P(const struct vm_throw_data *obj)
|
214
|
+
{
|
215
|
+
VM_ASSERT(THROW_DATA_P(obj));
|
216
|
+
return obj->flags & THROW_DATA_CONSUMED;
|
217
|
+
}
|
218
|
+
|
219
|
+
static inline void
|
220
|
+
THROW_DATA_CATCH_FRAME_SET(struct vm_throw_data *obj, const rb_control_frame_t *cfp)
|
221
|
+
{
|
222
|
+
VM_ASSERT(THROW_DATA_P(obj));
|
223
|
+
obj->catch_frame = cfp;
|
224
|
+
}
|
225
|
+
|
226
|
+
static inline void
|
227
|
+
THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st)
|
228
|
+
{
|
229
|
+
VM_ASSERT(THROW_DATA_P(obj));
|
230
|
+
obj->throw_state = st;
|
231
|
+
}
|
232
|
+
|
233
|
+
static inline void
|
234
|
+
THROW_DATA_CONSUMED_SET(struct vm_throw_data *obj)
|
235
|
+
{
|
236
|
+
if (THROW_DATA_P(obj) &&
|
237
|
+
THROW_DATA_STATE(obj) == TAG_BREAK) {
|
238
|
+
obj->flags |= THROW_DATA_CONSUMED;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
#define IS_ARGS_SPLAT(ci) (vm_ci_flag(ci) & VM_CALL_ARGS_SPLAT)
|
243
|
+
#define IS_ARGS_KEYWORD(ci) (vm_ci_flag(ci) & VM_CALL_KWARG)
|
244
|
+
#define IS_ARGS_KW_SPLAT(ci) (vm_ci_flag(ci) & VM_CALL_KW_SPLAT)
|
245
|
+
#define IS_ARGS_KW_OR_KW_SPLAT(ci) (vm_ci_flag(ci) & (VM_CALL_KWARG | VM_CALL_KW_SPLAT))
|
246
|
+
#define IS_ARGS_KW_SPLAT_MUT(ci) (vm_ci_flag(ci) & VM_CALL_KW_SPLAT_MUT)
|
247
|
+
|
248
|
+
/* If this returns true, an optimized function returned by `vm_call_iseq_setup_func`
|
249
|
+
can be used as a fastpath. */
|
250
|
+
static inline bool
|
251
|
+
vm_call_iseq_optimizable_p(const struct rb_callinfo *ci, const struct rb_callcache *cc)
|
252
|
+
{
|
253
|
+
return !IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) &&
|
254
|
+
METHOD_ENTRY_CACHEABLE(vm_cc_cme(cc));
|
255
|
+
}
|
256
|
+
|
257
|
+
#endif /* RUBY_INSNHELPER_H */
|