debase-ruby_core_source 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/ccan/list/list.h +28 -166
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/constant.h +3 -10
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/eval_intern.h +49 -89
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/gc.h +1 -8
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/id.h +5 -15
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/insns.inc +107 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/insns_info.inc +45 -89
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/internal.h +164 -666
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/iseq.h +158 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/method.h +144 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/node.h +42 -18
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/node_name.inc +6 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/opt_sc.inc +0 -40
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/optunifs.inc +0 -5
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/parse.h +8 -28
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/probes_helper.h +67 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regenc.h +16 -16
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regint.h +10 -33
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regparse.h +1 -5
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/revision.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/ruby_atomic.h +5 -68
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/symbol.h +13 -33
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/thread_pthread.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/transcode_data.h +7 -23
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/version.h +10 -31
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm.inc +497 -542
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm_core.h +305 -784
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm_insnhelper.h +56 -50
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/vm_opts.h +7 -8
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/vmtc.inc +0 -5
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/constant.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/eval_intern.h +3 -4
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/gc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/id.h +0 -9
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/insns.inc +46 -48
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/insns_info.inc +0 -20
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/internal.h +58 -290
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/iseq.h +15 -18
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/method.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/node.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/node_name.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/opt_sc.inc +0 -16
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/optunifs.inc +0 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/parse.h +8 -27
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/regenc.h +14 -14
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/regint.h +0 -8
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/regparse.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.3.5-p376/revision.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/ruby_atomic.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/symbol.h +3 -3
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/thread_pthread.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/version.h +9 -27
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm.inc +255 -264
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_call_iseq_optimized.inc +5 -5
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_core.h +37 -28
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_insnhelper.h +32 -16
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_opts.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vmtc.inc +0 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/constant.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/eval_intern.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/gc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/id.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/insns.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/insns_info.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/internal.h +116 -51
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/iseq.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/method.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/node.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/node_name.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/opt_sc.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/optunifs.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/parse.h +8 -27
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/regenc.h +79 -67
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/regint.h +187 -244
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/regparse.h +30 -27
- data/lib/debase/ruby_core_source/ruby-2.4.2-p198/revision.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/ruby_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/ruby_atomic.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/symbol.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/thread_pthread.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/version.h +6 -6
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm.inc +37 -34
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/vm_call_iseq_optimized.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_core.h +9 -7
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_insnhelper.h +30 -14
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/vm_opts.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/vmtc.inc +0 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +138 -143
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview1/method.h +0 -213
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview1/revision.h +0 -1
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview2/revision.h +0 -1
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview2/ruby_assert.h +0 -54
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/encindex.h +0 -67
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/id_table.h +0 -31
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/insns.inc +0 -112
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/iseq.h +0 -252
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/probes_helper.h +0 -43
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/revision.h +0 -1
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/ruby_assert.h +0 -54
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/vm_call_iseq_optimized.inc +0 -212
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
insnhelper.h - helper macros to implement each instructions
|
|
4
4
|
|
|
5
|
-
$Author:
|
|
5
|
+
$Author: nobu $
|
|
6
6
|
created at: 04/01/01 15:50:34 JST
|
|
7
7
|
|
|
8
8
|
Copyright (C) 2004-2007 Koichi Sasada
|
|
@@ -12,6 +12,28 @@
|
|
|
12
12
|
#ifndef RUBY_INSNHELPER_H
|
|
13
13
|
#define RUBY_INSNHELPER_H
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* VM Debug Level
|
|
17
|
+
*
|
|
18
|
+
* debug level:
|
|
19
|
+
* 0: no debug output
|
|
20
|
+
* 1: show instruction name
|
|
21
|
+
* 2: show stack frame when control stack frame is changed
|
|
22
|
+
* 3: show stack status
|
|
23
|
+
* 4: show register
|
|
24
|
+
* 5:
|
|
25
|
+
* 10: gc check
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
#ifndef VMDEBUG
|
|
29
|
+
#define VMDEBUG 0
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#if 0
|
|
33
|
+
#undef VMDEBUG
|
|
34
|
+
#define VMDEBUG 3
|
|
35
|
+
#endif
|
|
36
|
+
|
|
15
37
|
extern VALUE ruby_vm_const_missing_count;
|
|
16
38
|
|
|
17
39
|
#if VM_COLLECT_USAGE_DETAILS
|
|
@@ -79,6 +101,8 @@ enum vm_regan_acttype {
|
|
|
79
101
|
#define GET_CURRENT_INSN() (*GET_PC())
|
|
80
102
|
#define GET_OPERAND(n) (GET_PC()[(n)])
|
|
81
103
|
#define ADD_PC(n) (SET_PC(REG_PC + (n)))
|
|
104
|
+
|
|
105
|
+
#define GET_PC_COUNT() (REG_PC - GET_ISEQ()->iseq_encoded)
|
|
82
106
|
#define JUMP(dst) (REG_PC += (dst))
|
|
83
107
|
|
|
84
108
|
/* frame pointer, environment pointer */
|
|
@@ -104,7 +128,7 @@ enum vm_regan_acttype {
|
|
|
104
128
|
/* deal with variables */
|
|
105
129
|
/**********************************************************/
|
|
106
130
|
|
|
107
|
-
#define GET_PREV_EP(ep) ((VALUE *)((ep)[
|
|
131
|
+
#define GET_PREV_EP(ep) ((VALUE *)((ep)[0] & ~0x03))
|
|
108
132
|
|
|
109
133
|
#define GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)(entry))
|
|
110
134
|
#define SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)(entry), (val))
|
|
@@ -121,8 +145,27 @@ enum vm_regan_acttype {
|
|
|
121
145
|
/* deal with control flow 2: method/iterator */
|
|
122
146
|
/**********************************************************/
|
|
123
147
|
|
|
124
|
-
#define
|
|
125
|
-
|
|
148
|
+
#define COPY_CREF_OMOD(c1, c2) do { \
|
|
149
|
+
RB_OBJ_WRITE((c1), &(c1)->nd_refinements, (c2)->nd_refinements); \
|
|
150
|
+
if (!NIL_P((c2)->nd_refinements)) { \
|
|
151
|
+
(c1)->flags |= NODE_FL_CREF_OMOD_SHARED; \
|
|
152
|
+
(c2)->flags |= NODE_FL_CREF_OMOD_SHARED; \
|
|
153
|
+
} \
|
|
154
|
+
} while (0)
|
|
155
|
+
|
|
156
|
+
#define COPY_CREF(c1, c2) do { \
|
|
157
|
+
NODE *__tmp_c2 = (c2); \
|
|
158
|
+
COPY_CREF_OMOD(c1, __tmp_c2); \
|
|
159
|
+
RB_OBJ_WRITE((c1), &(c1)->nd_clss, __tmp_c2->nd_clss); \
|
|
160
|
+
(c1)->nd_visi = __tmp_c2->nd_visi;\
|
|
161
|
+
RB_OBJ_WRITE((c1), &(c1)->nd_next, __tmp_c2->nd_next); \
|
|
162
|
+
if (__tmp_c2->flags & NODE_FL_CREF_PUSHED_BY_EVAL) { \
|
|
163
|
+
(c1)->flags |= NODE_FL_CREF_PUSHED_BY_EVAL; \
|
|
164
|
+
} \
|
|
165
|
+
} while (0)
|
|
166
|
+
|
|
167
|
+
#define CALL_METHOD(ci) do { \
|
|
168
|
+
VALUE v = (*(ci)->call)(th, GET_CFP(), (ci)); \
|
|
126
169
|
if (v == Qundef) { \
|
|
127
170
|
RESTORE_REGS(); \
|
|
128
171
|
NEXT_INSN(); \
|
|
@@ -141,14 +184,14 @@ enum vm_regan_acttype {
|
|
|
141
184
|
#endif
|
|
142
185
|
|
|
143
186
|
#if OPT_CALL_FASTPATH
|
|
144
|
-
#define CI_SET_FASTPATH(
|
|
145
|
-
if (LIKELY(enabled)) ((
|
|
187
|
+
#define CI_SET_FASTPATH(ci, func, enabled) do { \
|
|
188
|
+
if (LIKELY(enabled)) ((ci)->call = (func)); \
|
|
146
189
|
} while (0)
|
|
147
190
|
#else
|
|
148
191
|
#define CI_SET_FASTPATH(ci, func, enabled) /* do nothing */
|
|
149
192
|
#endif
|
|
150
193
|
|
|
151
|
-
#define
|
|
194
|
+
#define GET_BLOCK_PTR() ((rb_block_t *)(GC_GUARDED_PTR_REF(GET_LEP()[0])))
|
|
152
195
|
|
|
153
196
|
/**********************************************************/
|
|
154
197
|
/* deal with control flow 3: exception */
|
|
@@ -172,11 +215,9 @@ enum vm_regan_acttype {
|
|
|
172
215
|
#endif
|
|
173
216
|
|
|
174
217
|
#define CALL_SIMPLE_METHOD(recv_) do { \
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
vm_search_method(ci, cc, calling.recv = (recv_)); \
|
|
179
|
-
CALL_METHOD(&calling, ci, cc); \
|
|
218
|
+
ci->blockptr = 0; ci->argc = ci->orig_argc; \
|
|
219
|
+
vm_search_method(ci, ci->recv = (recv_)); \
|
|
220
|
+
CALL_METHOD(ci); \
|
|
180
221
|
} while (0)
|
|
181
222
|
|
|
182
223
|
#define NEXT_CLASS_SERIAL() (++ruby_vm_class_serial)
|
|
@@ -185,43 +226,8 @@ enum vm_regan_acttype {
|
|
|
185
226
|
#define GET_GLOBAL_CONSTANT_STATE() (ruby_vm_global_constant_state)
|
|
186
227
|
#define INC_GLOBAL_CONSTANT_STATE() (++ruby_vm_global_constant_state)
|
|
187
228
|
|
|
188
|
-
static VALUE make_no_method_exception(VALUE exc,
|
|
189
|
-
int argc, const VALUE *argv
|
|
190
|
-
|
|
191
|
-
static inline struct vm_throw_data *
|
|
192
|
-
THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, VALUE st)
|
|
193
|
-
{
|
|
194
|
-
return (struct vm_throw_data *)rb_imemo_new(imemo_throw_data, val, (VALUE)cf, st, 0);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
static inline void
|
|
198
|
-
THROW_DATA_CATCH_FRAME_SET(struct vm_throw_data *obj, const rb_control_frame_t *cfp)
|
|
199
|
-
{
|
|
200
|
-
obj->catch_frame = cfp;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
static inline void
|
|
204
|
-
THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st)
|
|
205
|
-
{
|
|
206
|
-
obj->throw_state = (VALUE)st;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
static inline VALUE
|
|
210
|
-
THROW_DATA_VAL(const struct vm_throw_data *obj)
|
|
211
|
-
{
|
|
212
|
-
return obj->throw_obj;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
static inline const rb_control_frame_t *
|
|
216
|
-
THROW_DATA_CATCH_FRAME(const struct vm_throw_data *obj)
|
|
217
|
-
{
|
|
218
|
-
return obj->catch_frame;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
static int
|
|
222
|
-
THROW_DATA_STATE(const struct vm_throw_data *obj)
|
|
223
|
-
{
|
|
224
|
-
return (int)obj->throw_state;
|
|
225
|
-
}
|
|
229
|
+
static VALUE make_no_method_exception(VALUE exc, const char *format,
|
|
230
|
+
VALUE obj, int argc, const VALUE *argv);
|
|
231
|
+
|
|
226
232
|
|
|
227
233
|
#endif /* RUBY_INSNHELPER_H */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
vm_opts.h - VM optimize option
|
|
5
5
|
|
|
6
|
-
$Author:
|
|
6
|
+
$Author: tmm1 $
|
|
7
7
|
|
|
8
8
|
Copyright (C) 2004-2007 Koichi Sasada
|
|
9
9
|
|
|
@@ -18,13 +18,12 @@
|
|
|
18
18
|
* Following definitions are default values.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
#define OPT_TRACE_INSTRUCTION
|
|
22
|
-
#define OPT_TAILCALL_OPTIMIZATION
|
|
23
|
-
#define OPT_PEEPHOLE_OPTIMIZATION
|
|
24
|
-
#define OPT_SPECIALISED_INSTRUCTION
|
|
25
|
-
#define OPT_INLINE_CONST_CACHE
|
|
26
|
-
|
|
27
|
-
#define OPT_DEBUG_FROZEN_STRING_LITERAL 0
|
|
21
|
+
#define OPT_TRACE_INSTRUCTION 1
|
|
22
|
+
#define OPT_TAILCALL_OPTIMIZATION 0
|
|
23
|
+
#define OPT_PEEPHOLE_OPTIMIZATION 1
|
|
24
|
+
#define OPT_SPECIALISED_INSTRUCTION 1
|
|
25
|
+
#define OPT_INLINE_CONST_CACHE 1
|
|
26
|
+
|
|
28
27
|
|
|
29
28
|
/* Build Options.
|
|
30
29
|
* You can't change these options at runtime.
|
|
@@ -34,7 +34,6 @@ static const void *const insns_address_table[] = {
|
|
|
34
34
|
LABEL_PTR(putstring),
|
|
35
35
|
LABEL_PTR(concatstrings),
|
|
36
36
|
LABEL_PTR(tostring),
|
|
37
|
-
LABEL_PTR(freezestring),
|
|
38
37
|
LABEL_PTR(toregexp),
|
|
39
38
|
LABEL_PTR(newarray),
|
|
40
39
|
LABEL_PTR(duparray),
|
|
@@ -47,7 +46,6 @@ static const void *const insns_address_table[] = {
|
|
|
47
46
|
LABEL_PTR(dup),
|
|
48
47
|
LABEL_PTR(dupn),
|
|
49
48
|
LABEL_PTR(swap),
|
|
50
|
-
LABEL_PTR(reverse),
|
|
51
49
|
LABEL_PTR(reput),
|
|
52
50
|
LABEL_PTR(topn),
|
|
53
51
|
LABEL_PTR(setn),
|
|
@@ -59,8 +57,6 @@ static const void *const insns_address_table[] = {
|
|
|
59
57
|
LABEL_PTR(defineclass),
|
|
60
58
|
LABEL_PTR(send),
|
|
61
59
|
LABEL_PTR(opt_str_freeze),
|
|
62
|
-
LABEL_PTR(opt_newarray_max),
|
|
63
|
-
LABEL_PTR(opt_newarray_min),
|
|
64
60
|
LABEL_PTR(opt_send_without_block),
|
|
65
61
|
LABEL_PTR(invokesuper),
|
|
66
62
|
LABEL_PTR(invokeblock),
|
|
@@ -69,7 +65,6 @@ static const void *const insns_address_table[] = {
|
|
|
69
65
|
LABEL_PTR(jump),
|
|
70
66
|
LABEL_PTR(branchif),
|
|
71
67
|
LABEL_PTR(branchunless),
|
|
72
|
-
LABEL_PTR(branchnil),
|
|
73
68
|
LABEL_PTR(getinlinecache),
|
|
74
69
|
LABEL_PTR(setinlinecache),
|
|
75
70
|
LABEL_PTR(once),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -38,7 +38,7 @@ typedef struct rb_const_entry_struct {
|
|
|
38
38
|
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
|
|
39
39
|
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
|
|
40
40
|
VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
|
|
41
|
-
void rb_free_const_table(
|
|
41
|
+
void rb_free_const_table(st_table *tbl);
|
|
42
42
|
VALUE rb_public_const_get(VALUE klass, ID id);
|
|
43
43
|
VALUE rb_public_const_get_at(VALUE klass, ID id);
|
|
44
44
|
VALUE rb_public_const_get_from(VALUE klass, ID id);
|
|
File without changes
|
|
File without changes
|
|
@@ -121,7 +121,7 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
|
|
|
121
121
|
#define TH_PUSH_TAG(th) do { \
|
|
122
122
|
rb_thread_t * const _th = (th); \
|
|
123
123
|
struct rb_vm_tag _tag; \
|
|
124
|
-
_tag.tag =
|
|
124
|
+
_tag.tag = Qundef; \
|
|
125
125
|
_tag.prev = _th->tag;
|
|
126
126
|
|
|
127
127
|
#define TH_POP_TAG() \
|
|
@@ -139,11 +139,9 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
|
|
|
139
139
|
#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8)
|
|
140
140
|
# define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var))
|
|
141
141
|
# define VAR_INITIALIZED(var) ((var) = VAR_FROM_MEMORY(var))
|
|
142
|
-
# define VAR_NOCLOBBERED(var) volatile var
|
|
143
142
|
#else
|
|
144
143
|
# define VAR_FROM_MEMORY(var) (var)
|
|
145
144
|
# define VAR_INITIALIZED(var) ((void)&(var))
|
|
146
|
-
# define VAR_NOCLOBBERED(var) var
|
|
147
145
|
#endif
|
|
148
146
|
|
|
149
147
|
/* clear th->state, and return the value */
|
|
@@ -266,7 +264,7 @@ NORETURN(void rb_method_name_error(VALUE, VALUE));
|
|
|
266
264
|
|
|
267
265
|
NORETURN(void rb_fiber_start(void));
|
|
268
266
|
|
|
269
|
-
NORETURN(void rb_print_undef(VALUE, ID,
|
|
267
|
+
NORETURN(void rb_print_undef(VALUE, ID, int));
|
|
270
268
|
NORETURN(void rb_print_undef_str(VALUE, VALUE));
|
|
271
269
|
NORETURN(void rb_print_inaccessible(VALUE, ID, rb_method_visibility_t));
|
|
272
270
|
NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
|
|
@@ -280,6 +278,7 @@ rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void);
|
|
|
280
278
|
VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
|
|
281
279
|
void rb_vm_set_progname(VALUE filename);
|
|
282
280
|
void rb_thread_terminate_all(void);
|
|
281
|
+
VALUE rb_vm_top_self();
|
|
283
282
|
VALUE rb_vm_cbase(void);
|
|
284
283
|
|
|
285
284
|
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
|
|
File without changes
|
|
@@ -118,8 +118,6 @@ enum ruby_method_ids {
|
|
|
118
118
|
id_core_hash_merge_kwd,
|
|
119
119
|
id_debug_created_info,
|
|
120
120
|
tPRESERVED_ID_END,
|
|
121
|
-
tMax,
|
|
122
|
-
tMin,
|
|
123
121
|
tFreeze,
|
|
124
122
|
tInspect,
|
|
125
123
|
tIntern,
|
|
@@ -162,12 +160,8 @@ enum ruby_method_ids {
|
|
|
162
160
|
tMesg,
|
|
163
161
|
tException,
|
|
164
162
|
tUScore,
|
|
165
|
-
tLASTLINE,
|
|
166
|
-
tBACKREF,
|
|
167
163
|
tNEXT_ID,
|
|
168
164
|
#define TOKEN2LOCALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL|ID_STATIC_SYM)
|
|
169
|
-
TOKEN2LOCALID(Max),
|
|
170
|
-
TOKEN2LOCALID(Min),
|
|
171
165
|
TOKEN2LOCALID(Freeze),
|
|
172
166
|
TOKEN2LOCALID(Inspect),
|
|
173
167
|
TOKEN2LOCALID(Intern),
|
|
@@ -210,9 +204,6 @@ enum ruby_method_ids {
|
|
|
210
204
|
TOKEN2LOCALID(Mesg),
|
|
211
205
|
TOKEN2LOCALID(Exception),
|
|
212
206
|
TOKEN2LOCALID(UScore),
|
|
213
|
-
#define TOKEN2GLOBALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_GLOBAL|ID_STATIC_SYM)
|
|
214
|
-
TOKEN2GLOBALID(LASTLINE),
|
|
215
|
-
TOKEN2GLOBALID(BACKREF),
|
|
216
207
|
tLAST_OP_ID = tPRESERVED_ID_END-1,
|
|
217
208
|
idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
|
|
218
209
|
};
|
|
File without changes
|
|
@@ -60,53 +60,51 @@ enum ruby_vminsn_type {
|
|
|
60
60
|
BIN(defineclass) = 43,
|
|
61
61
|
BIN(send) = 44,
|
|
62
62
|
BIN(opt_str_freeze) = 45,
|
|
63
|
-
BIN(
|
|
64
|
-
BIN(
|
|
65
|
-
BIN(
|
|
66
|
-
BIN(
|
|
67
|
-
BIN(
|
|
68
|
-
BIN(
|
|
69
|
-
BIN(
|
|
70
|
-
BIN(
|
|
71
|
-
BIN(
|
|
72
|
-
BIN(
|
|
73
|
-
BIN(
|
|
74
|
-
BIN(
|
|
75
|
-
BIN(
|
|
76
|
-
BIN(
|
|
77
|
-
BIN(
|
|
78
|
-
BIN(
|
|
79
|
-
BIN(
|
|
80
|
-
BIN(
|
|
81
|
-
BIN(
|
|
82
|
-
BIN(
|
|
83
|
-
BIN(
|
|
84
|
-
BIN(
|
|
85
|
-
BIN(
|
|
86
|
-
BIN(
|
|
87
|
-
BIN(
|
|
88
|
-
BIN(
|
|
89
|
-
BIN(
|
|
90
|
-
BIN(
|
|
91
|
-
BIN(
|
|
92
|
-
BIN(
|
|
93
|
-
BIN(
|
|
94
|
-
BIN(
|
|
95
|
-
BIN(
|
|
96
|
-
BIN(
|
|
97
|
-
BIN(
|
|
98
|
-
BIN(
|
|
99
|
-
BIN(
|
|
100
|
-
BIN(
|
|
101
|
-
BIN(
|
|
102
|
-
BIN(
|
|
103
|
-
BIN(
|
|
104
|
-
BIN(
|
|
105
|
-
BIN(
|
|
106
|
-
BIN(
|
|
107
|
-
BIN(
|
|
108
|
-
|
|
109
|
-
BIN(putobject_OP_INT2FIX_O_1_C_) = 92,
|
|
110
|
-
VM_INSTRUCTION_SIZE = 93
|
|
63
|
+
BIN(opt_send_without_block) = 46,
|
|
64
|
+
BIN(invokesuper) = 47,
|
|
65
|
+
BIN(invokeblock) = 48,
|
|
66
|
+
BIN(leave) = 49,
|
|
67
|
+
BIN(throw) = 50,
|
|
68
|
+
BIN(jump) = 51,
|
|
69
|
+
BIN(branchif) = 52,
|
|
70
|
+
BIN(branchunless) = 53,
|
|
71
|
+
BIN(branchnil) = 54,
|
|
72
|
+
BIN(getinlinecache) = 55,
|
|
73
|
+
BIN(setinlinecache) = 56,
|
|
74
|
+
BIN(once) = 57,
|
|
75
|
+
BIN(opt_case_dispatch) = 58,
|
|
76
|
+
BIN(opt_plus) = 59,
|
|
77
|
+
BIN(opt_minus) = 60,
|
|
78
|
+
BIN(opt_mult) = 61,
|
|
79
|
+
BIN(opt_div) = 62,
|
|
80
|
+
BIN(opt_mod) = 63,
|
|
81
|
+
BIN(opt_eq) = 64,
|
|
82
|
+
BIN(opt_neq) = 65,
|
|
83
|
+
BIN(opt_lt) = 66,
|
|
84
|
+
BIN(opt_le) = 67,
|
|
85
|
+
BIN(opt_gt) = 68,
|
|
86
|
+
BIN(opt_ge) = 69,
|
|
87
|
+
BIN(opt_ltlt) = 70,
|
|
88
|
+
BIN(opt_aref) = 71,
|
|
89
|
+
BIN(opt_aset) = 72,
|
|
90
|
+
BIN(opt_aset_with) = 73,
|
|
91
|
+
BIN(opt_aref_with) = 74,
|
|
92
|
+
BIN(opt_length) = 75,
|
|
93
|
+
BIN(opt_size) = 76,
|
|
94
|
+
BIN(opt_empty_p) = 77,
|
|
95
|
+
BIN(opt_succ) = 78,
|
|
96
|
+
BIN(opt_not) = 79,
|
|
97
|
+
BIN(opt_regexpmatch1) = 80,
|
|
98
|
+
BIN(opt_regexpmatch2) = 81,
|
|
99
|
+
BIN(opt_call_c_function) = 82,
|
|
100
|
+
BIN(bitblt) = 83,
|
|
101
|
+
BIN(answer) = 84,
|
|
102
|
+
BIN(getlocal_OP__WC__0) = 85,
|
|
103
|
+
BIN(getlocal_OP__WC__1) = 86,
|
|
104
|
+
BIN(setlocal_OP__WC__0) = 87,
|
|
105
|
+
BIN(setlocal_OP__WC__1) = 88,
|
|
106
|
+
BIN(putobject_OP_INT2FIX_O_0_C_) = 89,
|
|
107
|
+
BIN(putobject_OP_INT2FIX_O_1_C_) = 90,
|
|
108
|
+
VM_INSTRUCTION_SIZE = 91
|
|
111
109
|
};
|
|
112
110
|
|
|
@@ -70,8 +70,6 @@ static const char *const insn_name_info[] = {
|
|
|
70
70
|
"defineclass",
|
|
71
71
|
"send",
|
|
72
72
|
"opt_str_freeze",
|
|
73
|
-
"opt_newarray_max",
|
|
74
|
-
"opt_newarray_min",
|
|
75
73
|
"opt_send_without_block",
|
|
76
74
|
"invokesuper",
|
|
77
75
|
"invokeblock",
|
|
@@ -167,8 +165,6 @@ static const char *const insn_operand_info[] = {
|
|
|
167
165
|
"ISN",
|
|
168
166
|
"CES",
|
|
169
167
|
"V",
|
|
170
|
-
"N",
|
|
171
|
-
"N",
|
|
172
168
|
"CE",
|
|
173
169
|
"CES",
|
|
174
170
|
"C",
|
|
@@ -264,8 +260,6 @@ static const int insn_len_info[] = {
|
|
|
264
260
|
4,
|
|
265
261
|
4,
|
|
266
262
|
2,
|
|
267
|
-
2,
|
|
268
|
-
2,
|
|
269
263
|
3,
|
|
270
264
|
4,
|
|
271
265
|
2,
|
|
@@ -367,8 +361,6 @@ static const int insn_stack_push_num_info[] = {
|
|
|
367
361
|
1,
|
|
368
362
|
1,
|
|
369
363
|
1,
|
|
370
|
-
1,
|
|
371
|
-
1,
|
|
372
364
|
0,
|
|
373
365
|
0,
|
|
374
366
|
0,
|
|
@@ -589,18 +581,6 @@ insn_stack_increase(int depth, int insn, VALUE *opes)
|
|
|
589
581
|
case BIN(opt_str_freeze):{
|
|
590
582
|
return depth + 1;
|
|
591
583
|
}
|
|
592
|
-
case BIN(opt_newarray_max):{
|
|
593
|
-
int inc = 0;
|
|
594
|
-
int num = FIX2INT(opes[0]);
|
|
595
|
-
inc += 1 - num;;
|
|
596
|
-
return depth + inc;
|
|
597
|
-
}
|
|
598
|
-
case BIN(opt_newarray_min):{
|
|
599
|
-
int inc = 0;
|
|
600
|
-
int num = FIX2INT(opes[0]);
|
|
601
|
-
inc += 1 - num;;
|
|
602
|
-
return depth + inc;
|
|
603
|
-
}
|
|
604
584
|
case BIN(opt_send_without_block):{
|
|
605
585
|
int inc = 0;
|
|
606
586
|
CALL_INFO ci = (CALL_INFO)(opes[0]);
|