debugger-ruby_core_source 1.1.1 → 1.1.2
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.
- data/CHANGELOG.md +3 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/addr2line.h +21 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/atomic.h +56 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/constant.h +34 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/debug.h +41 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/dln.h +50 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/encdb.h +167 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/eval_intern.h +234 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/gc.h +98 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/id.h +175 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/insns.inc +179 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/insns_info.inc +695 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/internal.h +232 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/iseq.h +125 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/known_errors.inc +731 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/method.h +105 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/node.h +503 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/node_name.inc +208 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/opt_sc.inc +670 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/optinsn.inc +30 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/optunifs.inc +116 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/parse.h +186 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/regenc.h +219 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/regint.h +850 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/regparse.h +362 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/revision.h +1 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/thread_pthread.h +51 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/thread_win32.h +40 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/timev.h +21 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/transcode_data.h +117 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/transdb.h +189 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/version.h +52 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/vm.inc +3051 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/vm_core.h +756 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/vm_exec.h +184 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/vm_insnhelper.h +220 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/vm_opts.h +51 -0
- data/lib/debugger/ruby_core_source/ruby-1.9.3-p194/vmtc.inc +97 -0
- data/lib/debugger/ruby_core_source/version.rb +1 -1
- metadata +54 -7
@@ -0,0 +1,21 @@
|
|
1
|
+
#ifndef RUBY_TIMEV_H
|
2
|
+
#define RUBY_TIMEV_H
|
3
|
+
|
4
|
+
struct vtm {
|
5
|
+
VALUE year; /* 2000 for example. Integer. */
|
6
|
+
int mon; /* 1..12 */
|
7
|
+
int mday; /* 1..31 */
|
8
|
+
int hour; /* 0..23 */
|
9
|
+
int min; /* 0..59 */
|
10
|
+
int sec; /* 0..60 */
|
11
|
+
VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */
|
12
|
+
VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */
|
13
|
+
int wday; /* 0:Sunday, 1:Monday, ..., 6:Saturday */
|
14
|
+
int yday; /* 1..366 */
|
15
|
+
int isdst; /* 0:StandardTime 1:DayLightSavingTime */
|
16
|
+
const char *zone; /* "JST", "EST", "EDT", etc. */
|
17
|
+
};
|
18
|
+
|
19
|
+
#define TIME_SCALE 1000000000
|
20
|
+
|
21
|
+
#endif
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
transcode_data.h -
|
4
|
+
|
5
|
+
$Author: nobu $
|
6
|
+
created at: Mon 10 Dec 2007 14:01:47 JST 2007
|
7
|
+
|
8
|
+
Copyright (C) 2007 Martin Duerst
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
|
12
|
+
#include "ruby/ruby.h"
|
13
|
+
|
14
|
+
#ifndef RUBY_TRANSCODE_DATA_H
|
15
|
+
#define RUBY_TRANSCODE_DATA_H 1
|
16
|
+
|
17
|
+
#if defined __GNUC__ && __GNUC__ >= 4
|
18
|
+
#pragma GCC visibility push(default)
|
19
|
+
#endif
|
20
|
+
|
21
|
+
#define WORDINDEX_SHIFT_BITS 2
|
22
|
+
#define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS)
|
23
|
+
#define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS)
|
24
|
+
#define BYTE_LOOKUP_BASE(bl) ((bl)[0])
|
25
|
+
#define BYTE_LOOKUP_INFO(bl) ((bl)[1])
|
26
|
+
|
27
|
+
#define PType (unsigned int)
|
28
|
+
|
29
|
+
#define NOMAP (PType 0x01) /* direct map */
|
30
|
+
#define ONEbt (0x02) /* one byte payload */
|
31
|
+
#define TWObt (0x03) /* two bytes payload */
|
32
|
+
#define THREEbt (0x05) /* three bytes payload */
|
33
|
+
#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */
|
34
|
+
#define INVALID (PType 0x07) /* invalid byte sequence */
|
35
|
+
#define UNDEF (PType 0x09) /* legal but undefined */
|
36
|
+
#define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */
|
37
|
+
#define FUNii (PType 0x0B) /* function from info to info */
|
38
|
+
#define FUNsi (PType 0x0D) /* function from start to info */
|
39
|
+
#define FUNio (PType 0x0E) /* function from info to output */
|
40
|
+
#define FUNso (PType 0x0F) /* function from start to output */
|
41
|
+
#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
|
42
|
+
#define GB4bt (PType 0x12) /* GB18030 four bytes payload */
|
43
|
+
#define FUNsio (PType 0x13) /* function from start and info to output */
|
44
|
+
|
45
|
+
#define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4)
|
46
|
+
#define STR1_BYTEINDEX(w) ((w) >> 6)
|
47
|
+
#define makeSTR1(bi) (((bi) << 6) | STR1)
|
48
|
+
#define makeSTR1LEN(len) ((len)-4)
|
49
|
+
|
50
|
+
#define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt))
|
51
|
+
#define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt))
|
52
|
+
#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned int)(unsigned char)(b3))<<24)|THREEbt)&0xffffffffU))
|
53
|
+
#define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)&0xffffffffU))
|
54
|
+
#define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|(((unsigned char)(b2))<<16)|((((unsigned char)(b1))&0x0f)<<24)|((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|GB4bt)&0xffffffffU))
|
55
|
+
#define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio))
|
56
|
+
|
57
|
+
#define getBT1(a) ((unsigned char)((a)>> 8))
|
58
|
+
#define getBT2(a) ((unsigned char)((a)>>16))
|
59
|
+
#define getBT3(a) ((unsigned char)((a)>>24))
|
60
|
+
#define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
|
61
|
+
|
62
|
+
#define getGB4bt0(a) ((unsigned char)((a)>> 8))
|
63
|
+
#define getGB4bt1(a) (((unsigned char)((a)>>24)&0x0F)|0x30)
|
64
|
+
#define getGB4bt2(a) ((unsigned char)((a)>>16))
|
65
|
+
#define getGB4bt3(a) (((unsigned char)((a)>>28)&0x0F)|0x30)
|
66
|
+
|
67
|
+
#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
|
68
|
+
|
69
|
+
/* do we need these??? maybe not, can be done with simple tables */
|
70
|
+
#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */
|
71
|
+
#define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */
|
72
|
+
#define THREETRAIL /* legal but undefined if three more trailing UTF-8 */
|
73
|
+
|
74
|
+
typedef enum {
|
75
|
+
asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */
|
76
|
+
asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */
|
77
|
+
asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */
|
78
|
+
/* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */
|
79
|
+
} rb_transcoder_asciicompat_type_t;
|
80
|
+
|
81
|
+
typedef struct rb_transcoder rb_transcoder;
|
82
|
+
|
83
|
+
/* static structure, one per supported encoding pair */
|
84
|
+
struct rb_transcoder {
|
85
|
+
const char *src_encoding;
|
86
|
+
const char *dst_encoding;
|
87
|
+
unsigned int conv_tree_start;
|
88
|
+
const unsigned char *byte_array;
|
89
|
+
unsigned int byte_array_length;
|
90
|
+
const unsigned int *word_array;
|
91
|
+
unsigned int word_array_length;
|
92
|
+
int word_size;
|
93
|
+
int input_unit_length;
|
94
|
+
int max_input;
|
95
|
+
int max_output;
|
96
|
+
rb_transcoder_asciicompat_type_t asciicompat_type;
|
97
|
+
size_t state_size;
|
98
|
+
int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */
|
99
|
+
int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */
|
100
|
+
VALUE (*func_ii)(void*, VALUE); /* info -> info */
|
101
|
+
VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */
|
102
|
+
ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */
|
103
|
+
ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */
|
104
|
+
ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */
|
105
|
+
ssize_t (*resetsize_func)(void*); /* -> len */
|
106
|
+
ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */
|
107
|
+
ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */
|
108
|
+
};
|
109
|
+
|
110
|
+
void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
|
111
|
+
void rb_register_transcoder(const rb_transcoder *);
|
112
|
+
|
113
|
+
#if defined __GNUC__ && __GNUC__ >= 4
|
114
|
+
#pragma GCC visibility pop
|
115
|
+
#endif
|
116
|
+
|
117
|
+
#endif /* RUBY_TRANSCODE_DATA_H */
|
@@ -0,0 +1,189 @@
|
|
1
|
+
rb_declare_transcoder("Big5", "UTF-8", "big5");
|
2
|
+
rb_declare_transcoder("UTF-8", "Big5", "big5");
|
3
|
+
rb_declare_transcoder("CP950", "UTF-8", "big5");
|
4
|
+
rb_declare_transcoder("UTF-8", "CP950", "big5");
|
5
|
+
rb_declare_transcoder("Big5-HKSCS", "UTF-8", "big5");
|
6
|
+
rb_declare_transcoder("UTF-8", "Big5-HKSCS", "big5");
|
7
|
+
rb_declare_transcoder("CP951", "UTF-8", "big5");
|
8
|
+
rb_declare_transcoder("UTF-8", "CP951", "big5");
|
9
|
+
rb_declare_transcoder("Big5-UAO", "UTF-8", "big5");
|
10
|
+
rb_declare_transcoder("UTF-8", "Big5-UAO", "big5");
|
11
|
+
rb_declare_transcoder("GB2312", "UTF-8", "chinese");
|
12
|
+
rb_declare_transcoder("GB12345", "UTF-8", "chinese");
|
13
|
+
rb_declare_transcoder("UTF-8", "GB2312", "chinese");
|
14
|
+
rb_declare_transcoder("UTF-8", "GB12345", "chinese");
|
15
|
+
rb_declare_transcoder("UTF8-DoCoMo", "UTF8-KDDI", "emoji");
|
16
|
+
rb_declare_transcoder("UTF8-DoCoMo", "UTF8-SoftBank", "emoji");
|
17
|
+
rb_declare_transcoder("UTF8-DoCoMo", "UTF-8", "emoji");
|
18
|
+
rb_declare_transcoder("UTF8-KDDI", "UTF8-DoCoMo", "emoji");
|
19
|
+
rb_declare_transcoder("UTF8-KDDI", "UTF8-SoftBank", "emoji");
|
20
|
+
rb_declare_transcoder("UTF8-KDDI", "UTF-8", "emoji");
|
21
|
+
rb_declare_transcoder("UTF8-SoftBank", "UTF8-DoCoMo", "emoji");
|
22
|
+
rb_declare_transcoder("UTF8-SoftBank", "UTF8-KDDI", "emoji");
|
23
|
+
rb_declare_transcoder("UTF8-SoftBank", "UTF-8", "emoji");
|
24
|
+
rb_declare_transcoder("UTF-8", "UTF8-DoCoMo", "emoji");
|
25
|
+
rb_declare_transcoder("UTF-8", "UTF8-KDDI", "emoji");
|
26
|
+
rb_declare_transcoder("UTF-8", "UTF8-SoftBank", "emoji");
|
27
|
+
rb_declare_transcoder("stateless-ISO-2022-JP-KDDI", "UTF8-KDDI", "emoji_iso2022_kddi");
|
28
|
+
rb_declare_transcoder("UTF8-KDDI", "stateless-ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
|
29
|
+
rb_declare_transcoder("ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
|
30
|
+
rb_declare_transcoder("stateless-ISO-2022-JP-KDDI", "ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
|
31
|
+
rb_declare_transcoder("SJIS-DOCOMO", "UTF8-DOCOMO", "emoji_sjis_docomo");
|
32
|
+
rb_declare_transcoder("UTF8-DOCOMO", "SJIS-DOCOMO", "emoji_sjis_docomo");
|
33
|
+
rb_declare_transcoder("SJIS-KDDI", "UTF8-KDDI", "emoji_sjis_kddi");
|
34
|
+
rb_declare_transcoder("UTF8-KDDI", "SJIS-KDDI", "emoji_sjis_kddi");
|
35
|
+
rb_declare_transcoder("SJIS-SoftBank", "UTF8-SoftBank", "emoji_sjis_softbank");
|
36
|
+
rb_declare_transcoder("UTF8-SoftBank", "SJIS-SoftBank", "emoji_sjis_softbank");
|
37
|
+
rb_declare_transcoder("", "amp_escape", "escape");
|
38
|
+
rb_declare_transcoder("", "xml_text_escape", "escape");
|
39
|
+
rb_declare_transcoder("", "xml_attr_content_escape", "escape");
|
40
|
+
rb_declare_transcoder("", "xml_attr_quote", "escape");
|
41
|
+
rb_declare_transcoder("GB18030", "UTF-8", "gb18030");
|
42
|
+
rb_declare_transcoder("UTF-8", "GB18030", "gb18030");
|
43
|
+
rb_declare_transcoder("GBK", "UTF-8", "gbk");
|
44
|
+
rb_declare_transcoder("UTF-8", "GBK", "gbk");
|
45
|
+
rb_declare_transcoder("ISO-2022-JP", "stateless-ISO-2022-JP", "iso2022");
|
46
|
+
rb_declare_transcoder("stateless-ISO-2022-JP", "ISO-2022-JP", "iso2022");
|
47
|
+
rb_declare_transcoder("stateless-ISO-2022-JP", "EUC-JP", "iso2022");
|
48
|
+
rb_declare_transcoder("EUC-JP", "stateless-ISO-2022-JP", "iso2022");
|
49
|
+
rb_declare_transcoder("CP50220", "cp51932", "iso2022");
|
50
|
+
rb_declare_transcoder("CP50221", "cp51932", "iso2022");
|
51
|
+
rb_declare_transcoder("CP51932", "CP50221", "iso2022");
|
52
|
+
rb_declare_transcoder("CP51932", "CP50220", "iso2022");
|
53
|
+
rb_declare_transcoder("EUC-JP", "Shift_JIS", "japanese");
|
54
|
+
rb_declare_transcoder("Shift_JIS", "EUC-JP", "japanese");
|
55
|
+
rb_declare_transcoder("EUC-JP", "UTF-8", "japanese_euc");
|
56
|
+
rb_declare_transcoder("eucJP-ms", "UTF-8", "japanese_euc");
|
57
|
+
rb_declare_transcoder("CP51932", "UTF-8", "japanese_euc");
|
58
|
+
rb_declare_transcoder("UTF-8", "EUC-JP", "japanese_euc");
|
59
|
+
rb_declare_transcoder("UTF-8", "eucJP-ms", "japanese_euc");
|
60
|
+
rb_declare_transcoder("UTF-8", "CP51932", "japanese_euc");
|
61
|
+
rb_declare_transcoder("Shift_JIS", "UTF-8", "japanese_sjis");
|
62
|
+
rb_declare_transcoder("Windows-31J", "UTF-8", "japanese_sjis");
|
63
|
+
rb_declare_transcoder("UTF-8", "Shift_JIS", "japanese_sjis");
|
64
|
+
rb_declare_transcoder("UTF-8", "Windows-31J", "japanese_sjis");
|
65
|
+
rb_declare_transcoder("UTF-8", "EUC-KR", "korean");
|
66
|
+
rb_declare_transcoder("EUC-KR", "UTF-8", "korean");
|
67
|
+
rb_declare_transcoder("UTF-8", "CP949", "korean");
|
68
|
+
rb_declare_transcoder("CP949", "UTF-8", "korean");
|
69
|
+
rb_declare_transcoder("", "universal_newline", "newline");
|
70
|
+
rb_declare_transcoder("", "crlf_newline", "newline");
|
71
|
+
rb_declare_transcoder("", "cr_newline", "newline");
|
72
|
+
rb_declare_transcoder("US-ASCII", "UTF-8", "single_byte");
|
73
|
+
rb_declare_transcoder("UTF-8", "US-ASCII", "single_byte");
|
74
|
+
rb_declare_transcoder("ASCII-8BIT", "UTF-8", "single_byte");
|
75
|
+
rb_declare_transcoder("UTF-8", "ASCII-8BIT", "single_byte");
|
76
|
+
rb_declare_transcoder("ISO-8859-1", "UTF-8", "single_byte");
|
77
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-1", "single_byte");
|
78
|
+
rb_declare_transcoder("ISO-8859-2", "UTF-8", "single_byte");
|
79
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-2", "single_byte");
|
80
|
+
rb_declare_transcoder("ISO-8859-3", "UTF-8", "single_byte");
|
81
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-3", "single_byte");
|
82
|
+
rb_declare_transcoder("ISO-8859-4", "UTF-8", "single_byte");
|
83
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-4", "single_byte");
|
84
|
+
rb_declare_transcoder("ISO-8859-5", "UTF-8", "single_byte");
|
85
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-5", "single_byte");
|
86
|
+
rb_declare_transcoder("ISO-8859-6", "UTF-8", "single_byte");
|
87
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-6", "single_byte");
|
88
|
+
rb_declare_transcoder("ISO-8859-7", "UTF-8", "single_byte");
|
89
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-7", "single_byte");
|
90
|
+
rb_declare_transcoder("ISO-8859-8", "UTF-8", "single_byte");
|
91
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-8", "single_byte");
|
92
|
+
rb_declare_transcoder("ISO-8859-9", "UTF-8", "single_byte");
|
93
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-9", "single_byte");
|
94
|
+
rb_declare_transcoder("ISO-8859-10", "UTF-8", "single_byte");
|
95
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-10", "single_byte");
|
96
|
+
rb_declare_transcoder("ISO-8859-11", "UTF-8", "single_byte");
|
97
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-11", "single_byte");
|
98
|
+
rb_declare_transcoder("ISO-8859-13", "UTF-8", "single_byte");
|
99
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-13", "single_byte");
|
100
|
+
rb_declare_transcoder("ISO-8859-14", "UTF-8", "single_byte");
|
101
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-14", "single_byte");
|
102
|
+
rb_declare_transcoder("ISO-8859-15", "UTF-8", "single_byte");
|
103
|
+
rb_declare_transcoder("UTF-8", "ISO-8859-15", "single_byte");
|
104
|
+
rb_declare_transcoder("WINDOWS-874", "UTF-8", "single_byte");
|
105
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-874", "single_byte");
|
106
|
+
rb_declare_transcoder("WINDOWS-1250", "UTF-8", "single_byte");
|
107
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1250", "single_byte");
|
108
|
+
rb_declare_transcoder("WINDOWS-1251", "UTF-8", "single_byte");
|
109
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1251", "single_byte");
|
110
|
+
rb_declare_transcoder("WINDOWS-1252", "UTF-8", "single_byte");
|
111
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1252", "single_byte");
|
112
|
+
rb_declare_transcoder("WINDOWS-1253", "UTF-8", "single_byte");
|
113
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1253", "single_byte");
|
114
|
+
rb_declare_transcoder("WINDOWS-1254", "UTF-8", "single_byte");
|
115
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1254", "single_byte");
|
116
|
+
rb_declare_transcoder("WINDOWS-1255", "UTF-8", "single_byte");
|
117
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1255", "single_byte");
|
118
|
+
rb_declare_transcoder("WINDOWS-1256", "UTF-8", "single_byte");
|
119
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1256", "single_byte");
|
120
|
+
rb_declare_transcoder("WINDOWS-1257", "UTF-8", "single_byte");
|
121
|
+
rb_declare_transcoder("UTF-8", "WINDOWS-1257", "single_byte");
|
122
|
+
rb_declare_transcoder("IBM437", "UTF-8", "single_byte");
|
123
|
+
rb_declare_transcoder("UTF-8", "IBM437", "single_byte");
|
124
|
+
rb_declare_transcoder("IBM775", "UTF-8", "single_byte");
|
125
|
+
rb_declare_transcoder("UTF-8", "IBM775", "single_byte");
|
126
|
+
rb_declare_transcoder("IBM737", "UTF-8", "single_byte");
|
127
|
+
rb_declare_transcoder("UTF-8", "IBM737", "single_byte");
|
128
|
+
rb_declare_transcoder("IBM852", "UTF-8", "single_byte");
|
129
|
+
rb_declare_transcoder("UTF-8", "IBM852", "single_byte");
|
130
|
+
rb_declare_transcoder("IBM855", "UTF-8", "single_byte");
|
131
|
+
rb_declare_transcoder("UTF-8", "IBM855", "single_byte");
|
132
|
+
rb_declare_transcoder("IBM857", "UTF-8", "single_byte");
|
133
|
+
rb_declare_transcoder("UTF-8", "IBM857", "single_byte");
|
134
|
+
rb_declare_transcoder("IBM860", "UTF-8", "single_byte");
|
135
|
+
rb_declare_transcoder("UTF-8", "IBM860", "single_byte");
|
136
|
+
rb_declare_transcoder("IBM861", "UTF-8", "single_byte");
|
137
|
+
rb_declare_transcoder("UTF-8", "IBM861", "single_byte");
|
138
|
+
rb_declare_transcoder("IBM862", "UTF-8", "single_byte");
|
139
|
+
rb_declare_transcoder("UTF-8", "IBM862", "single_byte");
|
140
|
+
rb_declare_transcoder("IBM863", "UTF-8", "single_byte");
|
141
|
+
rb_declare_transcoder("UTF-8", "IBM863", "single_byte");
|
142
|
+
rb_declare_transcoder("IBM865", "UTF-8", "single_byte");
|
143
|
+
rb_declare_transcoder("UTF-8", "IBM865", "single_byte");
|
144
|
+
rb_declare_transcoder("IBM866", "UTF-8", "single_byte");
|
145
|
+
rb_declare_transcoder("UTF-8", "IBM866", "single_byte");
|
146
|
+
rb_declare_transcoder("IBM869", "UTF-8", "single_byte");
|
147
|
+
rb_declare_transcoder("UTF-8", "IBM869", "single_byte");
|
148
|
+
rb_declare_transcoder("MACCROATIAN", "UTF-8", "single_byte");
|
149
|
+
rb_declare_transcoder("UTF-8", "MACCROATIAN", "single_byte");
|
150
|
+
rb_declare_transcoder("MACCYRILLIC", "UTF-8", "single_byte");
|
151
|
+
rb_declare_transcoder("UTF-8", "MACCYRILLIC", "single_byte");
|
152
|
+
rb_declare_transcoder("MACGREEK", "UTF-8", "single_byte");
|
153
|
+
rb_declare_transcoder("UTF-8", "MACGREEK", "single_byte");
|
154
|
+
rb_declare_transcoder("MACICELAND", "UTF-8", "single_byte");
|
155
|
+
rb_declare_transcoder("UTF-8", "MACICELAND", "single_byte");
|
156
|
+
rb_declare_transcoder("MACROMAN", "UTF-8", "single_byte");
|
157
|
+
rb_declare_transcoder("UTF-8", "MACROMAN", "single_byte");
|
158
|
+
rb_declare_transcoder("MACROMANIA", "UTF-8", "single_byte");
|
159
|
+
rb_declare_transcoder("UTF-8", "MACROMANIA", "single_byte");
|
160
|
+
rb_declare_transcoder("MACTURKISH", "UTF-8", "single_byte");
|
161
|
+
rb_declare_transcoder("UTF-8", "MACTURKISH", "single_byte");
|
162
|
+
rb_declare_transcoder("MACUKRAINE", "UTF-8", "single_byte");
|
163
|
+
rb_declare_transcoder("UTF-8", "MACUKRAINE", "single_byte");
|
164
|
+
rb_declare_transcoder("KOI8-U", "UTF-8", "single_byte");
|
165
|
+
rb_declare_transcoder("UTF-8", "KOI8-U", "single_byte");
|
166
|
+
rb_declare_transcoder("KOI8-R", "UTF-8", "single_byte");
|
167
|
+
rb_declare_transcoder("UTF-8", "KOI8-R", "single_byte");
|
168
|
+
rb_declare_transcoder("TIS-620", "UTF-8", "single_byte");
|
169
|
+
rb_declare_transcoder("UTF-8", "TIS-620", "single_byte");
|
170
|
+
rb_declare_transcoder("CP850", "UTF-8", "single_byte");
|
171
|
+
rb_declare_transcoder("UTF-8", "CP850", "single_byte");
|
172
|
+
rb_declare_transcoder("CP852", "UTF-8", "single_byte");
|
173
|
+
rb_declare_transcoder("UTF-8", "CP852", "single_byte");
|
174
|
+
rb_declare_transcoder("CP855", "UTF-8", "single_byte");
|
175
|
+
rb_declare_transcoder("UTF-8", "CP855", "single_byte");
|
176
|
+
rb_declare_transcoder("UTF-8", "UTF8-MAC", "utf8_mac");
|
177
|
+
rb_declare_transcoder("UTF8-MAC", "UTF-8", "utf8_mac");
|
178
|
+
rb_declare_transcoder("UTF-16BE", "UTF-8", "utf_16_32");
|
179
|
+
rb_declare_transcoder("UTF-8", "UTF-16BE", "utf_16_32");
|
180
|
+
rb_declare_transcoder("UTF-16LE", "UTF-8", "utf_16_32");
|
181
|
+
rb_declare_transcoder("UTF-8", "UTF-16LE", "utf_16_32");
|
182
|
+
rb_declare_transcoder("UTF-32BE", "UTF-8", "utf_16_32");
|
183
|
+
rb_declare_transcoder("UTF-8", "UTF-32BE", "utf_16_32");
|
184
|
+
rb_declare_transcoder("UTF-32LE", "UTF-8", "utf_16_32");
|
185
|
+
rb_declare_transcoder("UTF-8", "UTF-32LE", "utf_16_32");
|
186
|
+
rb_declare_transcoder("UTF-16", "UTF-8", "utf_16_32");
|
187
|
+
rb_declare_transcoder("UTF-32", "UTF-8", "utf_16_32");
|
188
|
+
rb_declare_transcoder("UTF-8", "UTF-16", "utf_16_32");
|
189
|
+
rb_declare_transcoder("UTF-8", "UTF-32", "utf_16_32");
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#define RUBY_VERSION "1.9.3"
|
2
|
+
#define RUBY_PATCHLEVEL 194
|
3
|
+
|
4
|
+
#define RUBY_RELEASE_DATE "2012-04-20"
|
5
|
+
#define RUBY_RELEASE_YEAR 2012
|
6
|
+
#define RUBY_RELEASE_MONTH 4
|
7
|
+
#define RUBY_RELEASE_DAY 20
|
8
|
+
|
9
|
+
#include "ruby/version.h"
|
10
|
+
|
11
|
+
#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
|
12
|
+
# if RUBY_LIB_VERSION_STYLE == 3
|
13
|
+
# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)"."STRINGIZE(RUBY_API_VERSION_TEENY)
|
14
|
+
# elif RUBY_LIB_VERSION_STYLE == 2
|
15
|
+
# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)
|
16
|
+
# endif
|
17
|
+
#endif
|
18
|
+
|
19
|
+
#if RUBY_PATCHLEVEL == -1
|
20
|
+
#define RUBY_PATCHLEVEL_STR "dev"
|
21
|
+
#else
|
22
|
+
#define RUBY_PATCHLEVEL_STR "p"STRINGIZE(RUBY_PATCHLEVEL)
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#ifndef RUBY_REVISION
|
26
|
+
# include "revision.h"
|
27
|
+
#endif
|
28
|
+
# ifndef RUBY_REVISION
|
29
|
+
# define RUBY_REVISION 0
|
30
|
+
#endif
|
31
|
+
|
32
|
+
#if RUBY_REVISION
|
33
|
+
# ifdef RUBY_BRANCH_NAME
|
34
|
+
# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "STRINGIZE(RUBY_REVISION)
|
35
|
+
# else
|
36
|
+
# define RUBY_REVISION_STR " revision "STRINGIZE(RUBY_REVISION)
|
37
|
+
# endif
|
38
|
+
#else
|
39
|
+
# define RUBY_REVISION_STR ""
|
40
|
+
#endif
|
41
|
+
|
42
|
+
# define RUBY_DESCRIPTION \
|
43
|
+
"ruby "RUBY_VERSION \
|
44
|
+
RUBY_PATCHLEVEL_STR \
|
45
|
+
" ("RUBY_RELEASE_DATE \
|
46
|
+
RUBY_REVISION_STR") " \
|
47
|
+
"["RUBY_PLATFORM"]"
|
48
|
+
# define RUBY_COPYRIGHT \
|
49
|
+
"ruby - Copyright (C) " \
|
50
|
+
STRINGIZE(RUBY_BIRTH_YEAR)"-" \
|
51
|
+
STRINGIZE(RUBY_RELEASE_YEAR)" " \
|
52
|
+
RUBY_AUTHOR
|
@@ -0,0 +1,3051 @@
|
|
1
|
+
/* -*-c-*- *********************************************************/
|
2
|
+
/*******************************************************************/
|
3
|
+
/*******************************************************************/
|
4
|
+
/**
|
5
|
+
This file is VM main loop.
|
6
|
+
|
7
|
+
----
|
8
|
+
This file is auto generated by insns2vm.rb
|
9
|
+
DO NOT TOUCH!
|
10
|
+
|
11
|
+
If you want to fix something, you must edit 'insns.c'
|
12
|
+
*/
|
13
|
+
|
14
|
+
|
15
|
+
INSN_ENTRY(nop){
|
16
|
+
{
|
17
|
+
|
18
|
+
|
19
|
+
DEBUG_ENTER_INSN("nop");
|
20
|
+
ADD_PC(1+0);
|
21
|
+
PREFETCH(GET_PC());
|
22
|
+
#define CURRENT_INSN_nop 1
|
23
|
+
#define INSN_IS_SC() 0
|
24
|
+
#define INSN_LABEL(lab) LABEL_nop_##lab
|
25
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
26
|
+
USAGE_ANALYSIS_INSN(BIN(nop));
|
27
|
+
{
|
28
|
+
#line 40 "insns.def"
|
29
|
+
/* none */
|
30
|
+
|
31
|
+
#line 32 "vm.inc"
|
32
|
+
#undef CURRENT_INSN_nop
|
33
|
+
#undef INSN_IS_SC
|
34
|
+
#undef INSN_LABEL
|
35
|
+
#undef LABEL_IS_SC
|
36
|
+
END_INSN(nop);}}}
|
37
|
+
INSN_ENTRY(getlocal){
|
38
|
+
{
|
39
|
+
VALUE val;
|
40
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
41
|
+
|
42
|
+
DEBUG_ENTER_INSN("getlocal");
|
43
|
+
ADD_PC(1+1);
|
44
|
+
PREFETCH(GET_PC());
|
45
|
+
#define CURRENT_INSN_getlocal 1
|
46
|
+
#define INSN_IS_SC() 0
|
47
|
+
#define INSN_LABEL(lab) LABEL_getlocal_##lab
|
48
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
49
|
+
USAGE_ANALYSIS_INSN(BIN(getlocal));
|
50
|
+
USAGE_ANALYSIS_OPERAND(BIN(getlocal), 0, idx);
|
51
|
+
{
|
52
|
+
#line 58 "insns.def"
|
53
|
+
val = *(GET_LFP() - idx);
|
54
|
+
|
55
|
+
#line 56 "vm.inc"
|
56
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
57
|
+
PUSH(val);
|
58
|
+
#undef CURRENT_INSN_getlocal
|
59
|
+
#undef INSN_IS_SC
|
60
|
+
#undef INSN_LABEL
|
61
|
+
#undef LABEL_IS_SC
|
62
|
+
END_INSN(getlocal);}}}
|
63
|
+
INSN_ENTRY(setlocal){
|
64
|
+
{
|
65
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
66
|
+
VALUE val = TOPN(0);
|
67
|
+
DEBUG_ENTER_INSN("setlocal");
|
68
|
+
ADD_PC(1+1);
|
69
|
+
PREFETCH(GET_PC());
|
70
|
+
POPN(1);
|
71
|
+
#define CURRENT_INSN_setlocal 1
|
72
|
+
#define INSN_IS_SC() 0
|
73
|
+
#define INSN_LABEL(lab) LABEL_setlocal_##lab
|
74
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
75
|
+
USAGE_ANALYSIS_INSN(BIN(setlocal));
|
76
|
+
USAGE_ANALYSIS_OPERAND(BIN(setlocal), 0, idx);
|
77
|
+
{
|
78
|
+
#line 72 "insns.def"
|
79
|
+
(*(GET_LFP() - idx)) = val;
|
80
|
+
|
81
|
+
#line 82 "vm.inc"
|
82
|
+
#undef CURRENT_INSN_setlocal
|
83
|
+
#undef INSN_IS_SC
|
84
|
+
#undef INSN_LABEL
|
85
|
+
#undef LABEL_IS_SC
|
86
|
+
END_INSN(setlocal);}}}
|
87
|
+
INSN_ENTRY(getspecial){
|
88
|
+
{
|
89
|
+
VALUE val;
|
90
|
+
rb_num_t type = (rb_num_t)GET_OPERAND(2);
|
91
|
+
VALUE key = (VALUE)GET_OPERAND(1);
|
92
|
+
|
93
|
+
DEBUG_ENTER_INSN("getspecial");
|
94
|
+
ADD_PC(1+2);
|
95
|
+
PREFETCH(GET_PC());
|
96
|
+
#define CURRENT_INSN_getspecial 1
|
97
|
+
#define INSN_IS_SC() 0
|
98
|
+
#define INSN_LABEL(lab) LABEL_getspecial_##lab
|
99
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
100
|
+
USAGE_ANALYSIS_INSN(BIN(getspecial));
|
101
|
+
USAGE_ANALYSIS_OPERAND(BIN(getspecial), 0, key);
|
102
|
+
USAGE_ANALYSIS_OPERAND(BIN(getspecial), 1, type);
|
103
|
+
{
|
104
|
+
#line 86 "insns.def"
|
105
|
+
val = vm_getspecial(th, GET_LFP(), key, type);
|
106
|
+
|
107
|
+
#line 108 "vm.inc"
|
108
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
109
|
+
PUSH(val);
|
110
|
+
#undef CURRENT_INSN_getspecial
|
111
|
+
#undef INSN_IS_SC
|
112
|
+
#undef INSN_LABEL
|
113
|
+
#undef LABEL_IS_SC
|
114
|
+
END_INSN(getspecial);}}}
|
115
|
+
INSN_ENTRY(setspecial){
|
116
|
+
{
|
117
|
+
VALUE key = (VALUE)GET_OPERAND(1);
|
118
|
+
VALUE obj = TOPN(0);
|
119
|
+
DEBUG_ENTER_INSN("setspecial");
|
120
|
+
ADD_PC(1+1);
|
121
|
+
PREFETCH(GET_PC());
|
122
|
+
POPN(1);
|
123
|
+
#define CURRENT_INSN_setspecial 1
|
124
|
+
#define INSN_IS_SC() 0
|
125
|
+
#define INSN_LABEL(lab) LABEL_setspecial_##lab
|
126
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
127
|
+
USAGE_ANALYSIS_INSN(BIN(setspecial));
|
128
|
+
USAGE_ANALYSIS_OPERAND(BIN(setspecial), 0, key);
|
129
|
+
{
|
130
|
+
#line 100 "insns.def"
|
131
|
+
lfp_svar_set(th, GET_LFP(), key, obj);
|
132
|
+
|
133
|
+
#line 134 "vm.inc"
|
134
|
+
#undef CURRENT_INSN_setspecial
|
135
|
+
#undef INSN_IS_SC
|
136
|
+
#undef INSN_LABEL
|
137
|
+
#undef LABEL_IS_SC
|
138
|
+
END_INSN(setspecial);}}}
|
139
|
+
INSN_ENTRY(getdynamic){
|
140
|
+
{
|
141
|
+
VALUE val;
|
142
|
+
rb_num_t level = (rb_num_t)GET_OPERAND(2);
|
143
|
+
dindex_t idx = (dindex_t)GET_OPERAND(1);
|
144
|
+
|
145
|
+
DEBUG_ENTER_INSN("getdynamic");
|
146
|
+
ADD_PC(1+2);
|
147
|
+
PREFETCH(GET_PC());
|
148
|
+
#define CURRENT_INSN_getdynamic 1
|
149
|
+
#define INSN_IS_SC() 0
|
150
|
+
#define INSN_LABEL(lab) LABEL_getdynamic_##lab
|
151
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
152
|
+
USAGE_ANALYSIS_INSN(BIN(getdynamic));
|
153
|
+
USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 0, idx);
|
154
|
+
USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 1, level);
|
155
|
+
{
|
156
|
+
#line 116 "insns.def"
|
157
|
+
rb_num_t i;
|
158
|
+
VALUE *dfp2 = GET_DFP();
|
159
|
+
for (i = 0; i < level; i++) {
|
160
|
+
dfp2 = GET_PREV_DFP(dfp2);
|
161
|
+
}
|
162
|
+
val = *(dfp2 - idx);
|
163
|
+
|
164
|
+
#line 165 "vm.inc"
|
165
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
166
|
+
PUSH(val);
|
167
|
+
#undef CURRENT_INSN_getdynamic
|
168
|
+
#undef INSN_IS_SC
|
169
|
+
#undef INSN_LABEL
|
170
|
+
#undef LABEL_IS_SC
|
171
|
+
END_INSN(getdynamic);}}}
|
172
|
+
INSN_ENTRY(setdynamic){
|
173
|
+
{
|
174
|
+
rb_num_t level = (rb_num_t)GET_OPERAND(2);
|
175
|
+
dindex_t idx = (dindex_t)GET_OPERAND(1);
|
176
|
+
VALUE val = TOPN(0);
|
177
|
+
DEBUG_ENTER_INSN("setdynamic");
|
178
|
+
ADD_PC(1+2);
|
179
|
+
PREFETCH(GET_PC());
|
180
|
+
POPN(1);
|
181
|
+
#define CURRENT_INSN_setdynamic 1
|
182
|
+
#define INSN_IS_SC() 0
|
183
|
+
#define INSN_LABEL(lab) LABEL_setdynamic_##lab
|
184
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
185
|
+
USAGE_ANALYSIS_INSN(BIN(setdynamic));
|
186
|
+
USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 0, idx);
|
187
|
+
USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 1, level);
|
188
|
+
{
|
189
|
+
#line 137 "insns.def"
|
190
|
+
rb_num_t i;
|
191
|
+
VALUE *dfp2 = GET_DFP();
|
192
|
+
for (i = 0; i < level; i++) {
|
193
|
+
dfp2 = GET_PREV_DFP(dfp2);
|
194
|
+
}
|
195
|
+
*(dfp2 - idx) = val;
|
196
|
+
|
197
|
+
#line 198 "vm.inc"
|
198
|
+
#undef CURRENT_INSN_setdynamic
|
199
|
+
#undef INSN_IS_SC
|
200
|
+
#undef INSN_LABEL
|
201
|
+
#undef LABEL_IS_SC
|
202
|
+
END_INSN(setdynamic);}}}
|
203
|
+
INSN_ENTRY(getinstancevariable){
|
204
|
+
{
|
205
|
+
VALUE val;
|
206
|
+
IC ic = (IC)GET_OPERAND(2);
|
207
|
+
ID id = (ID)GET_OPERAND(1);
|
208
|
+
|
209
|
+
DEBUG_ENTER_INSN("getinstancevariable");
|
210
|
+
ADD_PC(1+2);
|
211
|
+
PREFETCH(GET_PC());
|
212
|
+
#define CURRENT_INSN_getinstancevariable 1
|
213
|
+
#define INSN_IS_SC() 0
|
214
|
+
#define INSN_LABEL(lab) LABEL_getinstancevariable_##lab
|
215
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
216
|
+
USAGE_ANALYSIS_INSN(BIN(getinstancevariable));
|
217
|
+
USAGE_ANALYSIS_OPERAND(BIN(getinstancevariable), 0, id);
|
218
|
+
USAGE_ANALYSIS_OPERAND(BIN(getinstancevariable), 1, ic);
|
219
|
+
{
|
220
|
+
#line 157 "insns.def"
|
221
|
+
val = vm_getivar(GET_SELF(), id, ic);
|
222
|
+
|
223
|
+
#line 224 "vm.inc"
|
224
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
225
|
+
PUSH(val);
|
226
|
+
#undef CURRENT_INSN_getinstancevariable
|
227
|
+
#undef INSN_IS_SC
|
228
|
+
#undef INSN_LABEL
|
229
|
+
#undef LABEL_IS_SC
|
230
|
+
END_INSN(getinstancevariable);}}}
|
231
|
+
INSN_ENTRY(setinstancevariable){
|
232
|
+
{
|
233
|
+
IC ic = (IC)GET_OPERAND(2);
|
234
|
+
ID id = (ID)GET_OPERAND(1);
|
235
|
+
VALUE val = TOPN(0);
|
236
|
+
DEBUG_ENTER_INSN("setinstancevariable");
|
237
|
+
ADD_PC(1+2);
|
238
|
+
PREFETCH(GET_PC());
|
239
|
+
POPN(1);
|
240
|
+
#define CURRENT_INSN_setinstancevariable 1
|
241
|
+
#define INSN_IS_SC() 0
|
242
|
+
#define INSN_LABEL(lab) LABEL_setinstancevariable_##lab
|
243
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
244
|
+
USAGE_ANALYSIS_INSN(BIN(setinstancevariable));
|
245
|
+
USAGE_ANALYSIS_OPERAND(BIN(setinstancevariable), 0, id);
|
246
|
+
USAGE_ANALYSIS_OPERAND(BIN(setinstancevariable), 1, ic);
|
247
|
+
{
|
248
|
+
#line 172 "insns.def"
|
249
|
+
vm_setivar(GET_SELF(), id, val, ic);
|
250
|
+
|
251
|
+
#line 252 "vm.inc"
|
252
|
+
#undef CURRENT_INSN_setinstancevariable
|
253
|
+
#undef INSN_IS_SC
|
254
|
+
#undef INSN_LABEL
|
255
|
+
#undef LABEL_IS_SC
|
256
|
+
END_INSN(setinstancevariable);}}}
|
257
|
+
INSN_ENTRY(getclassvariable){
|
258
|
+
{
|
259
|
+
VALUE val;
|
260
|
+
ID id = (ID)GET_OPERAND(1);
|
261
|
+
|
262
|
+
DEBUG_ENTER_INSN("getclassvariable");
|
263
|
+
ADD_PC(1+1);
|
264
|
+
PREFETCH(GET_PC());
|
265
|
+
#define CURRENT_INSN_getclassvariable 1
|
266
|
+
#define INSN_IS_SC() 0
|
267
|
+
#define INSN_LABEL(lab) LABEL_getclassvariable_##lab
|
268
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
269
|
+
USAGE_ANALYSIS_INSN(BIN(getclassvariable));
|
270
|
+
USAGE_ANALYSIS_OPERAND(BIN(getclassvariable), 0, id);
|
271
|
+
{
|
272
|
+
#line 186 "insns.def"
|
273
|
+
NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
|
274
|
+
val = rb_cvar_get(vm_get_cvar_base(cref), id);
|
275
|
+
|
276
|
+
#line 277 "vm.inc"
|
277
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
278
|
+
PUSH(val);
|
279
|
+
#undef CURRENT_INSN_getclassvariable
|
280
|
+
#undef INSN_IS_SC
|
281
|
+
#undef INSN_LABEL
|
282
|
+
#undef LABEL_IS_SC
|
283
|
+
END_INSN(getclassvariable);}}}
|
284
|
+
INSN_ENTRY(setclassvariable){
|
285
|
+
{
|
286
|
+
ID id = (ID)GET_OPERAND(1);
|
287
|
+
VALUE val = TOPN(0);
|
288
|
+
DEBUG_ENTER_INSN("setclassvariable");
|
289
|
+
ADD_PC(1+1);
|
290
|
+
PREFETCH(GET_PC());
|
291
|
+
POPN(1);
|
292
|
+
#define CURRENT_INSN_setclassvariable 1
|
293
|
+
#define INSN_IS_SC() 0
|
294
|
+
#define INSN_LABEL(lab) LABEL_setclassvariable_##lab
|
295
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
296
|
+
USAGE_ANALYSIS_INSN(BIN(setclassvariable));
|
297
|
+
USAGE_ANALYSIS_OPERAND(BIN(setclassvariable), 0, id);
|
298
|
+
{
|
299
|
+
#line 201 "insns.def"
|
300
|
+
NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
|
301
|
+
rb_cvar_set(vm_get_cvar_base(cref), id, val);
|
302
|
+
|
303
|
+
#line 304 "vm.inc"
|
304
|
+
#undef CURRENT_INSN_setclassvariable
|
305
|
+
#undef INSN_IS_SC
|
306
|
+
#undef INSN_LABEL
|
307
|
+
#undef LABEL_IS_SC
|
308
|
+
END_INSN(setclassvariable);}}}
|
309
|
+
INSN_ENTRY(getconstant){
|
310
|
+
{
|
311
|
+
VALUE val;
|
312
|
+
ID id = (ID)GET_OPERAND(1);
|
313
|
+
VALUE klass = TOPN(0);
|
314
|
+
DEBUG_ENTER_INSN("getconstant");
|
315
|
+
ADD_PC(1+1);
|
316
|
+
PREFETCH(GET_PC());
|
317
|
+
POPN(1);
|
318
|
+
#define CURRENT_INSN_getconstant 1
|
319
|
+
#define INSN_IS_SC() 0
|
320
|
+
#define INSN_LABEL(lab) LABEL_getconstant_##lab
|
321
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
322
|
+
USAGE_ANALYSIS_INSN(BIN(getconstant));
|
323
|
+
USAGE_ANALYSIS_OPERAND(BIN(getconstant), 0, id);
|
324
|
+
{
|
325
|
+
#line 223 "insns.def"
|
326
|
+
val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0);
|
327
|
+
|
328
|
+
#line 329 "vm.inc"
|
329
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
330
|
+
PUSH(val);
|
331
|
+
#undef CURRENT_INSN_getconstant
|
332
|
+
#undef INSN_IS_SC
|
333
|
+
#undef INSN_LABEL
|
334
|
+
#undef LABEL_IS_SC
|
335
|
+
END_INSN(getconstant);}}}
|
336
|
+
INSN_ENTRY(setconstant){
|
337
|
+
{
|
338
|
+
ID id = (ID)GET_OPERAND(1);
|
339
|
+
VALUE val = TOPN(1);
|
340
|
+
VALUE cbase = TOPN(0);
|
341
|
+
DEBUG_ENTER_INSN("setconstant");
|
342
|
+
ADD_PC(1+1);
|
343
|
+
PREFETCH(GET_PC());
|
344
|
+
POPN(2);
|
345
|
+
#define CURRENT_INSN_setconstant 1
|
346
|
+
#define INSN_IS_SC() 0
|
347
|
+
#define INSN_LABEL(lab) LABEL_setconstant_##lab
|
348
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
349
|
+
USAGE_ANALYSIS_INSN(BIN(setconstant));
|
350
|
+
USAGE_ANALYSIS_OPERAND(BIN(setconstant), 0, id);
|
351
|
+
{
|
352
|
+
#line 245 "insns.def"
|
353
|
+
vm_check_if_namespace(cbase);
|
354
|
+
rb_const_set(cbase, id, val);
|
355
|
+
INC_VM_STATE_VERSION();
|
356
|
+
|
357
|
+
#line 358 "vm.inc"
|
358
|
+
#undef CURRENT_INSN_setconstant
|
359
|
+
#undef INSN_IS_SC
|
360
|
+
#undef INSN_LABEL
|
361
|
+
#undef LABEL_IS_SC
|
362
|
+
END_INSN(setconstant);}}}
|
363
|
+
INSN_ENTRY(getglobal){
|
364
|
+
{
|
365
|
+
VALUE val;
|
366
|
+
GENTRY entry = (GENTRY)GET_OPERAND(1);
|
367
|
+
|
368
|
+
DEBUG_ENTER_INSN("getglobal");
|
369
|
+
ADD_PC(1+1);
|
370
|
+
PREFETCH(GET_PC());
|
371
|
+
#define CURRENT_INSN_getglobal 1
|
372
|
+
#define INSN_IS_SC() 0
|
373
|
+
#define INSN_LABEL(lab) LABEL_getglobal_##lab
|
374
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
375
|
+
USAGE_ANALYSIS_INSN(BIN(getglobal));
|
376
|
+
USAGE_ANALYSIS_OPERAND(BIN(getglobal), 0, entry);
|
377
|
+
{
|
378
|
+
#line 261 "insns.def"
|
379
|
+
val = GET_GLOBAL((VALUE)entry);
|
380
|
+
|
381
|
+
#line 382 "vm.inc"
|
382
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
383
|
+
PUSH(val);
|
384
|
+
#undef CURRENT_INSN_getglobal
|
385
|
+
#undef INSN_IS_SC
|
386
|
+
#undef INSN_LABEL
|
387
|
+
#undef LABEL_IS_SC
|
388
|
+
END_INSN(getglobal);}}}
|
389
|
+
INSN_ENTRY(setglobal){
|
390
|
+
{
|
391
|
+
GENTRY entry = (GENTRY)GET_OPERAND(1);
|
392
|
+
VALUE val = TOPN(0);
|
393
|
+
DEBUG_ENTER_INSN("setglobal");
|
394
|
+
ADD_PC(1+1);
|
395
|
+
PREFETCH(GET_PC());
|
396
|
+
POPN(1);
|
397
|
+
#define CURRENT_INSN_setglobal 1
|
398
|
+
#define INSN_IS_SC() 0
|
399
|
+
#define INSN_LABEL(lab) LABEL_setglobal_##lab
|
400
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
401
|
+
USAGE_ANALYSIS_INSN(BIN(setglobal));
|
402
|
+
USAGE_ANALYSIS_OPERAND(BIN(setglobal), 0, entry);
|
403
|
+
{
|
404
|
+
#line 275 "insns.def"
|
405
|
+
SET_GLOBAL((VALUE)entry, val);
|
406
|
+
|
407
|
+
#line 408 "vm.inc"
|
408
|
+
#undef CURRENT_INSN_setglobal
|
409
|
+
#undef INSN_IS_SC
|
410
|
+
#undef INSN_LABEL
|
411
|
+
#undef LABEL_IS_SC
|
412
|
+
END_INSN(setglobal);}}}
|
413
|
+
INSN_ENTRY(putnil){
|
414
|
+
{
|
415
|
+
VALUE val;
|
416
|
+
|
417
|
+
|
418
|
+
DEBUG_ENTER_INSN("putnil");
|
419
|
+
ADD_PC(1+0);
|
420
|
+
PREFETCH(GET_PC());
|
421
|
+
#define CURRENT_INSN_putnil 1
|
422
|
+
#define INSN_IS_SC() 0
|
423
|
+
#define INSN_LABEL(lab) LABEL_putnil_##lab
|
424
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
425
|
+
USAGE_ANALYSIS_INSN(BIN(putnil));
|
426
|
+
{
|
427
|
+
#line 294 "insns.def"
|
428
|
+
val = Qnil;
|
429
|
+
|
430
|
+
#line 431 "vm.inc"
|
431
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
432
|
+
PUSH(val);
|
433
|
+
#undef CURRENT_INSN_putnil
|
434
|
+
#undef INSN_IS_SC
|
435
|
+
#undef INSN_LABEL
|
436
|
+
#undef LABEL_IS_SC
|
437
|
+
END_INSN(putnil);}}}
|
438
|
+
INSN_ENTRY(putself){
|
439
|
+
{
|
440
|
+
VALUE val;
|
441
|
+
|
442
|
+
|
443
|
+
DEBUG_ENTER_INSN("putself");
|
444
|
+
ADD_PC(1+0);
|
445
|
+
PREFETCH(GET_PC());
|
446
|
+
#define CURRENT_INSN_putself 1
|
447
|
+
#define INSN_IS_SC() 0
|
448
|
+
#define INSN_LABEL(lab) LABEL_putself_##lab
|
449
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
450
|
+
USAGE_ANALYSIS_INSN(BIN(putself));
|
451
|
+
{
|
452
|
+
#line 308 "insns.def"
|
453
|
+
val = GET_SELF();
|
454
|
+
|
455
|
+
#line 456 "vm.inc"
|
456
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
457
|
+
PUSH(val);
|
458
|
+
#undef CURRENT_INSN_putself
|
459
|
+
#undef INSN_IS_SC
|
460
|
+
#undef INSN_LABEL
|
461
|
+
#undef LABEL_IS_SC
|
462
|
+
END_INSN(putself);}}}
|
463
|
+
INSN_ENTRY(putobject){
|
464
|
+
{
|
465
|
+
VALUE val = (VALUE)GET_OPERAND(1);
|
466
|
+
|
467
|
+
DEBUG_ENTER_INSN("putobject");
|
468
|
+
ADD_PC(1+1);
|
469
|
+
PREFETCH(GET_PC());
|
470
|
+
#define CURRENT_INSN_putobject 1
|
471
|
+
#define INSN_IS_SC() 0
|
472
|
+
#define INSN_LABEL(lab) LABEL_putobject_##lab
|
473
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
474
|
+
USAGE_ANALYSIS_INSN(BIN(putobject));
|
475
|
+
USAGE_ANALYSIS_OPERAND(BIN(putobject), 0, val);
|
476
|
+
{
|
477
|
+
#line 324 "insns.def"
|
478
|
+
/* */
|
479
|
+
|
480
|
+
#line 481 "vm.inc"
|
481
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
482
|
+
PUSH(val);
|
483
|
+
#undef CURRENT_INSN_putobject
|
484
|
+
#undef INSN_IS_SC
|
485
|
+
#undef INSN_LABEL
|
486
|
+
#undef LABEL_IS_SC
|
487
|
+
END_INSN(putobject);}}}
|
488
|
+
INSN_ENTRY(putspecialobject){
|
489
|
+
{
|
490
|
+
VALUE val;
|
491
|
+
rb_num_t value_type = (rb_num_t)GET_OPERAND(1);
|
492
|
+
|
493
|
+
DEBUG_ENTER_INSN("putspecialobject");
|
494
|
+
ADD_PC(1+1);
|
495
|
+
PREFETCH(GET_PC());
|
496
|
+
#define CURRENT_INSN_putspecialobject 1
|
497
|
+
#define INSN_IS_SC() 0
|
498
|
+
#define INSN_LABEL(lab) LABEL_putspecialobject_##lab
|
499
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
500
|
+
USAGE_ANALYSIS_INSN(BIN(putspecialobject));
|
501
|
+
USAGE_ANALYSIS_OPERAND(BIN(putspecialobject), 0, value_type);
|
502
|
+
{
|
503
|
+
#line 339 "insns.def"
|
504
|
+
enum vm_special_object_type type = (enum vm_special_object_type)value_type;
|
505
|
+
|
506
|
+
switch (type) {
|
507
|
+
case VM_SPECIAL_OBJECT_VMCORE:
|
508
|
+
val = rb_mRubyVMFrozenCore;
|
509
|
+
break;
|
510
|
+
case VM_SPECIAL_OBJECT_CBASE:
|
511
|
+
val = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
|
512
|
+
break;
|
513
|
+
case VM_SPECIAL_OBJECT_CONST_BASE:
|
514
|
+
val = vm_get_const_base(GET_ISEQ(), GET_LFP(), GET_DFP());
|
515
|
+
break;
|
516
|
+
default:
|
517
|
+
rb_bug("putspecialobject insn: unknown value_type");
|
518
|
+
}
|
519
|
+
|
520
|
+
#line 521 "vm.inc"
|
521
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
522
|
+
PUSH(val);
|
523
|
+
#undef CURRENT_INSN_putspecialobject
|
524
|
+
#undef INSN_IS_SC
|
525
|
+
#undef INSN_LABEL
|
526
|
+
#undef LABEL_IS_SC
|
527
|
+
END_INSN(putspecialobject);}}}
|
528
|
+
INSN_ENTRY(putiseq){
|
529
|
+
{
|
530
|
+
VALUE ret;
|
531
|
+
ISEQ iseq = (ISEQ)GET_OPERAND(1);
|
532
|
+
|
533
|
+
DEBUG_ENTER_INSN("putiseq");
|
534
|
+
ADD_PC(1+1);
|
535
|
+
PREFETCH(GET_PC());
|
536
|
+
#define CURRENT_INSN_putiseq 1
|
537
|
+
#define INSN_IS_SC() 0
|
538
|
+
#define INSN_LABEL(lab) LABEL_putiseq_##lab
|
539
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
540
|
+
USAGE_ANALYSIS_INSN(BIN(putiseq));
|
541
|
+
USAGE_ANALYSIS_OPERAND(BIN(putiseq), 0, iseq);
|
542
|
+
{
|
543
|
+
#line 367 "insns.def"
|
544
|
+
ret = iseq->self;
|
545
|
+
|
546
|
+
#line 547 "vm.inc"
|
547
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
548
|
+
PUSH(ret);
|
549
|
+
#undef CURRENT_INSN_putiseq
|
550
|
+
#undef INSN_IS_SC
|
551
|
+
#undef INSN_LABEL
|
552
|
+
#undef LABEL_IS_SC
|
553
|
+
END_INSN(putiseq);}}}
|
554
|
+
INSN_ENTRY(putstring){
|
555
|
+
{
|
556
|
+
VALUE val;
|
557
|
+
VALUE str = (VALUE)GET_OPERAND(1);
|
558
|
+
|
559
|
+
DEBUG_ENTER_INSN("putstring");
|
560
|
+
ADD_PC(1+1);
|
561
|
+
PREFETCH(GET_PC());
|
562
|
+
#define CURRENT_INSN_putstring 1
|
563
|
+
#define INSN_IS_SC() 0
|
564
|
+
#define INSN_LABEL(lab) LABEL_putstring_##lab
|
565
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
566
|
+
USAGE_ANALYSIS_INSN(BIN(putstring));
|
567
|
+
USAGE_ANALYSIS_OPERAND(BIN(putstring), 0, str);
|
568
|
+
{
|
569
|
+
#line 381 "insns.def"
|
570
|
+
val = rb_str_resurrect(str);
|
571
|
+
|
572
|
+
#line 573 "vm.inc"
|
573
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
574
|
+
PUSH(val);
|
575
|
+
#undef CURRENT_INSN_putstring
|
576
|
+
#undef INSN_IS_SC
|
577
|
+
#undef INSN_LABEL
|
578
|
+
#undef LABEL_IS_SC
|
579
|
+
END_INSN(putstring);}}}
|
580
|
+
INSN_ENTRY(concatstrings){
|
581
|
+
{
|
582
|
+
VALUE val;
|
583
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
584
|
+
|
585
|
+
DEBUG_ENTER_INSN("concatstrings");
|
586
|
+
ADD_PC(1+1);
|
587
|
+
PREFETCH(GET_PC());
|
588
|
+
#define CURRENT_INSN_concatstrings 1
|
589
|
+
#define INSN_IS_SC() 0
|
590
|
+
#define INSN_LABEL(lab) LABEL_concatstrings_##lab
|
591
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
592
|
+
USAGE_ANALYSIS_INSN(BIN(concatstrings));
|
593
|
+
USAGE_ANALYSIS_OPERAND(BIN(concatstrings), 0, num);
|
594
|
+
{
|
595
|
+
#line 395 "insns.def"
|
596
|
+
rb_num_t i = num - 1;
|
597
|
+
|
598
|
+
val = rb_str_resurrect(TOPN(i));
|
599
|
+
while (i-- > 0) {
|
600
|
+
const VALUE v = TOPN(i);
|
601
|
+
rb_str_append(val, v);
|
602
|
+
}
|
603
|
+
POPN(num);
|
604
|
+
|
605
|
+
#line 606 "vm.inc"
|
606
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
607
|
+
PUSH(val);
|
608
|
+
#undef CURRENT_INSN_concatstrings
|
609
|
+
#undef INSN_IS_SC
|
610
|
+
#undef INSN_LABEL
|
611
|
+
#undef LABEL_IS_SC
|
612
|
+
END_INSN(concatstrings);}}}
|
613
|
+
INSN_ENTRY(tostring){
|
614
|
+
{
|
615
|
+
|
616
|
+
VALUE val = TOPN(0);
|
617
|
+
DEBUG_ENTER_INSN("tostring");
|
618
|
+
ADD_PC(1+0);
|
619
|
+
PREFETCH(GET_PC());
|
620
|
+
POPN(1);
|
621
|
+
#define CURRENT_INSN_tostring 1
|
622
|
+
#define INSN_IS_SC() 0
|
623
|
+
#define INSN_LABEL(lab) LABEL_tostring_##lab
|
624
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
625
|
+
USAGE_ANALYSIS_INSN(BIN(tostring));
|
626
|
+
{
|
627
|
+
#line 416 "insns.def"
|
628
|
+
val = rb_obj_as_string(val);
|
629
|
+
|
630
|
+
#line 631 "vm.inc"
|
631
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
632
|
+
PUSH(val);
|
633
|
+
#undef CURRENT_INSN_tostring
|
634
|
+
#undef INSN_IS_SC
|
635
|
+
#undef INSN_LABEL
|
636
|
+
#undef LABEL_IS_SC
|
637
|
+
END_INSN(tostring);}}}
|
638
|
+
INSN_ENTRY(toregexp){
|
639
|
+
{
|
640
|
+
VALUE val;
|
641
|
+
rb_num_t cnt = (rb_num_t)GET_OPERAND(2);
|
642
|
+
rb_num_t opt = (rb_num_t)GET_OPERAND(1);
|
643
|
+
|
644
|
+
DEBUG_ENTER_INSN("toregexp");
|
645
|
+
ADD_PC(1+2);
|
646
|
+
PREFETCH(GET_PC());
|
647
|
+
#define CURRENT_INSN_toregexp 1
|
648
|
+
#define INSN_IS_SC() 0
|
649
|
+
#define INSN_LABEL(lab) LABEL_toregexp_##lab
|
650
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
651
|
+
USAGE_ANALYSIS_INSN(BIN(toregexp));
|
652
|
+
USAGE_ANALYSIS_OPERAND(BIN(toregexp), 0, opt);
|
653
|
+
USAGE_ANALYSIS_OPERAND(BIN(toregexp), 1, cnt);
|
654
|
+
{
|
655
|
+
#line 431 "insns.def"
|
656
|
+
VALUE rb_reg_new_ary(VALUE ary, int options);
|
657
|
+
rb_num_t i;
|
658
|
+
const VALUE ary = rb_ary_tmp_new(cnt);
|
659
|
+
for (i = 0; i < cnt; i++) {
|
660
|
+
rb_ary_store(ary, cnt-i-1, TOPN(i));
|
661
|
+
}
|
662
|
+
POPN(cnt);
|
663
|
+
val = rb_reg_new_ary(ary, (int)opt);
|
664
|
+
rb_ary_clear(ary);
|
665
|
+
|
666
|
+
#line 667 "vm.inc"
|
667
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
668
|
+
PUSH(val);
|
669
|
+
#undef CURRENT_INSN_toregexp
|
670
|
+
#undef INSN_IS_SC
|
671
|
+
#undef INSN_LABEL
|
672
|
+
#undef LABEL_IS_SC
|
673
|
+
END_INSN(toregexp);}}}
|
674
|
+
INSN_ENTRY(newarray){
|
675
|
+
{
|
676
|
+
VALUE val;
|
677
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
678
|
+
|
679
|
+
DEBUG_ENTER_INSN("newarray");
|
680
|
+
ADD_PC(1+1);
|
681
|
+
PREFETCH(GET_PC());
|
682
|
+
#define CURRENT_INSN_newarray 1
|
683
|
+
#define INSN_IS_SC() 0
|
684
|
+
#define INSN_LABEL(lab) LABEL_newarray_##lab
|
685
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
686
|
+
USAGE_ANALYSIS_INSN(BIN(newarray));
|
687
|
+
USAGE_ANALYSIS_OPERAND(BIN(newarray), 0, num);
|
688
|
+
{
|
689
|
+
#line 453 "insns.def"
|
690
|
+
val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num));
|
691
|
+
POPN(num);
|
692
|
+
|
693
|
+
#line 694 "vm.inc"
|
694
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
695
|
+
PUSH(val);
|
696
|
+
#undef CURRENT_INSN_newarray
|
697
|
+
#undef INSN_IS_SC
|
698
|
+
#undef INSN_LABEL
|
699
|
+
#undef LABEL_IS_SC
|
700
|
+
END_INSN(newarray);}}}
|
701
|
+
INSN_ENTRY(duparray){
|
702
|
+
{
|
703
|
+
VALUE val;
|
704
|
+
VALUE ary = (VALUE)GET_OPERAND(1);
|
705
|
+
|
706
|
+
DEBUG_ENTER_INSN("duparray");
|
707
|
+
ADD_PC(1+1);
|
708
|
+
PREFETCH(GET_PC());
|
709
|
+
#define CURRENT_INSN_duparray 1
|
710
|
+
#define INSN_IS_SC() 0
|
711
|
+
#define INSN_LABEL(lab) LABEL_duparray_##lab
|
712
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
713
|
+
USAGE_ANALYSIS_INSN(BIN(duparray));
|
714
|
+
USAGE_ANALYSIS_OPERAND(BIN(duparray), 0, ary);
|
715
|
+
{
|
716
|
+
#line 468 "insns.def"
|
717
|
+
val = rb_ary_resurrect(ary);
|
718
|
+
|
719
|
+
#line 720 "vm.inc"
|
720
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
721
|
+
PUSH(val);
|
722
|
+
#undef CURRENT_INSN_duparray
|
723
|
+
#undef INSN_IS_SC
|
724
|
+
#undef INSN_LABEL
|
725
|
+
#undef LABEL_IS_SC
|
726
|
+
END_INSN(duparray);}}}
|
727
|
+
INSN_ENTRY(expandarray){
|
728
|
+
{
|
729
|
+
rb_num_t flag = (rb_num_t)GET_OPERAND(2);
|
730
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
731
|
+
VALUE ary = TOPN(0);
|
732
|
+
DEBUG_ENTER_INSN("expandarray");
|
733
|
+
ADD_PC(1+2);
|
734
|
+
PREFETCH(GET_PC());
|
735
|
+
POPN(1);
|
736
|
+
#define CURRENT_INSN_expandarray 1
|
737
|
+
#define INSN_IS_SC() 0
|
738
|
+
#define INSN_LABEL(lab) LABEL_expandarray_##lab
|
739
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
740
|
+
USAGE_ANALYSIS_INSN(BIN(expandarray));
|
741
|
+
USAGE_ANALYSIS_OPERAND(BIN(expandarray), 0, num);
|
742
|
+
USAGE_ANALYSIS_OPERAND(BIN(expandarray), 1, flag);
|
743
|
+
{
|
744
|
+
#line 489 "insns.def"
|
745
|
+
vm_expandarray(GET_CFP(), ary, num, (int)flag);
|
746
|
+
|
747
|
+
#line 748 "vm.inc"
|
748
|
+
#undef CURRENT_INSN_expandarray
|
749
|
+
#undef INSN_IS_SC
|
750
|
+
#undef INSN_LABEL
|
751
|
+
#undef LABEL_IS_SC
|
752
|
+
END_INSN(expandarray);}}}
|
753
|
+
INSN_ENTRY(concatarray){
|
754
|
+
{
|
755
|
+
VALUE ary;
|
756
|
+
|
757
|
+
VALUE ary1 = TOPN(1);
|
758
|
+
VALUE ary2st = TOPN(0);
|
759
|
+
DEBUG_ENTER_INSN("concatarray");
|
760
|
+
ADD_PC(1+0);
|
761
|
+
PREFETCH(GET_PC());
|
762
|
+
POPN(2);
|
763
|
+
#define CURRENT_INSN_concatarray 1
|
764
|
+
#define INSN_IS_SC() 0
|
765
|
+
#define INSN_LABEL(lab) LABEL_concatarray_##lab
|
766
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
767
|
+
USAGE_ANALYSIS_INSN(BIN(concatarray));
|
768
|
+
{
|
769
|
+
#line 503 "insns.def"
|
770
|
+
const VALUE ary2 = ary2st;
|
771
|
+
VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_a");
|
772
|
+
VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_a");
|
773
|
+
|
774
|
+
if (NIL_P(tmp1)) {
|
775
|
+
tmp1 = rb_ary_new3(1, ary1);
|
776
|
+
}
|
777
|
+
|
778
|
+
if (NIL_P(tmp2)) {
|
779
|
+
tmp2 = rb_ary_new3(1, ary2);
|
780
|
+
}
|
781
|
+
|
782
|
+
if (tmp1 == ary1) {
|
783
|
+
tmp1 = rb_ary_dup(ary1);
|
784
|
+
}
|
785
|
+
ary = rb_ary_concat(tmp1, tmp2);
|
786
|
+
|
787
|
+
#line 788 "vm.inc"
|
788
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
789
|
+
PUSH(ary);
|
790
|
+
#undef CURRENT_INSN_concatarray
|
791
|
+
#undef INSN_IS_SC
|
792
|
+
#undef INSN_LABEL
|
793
|
+
#undef LABEL_IS_SC
|
794
|
+
END_INSN(concatarray);}}}
|
795
|
+
INSN_ENTRY(splatarray){
|
796
|
+
{
|
797
|
+
VALUE obj;
|
798
|
+
|
799
|
+
VALUE ary = TOPN(0);
|
800
|
+
DEBUG_ENTER_INSN("splatarray");
|
801
|
+
ADD_PC(1+1);
|
802
|
+
PREFETCH(GET_PC());
|
803
|
+
POPN(1);
|
804
|
+
#define CURRENT_INSN_splatarray 1
|
805
|
+
#define INSN_IS_SC() 0
|
806
|
+
#define INSN_LABEL(lab) LABEL_splatarray_##lab
|
807
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
808
|
+
USAGE_ANALYSIS_INSN(BIN(splatarray));
|
809
|
+
USAGE_ANALYSIS_OPERAND(BIN(splatarray), 0, flag);
|
810
|
+
{
|
811
|
+
#line 532 "insns.def"
|
812
|
+
VALUE tmp = rb_check_convert_type(ary, T_ARRAY, "Array", "to_a");
|
813
|
+
if (NIL_P(tmp)) {
|
814
|
+
tmp = rb_ary_new3(1, ary);
|
815
|
+
}
|
816
|
+
obj = tmp;
|
817
|
+
|
818
|
+
#line 819 "vm.inc"
|
819
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
820
|
+
PUSH(obj);
|
821
|
+
#undef CURRENT_INSN_splatarray
|
822
|
+
#undef INSN_IS_SC
|
823
|
+
#undef INSN_LABEL
|
824
|
+
#undef LABEL_IS_SC
|
825
|
+
END_INSN(splatarray);}}}
|
826
|
+
INSN_ENTRY(checkincludearray){
|
827
|
+
{
|
828
|
+
VALUE result;
|
829
|
+
VALUE flag = (VALUE)GET_OPERAND(1);
|
830
|
+
VALUE obj = TOPN(1);
|
831
|
+
VALUE ary = TOPN(0);
|
832
|
+
DEBUG_ENTER_INSN("checkincludearray");
|
833
|
+
ADD_PC(1+1);
|
834
|
+
PREFETCH(GET_PC());
|
835
|
+
POPN(2);
|
836
|
+
#define CURRENT_INSN_checkincludearray 1
|
837
|
+
#define INSN_IS_SC() 0
|
838
|
+
#define INSN_LABEL(lab) LABEL_checkincludearray_##lab
|
839
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
840
|
+
USAGE_ANALYSIS_INSN(BIN(checkincludearray));
|
841
|
+
USAGE_ANALYSIS_OPERAND(BIN(checkincludearray), 0, flag);
|
842
|
+
{
|
843
|
+
#line 550 "insns.def"
|
844
|
+
int i;
|
845
|
+
result = Qfalse;
|
846
|
+
|
847
|
+
if (TYPE(ary) != T_ARRAY) {
|
848
|
+
ary = rb_Array(ary);
|
849
|
+
}
|
850
|
+
|
851
|
+
if (flag == Qtrue) {
|
852
|
+
/* NODE_CASE */
|
853
|
+
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
854
|
+
/* TODO: fix me (use another method dispatch) */
|
855
|
+
if (RTEST(rb_funcall2(RARRAY_PTR(ary)[i], idEqq, 1, &obj))) {
|
856
|
+
result = Qtrue;
|
857
|
+
break;
|
858
|
+
}
|
859
|
+
}
|
860
|
+
}
|
861
|
+
else {
|
862
|
+
obj = Qfalse;
|
863
|
+
/* NODE_WHEN */
|
864
|
+
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
865
|
+
if (RTEST(RARRAY_PTR(ary)[i])) {
|
866
|
+
obj = result = Qtrue;
|
867
|
+
break;
|
868
|
+
}
|
869
|
+
}
|
870
|
+
}
|
871
|
+
|
872
|
+
#line 873 "vm.inc"
|
873
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 2);
|
874
|
+
PUSH(obj);
|
875
|
+
PUSH(result);
|
876
|
+
#undef CURRENT_INSN_checkincludearray
|
877
|
+
#undef INSN_IS_SC
|
878
|
+
#undef INSN_LABEL
|
879
|
+
#undef LABEL_IS_SC
|
880
|
+
END_INSN(checkincludearray);}}}
|
881
|
+
INSN_ENTRY(newhash){
|
882
|
+
{
|
883
|
+
VALUE val;
|
884
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
885
|
+
|
886
|
+
DEBUG_ENTER_INSN("newhash");
|
887
|
+
ADD_PC(1+1);
|
888
|
+
PREFETCH(GET_PC());
|
889
|
+
#define CURRENT_INSN_newhash 1
|
890
|
+
#define INSN_IS_SC() 0
|
891
|
+
#define INSN_LABEL(lab) LABEL_newhash_##lab
|
892
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
893
|
+
USAGE_ANALYSIS_INSN(BIN(newhash));
|
894
|
+
USAGE_ANALYSIS_OPERAND(BIN(newhash), 0, num);
|
895
|
+
{
|
896
|
+
#line 591 "insns.def"
|
897
|
+
rb_num_t i;
|
898
|
+
val = rb_hash_new();
|
899
|
+
|
900
|
+
for (i = num; i > 0; i -= 2) {
|
901
|
+
const VALUE v = TOPN(i - 2);
|
902
|
+
const VALUE k = TOPN(i - 1);
|
903
|
+
rb_hash_aset(val, k, v);
|
904
|
+
}
|
905
|
+
POPN(num);
|
906
|
+
|
907
|
+
#line 908 "vm.inc"
|
908
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
909
|
+
PUSH(val);
|
910
|
+
#undef CURRENT_INSN_newhash
|
911
|
+
#undef INSN_IS_SC
|
912
|
+
#undef INSN_LABEL
|
913
|
+
#undef LABEL_IS_SC
|
914
|
+
END_INSN(newhash);}}}
|
915
|
+
INSN_ENTRY(newrange){
|
916
|
+
{
|
917
|
+
VALUE val;
|
918
|
+
rb_num_t flag = (rb_num_t)GET_OPERAND(1);
|
919
|
+
VALUE low = TOPN(1);
|
920
|
+
VALUE high = TOPN(0);
|
921
|
+
DEBUG_ENTER_INSN("newrange");
|
922
|
+
ADD_PC(1+1);
|
923
|
+
PREFETCH(GET_PC());
|
924
|
+
POPN(2);
|
925
|
+
#define CURRENT_INSN_newrange 1
|
926
|
+
#define INSN_IS_SC() 0
|
927
|
+
#define INSN_LABEL(lab) LABEL_newrange_##lab
|
928
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
929
|
+
USAGE_ANALYSIS_INSN(BIN(newrange));
|
930
|
+
USAGE_ANALYSIS_OPERAND(BIN(newrange), 0, flag);
|
931
|
+
{
|
932
|
+
#line 613 "insns.def"
|
933
|
+
val = rb_range_new(low, high, (int)flag);
|
934
|
+
|
935
|
+
#line 936 "vm.inc"
|
936
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
937
|
+
PUSH(val);
|
938
|
+
#undef CURRENT_INSN_newrange
|
939
|
+
#undef INSN_IS_SC
|
940
|
+
#undef INSN_LABEL
|
941
|
+
#undef LABEL_IS_SC
|
942
|
+
END_INSN(newrange);}}}
|
943
|
+
INSN_ENTRY(pop){
|
944
|
+
{
|
945
|
+
|
946
|
+
VALUE val = TOPN(0);
|
947
|
+
DEBUG_ENTER_INSN("pop");
|
948
|
+
ADD_PC(1+0);
|
949
|
+
PREFETCH(GET_PC());
|
950
|
+
POPN(1);
|
951
|
+
#define CURRENT_INSN_pop 1
|
952
|
+
#define INSN_IS_SC() 0
|
953
|
+
#define INSN_LABEL(lab) LABEL_pop_##lab
|
954
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
955
|
+
USAGE_ANALYSIS_INSN(BIN(pop));
|
956
|
+
{
|
957
|
+
#line 631 "insns.def"
|
958
|
+
val = val;
|
959
|
+
/* none */
|
960
|
+
|
961
|
+
#line 962 "vm.inc"
|
962
|
+
#undef CURRENT_INSN_pop
|
963
|
+
#undef INSN_IS_SC
|
964
|
+
#undef INSN_LABEL
|
965
|
+
#undef LABEL_IS_SC
|
966
|
+
END_INSN(pop);}}}
|
967
|
+
INSN_ENTRY(dup){
|
968
|
+
{
|
969
|
+
VALUE val2;
|
970
|
+
VALUE val1;
|
971
|
+
|
972
|
+
VALUE val = TOPN(0);
|
973
|
+
DEBUG_ENTER_INSN("dup");
|
974
|
+
ADD_PC(1+0);
|
975
|
+
PREFETCH(GET_PC());
|
976
|
+
POPN(1);
|
977
|
+
#define CURRENT_INSN_dup 1
|
978
|
+
#define INSN_IS_SC() 0
|
979
|
+
#define INSN_LABEL(lab) LABEL_dup_##lab
|
980
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
981
|
+
USAGE_ANALYSIS_INSN(BIN(dup));
|
982
|
+
{
|
983
|
+
#line 646 "insns.def"
|
984
|
+
val1 = val2 = val;
|
985
|
+
|
986
|
+
#line 987 "vm.inc"
|
987
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 2);
|
988
|
+
PUSH(val1);
|
989
|
+
PUSH(val2);
|
990
|
+
#undef CURRENT_INSN_dup
|
991
|
+
#undef INSN_IS_SC
|
992
|
+
#undef INSN_LABEL
|
993
|
+
#undef LABEL_IS_SC
|
994
|
+
END_INSN(dup);}}}
|
995
|
+
INSN_ENTRY(dupn){
|
996
|
+
{
|
997
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
998
|
+
|
999
|
+
DEBUG_ENTER_INSN("dupn");
|
1000
|
+
ADD_PC(1+1);
|
1001
|
+
PREFETCH(GET_PC());
|
1002
|
+
#define CURRENT_INSN_dupn 1
|
1003
|
+
#define INSN_IS_SC() 0
|
1004
|
+
#define INSN_LABEL(lab) LABEL_dupn_##lab
|
1005
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1006
|
+
USAGE_ANALYSIS_INSN(BIN(dupn));
|
1007
|
+
USAGE_ANALYSIS_OPERAND(BIN(dupn), 0, n);
|
1008
|
+
{
|
1009
|
+
#line 660 "insns.def"
|
1010
|
+
rb_num_t i;
|
1011
|
+
VALUE *sp = STACK_ADDR_FROM_TOP(n);
|
1012
|
+
for (i = 0; i < n; i++) {
|
1013
|
+
GET_SP()[i] = sp[i];
|
1014
|
+
}
|
1015
|
+
INC_SP(n);
|
1016
|
+
|
1017
|
+
#line 1018 "vm.inc"
|
1018
|
+
#undef CURRENT_INSN_dupn
|
1019
|
+
#undef INSN_IS_SC
|
1020
|
+
#undef INSN_LABEL
|
1021
|
+
#undef LABEL_IS_SC
|
1022
|
+
END_INSN(dupn);}}}
|
1023
|
+
INSN_ENTRY(swap){
|
1024
|
+
{
|
1025
|
+
|
1026
|
+
VALUE val = TOPN(1);
|
1027
|
+
VALUE obj = TOPN(0);
|
1028
|
+
DEBUG_ENTER_INSN("swap");
|
1029
|
+
ADD_PC(1+0);
|
1030
|
+
PREFETCH(GET_PC());
|
1031
|
+
POPN(2);
|
1032
|
+
#define CURRENT_INSN_swap 1
|
1033
|
+
#define INSN_IS_SC() 0
|
1034
|
+
#define INSN_LABEL(lab) LABEL_swap_##lab
|
1035
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1036
|
+
USAGE_ANALYSIS_INSN(BIN(swap));
|
1037
|
+
{
|
1038
|
+
#line 680 "insns.def"
|
1039
|
+
/* none */
|
1040
|
+
|
1041
|
+
#line 1042 "vm.inc"
|
1042
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 2);
|
1043
|
+
PUSH(obj);
|
1044
|
+
PUSH(val);
|
1045
|
+
#undef CURRENT_INSN_swap
|
1046
|
+
#undef INSN_IS_SC
|
1047
|
+
#undef INSN_LABEL
|
1048
|
+
#undef LABEL_IS_SC
|
1049
|
+
END_INSN(swap);}}}
|
1050
|
+
INSN_ENTRY(reput){
|
1051
|
+
{
|
1052
|
+
|
1053
|
+
VALUE val = TOPN(0);
|
1054
|
+
DEBUG_ENTER_INSN("reput");
|
1055
|
+
ADD_PC(1+0);
|
1056
|
+
PREFETCH(GET_PC());
|
1057
|
+
POPN(1);
|
1058
|
+
#define CURRENT_INSN_reput 1
|
1059
|
+
#define INSN_IS_SC() 0
|
1060
|
+
#define INSN_LABEL(lab) LABEL_reput_##lab
|
1061
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1062
|
+
USAGE_ANALYSIS_INSN(BIN(reput));
|
1063
|
+
{
|
1064
|
+
#line 694 "insns.def"
|
1065
|
+
/* none */
|
1066
|
+
|
1067
|
+
#line 1068 "vm.inc"
|
1068
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1069
|
+
PUSH(val);
|
1070
|
+
#undef CURRENT_INSN_reput
|
1071
|
+
#undef INSN_IS_SC
|
1072
|
+
#undef INSN_LABEL
|
1073
|
+
#undef LABEL_IS_SC
|
1074
|
+
END_INSN(reput);}}}
|
1075
|
+
INSN_ENTRY(topn){
|
1076
|
+
{
|
1077
|
+
VALUE val;
|
1078
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
1079
|
+
|
1080
|
+
DEBUG_ENTER_INSN("topn");
|
1081
|
+
ADD_PC(1+1);
|
1082
|
+
PREFETCH(GET_PC());
|
1083
|
+
#define CURRENT_INSN_topn 1
|
1084
|
+
#define INSN_IS_SC() 0
|
1085
|
+
#define INSN_LABEL(lab) LABEL_topn_##lab
|
1086
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1087
|
+
USAGE_ANALYSIS_INSN(BIN(topn));
|
1088
|
+
USAGE_ANALYSIS_OPERAND(BIN(topn), 0, n);
|
1089
|
+
{
|
1090
|
+
#line 708 "insns.def"
|
1091
|
+
val = TOPN(n);
|
1092
|
+
|
1093
|
+
#line 1094 "vm.inc"
|
1094
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1095
|
+
PUSH(val);
|
1096
|
+
#undef CURRENT_INSN_topn
|
1097
|
+
#undef INSN_IS_SC
|
1098
|
+
#undef INSN_LABEL
|
1099
|
+
#undef LABEL_IS_SC
|
1100
|
+
END_INSN(topn);}}}
|
1101
|
+
INSN_ENTRY(setn){
|
1102
|
+
{
|
1103
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
1104
|
+
VALUE val = TOPN(0);
|
1105
|
+
DEBUG_ENTER_INSN("setn");
|
1106
|
+
ADD_PC(1+1);
|
1107
|
+
PREFETCH(GET_PC());
|
1108
|
+
POPN(1);
|
1109
|
+
#define CURRENT_INSN_setn 1
|
1110
|
+
#define INSN_IS_SC() 0
|
1111
|
+
#define INSN_LABEL(lab) LABEL_setn_##lab
|
1112
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1113
|
+
USAGE_ANALYSIS_INSN(BIN(setn));
|
1114
|
+
USAGE_ANALYSIS_OPERAND(BIN(setn), 0, n);
|
1115
|
+
{
|
1116
|
+
#line 722 "insns.def"
|
1117
|
+
TOPN(n-1) = val;
|
1118
|
+
|
1119
|
+
#line 1120 "vm.inc"
|
1120
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1121
|
+
PUSH(val);
|
1122
|
+
#undef CURRENT_INSN_setn
|
1123
|
+
#undef INSN_IS_SC
|
1124
|
+
#undef INSN_LABEL
|
1125
|
+
#undef LABEL_IS_SC
|
1126
|
+
END_INSN(setn);}}}
|
1127
|
+
INSN_ENTRY(adjuststack){
|
1128
|
+
{
|
1129
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
1130
|
+
|
1131
|
+
DEBUG_ENTER_INSN("adjuststack");
|
1132
|
+
ADD_PC(1+1);
|
1133
|
+
PREFETCH(GET_PC());
|
1134
|
+
#define CURRENT_INSN_adjuststack 1
|
1135
|
+
#define INSN_IS_SC() 0
|
1136
|
+
#define INSN_LABEL(lab) LABEL_adjuststack_##lab
|
1137
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1138
|
+
USAGE_ANALYSIS_INSN(BIN(adjuststack));
|
1139
|
+
USAGE_ANALYSIS_OPERAND(BIN(adjuststack), 0, n);
|
1140
|
+
{
|
1141
|
+
#line 736 "insns.def"
|
1142
|
+
DEC_SP(n);
|
1143
|
+
|
1144
|
+
#line 1145 "vm.inc"
|
1145
|
+
#undef CURRENT_INSN_adjuststack
|
1146
|
+
#undef INSN_IS_SC
|
1147
|
+
#undef INSN_LABEL
|
1148
|
+
#undef LABEL_IS_SC
|
1149
|
+
END_INSN(adjuststack);}}}
|
1150
|
+
INSN_ENTRY(defined){
|
1151
|
+
{
|
1152
|
+
VALUE val;
|
1153
|
+
VALUE needstr = (VALUE)GET_OPERAND(3);
|
1154
|
+
VALUE obj = (VALUE)GET_OPERAND(2);
|
1155
|
+
rb_num_t op_type = (rb_num_t)GET_OPERAND(1);
|
1156
|
+
VALUE v = TOPN(0);
|
1157
|
+
DEBUG_ENTER_INSN("defined");
|
1158
|
+
ADD_PC(1+3);
|
1159
|
+
PREFETCH(GET_PC());
|
1160
|
+
POPN(1);
|
1161
|
+
#define CURRENT_INSN_defined 1
|
1162
|
+
#define INSN_IS_SC() 0
|
1163
|
+
#define INSN_LABEL(lab) LABEL_defined_##lab
|
1164
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1165
|
+
USAGE_ANALYSIS_INSN(BIN(defined));
|
1166
|
+
USAGE_ANALYSIS_OPERAND(BIN(defined), 0, op_type);
|
1167
|
+
USAGE_ANALYSIS_OPERAND(BIN(defined), 1, obj);
|
1168
|
+
USAGE_ANALYSIS_OPERAND(BIN(defined), 2, needstr);
|
1169
|
+
{
|
1170
|
+
#line 755 "insns.def"
|
1171
|
+
VALUE klass;
|
1172
|
+
const char *expr_type = 0;
|
1173
|
+
enum defined_type type = (enum defined_type)op_type;
|
1174
|
+
|
1175
|
+
val = Qnil;
|
1176
|
+
|
1177
|
+
switch (type) {
|
1178
|
+
case DEFINED_IVAR:
|
1179
|
+
if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) {
|
1180
|
+
expr_type = "instance-variable";
|
1181
|
+
}
|
1182
|
+
break;
|
1183
|
+
case DEFINED_IVAR2:
|
1184
|
+
klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
|
1185
|
+
break;
|
1186
|
+
case DEFINED_GVAR:
|
1187
|
+
if (rb_gvar_defined(rb_global_entry(SYM2ID(obj)))) {
|
1188
|
+
expr_type = "global-variable";
|
1189
|
+
}
|
1190
|
+
break;
|
1191
|
+
case DEFINED_CVAR:
|
1192
|
+
{
|
1193
|
+
NODE *cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
|
1194
|
+
klass = vm_get_cvar_base(cref);
|
1195
|
+
if (rb_cvar_defined(klass, SYM2ID(obj))) {
|
1196
|
+
expr_type = "class variable";
|
1197
|
+
}
|
1198
|
+
break;
|
1199
|
+
}
|
1200
|
+
case DEFINED_CONST:
|
1201
|
+
klass = v;
|
1202
|
+
if (vm_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) {
|
1203
|
+
expr_type = "constant";
|
1204
|
+
}
|
1205
|
+
break;
|
1206
|
+
case DEFINED_FUNC:
|
1207
|
+
klass = CLASS_OF(v);
|
1208
|
+
if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
|
1209
|
+
expr_type = "method";
|
1210
|
+
}
|
1211
|
+
break;
|
1212
|
+
case DEFINED_METHOD:{
|
1213
|
+
VALUE klass = CLASS_OF(v);
|
1214
|
+
const rb_method_entry_t *me = rb_method_entry(klass, SYM2ID(obj));
|
1215
|
+
|
1216
|
+
if (me) {
|
1217
|
+
if (!(me->flag & NOEX_PRIVATE)) {
|
1218
|
+
if (!((me->flag & NOEX_PROTECTED) &&
|
1219
|
+
!rb_obj_is_kind_of(GET_SELF(),
|
1220
|
+
rb_class_real(klass)))) {
|
1221
|
+
expr_type = "method";
|
1222
|
+
}
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
{
|
1226
|
+
VALUE args[2];
|
1227
|
+
VALUE r;
|
1228
|
+
|
1229
|
+
args[0] = obj; args[1] = Qfalse;
|
1230
|
+
r = rb_check_funcall(v, rb_intern("respond_to_missing?"), 2, args);
|
1231
|
+
if (r != Qundef && RTEST(r))
|
1232
|
+
expr_type = "method";
|
1233
|
+
}
|
1234
|
+
break;
|
1235
|
+
}
|
1236
|
+
case DEFINED_YIELD:
|
1237
|
+
if (GET_BLOCK_PTR()) {
|
1238
|
+
expr_type = "yield";
|
1239
|
+
}
|
1240
|
+
break;
|
1241
|
+
case DEFINED_ZSUPER:{
|
1242
|
+
rb_iseq_t *iseq = GET_ISEQ();
|
1243
|
+
while (iseq) {
|
1244
|
+
if (iseq->defined_method_id) {
|
1245
|
+
break;
|
1246
|
+
}
|
1247
|
+
iseq = iseq->parent_iseq;
|
1248
|
+
}
|
1249
|
+
if (iseq) {
|
1250
|
+
VALUE klass = vm_search_normal_superclass(iseq->klass, GET_SELF());
|
1251
|
+
if (rb_method_boundp(klass, iseq->defined_method_id, 0)) {
|
1252
|
+
expr_type = "super";
|
1253
|
+
}
|
1254
|
+
}
|
1255
|
+
break;
|
1256
|
+
}
|
1257
|
+
case DEFINED_REF:{
|
1258
|
+
val = vm_getspecial(th, GET_LFP(), Qfalse, FIX2INT(obj));
|
1259
|
+
if (val != Qnil) {
|
1260
|
+
expr_type = "global-variable";
|
1261
|
+
}
|
1262
|
+
break;
|
1263
|
+
}
|
1264
|
+
default:
|
1265
|
+
rb_bug("unimplemented defined? type (VM)");
|
1266
|
+
break;
|
1267
|
+
}
|
1268
|
+
if (expr_type != 0) {
|
1269
|
+
if (needstr != Qfalse) {
|
1270
|
+
val = rb_str_new2(expr_type);
|
1271
|
+
}
|
1272
|
+
else {
|
1273
|
+
val = Qtrue;
|
1274
|
+
}
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
#line 1278 "vm.inc"
|
1278
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1279
|
+
PUSH(val);
|
1280
|
+
#undef CURRENT_INSN_defined
|
1281
|
+
#undef INSN_IS_SC
|
1282
|
+
#undef INSN_LABEL
|
1283
|
+
#undef LABEL_IS_SC
|
1284
|
+
END_INSN(defined);}}}
|
1285
|
+
INSN_ENTRY(trace){
|
1286
|
+
{
|
1287
|
+
rb_num_t nf = (rb_num_t)GET_OPERAND(1);
|
1288
|
+
|
1289
|
+
DEBUG_ENTER_INSN("trace");
|
1290
|
+
ADD_PC(1+1);
|
1291
|
+
PREFETCH(GET_PC());
|
1292
|
+
#define CURRENT_INSN_trace 1
|
1293
|
+
#define INSN_IS_SC() 0
|
1294
|
+
#define INSN_LABEL(lab) LABEL_trace_##lab
|
1295
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1296
|
+
USAGE_ANALYSIS_INSN(BIN(trace));
|
1297
|
+
USAGE_ANALYSIS_OPERAND(BIN(trace), 0, nf);
|
1298
|
+
{
|
1299
|
+
#line 873 "insns.def"
|
1300
|
+
rb_event_flag_t flag = (rb_event_flag_t)nf;
|
1301
|
+
|
1302
|
+
EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
|
1303
|
+
|
1304
|
+
#line 1305 "vm.inc"
|
1305
|
+
#undef CURRENT_INSN_trace
|
1306
|
+
#undef INSN_IS_SC
|
1307
|
+
#undef INSN_LABEL
|
1308
|
+
#undef LABEL_IS_SC
|
1309
|
+
END_INSN(trace);}}}
|
1310
|
+
INSN_ENTRY(defineclass){
|
1311
|
+
{
|
1312
|
+
VALUE val;
|
1313
|
+
rb_num_t define_type = (rb_num_t)GET_OPERAND(3);
|
1314
|
+
ISEQ class_iseq = (ISEQ)GET_OPERAND(2);
|
1315
|
+
ID id = (ID)GET_OPERAND(1);
|
1316
|
+
VALUE cbase = TOPN(1);
|
1317
|
+
VALUE super = TOPN(0);
|
1318
|
+
DEBUG_ENTER_INSN("defineclass");
|
1319
|
+
ADD_PC(1+3);
|
1320
|
+
PREFETCH(GET_PC());
|
1321
|
+
POPN(2);
|
1322
|
+
#define CURRENT_INSN_defineclass 1
|
1323
|
+
#define INSN_IS_SC() 0
|
1324
|
+
#define INSN_LABEL(lab) LABEL_defineclass_##lab
|
1325
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1326
|
+
USAGE_ANALYSIS_INSN(BIN(defineclass));
|
1327
|
+
USAGE_ANALYSIS_OPERAND(BIN(defineclass), 0, id);
|
1328
|
+
USAGE_ANALYSIS_OPERAND(BIN(defineclass), 1, class_iseq);
|
1329
|
+
USAGE_ANALYSIS_OPERAND(BIN(defineclass), 2, define_type);
|
1330
|
+
{
|
1331
|
+
#line 897 "insns.def"
|
1332
|
+
VALUE klass;
|
1333
|
+
|
1334
|
+
switch ((int)define_type) {
|
1335
|
+
case 0: /* scoped: class Foo::Bar */
|
1336
|
+
case 3: /* no scope: class Bar */
|
1337
|
+
/* val is dummy. classdef returns class scope value */
|
1338
|
+
|
1339
|
+
if (super == Qnil) {
|
1340
|
+
super = rb_cObject;
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
vm_check_if_namespace(cbase);
|
1344
|
+
|
1345
|
+
/* find klass */
|
1346
|
+
rb_autoload_load(cbase, id);
|
1347
|
+
if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
|
1348
|
+
/* already exist */
|
1349
|
+
klass = define_type == 0 ? rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
|
1350
|
+
if (TYPE(klass) != T_CLASS) {
|
1351
|
+
rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
|
1352
|
+
}
|
1353
|
+
|
1354
|
+
if (super != rb_cObject) {
|
1355
|
+
VALUE tmp;
|
1356
|
+
tmp = rb_class_real(RCLASS_SUPER(klass));
|
1357
|
+
|
1358
|
+
if (tmp != super) {
|
1359
|
+
rb_raise(rb_eTypeError, "superclass mismatch for class %s",
|
1360
|
+
rb_id2name(id));
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
}
|
1364
|
+
else {
|
1365
|
+
/* new class declaration */
|
1366
|
+
klass = rb_define_class_id(id, super);
|
1367
|
+
rb_set_class_path_string(klass, cbase, rb_id2str(id));
|
1368
|
+
rb_const_set(cbase, id, klass);
|
1369
|
+
rb_class_inherited(super, klass);
|
1370
|
+
}
|
1371
|
+
break;
|
1372
|
+
case 1:
|
1373
|
+
/* val is dummy. classdef returns class scope value */
|
1374
|
+
/* super is dummy */
|
1375
|
+
klass = rb_singleton_class(cbase);
|
1376
|
+
break;
|
1377
|
+
case 2: /* scoped: module Foo::Bar or module ::Bar */
|
1378
|
+
case 5: /* no scope: module Bar */
|
1379
|
+
/* val is dummy. classdef returns class scope value */
|
1380
|
+
/* super is dummy */
|
1381
|
+
|
1382
|
+
vm_check_if_namespace(cbase);
|
1383
|
+
|
1384
|
+
/* find klass */
|
1385
|
+
if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
|
1386
|
+
klass = define_type == 2 ? rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
|
1387
|
+
/* already exist */
|
1388
|
+
if (TYPE(klass) != T_MODULE) {
|
1389
|
+
rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id));
|
1390
|
+
}
|
1391
|
+
}
|
1392
|
+
else {
|
1393
|
+
/* new module declaration */
|
1394
|
+
klass = rb_define_module_id(id);
|
1395
|
+
rb_set_class_path_string(klass, cbase, rb_id2str(id));
|
1396
|
+
rb_const_set(cbase, id, klass);
|
1397
|
+
}
|
1398
|
+
break;
|
1399
|
+
default:
|
1400
|
+
rb_bug("unknown defineclass type: %d", (int)define_type);
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC, NULL));
|
1404
|
+
|
1405
|
+
/* enter scope */
|
1406
|
+
vm_push_frame(th, class_iseq,
|
1407
|
+
VM_FRAME_MAGIC_CLASS, klass, (VALUE) GET_BLOCK_PTR(),
|
1408
|
+
class_iseq->iseq_encoded, GET_SP(), 0,
|
1409
|
+
class_iseq->local_size);
|
1410
|
+
RESTORE_REGS();
|
1411
|
+
|
1412
|
+
INC_VM_STATE_VERSION();
|
1413
|
+
NEXT_INSN();
|
1414
|
+
|
1415
|
+
#line 1416 "vm.inc"
|
1416
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1417
|
+
PUSH(val);
|
1418
|
+
#undef CURRENT_INSN_defineclass
|
1419
|
+
#undef INSN_IS_SC
|
1420
|
+
#undef INSN_LABEL
|
1421
|
+
#undef LABEL_IS_SC
|
1422
|
+
END_INSN(defineclass);}}}
|
1423
|
+
INSN_ENTRY(send){
|
1424
|
+
{
|
1425
|
+
VALUE val;
|
1426
|
+
IC ic = (IC)GET_OPERAND(5);
|
1427
|
+
rb_num_t op_flag = (rb_num_t)GET_OPERAND(4);
|
1428
|
+
ISEQ blockiseq = (ISEQ)GET_OPERAND(3);
|
1429
|
+
rb_num_t op_argc = (rb_num_t)GET_OPERAND(2);
|
1430
|
+
ID op_id = (ID)GET_OPERAND(1);
|
1431
|
+
|
1432
|
+
DEBUG_ENTER_INSN("send");
|
1433
|
+
ADD_PC(1+5);
|
1434
|
+
PREFETCH(GET_PC());
|
1435
|
+
#define CURRENT_INSN_send 1
|
1436
|
+
#define INSN_IS_SC() 0
|
1437
|
+
#define INSN_LABEL(lab) LABEL_send_##lab
|
1438
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1439
|
+
USAGE_ANALYSIS_INSN(BIN(send));
|
1440
|
+
USAGE_ANALYSIS_OPERAND(BIN(send), 0, op_id);
|
1441
|
+
USAGE_ANALYSIS_OPERAND(BIN(send), 1, op_argc);
|
1442
|
+
USAGE_ANALYSIS_OPERAND(BIN(send), 2, blockiseq);
|
1443
|
+
USAGE_ANALYSIS_OPERAND(BIN(send), 3, op_flag);
|
1444
|
+
USAGE_ANALYSIS_OPERAND(BIN(send), 4, ic);
|
1445
|
+
{
|
1446
|
+
#line 1003 "insns.def"
|
1447
|
+
const rb_method_entry_t *me;
|
1448
|
+
VALUE recv, klass;
|
1449
|
+
rb_block_t *blockptr = 0;
|
1450
|
+
VALUE flag = op_flag;
|
1451
|
+
int num = caller_setup_args(th, GET_CFP(), flag, (int)op_argc,
|
1452
|
+
(rb_iseq_t *)blockiseq, &blockptr);
|
1453
|
+
ID id = op_id;
|
1454
|
+
|
1455
|
+
/* get receiver */
|
1456
|
+
recv = TOPN(num);
|
1457
|
+
klass = CLASS_OF(recv);
|
1458
|
+
me = vm_method_search(id, klass, ic);
|
1459
|
+
CALL_METHOD(num, blockptr, flag, id, me, recv);
|
1460
|
+
|
1461
|
+
#line 1462 "vm.inc"
|
1462
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1463
|
+
PUSH(val);
|
1464
|
+
#undef CURRENT_INSN_send
|
1465
|
+
#undef INSN_IS_SC
|
1466
|
+
#undef INSN_LABEL
|
1467
|
+
#undef LABEL_IS_SC
|
1468
|
+
END_INSN(send);}}}
|
1469
|
+
INSN_ENTRY(invokesuper){
|
1470
|
+
{
|
1471
|
+
VALUE val;
|
1472
|
+
rb_num_t op_flag = (rb_num_t)GET_OPERAND(3);
|
1473
|
+
ISEQ blockiseq = (ISEQ)GET_OPERAND(2);
|
1474
|
+
rb_num_t op_argc = (rb_num_t)GET_OPERAND(1);
|
1475
|
+
|
1476
|
+
DEBUG_ENTER_INSN("invokesuper");
|
1477
|
+
ADD_PC(1+3);
|
1478
|
+
PREFETCH(GET_PC());
|
1479
|
+
#define CURRENT_INSN_invokesuper 1
|
1480
|
+
#define INSN_IS_SC() 0
|
1481
|
+
#define INSN_LABEL(lab) LABEL_invokesuper_##lab
|
1482
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1483
|
+
USAGE_ANALYSIS_INSN(BIN(invokesuper));
|
1484
|
+
USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 0, op_argc);
|
1485
|
+
USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 1, blockiseq);
|
1486
|
+
USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 2, op_flag);
|
1487
|
+
{
|
1488
|
+
#line 1031 "insns.def"
|
1489
|
+
rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0;
|
1490
|
+
VALUE flag = op_flag;
|
1491
|
+
int num = caller_setup_args(th, GET_CFP(), flag,
|
1492
|
+
(int)op_argc, blockiseq, &blockptr);
|
1493
|
+
VALUE recv, klass;
|
1494
|
+
ID id;
|
1495
|
+
const rb_method_entry_t *me;
|
1496
|
+
|
1497
|
+
flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT;
|
1498
|
+
|
1499
|
+
recv = GET_SELF();
|
1500
|
+
vm_search_superclass(GET_CFP(), GET_ISEQ(), recv, TOPN(num), &id, &klass);
|
1501
|
+
|
1502
|
+
/* temporary measure for [Bug #2402] [Bug #2502] [Bug #3136] */
|
1503
|
+
if (!rb_obj_is_kind_of(recv, klass)) {
|
1504
|
+
rb_raise(rb_eNotImpError, "super from singleton method that is defined to multiple classes is not supported; this will be fixed in 1.9.3 or later");
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
me = rb_method_entry(klass, id);
|
1508
|
+
|
1509
|
+
CALL_METHOD(num, blockptr, flag, id, me, recv);
|
1510
|
+
|
1511
|
+
#line 1512 "vm.inc"
|
1512
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1513
|
+
PUSH(val);
|
1514
|
+
#undef CURRENT_INSN_invokesuper
|
1515
|
+
#undef INSN_IS_SC
|
1516
|
+
#undef INSN_LABEL
|
1517
|
+
#undef LABEL_IS_SC
|
1518
|
+
END_INSN(invokesuper);}}}
|
1519
|
+
INSN_ENTRY(invokeblock){
|
1520
|
+
{
|
1521
|
+
VALUE val;
|
1522
|
+
rb_num_t flag = (rb_num_t)GET_OPERAND(2);
|
1523
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
1524
|
+
|
1525
|
+
DEBUG_ENTER_INSN("invokeblock");
|
1526
|
+
ADD_PC(1+2);
|
1527
|
+
PREFETCH(GET_PC());
|
1528
|
+
#define CURRENT_INSN_invokeblock 1
|
1529
|
+
#define INSN_IS_SC() 0
|
1530
|
+
#define INSN_LABEL(lab) LABEL_invokeblock_##lab
|
1531
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1532
|
+
USAGE_ANALYSIS_INSN(BIN(invokeblock));
|
1533
|
+
USAGE_ANALYSIS_OPERAND(BIN(invokeblock), 0, num);
|
1534
|
+
USAGE_ANALYSIS_OPERAND(BIN(invokeblock), 1, flag);
|
1535
|
+
{
|
1536
|
+
#line 1066 "insns.def"
|
1537
|
+
val = vm_invoke_block(th, GET_CFP(), num, flag);
|
1538
|
+
if (val == Qundef) {
|
1539
|
+
RESTORE_REGS();
|
1540
|
+
NEXT_INSN();
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
#line 1544 "vm.inc"
|
1544
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1545
|
+
PUSH(val);
|
1546
|
+
#undef CURRENT_INSN_invokeblock
|
1547
|
+
#undef INSN_IS_SC
|
1548
|
+
#undef INSN_LABEL
|
1549
|
+
#undef LABEL_IS_SC
|
1550
|
+
END_INSN(invokeblock);}}}
|
1551
|
+
INSN_ENTRY(leave){
|
1552
|
+
{
|
1553
|
+
|
1554
|
+
VALUE val = TOPN(0);
|
1555
|
+
DEBUG_ENTER_INSN("leave");
|
1556
|
+
ADD_PC(1+0);
|
1557
|
+
PREFETCH(GET_PC());
|
1558
|
+
POPN(1);
|
1559
|
+
#define CURRENT_INSN_leave 1
|
1560
|
+
#define INSN_IS_SC() 0
|
1561
|
+
#define INSN_LABEL(lab) LABEL_leave_##lab
|
1562
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1563
|
+
USAGE_ANALYSIS_INSN(BIN(leave));
|
1564
|
+
{
|
1565
|
+
#line 1084 "insns.def"
|
1566
|
+
if (OPT_CHECKED_RUN) {
|
1567
|
+
if (reg_cfp->sp != reg_cfp->bp) {
|
1568
|
+
rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
|
1569
|
+
VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, reg_cfp->bp));
|
1570
|
+
}
|
1571
|
+
}
|
1572
|
+
|
1573
|
+
RUBY_VM_CHECK_INTS();
|
1574
|
+
vm_pop_frame(th);
|
1575
|
+
RESTORE_REGS();
|
1576
|
+
|
1577
|
+
#line 1578 "vm.inc"
|
1578
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1579
|
+
PUSH(val);
|
1580
|
+
#undef CURRENT_INSN_leave
|
1581
|
+
#undef INSN_IS_SC
|
1582
|
+
#undef INSN_LABEL
|
1583
|
+
#undef LABEL_IS_SC
|
1584
|
+
END_INSN(leave);}}}
|
1585
|
+
INSN_ENTRY(finish){
|
1586
|
+
{
|
1587
|
+
|
1588
|
+
VALUE val = TOPN(0);
|
1589
|
+
DEBUG_ENTER_INSN("finish");
|
1590
|
+
ADD_PC(1+0);
|
1591
|
+
PREFETCH(GET_PC());
|
1592
|
+
POPN(1);
|
1593
|
+
#define CURRENT_INSN_finish 1
|
1594
|
+
#define INSN_IS_SC() 0
|
1595
|
+
#define INSN_LABEL(lab) LABEL_finish_##lab
|
1596
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1597
|
+
USAGE_ANALYSIS_INSN(BIN(finish));
|
1598
|
+
{
|
1599
|
+
#line 1107 "insns.def"
|
1600
|
+
#if OPT_CALL_THREADED_CODE
|
1601
|
+
rb_bug("unused instruction on OPT_CALL_THREADED_CODE");
|
1602
|
+
#else
|
1603
|
+
th->cfp++;
|
1604
|
+
return val;
|
1605
|
+
#endif
|
1606
|
+
|
1607
|
+
#line 1608 "vm.inc"
|
1608
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1609
|
+
PUSH(val);
|
1610
|
+
#undef CURRENT_INSN_finish
|
1611
|
+
#undef INSN_IS_SC
|
1612
|
+
#undef INSN_LABEL
|
1613
|
+
#undef LABEL_IS_SC
|
1614
|
+
END_INSN(finish);}}}
|
1615
|
+
INSN_ENTRY(throw){
|
1616
|
+
{
|
1617
|
+
VALUE val;
|
1618
|
+
rb_num_t throw_state = (rb_num_t)GET_OPERAND(1);
|
1619
|
+
VALUE throwobj = TOPN(0);
|
1620
|
+
DEBUG_ENTER_INSN("throw");
|
1621
|
+
ADD_PC(1+1);
|
1622
|
+
PREFETCH(GET_PC());
|
1623
|
+
POPN(1);
|
1624
|
+
#define CURRENT_INSN_throw 1
|
1625
|
+
#define INSN_IS_SC() 0
|
1626
|
+
#define INSN_LABEL(lab) LABEL_throw_##lab
|
1627
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1628
|
+
USAGE_ANALYSIS_INSN(BIN(throw));
|
1629
|
+
USAGE_ANALYSIS_OPERAND(BIN(throw), 0, throw_state);
|
1630
|
+
{
|
1631
|
+
#line 1130 "insns.def"
|
1632
|
+
RUBY_VM_CHECK_INTS();
|
1633
|
+
val = vm_throw(th, GET_CFP(), throw_state, throwobj);
|
1634
|
+
THROW_EXCEPTION(val);
|
1635
|
+
/* unreachable */
|
1636
|
+
|
1637
|
+
#line 1638 "vm.inc"
|
1638
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1639
|
+
PUSH(val);
|
1640
|
+
#undef CURRENT_INSN_throw
|
1641
|
+
#undef INSN_IS_SC
|
1642
|
+
#undef INSN_LABEL
|
1643
|
+
#undef LABEL_IS_SC
|
1644
|
+
END_INSN(throw);}}}
|
1645
|
+
INSN_ENTRY(jump){
|
1646
|
+
{
|
1647
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1648
|
+
|
1649
|
+
DEBUG_ENTER_INSN("jump");
|
1650
|
+
ADD_PC(1+1);
|
1651
|
+
PREFETCH(GET_PC());
|
1652
|
+
#define CURRENT_INSN_jump 1
|
1653
|
+
#define INSN_IS_SC() 0
|
1654
|
+
#define INSN_LABEL(lab) LABEL_jump_##lab
|
1655
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1656
|
+
USAGE_ANALYSIS_INSN(BIN(jump));
|
1657
|
+
USAGE_ANALYSIS_OPERAND(BIN(jump), 0, dst);
|
1658
|
+
{
|
1659
|
+
#line 1151 "insns.def"
|
1660
|
+
RUBY_VM_CHECK_INTS();
|
1661
|
+
JUMP(dst);
|
1662
|
+
|
1663
|
+
#line 1664 "vm.inc"
|
1664
|
+
#undef CURRENT_INSN_jump
|
1665
|
+
#undef INSN_IS_SC
|
1666
|
+
#undef INSN_LABEL
|
1667
|
+
#undef LABEL_IS_SC
|
1668
|
+
END_INSN(jump);}}}
|
1669
|
+
INSN_ENTRY(branchif){
|
1670
|
+
{
|
1671
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1672
|
+
VALUE val = TOPN(0);
|
1673
|
+
DEBUG_ENTER_INSN("branchif");
|
1674
|
+
ADD_PC(1+1);
|
1675
|
+
PREFETCH(GET_PC());
|
1676
|
+
POPN(1);
|
1677
|
+
#define CURRENT_INSN_branchif 1
|
1678
|
+
#define INSN_IS_SC() 0
|
1679
|
+
#define INSN_LABEL(lab) LABEL_branchif_##lab
|
1680
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1681
|
+
USAGE_ANALYSIS_INSN(BIN(branchif));
|
1682
|
+
USAGE_ANALYSIS_OPERAND(BIN(branchif), 0, dst);
|
1683
|
+
{
|
1684
|
+
#line 1166 "insns.def"
|
1685
|
+
if (RTEST(val)) {
|
1686
|
+
RUBY_VM_CHECK_INTS();
|
1687
|
+
JUMP(dst);
|
1688
|
+
}
|
1689
|
+
|
1690
|
+
#line 1691 "vm.inc"
|
1691
|
+
#undef CURRENT_INSN_branchif
|
1692
|
+
#undef INSN_IS_SC
|
1693
|
+
#undef INSN_LABEL
|
1694
|
+
#undef LABEL_IS_SC
|
1695
|
+
END_INSN(branchif);}}}
|
1696
|
+
INSN_ENTRY(branchunless){
|
1697
|
+
{
|
1698
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1699
|
+
VALUE val = TOPN(0);
|
1700
|
+
DEBUG_ENTER_INSN("branchunless");
|
1701
|
+
ADD_PC(1+1);
|
1702
|
+
PREFETCH(GET_PC());
|
1703
|
+
POPN(1);
|
1704
|
+
#define CURRENT_INSN_branchunless 1
|
1705
|
+
#define INSN_IS_SC() 0
|
1706
|
+
#define INSN_LABEL(lab) LABEL_branchunless_##lab
|
1707
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1708
|
+
USAGE_ANALYSIS_INSN(BIN(branchunless));
|
1709
|
+
USAGE_ANALYSIS_OPERAND(BIN(branchunless), 0, dst);
|
1710
|
+
{
|
1711
|
+
#line 1183 "insns.def"
|
1712
|
+
if (!RTEST(val)) {
|
1713
|
+
RUBY_VM_CHECK_INTS();
|
1714
|
+
JUMP(dst);
|
1715
|
+
}
|
1716
|
+
|
1717
|
+
#line 1718 "vm.inc"
|
1718
|
+
#undef CURRENT_INSN_branchunless
|
1719
|
+
#undef INSN_IS_SC
|
1720
|
+
#undef INSN_LABEL
|
1721
|
+
#undef LABEL_IS_SC
|
1722
|
+
END_INSN(branchunless);}}}
|
1723
|
+
INSN_ENTRY(getinlinecache){
|
1724
|
+
{
|
1725
|
+
VALUE val;
|
1726
|
+
IC ic = (IC)GET_OPERAND(2);
|
1727
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1728
|
+
|
1729
|
+
DEBUG_ENTER_INSN("getinlinecache");
|
1730
|
+
ADD_PC(1+2);
|
1731
|
+
PREFETCH(GET_PC());
|
1732
|
+
#define CURRENT_INSN_getinlinecache 1
|
1733
|
+
#define INSN_IS_SC() 0
|
1734
|
+
#define INSN_LABEL(lab) LABEL_getinlinecache_##lab
|
1735
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1736
|
+
USAGE_ANALYSIS_INSN(BIN(getinlinecache));
|
1737
|
+
USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 0, dst);
|
1738
|
+
USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 1, ic);
|
1739
|
+
{
|
1740
|
+
#line 1205 "insns.def"
|
1741
|
+
if (ic->ic_vmstat == GET_VM_STATE_VERSION()) {
|
1742
|
+
val = ic->ic_value.value;
|
1743
|
+
JUMP(dst);
|
1744
|
+
}
|
1745
|
+
else {
|
1746
|
+
/* none */
|
1747
|
+
val = Qnil;
|
1748
|
+
}
|
1749
|
+
|
1750
|
+
#line 1751 "vm.inc"
|
1751
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1752
|
+
PUSH(val);
|
1753
|
+
#undef CURRENT_INSN_getinlinecache
|
1754
|
+
#undef INSN_IS_SC
|
1755
|
+
#undef INSN_LABEL
|
1756
|
+
#undef LABEL_IS_SC
|
1757
|
+
END_INSN(getinlinecache);}}}
|
1758
|
+
INSN_ENTRY(onceinlinecache){
|
1759
|
+
{
|
1760
|
+
VALUE val;
|
1761
|
+
IC ic = (IC)GET_OPERAND(2);
|
1762
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1763
|
+
|
1764
|
+
DEBUG_ENTER_INSN("onceinlinecache");
|
1765
|
+
ADD_PC(1+2);
|
1766
|
+
PREFETCH(GET_PC());
|
1767
|
+
#define CURRENT_INSN_onceinlinecache 1
|
1768
|
+
#define INSN_IS_SC() 0
|
1769
|
+
#define INSN_LABEL(lab) LABEL_onceinlinecache_##lab
|
1770
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1771
|
+
USAGE_ANALYSIS_INSN(BIN(onceinlinecache));
|
1772
|
+
USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 0, dst);
|
1773
|
+
USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 1, ic);
|
1774
|
+
{
|
1775
|
+
#line 1226 "insns.def"
|
1776
|
+
retry:
|
1777
|
+
if (ic->ic_vmstat) {
|
1778
|
+
val = ic->ic_value.value;
|
1779
|
+
JUMP(dst);
|
1780
|
+
}
|
1781
|
+
else if (ic->ic_value.value == Qundef)
|
1782
|
+
{
|
1783
|
+
RUBY_VM_CHECK_INTS();
|
1784
|
+
rb_thread_schedule();
|
1785
|
+
goto retry;
|
1786
|
+
}
|
1787
|
+
else {
|
1788
|
+
/* none */
|
1789
|
+
ic->ic_value.value = Qundef;
|
1790
|
+
val = Qnil;
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
#line 1794 "vm.inc"
|
1794
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1795
|
+
PUSH(val);
|
1796
|
+
#undef CURRENT_INSN_onceinlinecache
|
1797
|
+
#undef INSN_IS_SC
|
1798
|
+
#undef INSN_LABEL
|
1799
|
+
#undef LABEL_IS_SC
|
1800
|
+
END_INSN(onceinlinecache);}}}
|
1801
|
+
INSN_ENTRY(setinlinecache){
|
1802
|
+
{
|
1803
|
+
IC ic = (IC)GET_OPERAND(1);
|
1804
|
+
VALUE val = TOPN(0);
|
1805
|
+
DEBUG_ENTER_INSN("setinlinecache");
|
1806
|
+
ADD_PC(1+1);
|
1807
|
+
PREFETCH(GET_PC());
|
1808
|
+
POPN(1);
|
1809
|
+
#define CURRENT_INSN_setinlinecache 1
|
1810
|
+
#define INSN_IS_SC() 0
|
1811
|
+
#define INSN_LABEL(lab) LABEL_setinlinecache_##lab
|
1812
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1813
|
+
USAGE_ANALYSIS_INSN(BIN(setinlinecache));
|
1814
|
+
USAGE_ANALYSIS_OPERAND(BIN(setinlinecache), 0, ic);
|
1815
|
+
{
|
1816
|
+
#line 1255 "insns.def"
|
1817
|
+
if (ic->ic_value.value == Qundef) {
|
1818
|
+
rb_ary_push(GET_ISEQ()->mark_ary, val);
|
1819
|
+
}
|
1820
|
+
ic->ic_value.value = val;
|
1821
|
+
ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count;
|
1822
|
+
ruby_vm_const_missing_count = 0;
|
1823
|
+
|
1824
|
+
#line 1825 "vm.inc"
|
1825
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1826
|
+
PUSH(val);
|
1827
|
+
#undef CURRENT_INSN_setinlinecache
|
1828
|
+
#undef INSN_IS_SC
|
1829
|
+
#undef INSN_LABEL
|
1830
|
+
#undef LABEL_IS_SC
|
1831
|
+
END_INSN(setinlinecache);}}}
|
1832
|
+
INSN_ENTRY(opt_case_dispatch){
|
1833
|
+
{
|
1834
|
+
OFFSET else_offset = (OFFSET)GET_OPERAND(2);
|
1835
|
+
CDHASH hash = (CDHASH)GET_OPERAND(1);
|
1836
|
+
VALUE key = TOPN(0);
|
1837
|
+
DEBUG_ENTER_INSN("opt_case_dispatch");
|
1838
|
+
ADD_PC(1+2);
|
1839
|
+
PREFETCH(GET_PC());
|
1840
|
+
POPN(1);
|
1841
|
+
#define CURRENT_INSN_opt_case_dispatch 1
|
1842
|
+
#define INSN_IS_SC() 0
|
1843
|
+
#define INSN_LABEL(lab) LABEL_opt_case_dispatch_##lab
|
1844
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1845
|
+
USAGE_ANALYSIS_INSN(BIN(opt_case_dispatch));
|
1846
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 0, hash);
|
1847
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 1, else_offset);
|
1848
|
+
{
|
1849
|
+
#line 1274 "insns.def"
|
1850
|
+
switch(TYPE(key)) {
|
1851
|
+
case T_FLOAT: {
|
1852
|
+
double ival;
|
1853
|
+
if (modf(RFLOAT_VALUE(key), &ival) == 0.0) {
|
1854
|
+
key = FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
|
1855
|
+
}
|
1856
|
+
}
|
1857
|
+
case T_SYMBOL: /* fall through */
|
1858
|
+
case T_FIXNUM:
|
1859
|
+
case T_BIGNUM:
|
1860
|
+
case T_STRING:
|
1861
|
+
if (BASIC_OP_UNREDEFINED_P(BOP_EQQ)) {
|
1862
|
+
st_data_t val;
|
1863
|
+
if (st_lookup(RHASH_TBL(hash), key, &val)) {
|
1864
|
+
JUMP(FIX2INT((VALUE)val));
|
1865
|
+
}
|
1866
|
+
else {
|
1867
|
+
JUMP(else_offset);
|
1868
|
+
}
|
1869
|
+
break;
|
1870
|
+
}
|
1871
|
+
default:
|
1872
|
+
break;
|
1873
|
+
}
|
1874
|
+
|
1875
|
+
#line 1876 "vm.inc"
|
1876
|
+
#undef CURRENT_INSN_opt_case_dispatch
|
1877
|
+
#undef INSN_IS_SC
|
1878
|
+
#undef INSN_LABEL
|
1879
|
+
#undef LABEL_IS_SC
|
1880
|
+
END_INSN(opt_case_dispatch);}}}
|
1881
|
+
INSN_ENTRY(opt_checkenv){
|
1882
|
+
{
|
1883
|
+
|
1884
|
+
|
1885
|
+
DEBUG_ENTER_INSN("opt_checkenv");
|
1886
|
+
ADD_PC(1+0);
|
1887
|
+
PREFETCH(GET_PC());
|
1888
|
+
#define CURRENT_INSN_opt_checkenv 1
|
1889
|
+
#define INSN_IS_SC() 0
|
1890
|
+
#define INSN_LABEL(lab) LABEL_opt_checkenv_##lab
|
1891
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1892
|
+
USAGE_ANALYSIS_INSN(BIN(opt_checkenv));
|
1893
|
+
{
|
1894
|
+
#line 1311 "insns.def"
|
1895
|
+
if (GET_CFP()->bp != GET_DFP() + 1) {
|
1896
|
+
VALUE *new_dfp = GET_CFP()->bp - 1;
|
1897
|
+
/* TODO: copy env and clean stack at creating env? */
|
1898
|
+
*new_dfp = *GET_DFP();
|
1899
|
+
SET_DFP(new_dfp);
|
1900
|
+
}
|
1901
|
+
|
1902
|
+
#line 1903 "vm.inc"
|
1903
|
+
#undef CURRENT_INSN_opt_checkenv
|
1904
|
+
#undef INSN_IS_SC
|
1905
|
+
#undef INSN_LABEL
|
1906
|
+
#undef LABEL_IS_SC
|
1907
|
+
END_INSN(opt_checkenv);}}}
|
1908
|
+
INSN_ENTRY(opt_plus){
|
1909
|
+
{
|
1910
|
+
VALUE val;
|
1911
|
+
IC ic = (IC)GET_OPERAND(1);
|
1912
|
+
VALUE recv = TOPN(1);
|
1913
|
+
VALUE obj = TOPN(0);
|
1914
|
+
DEBUG_ENTER_INSN("opt_plus");
|
1915
|
+
ADD_PC(1+1);
|
1916
|
+
PREFETCH(GET_PC());
|
1917
|
+
POPN(2);
|
1918
|
+
#define CURRENT_INSN_opt_plus 1
|
1919
|
+
#define INSN_IS_SC() 0
|
1920
|
+
#define INSN_LABEL(lab) LABEL_opt_plus_##lab
|
1921
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1922
|
+
USAGE_ANALYSIS_INSN(BIN(opt_plus));
|
1923
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_plus), 0, ic);
|
1924
|
+
{
|
1925
|
+
#line 1333 "insns.def"
|
1926
|
+
if (0) {
|
1927
|
+
|
1928
|
+
}
|
1929
|
+
#if 1
|
1930
|
+
else if (FIXNUM_2_P(recv, obj) &&
|
1931
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
|
1932
|
+
/* fixnum + fixnum */
|
1933
|
+
#ifndef LONG_LONG_VALUE
|
1934
|
+
val = (recv + (obj & (~1)));
|
1935
|
+
if ((~(recv ^ obj) & (recv ^ val)) &
|
1936
|
+
((VALUE)0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) {
|
1937
|
+
val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
|
1938
|
+
rb_int2big(FIX2LONG(obj)));
|
1939
|
+
}
|
1940
|
+
#else
|
1941
|
+
long a, b, c;
|
1942
|
+
a = FIX2LONG(recv);
|
1943
|
+
b = FIX2LONG(obj);
|
1944
|
+
c = a + b;
|
1945
|
+
if (FIXABLE(c)) {
|
1946
|
+
val = LONG2FIX(c);
|
1947
|
+
}
|
1948
|
+
else {
|
1949
|
+
val = rb_big_plus(rb_int2big(a), rb_int2big(b));
|
1950
|
+
}
|
1951
|
+
#endif
|
1952
|
+
}
|
1953
|
+
#endif
|
1954
|
+
|
1955
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
1956
|
+
if (0) {
|
1957
|
+
}
|
1958
|
+
#if 1
|
1959
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
1960
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
1961
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
|
1962
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
|
1963
|
+
}
|
1964
|
+
#endif
|
1965
|
+
|
1966
|
+
#if 1
|
1967
|
+
else if (HEAP_CLASS_OF(recv) == rb_cString &&
|
1968
|
+
HEAP_CLASS_OF(obj) == rb_cString &&
|
1969
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
|
1970
|
+
val = rb_str_plus(recv, obj);
|
1971
|
+
}
|
1972
|
+
#endif
|
1973
|
+
#if 1
|
1974
|
+
else if (HEAP_CLASS_OF(recv) == rb_cArray &&
|
1975
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
|
1976
|
+
val = rb_ary_plus(recv, obj);
|
1977
|
+
}
|
1978
|
+
#endif
|
1979
|
+
else {
|
1980
|
+
goto INSN_LABEL(normal_dispatch);
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
else {
|
1984
|
+
INSN_LABEL(normal_dispatch):
|
1985
|
+
PUSH(recv);
|
1986
|
+
PUSH(obj);
|
1987
|
+
CALL_SIMPLE_METHOD(1, idPLUS, recv);
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
#line 1991 "vm.inc"
|
1991
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
1992
|
+
PUSH(val);
|
1993
|
+
#undef CURRENT_INSN_opt_plus
|
1994
|
+
#undef INSN_IS_SC
|
1995
|
+
#undef INSN_LABEL
|
1996
|
+
#undef LABEL_IS_SC
|
1997
|
+
END_INSN(opt_plus);}}}
|
1998
|
+
INSN_ENTRY(opt_minus){
|
1999
|
+
{
|
2000
|
+
VALUE val;
|
2001
|
+
IC ic = (IC)GET_OPERAND(1);
|
2002
|
+
VALUE recv = TOPN(1);
|
2003
|
+
VALUE obj = TOPN(0);
|
2004
|
+
DEBUG_ENTER_INSN("opt_minus");
|
2005
|
+
ADD_PC(1+1);
|
2006
|
+
PREFETCH(GET_PC());
|
2007
|
+
POPN(2);
|
2008
|
+
#define CURRENT_INSN_opt_minus 1
|
2009
|
+
#define INSN_IS_SC() 0
|
2010
|
+
#define INSN_LABEL(lab) LABEL_opt_minus_##lab
|
2011
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2012
|
+
USAGE_ANALYSIS_INSN(BIN(opt_minus));
|
2013
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_minus), 0, ic);
|
2014
|
+
{
|
2015
|
+
#line 1409 "insns.def"
|
2016
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2017
|
+
BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
|
2018
|
+
long a, b, c;
|
2019
|
+
|
2020
|
+
a = FIX2LONG(recv);
|
2021
|
+
b = FIX2LONG(obj);
|
2022
|
+
c = a - b;
|
2023
|
+
|
2024
|
+
if (FIXABLE(c)) {
|
2025
|
+
val = LONG2FIX(c);
|
2026
|
+
}
|
2027
|
+
else {
|
2028
|
+
val = rb_big_minus(rb_int2big(a), rb_int2big(b));
|
2029
|
+
}
|
2030
|
+
}
|
2031
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2032
|
+
if (0) {
|
2033
|
+
}
|
2034
|
+
#if 1
|
2035
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
2036
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
2037
|
+
BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
|
2038
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
|
2039
|
+
}
|
2040
|
+
#endif
|
2041
|
+
else {
|
2042
|
+
goto INSN_LABEL(normal_dispatch);
|
2043
|
+
}
|
2044
|
+
}
|
2045
|
+
else {
|
2046
|
+
/* other */
|
2047
|
+
INSN_LABEL(normal_dispatch):
|
2048
|
+
PUSH(recv);
|
2049
|
+
PUSH(obj);
|
2050
|
+
CALL_SIMPLE_METHOD(1, idMINUS, recv);
|
2051
|
+
}
|
2052
|
+
|
2053
|
+
#line 2054 "vm.inc"
|
2054
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2055
|
+
PUSH(val);
|
2056
|
+
#undef CURRENT_INSN_opt_minus
|
2057
|
+
#undef INSN_IS_SC
|
2058
|
+
#undef INSN_LABEL
|
2059
|
+
#undef LABEL_IS_SC
|
2060
|
+
END_INSN(opt_minus);}}}
|
2061
|
+
INSN_ENTRY(opt_mult){
|
2062
|
+
{
|
2063
|
+
VALUE val;
|
2064
|
+
IC ic = (IC)GET_OPERAND(1);
|
2065
|
+
VALUE recv = TOPN(1);
|
2066
|
+
VALUE obj = TOPN(0);
|
2067
|
+
DEBUG_ENTER_INSN("opt_mult");
|
2068
|
+
ADD_PC(1+1);
|
2069
|
+
PREFETCH(GET_PC());
|
2070
|
+
POPN(2);
|
2071
|
+
#define CURRENT_INSN_opt_mult 1
|
2072
|
+
#define INSN_IS_SC() 0
|
2073
|
+
#define INSN_LABEL(lab) LABEL_opt_mult_##lab
|
2074
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2075
|
+
USAGE_ANALYSIS_INSN(BIN(opt_mult));
|
2076
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_mult), 0, ic);
|
2077
|
+
{
|
2078
|
+
#line 1458 "insns.def"
|
2079
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2080
|
+
BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
|
2081
|
+
long a, b;
|
2082
|
+
|
2083
|
+
a = FIX2LONG(recv);
|
2084
|
+
if (a == 0) {
|
2085
|
+
val = recv;
|
2086
|
+
}
|
2087
|
+
else {
|
2088
|
+
volatile long c;
|
2089
|
+
b = FIX2LONG(obj);
|
2090
|
+
c = a * b;
|
2091
|
+
|
2092
|
+
if (FIXABLE(c) && c / a == b) {
|
2093
|
+
val = LONG2FIX(c);
|
2094
|
+
}
|
2095
|
+
else {
|
2096
|
+
val = rb_big_mul(rb_int2big(a), rb_int2big(b));
|
2097
|
+
}
|
2098
|
+
}
|
2099
|
+
}
|
2100
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2101
|
+
if (0) {
|
2102
|
+
}
|
2103
|
+
#if 1
|
2104
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
2105
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
2106
|
+
BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
|
2107
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
|
2108
|
+
}
|
2109
|
+
#endif
|
2110
|
+
else {
|
2111
|
+
goto INSN_LABEL(normal_dispatch);
|
2112
|
+
}
|
2113
|
+
}
|
2114
|
+
else {
|
2115
|
+
INSN_LABEL(normal_dispatch):
|
2116
|
+
PUSH(recv);
|
2117
|
+
PUSH(obj);
|
2118
|
+
CALL_SIMPLE_METHOD(1, idMULT, recv);
|
2119
|
+
}
|
2120
|
+
|
2121
|
+
#line 2122 "vm.inc"
|
2122
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2123
|
+
PUSH(val);
|
2124
|
+
#undef CURRENT_INSN_opt_mult
|
2125
|
+
#undef INSN_IS_SC
|
2126
|
+
#undef INSN_LABEL
|
2127
|
+
#undef LABEL_IS_SC
|
2128
|
+
END_INSN(opt_mult);}}}
|
2129
|
+
INSN_ENTRY(opt_div){
|
2130
|
+
{
|
2131
|
+
VALUE val;
|
2132
|
+
IC ic = (IC)GET_OPERAND(1);
|
2133
|
+
VALUE recv = TOPN(1);
|
2134
|
+
VALUE obj = TOPN(0);
|
2135
|
+
DEBUG_ENTER_INSN("opt_div");
|
2136
|
+
ADD_PC(1+1);
|
2137
|
+
PREFETCH(GET_PC());
|
2138
|
+
POPN(2);
|
2139
|
+
#define CURRENT_INSN_opt_div 1
|
2140
|
+
#define INSN_IS_SC() 0
|
2141
|
+
#define INSN_LABEL(lab) LABEL_opt_div_##lab
|
2142
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2143
|
+
USAGE_ANALYSIS_INSN(BIN(opt_div));
|
2144
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_div), 0, ic);
|
2145
|
+
{
|
2146
|
+
#line 1512 "insns.def"
|
2147
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2148
|
+
BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
|
2149
|
+
long x, y, div;
|
2150
|
+
|
2151
|
+
x = FIX2LONG(recv);
|
2152
|
+
y = FIX2LONG(obj);
|
2153
|
+
{
|
2154
|
+
/* copied from numeric.c#fixdivmod */
|
2155
|
+
long mod;
|
2156
|
+
if (y == 0)
|
2157
|
+
goto INSN_LABEL(normal_dispatch);
|
2158
|
+
if (y < 0) {
|
2159
|
+
if (x < 0)
|
2160
|
+
div = -x / -y;
|
2161
|
+
else
|
2162
|
+
div = -(x / -y);
|
2163
|
+
}
|
2164
|
+
else {
|
2165
|
+
if (x < 0)
|
2166
|
+
div = -(-x / y);
|
2167
|
+
else
|
2168
|
+
div = x / y;
|
2169
|
+
}
|
2170
|
+
mod = x - div * y;
|
2171
|
+
if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
|
2172
|
+
mod += y;
|
2173
|
+
div -= 1;
|
2174
|
+
}
|
2175
|
+
}
|
2176
|
+
val = LONG2NUM(div);
|
2177
|
+
}
|
2178
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2179
|
+
if (0) {
|
2180
|
+
}
|
2181
|
+
#if 1
|
2182
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
2183
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
2184
|
+
BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
|
2185
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
|
2186
|
+
}
|
2187
|
+
#endif
|
2188
|
+
else {
|
2189
|
+
goto INSN_LABEL(normal_dispatch);
|
2190
|
+
}
|
2191
|
+
}
|
2192
|
+
else {
|
2193
|
+
INSN_LABEL(normal_dispatch):
|
2194
|
+
PUSH(recv);
|
2195
|
+
PUSH(obj);
|
2196
|
+
CALL_SIMPLE_METHOD(1, idDIV, recv);
|
2197
|
+
}
|
2198
|
+
|
2199
|
+
#line 2200 "vm.inc"
|
2200
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2201
|
+
PUSH(val);
|
2202
|
+
#undef CURRENT_INSN_opt_div
|
2203
|
+
#undef INSN_IS_SC
|
2204
|
+
#undef INSN_LABEL
|
2205
|
+
#undef LABEL_IS_SC
|
2206
|
+
END_INSN(opt_div);}}}
|
2207
|
+
INSN_ENTRY(opt_mod){
|
2208
|
+
{
|
2209
|
+
VALUE val;
|
2210
|
+
IC ic = (IC)GET_OPERAND(1);
|
2211
|
+
VALUE recv = TOPN(1);
|
2212
|
+
VALUE obj = TOPN(0);
|
2213
|
+
DEBUG_ENTER_INSN("opt_mod");
|
2214
|
+
ADD_PC(1+1);
|
2215
|
+
PREFETCH(GET_PC());
|
2216
|
+
POPN(2);
|
2217
|
+
#define CURRENT_INSN_opt_mod 1
|
2218
|
+
#define INSN_IS_SC() 0
|
2219
|
+
#define INSN_LABEL(lab) LABEL_opt_mod_##lab
|
2220
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2221
|
+
USAGE_ANALYSIS_INSN(BIN(opt_mod));
|
2222
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_mod), 0, ic);
|
2223
|
+
{
|
2224
|
+
#line 1576 "insns.def"
|
2225
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2226
|
+
BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
|
2227
|
+
long x, y, mod;
|
2228
|
+
|
2229
|
+
x = FIX2LONG(recv);
|
2230
|
+
y = FIX2LONG(obj);
|
2231
|
+
{
|
2232
|
+
/* copied from numeric.c#fixdivmod */
|
2233
|
+
long div;
|
2234
|
+
|
2235
|
+
if (y == 0)
|
2236
|
+
rb_num_zerodiv();
|
2237
|
+
if (y < 0) {
|
2238
|
+
if (x < 0)
|
2239
|
+
div = -x / -y;
|
2240
|
+
else
|
2241
|
+
div = -(x / -y);
|
2242
|
+
}
|
2243
|
+
else {
|
2244
|
+
if (x < 0)
|
2245
|
+
div = -(-x / y);
|
2246
|
+
else
|
2247
|
+
div = x / y;
|
2248
|
+
}
|
2249
|
+
mod = x - div * y;
|
2250
|
+
if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
|
2251
|
+
mod += y;
|
2252
|
+
div -= 1;
|
2253
|
+
}
|
2254
|
+
}
|
2255
|
+
val = LONG2FIX(mod);
|
2256
|
+
}
|
2257
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2258
|
+
if (0) {
|
2259
|
+
}
|
2260
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
2261
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
2262
|
+
BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
|
2263
|
+
val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
|
2264
|
+
}
|
2265
|
+
else {
|
2266
|
+
goto INSN_LABEL(normal_dispatch);
|
2267
|
+
}
|
2268
|
+
}
|
2269
|
+
else {
|
2270
|
+
INSN_LABEL(normal_dispatch):
|
2271
|
+
PUSH(recv);
|
2272
|
+
PUSH(obj);
|
2273
|
+
CALL_SIMPLE_METHOD(1, idMOD, recv);
|
2274
|
+
}
|
2275
|
+
|
2276
|
+
#line 2277 "vm.inc"
|
2277
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2278
|
+
PUSH(val);
|
2279
|
+
#undef CURRENT_INSN_opt_mod
|
2280
|
+
#undef INSN_IS_SC
|
2281
|
+
#undef INSN_LABEL
|
2282
|
+
#undef LABEL_IS_SC
|
2283
|
+
END_INSN(opt_mod);}}}
|
2284
|
+
INSN_ENTRY(opt_eq){
|
2285
|
+
{
|
2286
|
+
VALUE val;
|
2287
|
+
IC ic = (IC)GET_OPERAND(1);
|
2288
|
+
VALUE recv = TOPN(1);
|
2289
|
+
VALUE obj = TOPN(0);
|
2290
|
+
DEBUG_ENTER_INSN("opt_eq");
|
2291
|
+
ADD_PC(1+1);
|
2292
|
+
PREFETCH(GET_PC());
|
2293
|
+
POPN(2);
|
2294
|
+
#define CURRENT_INSN_opt_eq 1
|
2295
|
+
#define INSN_IS_SC() 0
|
2296
|
+
#define INSN_LABEL(lab) LABEL_opt_eq_##lab
|
2297
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2298
|
+
USAGE_ANALYSIS_INSN(BIN(opt_eq));
|
2299
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_eq), 0, ic);
|
2300
|
+
{
|
2301
|
+
#line 1639 "insns.def"
|
2302
|
+
val = opt_eq_func(recv, obj, ic);
|
2303
|
+
|
2304
|
+
if (val == Qundef) {
|
2305
|
+
/* other */
|
2306
|
+
PUSH(recv);
|
2307
|
+
PUSH(obj);
|
2308
|
+
CALL_SIMPLE_METHOD(1, idEq, recv);
|
2309
|
+
}
|
2310
|
+
|
2311
|
+
#line 2312 "vm.inc"
|
2312
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2313
|
+
PUSH(val);
|
2314
|
+
#undef CURRENT_INSN_opt_eq
|
2315
|
+
#undef INSN_IS_SC
|
2316
|
+
#undef INSN_LABEL
|
2317
|
+
#undef LABEL_IS_SC
|
2318
|
+
END_INSN(opt_eq);}}}
|
2319
|
+
INSN_ENTRY(opt_neq){
|
2320
|
+
{
|
2321
|
+
VALUE val;
|
2322
|
+
IC ic_eq = (IC)GET_OPERAND(2);
|
2323
|
+
IC ic = (IC)GET_OPERAND(1);
|
2324
|
+
VALUE recv = TOPN(1);
|
2325
|
+
VALUE obj = TOPN(0);
|
2326
|
+
DEBUG_ENTER_INSN("opt_neq");
|
2327
|
+
ADD_PC(1+2);
|
2328
|
+
PREFETCH(GET_PC());
|
2329
|
+
POPN(2);
|
2330
|
+
#define CURRENT_INSN_opt_neq 1
|
2331
|
+
#define INSN_IS_SC() 0
|
2332
|
+
#define INSN_LABEL(lab) LABEL_opt_neq_##lab
|
2333
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2334
|
+
USAGE_ANALYSIS_INSN(BIN(opt_neq));
|
2335
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_neq), 0, ic);
|
2336
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_neq), 1, ic_eq);
|
2337
|
+
{
|
2338
|
+
#line 1660 "insns.def"
|
2339
|
+
extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
|
2340
|
+
const rb_method_entry_t *me = vm_method_search(idNeq, CLASS_OF(recv), ic);
|
2341
|
+
val = Qundef;
|
2342
|
+
|
2343
|
+
if (check_cfunc(me, rb_obj_not_equal)) {
|
2344
|
+
val = opt_eq_func(recv, obj, ic_eq);
|
2345
|
+
|
2346
|
+
if (val != Qundef) {
|
2347
|
+
val = RTEST(val) ? Qfalse : Qtrue;
|
2348
|
+
}
|
2349
|
+
}
|
2350
|
+
|
2351
|
+
if (val == Qundef) {
|
2352
|
+
/* other */
|
2353
|
+
PUSH(recv);
|
2354
|
+
PUSH(obj);
|
2355
|
+
CALL_SIMPLE_METHOD(1, idNeq, recv);
|
2356
|
+
}
|
2357
|
+
|
2358
|
+
#line 2359 "vm.inc"
|
2359
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2360
|
+
PUSH(val);
|
2361
|
+
#undef CURRENT_INSN_opt_neq
|
2362
|
+
#undef INSN_IS_SC
|
2363
|
+
#undef INSN_LABEL
|
2364
|
+
#undef LABEL_IS_SC
|
2365
|
+
END_INSN(opt_neq);}}}
|
2366
|
+
INSN_ENTRY(opt_lt){
|
2367
|
+
{
|
2368
|
+
VALUE val;
|
2369
|
+
IC ic = (IC)GET_OPERAND(1);
|
2370
|
+
VALUE recv = TOPN(1);
|
2371
|
+
VALUE obj = TOPN(0);
|
2372
|
+
DEBUG_ENTER_INSN("opt_lt");
|
2373
|
+
ADD_PC(1+1);
|
2374
|
+
PREFETCH(GET_PC());
|
2375
|
+
POPN(2);
|
2376
|
+
#define CURRENT_INSN_opt_lt 1
|
2377
|
+
#define INSN_IS_SC() 0
|
2378
|
+
#define INSN_LABEL(lab) LABEL_opt_lt_##lab
|
2379
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2380
|
+
USAGE_ANALYSIS_INSN(BIN(opt_lt));
|
2381
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_lt), 0, ic);
|
2382
|
+
{
|
2383
|
+
#line 1691 "insns.def"
|
2384
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2385
|
+
BASIC_OP_UNREDEFINED_P(BOP_LT)) {
|
2386
|
+
SIGNED_VALUE a = recv, b = obj;
|
2387
|
+
|
2388
|
+
if (a < b) {
|
2389
|
+
val = Qtrue;
|
2390
|
+
}
|
2391
|
+
else {
|
2392
|
+
val = Qfalse;
|
2393
|
+
}
|
2394
|
+
}
|
2395
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2396
|
+
if (0) {
|
2397
|
+
}
|
2398
|
+
#if 1
|
2399
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
2400
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
2401
|
+
BASIC_OP_UNREDEFINED_P(BOP_LT)) {
|
2402
|
+
double a = RFLOAT_VALUE(recv);
|
2403
|
+
double b = RFLOAT_VALUE(obj);
|
2404
|
+
#if defined(_MSC_VER) && _MSC_VER < 1300
|
2405
|
+
if (isnan(a) || isnan(b)) val = Qfalse;
|
2406
|
+
else
|
2407
|
+
#endif
|
2408
|
+
val = a < b ? Qtrue : Qfalse;
|
2409
|
+
}
|
2410
|
+
#endif
|
2411
|
+
else {
|
2412
|
+
goto INSN_LABEL(normal_dispatch);
|
2413
|
+
}
|
2414
|
+
}
|
2415
|
+
else {
|
2416
|
+
INSN_LABEL(normal_dispatch):
|
2417
|
+
PUSH(recv);
|
2418
|
+
PUSH(obj);
|
2419
|
+
CALL_SIMPLE_METHOD(1, idLT, recv);
|
2420
|
+
}
|
2421
|
+
|
2422
|
+
#line 2423 "vm.inc"
|
2423
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2424
|
+
PUSH(val);
|
2425
|
+
#undef CURRENT_INSN_opt_lt
|
2426
|
+
#undef INSN_IS_SC
|
2427
|
+
#undef INSN_LABEL
|
2428
|
+
#undef LABEL_IS_SC
|
2429
|
+
END_INSN(opt_lt);}}}
|
2430
|
+
INSN_ENTRY(opt_le){
|
2431
|
+
{
|
2432
|
+
VALUE val;
|
2433
|
+
IC ic = (IC)GET_OPERAND(1);
|
2434
|
+
VALUE recv = TOPN(1);
|
2435
|
+
VALUE obj = TOPN(0);
|
2436
|
+
DEBUG_ENTER_INSN("opt_le");
|
2437
|
+
ADD_PC(1+1);
|
2438
|
+
PREFETCH(GET_PC());
|
2439
|
+
POPN(2);
|
2440
|
+
#define CURRENT_INSN_opt_le 1
|
2441
|
+
#define INSN_IS_SC() 0
|
2442
|
+
#define INSN_LABEL(lab) LABEL_opt_le_##lab
|
2443
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2444
|
+
USAGE_ANALYSIS_INSN(BIN(opt_le));
|
2445
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_le), 0, ic);
|
2446
|
+
{
|
2447
|
+
#line 1741 "insns.def"
|
2448
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2449
|
+
BASIC_OP_UNREDEFINED_P(BOP_LE)) {
|
2450
|
+
SIGNED_VALUE a = recv, b = obj;
|
2451
|
+
|
2452
|
+
if (a <= b) {
|
2453
|
+
val = Qtrue;
|
2454
|
+
}
|
2455
|
+
else {
|
2456
|
+
val = Qfalse;
|
2457
|
+
}
|
2458
|
+
}
|
2459
|
+
else {
|
2460
|
+
/* other */
|
2461
|
+
PUSH(recv);
|
2462
|
+
PUSH(obj);
|
2463
|
+
CALL_SIMPLE_METHOD(1, idLE, recv);
|
2464
|
+
}
|
2465
|
+
|
2466
|
+
#line 2467 "vm.inc"
|
2467
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2468
|
+
PUSH(val);
|
2469
|
+
#undef CURRENT_INSN_opt_le
|
2470
|
+
#undef INSN_IS_SC
|
2471
|
+
#undef INSN_LABEL
|
2472
|
+
#undef LABEL_IS_SC
|
2473
|
+
END_INSN(opt_le);}}}
|
2474
|
+
INSN_ENTRY(opt_gt){
|
2475
|
+
{
|
2476
|
+
VALUE val;
|
2477
|
+
IC ic = (IC)GET_OPERAND(1);
|
2478
|
+
VALUE recv = TOPN(1);
|
2479
|
+
VALUE obj = TOPN(0);
|
2480
|
+
DEBUG_ENTER_INSN("opt_gt");
|
2481
|
+
ADD_PC(1+1);
|
2482
|
+
PREFETCH(GET_PC());
|
2483
|
+
POPN(2);
|
2484
|
+
#define CURRENT_INSN_opt_gt 1
|
2485
|
+
#define INSN_IS_SC() 0
|
2486
|
+
#define INSN_LABEL(lab) LABEL_opt_gt_##lab
|
2487
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2488
|
+
USAGE_ANALYSIS_INSN(BIN(opt_gt));
|
2489
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_gt), 0, ic);
|
2490
|
+
{
|
2491
|
+
#line 1771 "insns.def"
|
2492
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2493
|
+
BASIC_OP_UNREDEFINED_P(BOP_GT)) {
|
2494
|
+
SIGNED_VALUE a = recv, b = obj;
|
2495
|
+
|
2496
|
+
if (a > b) {
|
2497
|
+
val = Qtrue;
|
2498
|
+
}
|
2499
|
+
else {
|
2500
|
+
val = Qfalse;
|
2501
|
+
}
|
2502
|
+
}
|
2503
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2504
|
+
if (0) {
|
2505
|
+
}
|
2506
|
+
#if 1
|
2507
|
+
else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
|
2508
|
+
HEAP_CLASS_OF(obj) == rb_cFloat &&
|
2509
|
+
BASIC_OP_UNREDEFINED_P(BOP_GT)) {
|
2510
|
+
double a = RFLOAT_VALUE(recv);
|
2511
|
+
double b = RFLOAT_VALUE(obj);
|
2512
|
+
#if defined(_MSC_VER) && _MSC_VER < 1300
|
2513
|
+
if (isnan(a) || isnan(b)) val = Qfalse;
|
2514
|
+
else
|
2515
|
+
#endif
|
2516
|
+
val = a > b ? Qtrue : Qfalse;
|
2517
|
+
}
|
2518
|
+
#endif
|
2519
|
+
else {
|
2520
|
+
goto INSN_LABEL(normal_dispatch);
|
2521
|
+
}
|
2522
|
+
}
|
2523
|
+
else {
|
2524
|
+
INSN_LABEL(normal_dispatch):
|
2525
|
+
PUSH(recv);
|
2526
|
+
PUSH(obj);
|
2527
|
+
CALL_SIMPLE_METHOD(1, idGT, recv);
|
2528
|
+
}
|
2529
|
+
|
2530
|
+
#line 2531 "vm.inc"
|
2531
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2532
|
+
PUSH(val);
|
2533
|
+
#undef CURRENT_INSN_opt_gt
|
2534
|
+
#undef INSN_IS_SC
|
2535
|
+
#undef INSN_LABEL
|
2536
|
+
#undef LABEL_IS_SC
|
2537
|
+
END_INSN(opt_gt);}}}
|
2538
|
+
INSN_ENTRY(opt_ge){
|
2539
|
+
{
|
2540
|
+
VALUE val;
|
2541
|
+
IC ic = (IC)GET_OPERAND(1);
|
2542
|
+
VALUE recv = TOPN(1);
|
2543
|
+
VALUE obj = TOPN(0);
|
2544
|
+
DEBUG_ENTER_INSN("opt_ge");
|
2545
|
+
ADD_PC(1+1);
|
2546
|
+
PREFETCH(GET_PC());
|
2547
|
+
POPN(2);
|
2548
|
+
#define CURRENT_INSN_opt_ge 1
|
2549
|
+
#define INSN_IS_SC() 0
|
2550
|
+
#define INSN_LABEL(lab) LABEL_opt_ge_##lab
|
2551
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2552
|
+
USAGE_ANALYSIS_INSN(BIN(opt_ge));
|
2553
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_ge), 0, ic);
|
2554
|
+
{
|
2555
|
+
#line 1821 "insns.def"
|
2556
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2557
|
+
BASIC_OP_UNREDEFINED_P(BOP_GE)) {
|
2558
|
+
SIGNED_VALUE a = recv, b = obj;
|
2559
|
+
|
2560
|
+
if (a >= b) {
|
2561
|
+
val = Qtrue;
|
2562
|
+
}
|
2563
|
+
else {
|
2564
|
+
val = Qfalse;
|
2565
|
+
}
|
2566
|
+
}
|
2567
|
+
else {
|
2568
|
+
PUSH(recv);
|
2569
|
+
PUSH(obj);
|
2570
|
+
CALL_SIMPLE_METHOD(1, idGE, recv);
|
2571
|
+
}
|
2572
|
+
|
2573
|
+
#line 2574 "vm.inc"
|
2574
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2575
|
+
PUSH(val);
|
2576
|
+
#undef CURRENT_INSN_opt_ge
|
2577
|
+
#undef INSN_IS_SC
|
2578
|
+
#undef INSN_LABEL
|
2579
|
+
#undef LABEL_IS_SC
|
2580
|
+
END_INSN(opt_ge);}}}
|
2581
|
+
INSN_ENTRY(opt_ltlt){
|
2582
|
+
{
|
2583
|
+
VALUE val;
|
2584
|
+
IC ic = (IC)GET_OPERAND(1);
|
2585
|
+
VALUE recv = TOPN(1);
|
2586
|
+
VALUE obj = TOPN(0);
|
2587
|
+
DEBUG_ENTER_INSN("opt_ltlt");
|
2588
|
+
ADD_PC(1+1);
|
2589
|
+
PREFETCH(GET_PC());
|
2590
|
+
POPN(2);
|
2591
|
+
#define CURRENT_INSN_opt_ltlt 1
|
2592
|
+
#define INSN_IS_SC() 0
|
2593
|
+
#define INSN_LABEL(lab) LABEL_opt_ltlt_##lab
|
2594
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2595
|
+
USAGE_ANALYSIS_INSN(BIN(opt_ltlt));
|
2596
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_ltlt), 0, ic);
|
2597
|
+
{
|
2598
|
+
#line 1850 "insns.def"
|
2599
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2600
|
+
if (0) {
|
2601
|
+
}
|
2602
|
+
else if (HEAP_CLASS_OF(recv) == rb_cString &&
|
2603
|
+
BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
|
2604
|
+
val = rb_str_concat(recv, obj);
|
2605
|
+
}
|
2606
|
+
else if (HEAP_CLASS_OF(recv) == rb_cArray &&
|
2607
|
+
BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
|
2608
|
+
val = rb_ary_push(recv, obj);
|
2609
|
+
}
|
2610
|
+
else {
|
2611
|
+
goto INSN_LABEL(normal_dispatch);
|
2612
|
+
}
|
2613
|
+
}
|
2614
|
+
else {
|
2615
|
+
INSN_LABEL(normal_dispatch):
|
2616
|
+
PUSH(recv);
|
2617
|
+
PUSH(obj);
|
2618
|
+
CALL_SIMPLE_METHOD(1, idLTLT, recv);
|
2619
|
+
}
|
2620
|
+
|
2621
|
+
#line 2622 "vm.inc"
|
2622
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2623
|
+
PUSH(val);
|
2624
|
+
#undef CURRENT_INSN_opt_ltlt
|
2625
|
+
#undef INSN_IS_SC
|
2626
|
+
#undef INSN_LABEL
|
2627
|
+
#undef LABEL_IS_SC
|
2628
|
+
END_INSN(opt_ltlt);}}}
|
2629
|
+
INSN_ENTRY(opt_aref){
|
2630
|
+
{
|
2631
|
+
VALUE val;
|
2632
|
+
IC ic = (IC)GET_OPERAND(1);
|
2633
|
+
VALUE recv = TOPN(1);
|
2634
|
+
VALUE obj = TOPN(0);
|
2635
|
+
DEBUG_ENTER_INSN("opt_aref");
|
2636
|
+
ADD_PC(1+1);
|
2637
|
+
PREFETCH(GET_PC());
|
2638
|
+
POPN(2);
|
2639
|
+
#define CURRENT_INSN_opt_aref 1
|
2640
|
+
#define INSN_IS_SC() 0
|
2641
|
+
#define INSN_LABEL(lab) LABEL_opt_aref_##lab
|
2642
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2643
|
+
USAGE_ANALYSIS_INSN(BIN(opt_aref));
|
2644
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_aref), 0, ic);
|
2645
|
+
{
|
2646
|
+
#line 1884 "insns.def"
|
2647
|
+
if (!SPECIAL_CONST_P(recv) && BASIC_OP_UNREDEFINED_P(BOP_AREF)) {
|
2648
|
+
if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
|
2649
|
+
val = rb_ary_entry(recv, FIX2LONG(obj));
|
2650
|
+
}
|
2651
|
+
else if (HEAP_CLASS_OF(recv) == rb_cHash) {
|
2652
|
+
val = rb_hash_aref(recv, obj);
|
2653
|
+
}
|
2654
|
+
else {
|
2655
|
+
goto INSN_LABEL(normal_dispatch);
|
2656
|
+
}
|
2657
|
+
}
|
2658
|
+
else {
|
2659
|
+
INSN_LABEL(normal_dispatch):
|
2660
|
+
PUSH(recv);
|
2661
|
+
PUSH(obj);
|
2662
|
+
CALL_SIMPLE_METHOD(1, idAREF, recv);
|
2663
|
+
}
|
2664
|
+
|
2665
|
+
#line 2666 "vm.inc"
|
2666
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2667
|
+
PUSH(val);
|
2668
|
+
#undef CURRENT_INSN_opt_aref
|
2669
|
+
#undef INSN_IS_SC
|
2670
|
+
#undef INSN_LABEL
|
2671
|
+
#undef LABEL_IS_SC
|
2672
|
+
END_INSN(opt_aref);}}}
|
2673
|
+
INSN_ENTRY(opt_aset){
|
2674
|
+
{
|
2675
|
+
VALUE val;
|
2676
|
+
IC ic = (IC)GET_OPERAND(1);
|
2677
|
+
VALUE recv = TOPN(2);
|
2678
|
+
VALUE obj = TOPN(1);
|
2679
|
+
VALUE set = TOPN(0);
|
2680
|
+
DEBUG_ENTER_INSN("opt_aset");
|
2681
|
+
ADD_PC(1+1);
|
2682
|
+
PREFETCH(GET_PC());
|
2683
|
+
POPN(3);
|
2684
|
+
#define CURRENT_INSN_opt_aset 1
|
2685
|
+
#define INSN_IS_SC() 0
|
2686
|
+
#define INSN_LABEL(lab) LABEL_opt_aset_##lab
|
2687
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2688
|
+
USAGE_ANALYSIS_INSN(BIN(opt_aset));
|
2689
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_aset), 0, ic);
|
2690
|
+
{
|
2691
|
+
#line 1914 "insns.def"
|
2692
|
+
if (!SPECIAL_CONST_P(recv) &&
|
2693
|
+
BASIC_OP_UNREDEFINED_P(BOP_ASET)) {
|
2694
|
+
if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
|
2695
|
+
rb_ary_store(recv, FIX2LONG(obj), set);
|
2696
|
+
val = set;
|
2697
|
+
}
|
2698
|
+
else if (HEAP_CLASS_OF(recv) == rb_cHash) {
|
2699
|
+
rb_hash_aset(recv, obj, set);
|
2700
|
+
val = set;
|
2701
|
+
}
|
2702
|
+
else {
|
2703
|
+
goto INSN_LABEL(normal_dispatch);
|
2704
|
+
}
|
2705
|
+
}
|
2706
|
+
else {
|
2707
|
+
INSN_LABEL(normal_dispatch):
|
2708
|
+
PUSH(recv);
|
2709
|
+
PUSH(obj);
|
2710
|
+
PUSH(set);
|
2711
|
+
CALL_SIMPLE_METHOD(2, idASET, recv);
|
2712
|
+
}
|
2713
|
+
|
2714
|
+
#line 2715 "vm.inc"
|
2715
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2716
|
+
PUSH(val);
|
2717
|
+
#undef CURRENT_INSN_opt_aset
|
2718
|
+
#undef INSN_IS_SC
|
2719
|
+
#undef INSN_LABEL
|
2720
|
+
#undef LABEL_IS_SC
|
2721
|
+
END_INSN(opt_aset);}}}
|
2722
|
+
INSN_ENTRY(opt_length){
|
2723
|
+
{
|
2724
|
+
VALUE val;
|
2725
|
+
IC ic = (IC)GET_OPERAND(1);
|
2726
|
+
VALUE recv = TOPN(0);
|
2727
|
+
DEBUG_ENTER_INSN("opt_length");
|
2728
|
+
ADD_PC(1+1);
|
2729
|
+
PREFETCH(GET_PC());
|
2730
|
+
POPN(1);
|
2731
|
+
#define CURRENT_INSN_opt_length 1
|
2732
|
+
#define INSN_IS_SC() 0
|
2733
|
+
#define INSN_LABEL(lab) LABEL_opt_length_##lab
|
2734
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2735
|
+
USAGE_ANALYSIS_INSN(BIN(opt_length));
|
2736
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_length), 0, ic);
|
2737
|
+
{
|
2738
|
+
#line 1948 "insns.def"
|
2739
|
+
if (LIKELY(!SPECIAL_CONST_P(recv) &&
|
2740
|
+
BASIC_OP_UNREDEFINED_P(BOP_LENGTH))) {
|
2741
|
+
if (HEAP_CLASS_OF(recv) == rb_cString) {
|
2742
|
+
val = rb_str_length(recv);
|
2743
|
+
}
|
2744
|
+
else if (HEAP_CLASS_OF(recv) == rb_cArray) {
|
2745
|
+
val = LONG2NUM(RARRAY_LEN(recv));
|
2746
|
+
}
|
2747
|
+
else if (HEAP_CLASS_OF(recv) == rb_cHash) {
|
2748
|
+
val = INT2FIX(RHASH_SIZE(recv));
|
2749
|
+
}
|
2750
|
+
else {
|
2751
|
+
goto INSN_LABEL(normal_dispatch);
|
2752
|
+
}
|
2753
|
+
}
|
2754
|
+
else {
|
2755
|
+
INSN_LABEL(normal_dispatch):
|
2756
|
+
PUSH(recv);
|
2757
|
+
CALL_SIMPLE_METHOD(0, idLength, recv);
|
2758
|
+
}
|
2759
|
+
|
2760
|
+
#line 2761 "vm.inc"
|
2761
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2762
|
+
PUSH(val);
|
2763
|
+
#undef CURRENT_INSN_opt_length
|
2764
|
+
#undef INSN_IS_SC
|
2765
|
+
#undef INSN_LABEL
|
2766
|
+
#undef LABEL_IS_SC
|
2767
|
+
END_INSN(opt_length);}}}
|
2768
|
+
INSN_ENTRY(opt_size){
|
2769
|
+
{
|
2770
|
+
VALUE val;
|
2771
|
+
IC ic = (IC)GET_OPERAND(1);
|
2772
|
+
VALUE recv = TOPN(0);
|
2773
|
+
DEBUG_ENTER_INSN("opt_size");
|
2774
|
+
ADD_PC(1+1);
|
2775
|
+
PREFETCH(GET_PC());
|
2776
|
+
POPN(1);
|
2777
|
+
#define CURRENT_INSN_opt_size 1
|
2778
|
+
#define INSN_IS_SC() 0
|
2779
|
+
#define INSN_LABEL(lab) LABEL_opt_size_##lab
|
2780
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2781
|
+
USAGE_ANALYSIS_INSN(BIN(opt_size));
|
2782
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_size), 0, ic);
|
2783
|
+
{
|
2784
|
+
#line 1981 "insns.def"
|
2785
|
+
if (LIKELY(BASIC_OP_UNREDEFINED_P(BOP_SIZE) &&
|
2786
|
+
!SPECIAL_CONST_P(recv))) {
|
2787
|
+
if (HEAP_CLASS_OF(recv) == rb_cString) {
|
2788
|
+
val = rb_str_length(recv);
|
2789
|
+
}
|
2790
|
+
else if (HEAP_CLASS_OF(recv) == rb_cArray) {
|
2791
|
+
val = LONG2NUM(RARRAY_LEN(recv));
|
2792
|
+
}
|
2793
|
+
else if (HEAP_CLASS_OF(recv) == rb_cHash) {
|
2794
|
+
val = INT2FIX(RHASH_SIZE(recv));
|
2795
|
+
}
|
2796
|
+
else {
|
2797
|
+
goto INSN_LABEL(normal_dispatch);
|
2798
|
+
}
|
2799
|
+
}
|
2800
|
+
else {
|
2801
|
+
INSN_LABEL(normal_dispatch):
|
2802
|
+
PUSH(recv);
|
2803
|
+
CALL_SIMPLE_METHOD(0, idSize, recv);
|
2804
|
+
}
|
2805
|
+
|
2806
|
+
#line 2807 "vm.inc"
|
2807
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2808
|
+
PUSH(val);
|
2809
|
+
#undef CURRENT_INSN_opt_size
|
2810
|
+
#undef INSN_IS_SC
|
2811
|
+
#undef INSN_LABEL
|
2812
|
+
#undef LABEL_IS_SC
|
2813
|
+
END_INSN(opt_size);}}}
|
2814
|
+
INSN_ENTRY(opt_succ){
|
2815
|
+
{
|
2816
|
+
VALUE val;
|
2817
|
+
IC ic = (IC)GET_OPERAND(1);
|
2818
|
+
VALUE recv = TOPN(0);
|
2819
|
+
DEBUG_ENTER_INSN("opt_succ");
|
2820
|
+
ADD_PC(1+1);
|
2821
|
+
PREFETCH(GET_PC());
|
2822
|
+
POPN(1);
|
2823
|
+
#define CURRENT_INSN_opt_succ 1
|
2824
|
+
#define INSN_IS_SC() 0
|
2825
|
+
#define INSN_LABEL(lab) LABEL_opt_succ_##lab
|
2826
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2827
|
+
USAGE_ANALYSIS_INSN(BIN(opt_succ));
|
2828
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_succ), 0, ic);
|
2829
|
+
{
|
2830
|
+
#line 2014 "insns.def"
|
2831
|
+
if (SPECIAL_CONST_P(recv)) {
|
2832
|
+
if (FIXNUM_P(recv) &&
|
2833
|
+
BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
|
2834
|
+
const VALUE obj = INT2FIX(1);
|
2835
|
+
/* fixnum + INT2FIX(1) */
|
2836
|
+
val = (recv + (obj & (~1)));
|
2837
|
+
if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) {
|
2838
|
+
val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
|
2839
|
+
rb_int2big(FIX2LONG(obj)));
|
2840
|
+
}
|
2841
|
+
}
|
2842
|
+
else {
|
2843
|
+
goto INSN_LABEL(normal_dispatch);
|
2844
|
+
}
|
2845
|
+
}
|
2846
|
+
else {
|
2847
|
+
if (HEAP_CLASS_OF(recv) == rb_cString &&
|
2848
|
+
BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
|
2849
|
+
val = rb_str_succ(recv);
|
2850
|
+
}
|
2851
|
+
else if (HEAP_CLASS_OF(recv) == rb_cTime &&
|
2852
|
+
BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
|
2853
|
+
val = rb_time_succ(recv);
|
2854
|
+
}
|
2855
|
+
else
|
2856
|
+
{
|
2857
|
+
goto INSN_LABEL(normal_dispatch);
|
2858
|
+
}
|
2859
|
+
}
|
2860
|
+
if (0) {
|
2861
|
+
INSN_LABEL(normal_dispatch):
|
2862
|
+
PUSH(recv);
|
2863
|
+
CALL_SIMPLE_METHOD(0, idSucc, recv);
|
2864
|
+
}
|
2865
|
+
|
2866
|
+
#line 2867 "vm.inc"
|
2867
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2868
|
+
PUSH(val);
|
2869
|
+
#undef CURRENT_INSN_opt_succ
|
2870
|
+
#undef INSN_IS_SC
|
2871
|
+
#undef INSN_LABEL
|
2872
|
+
#undef LABEL_IS_SC
|
2873
|
+
END_INSN(opt_succ);}}}
|
2874
|
+
INSN_ENTRY(opt_not){
|
2875
|
+
{
|
2876
|
+
VALUE val;
|
2877
|
+
IC ic = (IC)GET_OPERAND(1);
|
2878
|
+
VALUE recv = TOPN(0);
|
2879
|
+
DEBUG_ENTER_INSN("opt_not");
|
2880
|
+
ADD_PC(1+1);
|
2881
|
+
PREFETCH(GET_PC());
|
2882
|
+
POPN(1);
|
2883
|
+
#define CURRENT_INSN_opt_not 1
|
2884
|
+
#define INSN_IS_SC() 0
|
2885
|
+
#define INSN_LABEL(lab) LABEL_opt_not_##lab
|
2886
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2887
|
+
USAGE_ANALYSIS_INSN(BIN(opt_not));
|
2888
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_not), 0, ic);
|
2889
|
+
{
|
2890
|
+
#line 2061 "insns.def"
|
2891
|
+
extern VALUE rb_obj_not(VALUE obj);
|
2892
|
+
const rb_method_entry_t *me = vm_method_search(idNot, CLASS_OF(recv), ic);
|
2893
|
+
|
2894
|
+
if (check_cfunc(me, rb_obj_not)) {
|
2895
|
+
val = RTEST(recv) ? Qfalse : Qtrue;
|
2896
|
+
}
|
2897
|
+
else {
|
2898
|
+
PUSH(recv);
|
2899
|
+
CALL_SIMPLE_METHOD(0, idNot, recv);
|
2900
|
+
}
|
2901
|
+
|
2902
|
+
#line 2903 "vm.inc"
|
2903
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2904
|
+
PUSH(val);
|
2905
|
+
#undef CURRENT_INSN_opt_not
|
2906
|
+
#undef INSN_IS_SC
|
2907
|
+
#undef INSN_LABEL
|
2908
|
+
#undef LABEL_IS_SC
|
2909
|
+
END_INSN(opt_not);}}}
|
2910
|
+
INSN_ENTRY(opt_regexpmatch1){
|
2911
|
+
{
|
2912
|
+
VALUE val;
|
2913
|
+
VALUE r = (VALUE)GET_OPERAND(1);
|
2914
|
+
VALUE obj = TOPN(0);
|
2915
|
+
DEBUG_ENTER_INSN("opt_regexpmatch1");
|
2916
|
+
ADD_PC(1+1);
|
2917
|
+
PREFETCH(GET_PC());
|
2918
|
+
POPN(1);
|
2919
|
+
#define CURRENT_INSN_opt_regexpmatch1 1
|
2920
|
+
#define INSN_IS_SC() 0
|
2921
|
+
#define INSN_LABEL(lab) LABEL_opt_regexpmatch1_##lab
|
2922
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2923
|
+
USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch1));
|
2924
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_regexpmatch1), 0, r);
|
2925
|
+
{
|
2926
|
+
#line 2085 "insns.def"
|
2927
|
+
val = rb_reg_match(r, obj);
|
2928
|
+
|
2929
|
+
#line 2930 "vm.inc"
|
2930
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2931
|
+
PUSH(val);
|
2932
|
+
#undef CURRENT_INSN_opt_regexpmatch1
|
2933
|
+
#undef INSN_IS_SC
|
2934
|
+
#undef INSN_LABEL
|
2935
|
+
#undef LABEL_IS_SC
|
2936
|
+
END_INSN(opt_regexpmatch1);}}}
|
2937
|
+
INSN_ENTRY(opt_regexpmatch2){
|
2938
|
+
{
|
2939
|
+
VALUE val;
|
2940
|
+
|
2941
|
+
VALUE obj2 = TOPN(1);
|
2942
|
+
VALUE obj1 = TOPN(0);
|
2943
|
+
DEBUG_ENTER_INSN("opt_regexpmatch2");
|
2944
|
+
ADD_PC(1+0);
|
2945
|
+
PREFETCH(GET_PC());
|
2946
|
+
POPN(2);
|
2947
|
+
#define CURRENT_INSN_opt_regexpmatch2 1
|
2948
|
+
#define INSN_IS_SC() 0
|
2949
|
+
#define INSN_LABEL(lab) LABEL_opt_regexpmatch2_##lab
|
2950
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2951
|
+
USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch2));
|
2952
|
+
{
|
2953
|
+
#line 2099 "insns.def"
|
2954
|
+
if (TYPE(obj2) == T_STRING) {
|
2955
|
+
val = rb_reg_match(obj1, obj2);
|
2956
|
+
}
|
2957
|
+
else {
|
2958
|
+
val = rb_funcall(obj2, idEqTilde, 1, obj1);
|
2959
|
+
}
|
2960
|
+
|
2961
|
+
#line 2962 "vm.inc"
|
2962
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
2963
|
+
PUSH(val);
|
2964
|
+
#undef CURRENT_INSN_opt_regexpmatch2
|
2965
|
+
#undef INSN_IS_SC
|
2966
|
+
#undef INSN_LABEL
|
2967
|
+
#undef LABEL_IS_SC
|
2968
|
+
END_INSN(opt_regexpmatch2);}}}
|
2969
|
+
INSN_ENTRY(opt_call_c_function){
|
2970
|
+
{
|
2971
|
+
rb_insn_func_t funcptr = (rb_insn_func_t)GET_OPERAND(1);
|
2972
|
+
|
2973
|
+
DEBUG_ENTER_INSN("opt_call_c_function");
|
2974
|
+
ADD_PC(1+1);
|
2975
|
+
PREFETCH(GET_PC());
|
2976
|
+
#define CURRENT_INSN_opt_call_c_function 1
|
2977
|
+
#define INSN_IS_SC() 0
|
2978
|
+
#define INSN_LABEL(lab) LABEL_opt_call_c_function_##lab
|
2979
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2980
|
+
USAGE_ANALYSIS_INSN(BIN(opt_call_c_function));
|
2981
|
+
USAGE_ANALYSIS_OPERAND(BIN(opt_call_c_function), 0, funcptr);
|
2982
|
+
{
|
2983
|
+
#line 2118 "insns.def"
|
2984
|
+
reg_cfp = (funcptr)(th, reg_cfp);
|
2985
|
+
|
2986
|
+
if (reg_cfp == 0) {
|
2987
|
+
VALUE err = th->errinfo;
|
2988
|
+
th->errinfo = Qnil;
|
2989
|
+
THROW_EXCEPTION(err);
|
2990
|
+
}
|
2991
|
+
|
2992
|
+
RESTORE_REGS();
|
2993
|
+
NEXT_INSN();
|
2994
|
+
|
2995
|
+
#line 2996 "vm.inc"
|
2996
|
+
#undef CURRENT_INSN_opt_call_c_function
|
2997
|
+
#undef INSN_IS_SC
|
2998
|
+
#undef INSN_LABEL
|
2999
|
+
#undef LABEL_IS_SC
|
3000
|
+
END_INSN(opt_call_c_function);}}}
|
3001
|
+
INSN_ENTRY(bitblt){
|
3002
|
+
{
|
3003
|
+
VALUE ret;
|
3004
|
+
|
3005
|
+
|
3006
|
+
DEBUG_ENTER_INSN("bitblt");
|
3007
|
+
ADD_PC(1+0);
|
3008
|
+
PREFETCH(GET_PC());
|
3009
|
+
#define CURRENT_INSN_bitblt 1
|
3010
|
+
#define INSN_IS_SC() 0
|
3011
|
+
#define INSN_LABEL(lab) LABEL_bitblt_##lab
|
3012
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3013
|
+
USAGE_ANALYSIS_INSN(BIN(bitblt));
|
3014
|
+
{
|
3015
|
+
#line 2141 "insns.def"
|
3016
|
+
ret = rb_str_new2("a bit of bacon, lettuce and tomato");
|
3017
|
+
|
3018
|
+
#line 3019 "vm.inc"
|
3019
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
3020
|
+
PUSH(ret);
|
3021
|
+
#undef CURRENT_INSN_bitblt
|
3022
|
+
#undef INSN_IS_SC
|
3023
|
+
#undef INSN_LABEL
|
3024
|
+
#undef LABEL_IS_SC
|
3025
|
+
END_INSN(bitblt);}}}
|
3026
|
+
INSN_ENTRY(answer){
|
3027
|
+
{
|
3028
|
+
VALUE ret;
|
3029
|
+
|
3030
|
+
|
3031
|
+
DEBUG_ENTER_INSN("answer");
|
3032
|
+
ADD_PC(1+0);
|
3033
|
+
PREFETCH(GET_PC());
|
3034
|
+
#define CURRENT_INSN_answer 1
|
3035
|
+
#define INSN_IS_SC() 0
|
3036
|
+
#define INSN_LABEL(lab) LABEL_answer_##lab
|
3037
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3038
|
+
USAGE_ANALYSIS_INSN(BIN(answer));
|
3039
|
+
{
|
3040
|
+
#line 2155 "insns.def"
|
3041
|
+
ret = INT2FIX(42);
|
3042
|
+
|
3043
|
+
#line 3044 "vm.inc"
|
3044
|
+
CHECK_STACK_OVERFLOW(REG_CFP, 1);
|
3045
|
+
PUSH(ret);
|
3046
|
+
#undef CURRENT_INSN_answer
|
3047
|
+
#undef INSN_IS_SC
|
3048
|
+
#undef INSN_LABEL
|
3049
|
+
#undef LABEL_IS_SC
|
3050
|
+
END_INSN(answer);}}}
|
3051
|
+
|