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,54 @@
|
|
1
|
+
#ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_THREAD_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for Thread.
|
11
|
+
*/
|
12
|
+
#include "ruby/ruby.h" /* for VALUE */
|
13
|
+
#include "ruby/intern.h" /* for rb_blocking_function_t */
|
14
|
+
|
15
|
+
struct rb_thread_struct; /* in vm_core.h */
|
16
|
+
|
17
|
+
/* thread.c */
|
18
|
+
#define COVERAGE_INDEX_LINES 0
|
19
|
+
#define COVERAGE_INDEX_BRANCHES 1
|
20
|
+
#define COVERAGE_TARGET_LINES 1
|
21
|
+
#define COVERAGE_TARGET_BRANCHES 2
|
22
|
+
#define COVERAGE_TARGET_METHODS 4
|
23
|
+
#define COVERAGE_TARGET_ONESHOT_LINES 8
|
24
|
+
|
25
|
+
VALUE rb_obj_is_mutex(VALUE obj);
|
26
|
+
VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
|
27
|
+
void rb_thread_execute_interrupts(VALUE th);
|
28
|
+
VALUE rb_get_coverages(void);
|
29
|
+
int rb_get_coverage_mode(void);
|
30
|
+
VALUE rb_default_coverage(int);
|
31
|
+
VALUE rb_thread_shield_new(void);
|
32
|
+
VALUE rb_thread_shield_wait(VALUE self);
|
33
|
+
VALUE rb_thread_shield_release(VALUE self);
|
34
|
+
VALUE rb_thread_shield_destroy(VALUE self);
|
35
|
+
int rb_thread_to_be_killed(VALUE thread);
|
36
|
+
void rb_mutex_allow_trap(VALUE self, int val);
|
37
|
+
VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
|
38
|
+
VALUE rb_mutex_owned_p(VALUE self);
|
39
|
+
|
40
|
+
int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
|
41
|
+
|
42
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
43
|
+
/* Temporary. This API will be removed (renamed). */
|
44
|
+
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
|
45
|
+
|
46
|
+
/* thread.c (export) */
|
47
|
+
int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
|
48
|
+
RUBY_SYMBOL_EXPORT_END
|
49
|
+
|
50
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
51
|
+
int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
|
52
|
+
MJIT_SYMBOL_EXPORT_END
|
53
|
+
|
54
|
+
#endif /* INTERNAL_THREAD_H */
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#ifndef INTERNAL_TIME_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_TIME_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for Time.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/config.h" /* for SIGNEDNESS_OF_TIME_T */
|
13
|
+
#include "internal/bits.h" /* for SIGNED_INTEGER_MAX */
|
14
|
+
#include "ruby/ruby.h" /* for VALUE */
|
15
|
+
|
16
|
+
#if SIGNEDNESS_OF_TIME_T < 0 /* signed */
|
17
|
+
# define TIMET_MAX SIGNED_INTEGER_MAX(time_t)
|
18
|
+
# define TIMET_MIN SIGNED_INTEGER_MIN(time_t)
|
19
|
+
#elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */
|
20
|
+
# define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t)
|
21
|
+
# define TIMET_MIN ((time_t)0)
|
22
|
+
#endif
|
23
|
+
|
24
|
+
struct timeval; /* <- in <sys/time.h> or <winsock2.h> */
|
25
|
+
|
26
|
+
/* time.c */
|
27
|
+
struct timeval rb_time_timeval(VALUE);
|
28
|
+
|
29
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
30
|
+
/* time.c (export) */
|
31
|
+
void ruby_reset_leap_second_info(void);
|
32
|
+
void ruby_reset_timezone(void);
|
33
|
+
RUBY_SYMBOL_EXPORT_END
|
34
|
+
|
35
|
+
#endif /* INTERNAL_TIME_H */
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#ifndef INTERNAL_TRANSCODE_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_TRANSCODE_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for Encoding::Converter.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/config.h"
|
13
|
+
#include <stddef.h> /* for size_t */
|
14
|
+
#include "ruby/ruby.h" /* for VALUE */
|
15
|
+
#include "ruby/encoding.h" /* for rb_econv_t */
|
16
|
+
|
17
|
+
/* transcode.c */
|
18
|
+
extern VALUE rb_cEncodingConverter;
|
19
|
+
size_t rb_econv_memsize(rb_econv_t *);
|
20
|
+
|
21
|
+
#endif /* INTERNAL_TRANSCODE_H */
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#ifndef INTERNAL_UTIL_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_UTIL_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header corresponding util.c.
|
11
|
+
* @warning DO NOT ADD RANDOM GARBAGE HERE THIS FILE IS FOR util.c
|
12
|
+
*/
|
13
|
+
#include "ruby/internal/config.h"
|
14
|
+
#include <stddef.h> /* for size_t */
|
15
|
+
|
16
|
+
#ifdef HAVE_SYS_TYPES_H
|
17
|
+
# include <sys/types.h> /* for ssize_t (note: on Windows ssize_t is */
|
18
|
+
#endif /* `#define`d in ruby/config.h) */
|
19
|
+
|
20
|
+
/* util.c */
|
21
|
+
char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
|
22
|
+
char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve);
|
23
|
+
|
24
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
25
|
+
/* util.c (export) */
|
26
|
+
extern const signed char ruby_digit36_to_number_table[];
|
27
|
+
extern const char ruby_hexdigits[];
|
28
|
+
extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
|
29
|
+
RUBY_SYMBOL_EXPORT_END
|
30
|
+
|
31
|
+
#endif /* INTERNAL_UTIL_H */
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#ifndef INTERNAL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_VARIABLE_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for variables.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/config.h"
|
13
|
+
#include <stddef.h> /* for size_t */
|
14
|
+
#include "constant.h" /* for rb_const_entry_t */
|
15
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
16
|
+
#include "ruby/ruby.h" /* for VALUE */
|
17
|
+
|
18
|
+
/* global variable */
|
19
|
+
|
20
|
+
#define ROBJECT_TRANSIENT_FLAG FL_USER13
|
21
|
+
|
22
|
+
/* variable.c */
|
23
|
+
void rb_gc_mark_global_tbl(void);
|
24
|
+
void rb_gc_update_global_tbl(void);
|
25
|
+
size_t rb_generic_ivar_memsize(VALUE);
|
26
|
+
VALUE rb_search_class_path(VALUE);
|
27
|
+
VALUE rb_attr_delete(VALUE, ID);
|
28
|
+
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
|
29
|
+
void rb_autoload_str(VALUE mod, ID id, VALUE file);
|
30
|
+
VALUE rb_autoload_at_p(VALUE, ID, int);
|
31
|
+
NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
|
32
|
+
rb_gvar_getter_t *rb_gvar_getter_function_of(ID);
|
33
|
+
rb_gvar_setter_t *rb_gvar_setter_function_of(ID);
|
34
|
+
void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
|
35
|
+
void rb_gvar_ractor_local(const char *name);
|
36
|
+
static inline bool ROBJ_TRANSIENT_P(VALUE obj);
|
37
|
+
static inline void ROBJ_TRANSIENT_SET(VALUE obj);
|
38
|
+
static inline void ROBJ_TRANSIENT_UNSET(VALUE obj);
|
39
|
+
|
40
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
41
|
+
/* variable.c (export) */
|
42
|
+
void rb_mark_generic_ivar(VALUE);
|
43
|
+
void rb_mv_generic_ivar(VALUE src, VALUE dst);
|
44
|
+
VALUE rb_const_missing(VALUE klass, VALUE name);
|
45
|
+
int rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
|
46
|
+
void rb_iv_tbl_copy(VALUE dst, VALUE src);
|
47
|
+
void rb_deprecate_constant(VALUE mod, const char *name);
|
48
|
+
RUBY_SYMBOL_EXPORT_END
|
49
|
+
|
50
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
51
|
+
VALUE rb_gvar_get(ID);
|
52
|
+
VALUE rb_gvar_set(ID, VALUE);
|
53
|
+
VALUE rb_gvar_defined(ID);
|
54
|
+
void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID);
|
55
|
+
void rb_init_iv_list(VALUE obj);
|
56
|
+
MJIT_SYMBOL_EXPORT_END
|
57
|
+
|
58
|
+
static inline bool
|
59
|
+
ROBJ_TRANSIENT_P(VALUE obj)
|
60
|
+
{
|
61
|
+
#if USE_TRANSIENT_HEAP
|
62
|
+
return FL_TEST_RAW(obj, ROBJECT_TRANSIENT_FLAG);
|
63
|
+
#else
|
64
|
+
return false;
|
65
|
+
#endif
|
66
|
+
}
|
67
|
+
|
68
|
+
static inline void
|
69
|
+
ROBJ_TRANSIENT_SET(VALUE obj)
|
70
|
+
{
|
71
|
+
#if USE_TRANSIENT_HEAP
|
72
|
+
FL_SET_RAW(obj, ROBJECT_TRANSIENT_FLAG);
|
73
|
+
#endif
|
74
|
+
}
|
75
|
+
|
76
|
+
static inline void
|
77
|
+
ROBJ_TRANSIENT_UNSET(VALUE obj)
|
78
|
+
{
|
79
|
+
#if USE_TRANSIENT_HEAP
|
80
|
+
FL_UNSET_RAW(obj, ROBJECT_TRANSIENT_FLAG);
|
81
|
+
#endif
|
82
|
+
}
|
83
|
+
|
84
|
+
#endif /* INTERNAL_VARIABLE_H */
|
@@ -0,0 +1,136 @@
|
|
1
|
+
#ifndef INTERNAL_VM_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_VM_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for RubyVM.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
13
|
+
#include "internal/serial.h" /* for rb_serial_t */
|
14
|
+
#include "internal/static_assert.h" /* for STATIC_ASSERT */
|
15
|
+
#include "ruby/ruby.h" /* for ID */
|
16
|
+
#include "ruby/st.h" /* for st_table */
|
17
|
+
|
18
|
+
#ifdef rb_funcallv
|
19
|
+
# undef rb_funcallv
|
20
|
+
#endif
|
21
|
+
|
22
|
+
#ifdef rb_method_basic_definition_p
|
23
|
+
# undef rb_method_basic_definition_p
|
24
|
+
#endif
|
25
|
+
|
26
|
+
struct rb_callable_method_entry_struct; /* in method.h */
|
27
|
+
struct rb_method_definition_struct; /* in method.h */
|
28
|
+
struct rb_execution_context_struct; /* in vm_core.h */
|
29
|
+
struct rb_control_frame_struct; /* in vm_core.h */
|
30
|
+
struct rb_callinfo; /* in vm_core.h */
|
31
|
+
|
32
|
+
enum method_missing_reason {
|
33
|
+
MISSING_NOENTRY = 0x00,
|
34
|
+
MISSING_PRIVATE = 0x01,
|
35
|
+
MISSING_PROTECTED = 0x02,
|
36
|
+
MISSING_FCALL = 0x04,
|
37
|
+
MISSING_VCALL = 0x08,
|
38
|
+
MISSING_SUPER = 0x10,
|
39
|
+
MISSING_MISSING = 0x20,
|
40
|
+
MISSING_NONE = 0x40
|
41
|
+
};
|
42
|
+
|
43
|
+
/* vm_insnhelper.h */
|
44
|
+
rb_serial_t rb_next_class_serial(void);
|
45
|
+
|
46
|
+
/* vm.c */
|
47
|
+
VALUE rb_obj_is_thread(VALUE obj);
|
48
|
+
void rb_vm_mark(void *ptr);
|
49
|
+
void rb_vm_each_stack_value(void *ptr, void (*cb)(VALUE, void*), void *ctx);
|
50
|
+
PUREFUNC(VALUE rb_vm_top_self(void));
|
51
|
+
void rb_vm_inc_const_missing_count(void);
|
52
|
+
const void **rb_vm_get_insns_address_table(void);
|
53
|
+
VALUE rb_source_location(int *pline);
|
54
|
+
const char *rb_source_location_cstr(int *pline);
|
55
|
+
MJIT_STATIC void rb_vm_pop_cfunc_frame(void);
|
56
|
+
int rb_vm_add_root_module(VALUE module);
|
57
|
+
void rb_vm_check_redefinition_by_prepend(VALUE klass);
|
58
|
+
int rb_vm_check_optimizable_mid(VALUE mid);
|
59
|
+
VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
|
60
|
+
MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE);
|
61
|
+
PUREFUNC(st_table *rb_vm_fstring_table(void));
|
62
|
+
|
63
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
64
|
+
VALUE vm_exec(struct rb_execution_context_struct *, bool); /* used in JIT-ed code */
|
65
|
+
MJIT_SYMBOL_EXPORT_END
|
66
|
+
|
67
|
+
/* vm_eval.c */
|
68
|
+
VALUE rb_current_realfilepath(void);
|
69
|
+
VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE);
|
70
|
+
typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
|
71
|
+
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
|
72
|
+
rb_check_funcall_hook *hook, VALUE arg);
|
73
|
+
VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv,
|
74
|
+
rb_check_funcall_hook *hook, VALUE arg, int kw_splat);
|
75
|
+
const char *rb_type_str(enum ruby_value_type type);
|
76
|
+
VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
|
77
|
+
VALUE rb_check_funcall_basic_kw(VALUE, ID, VALUE, int, const VALUE*, int);
|
78
|
+
VALUE rb_yield_1(VALUE val);
|
79
|
+
VALUE rb_yield_force_blockarg(VALUE values);
|
80
|
+
VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
|
81
|
+
rb_block_call_func_t bl_proc, int min_argc, int max_argc,
|
82
|
+
VALUE data2);
|
83
|
+
|
84
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
85
|
+
VALUE rb_vm_call0(struct rb_execution_context_struct *ec, VALUE recv, ID id, int argc, const VALUE *argv, const struct rb_callable_method_entry_struct *me, int kw_splat);
|
86
|
+
VALUE rb_vm_call_kw(struct rb_execution_context_struct *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const struct rb_callable_method_entry_struct *me, int kw_splat);
|
87
|
+
VALUE rb_make_no_method_exception(VALUE exc, VALUE format, VALUE obj, int argc, const VALUE *argv, int priv);
|
88
|
+
MJIT_SYMBOL_EXPORT_END
|
89
|
+
|
90
|
+
/* vm_insnhelper.c */
|
91
|
+
VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
|
92
|
+
VALUE rb_eql_opt(VALUE obj1, VALUE obj2);
|
93
|
+
|
94
|
+
struct rb_iseq_struct;
|
95
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
96
|
+
const struct rb_callcache *rb_vm_search_method_slowpath(const struct rb_callinfo *ci, VALUE klass);
|
97
|
+
MJIT_SYMBOL_EXPORT_END
|
98
|
+
|
99
|
+
/* vm_method.c */
|
100
|
+
struct rb_execution_context_struct;
|
101
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
102
|
+
int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE klass, VALUE obj, ID id, int priv);
|
103
|
+
MJIT_SYMBOL_EXPORT_END
|
104
|
+
|
105
|
+
/* vm_dump.c */
|
106
|
+
void rb_print_backtrace(void);
|
107
|
+
|
108
|
+
/* vm_backtrace.c */
|
109
|
+
VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval);
|
110
|
+
VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval);
|
111
|
+
VALUE rb_vm_backtrace(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
|
112
|
+
VALUE rb_vm_backtrace_locations(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
|
113
|
+
VALUE rb_make_backtrace(void);
|
114
|
+
void rb_backtrace_print_as_bugreport(void);
|
115
|
+
int rb_backtrace_p(VALUE obj);
|
116
|
+
VALUE rb_backtrace_to_str_ary(VALUE obj);
|
117
|
+
VALUE rb_backtrace_to_location_ary(VALUE obj);
|
118
|
+
void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output);
|
119
|
+
|
120
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
121
|
+
VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec);
|
122
|
+
void rb_backtrace_use_iseq_first_lineno_for_last_location(VALUE self);
|
123
|
+
MJIT_SYMBOL_EXPORT_END
|
124
|
+
|
125
|
+
#define RUBY_DTRACE_CREATE_HOOK(name, arg) \
|
126
|
+
RUBY_DTRACE_HOOK(name##_CREATE, arg)
|
127
|
+
#define RUBY_DTRACE_HOOK(name, arg) \
|
128
|
+
do { \
|
129
|
+
if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
|
130
|
+
int dtrace_line; \
|
131
|
+
const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \
|
132
|
+
if (!dtrace_file) dtrace_file = ""; \
|
133
|
+
RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
|
134
|
+
} \
|
135
|
+
} while (0)
|
136
|
+
#endif /* INTERNAL_VM_H */
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#ifndef INTERNAL_WARNINGS_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_WARNINGS_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header to suppres / mandate warnings.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/warning_push.h"
|
13
|
+
#define COMPILER_WARNING_PUSH RBIMPL_WARNING_PUSH()
|
14
|
+
#define COMPILER_WARNING_POP RBIMPL_WARNING_POP()
|
15
|
+
#define COMPILER_WARNING_ERROR(flag) RBIMPL_WARNING_ERROR(flag)
|
16
|
+
#define COMPILER_WARNING_IGNORED(flag) RBIMPL_WARNING_IGNORED(flag)
|
17
|
+
#endif /* INTERNAL_WARNINGS_H */
|
@@ -0,0 +1,305 @@
|
|
1
|
+
#ifndef RUBY_ISEQ_H
|
2
|
+
#define RUBY_ISEQ_H 1
|
3
|
+
/**********************************************************************
|
4
|
+
|
5
|
+
iseq.h -
|
6
|
+
|
7
|
+
$Author$
|
8
|
+
created at: 04/01/01 23:36:57 JST
|
9
|
+
|
10
|
+
Copyright (C) 2004-2008 Koichi Sasada
|
11
|
+
|
12
|
+
**********************************************************************/
|
13
|
+
#include "internal/gc.h"
|
14
|
+
#include "vm_core.h"
|
15
|
+
|
16
|
+
RUBY_EXTERN const int ruby_api_version[];
|
17
|
+
#define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])
|
18
|
+
#define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1])
|
19
|
+
|
20
|
+
#ifndef rb_iseq_t
|
21
|
+
typedef struct rb_iseq_struct rb_iseq_t;
|
22
|
+
#define rb_iseq_t rb_iseq_t
|
23
|
+
#endif
|
24
|
+
|
25
|
+
extern const ID rb_iseq_shared_exc_local_tbl[];
|
26
|
+
|
27
|
+
#define ISEQ_COVERAGE(iseq) iseq->body->variable.coverage
|
28
|
+
#define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &iseq->body->variable.coverage, cov)
|
29
|
+
#define ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)
|
30
|
+
#define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)
|
31
|
+
|
32
|
+
#define ISEQ_PC2BRANCHINDEX(iseq) iseq->body->variable.pc2branchindex
|
33
|
+
#define ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &iseq->body->variable.pc2branchindex, h)
|
34
|
+
|
35
|
+
#define ISEQ_FLIP_CNT(iseq) (iseq)->body->variable.flip_count
|
36
|
+
|
37
|
+
static inline rb_snum_t
|
38
|
+
ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq)
|
39
|
+
{
|
40
|
+
rb_snum_t cnt = iseq->body->variable.flip_count;
|
41
|
+
iseq->body->variable.flip_count += 1;
|
42
|
+
return cnt;
|
43
|
+
}
|
44
|
+
|
45
|
+
static inline VALUE *
|
46
|
+
ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq)
|
47
|
+
{
|
48
|
+
return iseq->body->variable.original_iseq;
|
49
|
+
}
|
50
|
+
|
51
|
+
static inline void
|
52
|
+
ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq)
|
53
|
+
{
|
54
|
+
void *ptr = iseq->body->variable.original_iseq;
|
55
|
+
iseq->body->variable.original_iseq = NULL;
|
56
|
+
if (ptr) {
|
57
|
+
ruby_xfree(ptr);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
static inline VALUE *
|
62
|
+
ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
|
63
|
+
{
|
64
|
+
return iseq->body->variable.original_iseq =
|
65
|
+
ALLOC_N(VALUE, size);
|
66
|
+
}
|
67
|
+
|
68
|
+
#define ISEQ_TRACE_EVENTS (RUBY_EVENT_LINE | \
|
69
|
+
RUBY_EVENT_CLASS | \
|
70
|
+
RUBY_EVENT_END | \
|
71
|
+
RUBY_EVENT_CALL | \
|
72
|
+
RUBY_EVENT_RETURN| \
|
73
|
+
RUBY_EVENT_B_CALL| \
|
74
|
+
RUBY_EVENT_B_RETURN| \
|
75
|
+
RUBY_EVENT_COVERAGE_LINE| \
|
76
|
+
RUBY_EVENT_COVERAGE_BRANCH)
|
77
|
+
|
78
|
+
#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
|
79
|
+
#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2
|
80
|
+
#define ISEQ_TRANSLATED IMEMO_FL_USER3
|
81
|
+
#define ISEQ_MARKABLE_ISEQ IMEMO_FL_USER4
|
82
|
+
|
83
|
+
#define ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW(((VALUE)iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0)
|
84
|
+
|
85
|
+
struct iseq_compile_data {
|
86
|
+
/* GC is needed */
|
87
|
+
const VALUE err_info;
|
88
|
+
const VALUE catch_table_ary; /* Array */
|
89
|
+
|
90
|
+
/* GC is not needed */
|
91
|
+
struct iseq_label_data *start_label;
|
92
|
+
struct iseq_label_data *end_label;
|
93
|
+
struct iseq_label_data *redo_label;
|
94
|
+
const rb_iseq_t *current_block;
|
95
|
+
struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
|
96
|
+
struct {
|
97
|
+
struct iseq_compile_data_storage *storage_head;
|
98
|
+
struct iseq_compile_data_storage *storage_current;
|
99
|
+
} node;
|
100
|
+
struct {
|
101
|
+
struct iseq_compile_data_storage *storage_head;
|
102
|
+
struct iseq_compile_data_storage *storage_current;
|
103
|
+
} insn;
|
104
|
+
int loopval_popped; /* used by NODE_BREAK */
|
105
|
+
int last_line;
|
106
|
+
int label_no;
|
107
|
+
int node_level;
|
108
|
+
int isolated_depth;
|
109
|
+
unsigned int ci_index;
|
110
|
+
const rb_compile_option_t *option;
|
111
|
+
struct rb_id_table *ivar_cache_table;
|
112
|
+
const struct rb_builtin_function *builtin_function_table;
|
113
|
+
#if OPT_SUPPORT_JOKE
|
114
|
+
st_table *labels_table;
|
115
|
+
#endif
|
116
|
+
};
|
117
|
+
|
118
|
+
static inline struct iseq_compile_data *
|
119
|
+
ISEQ_COMPILE_DATA(const rb_iseq_t *iseq)
|
120
|
+
{
|
121
|
+
if (iseq->flags & ISEQ_USE_COMPILE_DATA) {
|
122
|
+
return iseq->aux.compile_data;
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
return NULL;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
static inline void
|
130
|
+
ISEQ_COMPILE_DATA_ALLOC(rb_iseq_t *iseq)
|
131
|
+
{
|
132
|
+
iseq->aux.compile_data = ZALLOC(struct iseq_compile_data);
|
133
|
+
iseq->flags |= ISEQ_USE_COMPILE_DATA;
|
134
|
+
}
|
135
|
+
|
136
|
+
static inline void
|
137
|
+
ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq)
|
138
|
+
{
|
139
|
+
iseq->flags &= ~ISEQ_USE_COMPILE_DATA;
|
140
|
+
iseq->aux.compile_data = NULL;
|
141
|
+
}
|
142
|
+
|
143
|
+
static inline rb_iseq_t *
|
144
|
+
iseq_imemo_alloc(void)
|
145
|
+
{
|
146
|
+
return (rb_iseq_t *)rb_imemo_new(imemo_iseq, 0, 0, 0, 0);
|
147
|
+
}
|
148
|
+
|
149
|
+
VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
|
150
|
+
void rb_ibf_load_iseq_complete(rb_iseq_t *iseq);
|
151
|
+
const rb_iseq_t *rb_iseq_ibf_load(VALUE str);
|
152
|
+
const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
|
153
|
+
VALUE rb_iseq_ibf_load_extra_data(VALUE str);
|
154
|
+
void rb_iseq_init_trace(rb_iseq_t *iseq);
|
155
|
+
int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line);
|
156
|
+
int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval);
|
157
|
+
const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
|
158
|
+
|
159
|
+
#if VM_INSN_INFO_TABLE_IMPL == 2
|
160
|
+
unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body);
|
161
|
+
#endif
|
162
|
+
|
163
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
164
|
+
|
165
|
+
/* compile.c */
|
166
|
+
VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node);
|
167
|
+
VALUE rb_iseq_compile_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc);
|
168
|
+
VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
|
169
|
+
void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
|
170
|
+
VALUE locals, VALUE args,
|
171
|
+
VALUE exception, VALUE body);
|
172
|
+
void rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *arena);
|
173
|
+
|
174
|
+
/* iseq.c */
|
175
|
+
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
|
176
|
+
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
|
177
|
+
unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos);
|
178
|
+
void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events);
|
179
|
+
void rb_iseq_trace_set_all(rb_event_flag_t turnon_events);
|
180
|
+
void rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq);
|
181
|
+
|
182
|
+
struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(void);
|
183
|
+
VALUE rb_iseqw_new(const rb_iseq_t *iseq);
|
184
|
+
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
|
185
|
+
|
186
|
+
VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */
|
187
|
+
VALUE rb_iseq_label(const rb_iseq_t *iseq);
|
188
|
+
VALUE rb_iseq_base_label(const rb_iseq_t *iseq);
|
189
|
+
VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq);
|
190
|
+
VALUE rb_iseq_method_name(const rb_iseq_t *iseq);
|
191
|
+
void rb_iseq_code_location(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
|
192
|
+
|
193
|
+
void rb_iseq_remove_coverage_all(void);
|
194
|
+
|
195
|
+
/* proc.c */
|
196
|
+
const rb_iseq_t *rb_method_iseq(VALUE body);
|
197
|
+
const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
|
198
|
+
|
199
|
+
struct rb_compile_option_struct {
|
200
|
+
unsigned int inline_const_cache: 1;
|
201
|
+
unsigned int peephole_optimization: 1;
|
202
|
+
unsigned int tailcall_optimization: 1;
|
203
|
+
unsigned int specialized_instruction: 1;
|
204
|
+
unsigned int operands_unification: 1;
|
205
|
+
unsigned int instructions_unification: 1;
|
206
|
+
unsigned int stack_caching: 1;
|
207
|
+
unsigned int frozen_string_literal: 1;
|
208
|
+
unsigned int debug_frozen_string_literal: 1;
|
209
|
+
unsigned int coverage_enabled: 1;
|
210
|
+
int debug_level;
|
211
|
+
};
|
212
|
+
|
213
|
+
struct iseq_insn_info_entry {
|
214
|
+
int line_no;
|
215
|
+
rb_event_flag_t events;
|
216
|
+
};
|
217
|
+
|
218
|
+
struct iseq_catch_table_entry {
|
219
|
+
enum catch_type {
|
220
|
+
CATCH_TYPE_RESCUE = INT2FIX(1),
|
221
|
+
CATCH_TYPE_ENSURE = INT2FIX(2),
|
222
|
+
CATCH_TYPE_RETRY = INT2FIX(3),
|
223
|
+
CATCH_TYPE_BREAK = INT2FIX(4),
|
224
|
+
CATCH_TYPE_REDO = INT2FIX(5),
|
225
|
+
CATCH_TYPE_NEXT = INT2FIX(6)
|
226
|
+
} type;
|
227
|
+
|
228
|
+
/*
|
229
|
+
* iseq type:
|
230
|
+
* CATCH_TYPE_RESCUE, CATCH_TYPE_ENSURE:
|
231
|
+
* use iseq as continuation.
|
232
|
+
*
|
233
|
+
* CATCH_TYPE_BREAK (iter):
|
234
|
+
* use iseq as key.
|
235
|
+
*
|
236
|
+
* CATCH_TYPE_BREAK (while), CATCH_TYPE_RETRY,
|
237
|
+
* CATCH_TYPE_REDO, CATCH_TYPE_NEXT:
|
238
|
+
* NULL.
|
239
|
+
*/
|
240
|
+
rb_iseq_t *iseq;
|
241
|
+
|
242
|
+
unsigned int start;
|
243
|
+
unsigned int end;
|
244
|
+
unsigned int cont;
|
245
|
+
unsigned int sp;
|
246
|
+
};
|
247
|
+
|
248
|
+
PACKED_STRUCT_UNALIGNED(struct iseq_catch_table {
|
249
|
+
unsigned int size;
|
250
|
+
struct iseq_catch_table_entry entries[FLEX_ARY_LEN];
|
251
|
+
});
|
252
|
+
|
253
|
+
static inline int
|
254
|
+
iseq_catch_table_bytes(int n)
|
255
|
+
{
|
256
|
+
enum {
|
257
|
+
catch_table_entry_size = sizeof(struct iseq_catch_table_entry),
|
258
|
+
catch_table_entries_max = (INT_MAX - offsetof(struct iseq_catch_table, entries)) / catch_table_entry_size
|
259
|
+
};
|
260
|
+
if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n);
|
261
|
+
return (int)(offsetof(struct iseq_catch_table, entries) +
|
262
|
+
n * catch_table_entry_size);
|
263
|
+
}
|
264
|
+
|
265
|
+
#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
|
266
|
+
|
267
|
+
struct iseq_compile_data_storage {
|
268
|
+
struct iseq_compile_data_storage *next;
|
269
|
+
unsigned int pos;
|
270
|
+
unsigned int size;
|
271
|
+
char buff[FLEX_ARY_LEN];
|
272
|
+
};
|
273
|
+
|
274
|
+
/* defined? */
|
275
|
+
|
276
|
+
enum defined_type {
|
277
|
+
DEFINED_NOT_DEFINED,
|
278
|
+
DEFINED_NIL = 1,
|
279
|
+
DEFINED_IVAR,
|
280
|
+
DEFINED_LVAR,
|
281
|
+
DEFINED_GVAR,
|
282
|
+
DEFINED_CVAR,
|
283
|
+
DEFINED_CONST,
|
284
|
+
DEFINED_METHOD,
|
285
|
+
DEFINED_YIELD,
|
286
|
+
DEFINED_ZSUPER,
|
287
|
+
DEFINED_SELF,
|
288
|
+
DEFINED_TRUE,
|
289
|
+
DEFINED_FALSE,
|
290
|
+
DEFINED_ASGN,
|
291
|
+
DEFINED_EXPR,
|
292
|
+
DEFINED_IVAR2,
|
293
|
+
DEFINED_REF,
|
294
|
+
DEFINED_FUNC,
|
295
|
+
DEFINED_CONST_FROM
|
296
|
+
};
|
297
|
+
|
298
|
+
VALUE rb_iseq_defined_string(enum defined_type type);
|
299
|
+
|
300
|
+
/* vm.c */
|
301
|
+
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
|
302
|
+
|
303
|
+
RUBY_SYMBOL_EXPORT_END
|
304
|
+
|
305
|
+
#endif /* RUBY_ISEQ_H */
|