ruby-internal 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ruby-internal-node-dump +1 -1
- data/bin/ruby-internal-obfuscate +1 -1
- data/ext/internal/method/extconf.rb +4 -0
- data/ext/internal/method/internal_method.h +65 -0
- data/ext/internal/method/{method.h.rpp → internal_method.h.rpp} +21 -0
- data/ext/internal/method/method.c +69 -13
- data/ext/internal/module/classpath.c +12 -14
- data/ext/internal/module/extconf.rb +3 -2
- data/ext/internal/module/module.c +36 -15
- data/ext/internal/node/block.h.rpp +1 -0
- data/ext/internal/node/extconf.rb +0 -22
- data/ext/internal/node/global_entry.h +45 -3
- data/ext/internal/node/global_entry.h.rpp +12 -3
- data/ext/internal/node/node.c +42 -15
- data/ext/internal/node/node_type_descrip.c +16 -20
- data/ext/internal/node/node_type_descrip.c.rpp +1 -0
- data/ext/internal/node/nodeinfo.c +133 -281
- data/ext/internal/node/nodeinfo.c.rpp +8 -4
- data/ext/internal/node/nodeinfo.h.rpp +2 -1
- data/ext/internal/noex/noex.c +4 -0
- data/ext/internal/proc/proc.c +2 -2
- data/ext/internal/vm/constants/constants.c +2 -0
- data/ext/internal/vm/constants/extconf.rb +2 -0
- data/ext/internal/vm/control_frame/control_frame.c +21 -3
- data/ext/internal/vm/control_frame/extconf.rb +4 -0
- data/ext/internal/vm/inline_cache/inline_cache.c +12 -5
- data/ext/internal/vm/instruction/insns_info.c +141 -64
- data/ext/internal/vm/instruction/insns_info.c.rpp +3 -0
- data/ext/internal/vm/instruction/insns_info.h +80 -71
- data/ext/internal/vm/iseq/iseq.c +6 -6
- data/ext/internal/vm/iseq/iseq_load.inc.rpp +6 -3
- data/ext/mkmf-ruby-internal.rb +21 -1
- data/ext/ruby_source_dir.rb +6 -2
- data/post-setup.rb +1 -0
- data/pre-config.rb +9 -0
- data/run_tests.rb +1 -0
- data/test/test_method.rb +1 -1
- data/test/test_module.rb +1 -1
- metadata +309 -321
- data/ext/internal/method/method.h +0 -20
- data/ext/internal/yarv-headers/debug.h +0 -36
- data/ext/internal/yarv-headers/dln.h +0 -41
- data/ext/internal/yarv-headers/encdb.h +0 -147
- data/ext/internal/yarv-headers/eval_intern.h +0 -215
- data/ext/internal/yarv-headers/gc.h +0 -75
- data/ext/internal/yarv-headers/id.h +0 -163
- data/ext/internal/yarv-headers/iseq.h +0 -103
- data/ext/internal/yarv-headers/node.h +0 -516
- data/ext/internal/yarv-headers/parse.h +0 -188
- data/ext/internal/yarv-headers/regenc.h +0 -207
- data/ext/internal/yarv-headers/regint.h +0 -842
- data/ext/internal/yarv-headers/regparse.h +0 -351
- data/ext/internal/yarv-headers/revision.h +0 -1
- data/ext/internal/yarv-headers/thread_pthread.h +0 -24
- data/ext/internal/yarv-headers/thread_win32.h +0 -33
- data/ext/internal/yarv-headers/transcode_data.h +0 -106
- data/ext/internal/yarv-headers/transdb.h +0 -147
- data/ext/internal/yarv-headers/version.h +0 -54
- data/ext/internal/yarv-headers/vm_core.h +0 -646
- data/ext/internal/yarv-headers/vm_exec.h +0 -184
- data/ext/internal/yarv-headers/vm_insnhelper.h +0 -195
- data/ext/internal/yarv-headers/vm_opts.h +0 -51
- data/ext/rubypp.rb +0 -97
@@ -61,6 +61,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
61
61
|
case NEN_NONE:
|
62
62
|
return Qnil;
|
63
63
|
#ruby <<END
|
64
|
+
$: << '.' # TODO: hack
|
64
65
|
require 'read_node_h'
|
65
66
|
require 'nodes'
|
66
67
|
require 'node_type_descrip'
|
@@ -129,7 +130,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
129
130
|
else
|
130
131
|
{
|
131
132
|
path = rb_class_path(klass);
|
132
|
-
if(
|
133
|
+
if(StringValuePtr(path)[0] == '#')
|
133
134
|
{
|
134
135
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
135
136
|
}
|
@@ -256,20 +257,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
256
257
|
END
|
257
258
|
when /\.value$/
|
258
259
|
puts <<-END
|
260
|
+
int flags;
|
259
261
|
Check_Type(v, T_ARRAY);
|
260
262
|
if(RARRAY_LEN(v) != 2)
|
261
263
|
{
|
262
264
|
rb_raise(rb_eArgError, "wrong size for array");
|
263
265
|
}
|
264
|
-
|
266
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
265
267
|
switch(flags & T_MASK)
|
266
268
|
{
|
267
269
|
case T_CLASS:
|
268
270
|
case T_MODULE:
|
269
271
|
{
|
270
|
-
VALUE str
|
272
|
+
VALUE str, klass;
|
273
|
+
|
274
|
+
str = RARRAY_PTR(v)[1];
|
271
275
|
Check_Type(str, T_STRING);
|
272
|
-
|
276
|
+
klass = rb_path2class(StringValuePtr(str));
|
273
277
|
if(flags & FL_SINGLETON)
|
274
278
|
{
|
275
279
|
*(VALUE *)(&n->nd_#{node_elem_name}) =
|
data/ext/internal/noex/noex.c
CHANGED
data/ext/internal/proc/proc.c
CHANGED
@@ -133,13 +133,13 @@ static VALUE proc_dump(VALUE self, VALUE limit)
|
|
133
133
|
{
|
134
134
|
#ifdef RUBY_VM
|
135
135
|
rb_proc_t * p;
|
136
|
-
VALUE iseq;
|
136
|
+
VALUE iseq, str;
|
137
137
|
rb_iseq_t * iseqdat;
|
138
138
|
GetProcPtr(self, p);
|
139
139
|
iseq = p->block.iseq->self;
|
140
140
|
iseqdat = iseq_check(iseq);
|
141
141
|
iseqdat->type = ISEQ_TYPE_TOP; /* TODO: is this right? */
|
142
|
-
|
142
|
+
str = marshal_dump(iseq, limit);
|
143
143
|
return str;
|
144
144
|
#else
|
145
145
|
struct BLOCK * b;
|
@@ -25,7 +25,9 @@ void Init_constants(void)
|
|
25
25
|
rb_define_const(rb_cRubyVM, "CALL_TAILCALL_BIT", INT2NUM(VM_CALL_TAILCALL_BIT));
|
26
26
|
rb_define_const(rb_cRubyVM, "CALL_TAILRECURSION_BIT", INT2NUM(VM_CALL_TAILRECURSION_BIT));
|
27
27
|
rb_define_const(rb_cRubyVM, "CALL_SUPER_BIT", INT2NUM(VM_CALL_SUPER_BIT));
|
28
|
+
#ifdef HAVE_RUBY_CALL_SEND_BIT
|
28
29
|
rb_define_const(rb_cRubyVM, "CALL_SEND_BIT", INT2NUM(VM_CALL_SEND_BIT));
|
30
|
+
#endif
|
29
31
|
rb_define_const(rb_cRubyVM, "SPECIAL_OBJECT_VMCORE", INT2NUM(VM_SPECIAL_OBJECT_VMCORE));
|
30
32
|
rb_define_const(rb_cRubyVM, "SPECIAL_OBJECT_CBASE", INT2NUM(VM_SPECIAL_OBJECT_CBASE));
|
31
33
|
#endif
|
@@ -85,11 +85,20 @@ static VALUE control_frame_proc(VALUE control_frame)
|
|
85
85
|
*/
|
86
86
|
static VALUE control_frame_method_id(VALUE control_frame)
|
87
87
|
{
|
88
|
+
ID method_id;
|
88
89
|
struct RubyInternalControlFrame * cfp;
|
90
|
+
|
89
91
|
Data_Get_Struct(control_frame, struct RubyInternalControlFrame, cfp);
|
90
|
-
|
92
|
+
|
93
|
+
#if RUBY_VERSION_CODE >= 192
|
94
|
+
method_id = cfp->control_frame->me->called_id; /* TODO: right? */
|
95
|
+
#else
|
96
|
+
method_id = cfp->control_frame->method_id;
|
97
|
+
#endif
|
98
|
+
|
99
|
+
if(method_id)
|
91
100
|
{
|
92
|
-
return ID2SYM(
|
101
|
+
return ID2SYM(method_id);
|
93
102
|
}
|
94
103
|
else
|
95
104
|
{
|
@@ -105,9 +114,18 @@ static VALUE control_frame_method_id(VALUE control_frame)
|
|
105
114
|
*/
|
106
115
|
static VALUE control_frame_method_class(VALUE control_frame)
|
107
116
|
{
|
117
|
+
VALUE klass;
|
108
118
|
struct RubyInternalControlFrame * cfp;
|
119
|
+
|
109
120
|
Data_Get_Struct(control_frame, struct RubyInternalControlFrame, cfp);
|
110
|
-
|
121
|
+
|
122
|
+
#if RUBY_VERSION_CODE >= 192
|
123
|
+
klass = cfp->control_frame->me->klass; /* TODO: right? */
|
124
|
+
#else
|
125
|
+
klass = cfp->control_frame->method_class;
|
126
|
+
#endif
|
127
|
+
|
128
|
+
return klass;
|
111
129
|
}
|
112
130
|
|
113
131
|
/*
|
@@ -15,8 +15,15 @@
|
|
15
15
|
*/
|
16
16
|
static VALUE inline_cache_klass(VALUE self)
|
17
17
|
{
|
18
|
-
|
19
|
-
|
18
|
+
IC inline_cache = (IC)unwrap_node(self);
|
19
|
+
if (inline_cache->ic_class == Qundef)
|
20
|
+
{
|
21
|
+
return Qnil;
|
22
|
+
}
|
23
|
+
else
|
24
|
+
{
|
25
|
+
return inline_cache->ic_class;
|
26
|
+
}
|
20
27
|
}
|
21
28
|
|
22
29
|
/*
|
@@ -27,8 +34,8 @@ static VALUE inline_cache_klass(VALUE self)
|
|
27
34
|
*/
|
28
35
|
static VALUE inline_cache_value(VALUE self)
|
29
36
|
{
|
30
|
-
|
31
|
-
return
|
37
|
+
/* TODO: Wrap the LABEL object (from compile.c) */
|
38
|
+
return Qnil;
|
32
39
|
}
|
33
40
|
|
34
41
|
/*
|
@@ -39,7 +46,7 @@ static VALUE inline_cache_value(VALUE self)
|
|
39
46
|
*/
|
40
47
|
static VALUE inline_cache_vmstat(VALUE self)
|
41
48
|
{
|
42
|
-
IC inline_cache = unwrap_node(self);
|
49
|
+
IC inline_cache = (IC)unwrap_node(self);
|
43
50
|
return INT2NUM(inline_cache->ic_vmstat);
|
44
51
|
}
|
45
52
|
|
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
#ifdef RUBY_VM
|
4
4
|
|
5
|
+
#include "iseq.h"
|
6
|
+
#include "vm_core.h"
|
7
|
+
|
5
8
|
static rb_compile_option_t COMPILE_OPTION_DEFAULT = {
|
6
9
|
OPT_INLINE_CONST_CACHE, /* int inline_const_cache; */
|
7
10
|
OPT_PEEPHOLE_OPTIMIZATION, /* int peephole_optimization; */
|
@@ -601,9 +604,9 @@ static VALUE insn_GETINSTANCEVARIABLE_name(VALUE self)
|
|
601
604
|
static VALUE insn_GETINSTANCEVARIABLE_operand_names(VALUE self)
|
602
605
|
{
|
603
606
|
VALUE v[] = {
|
604
|
-
ID2SYM(rb_intern("id"))
|
607
|
+
ID2SYM(rb_intern("id")), ID2SYM(rb_intern("ic"))
|
605
608
|
};
|
606
|
-
return rb_ary_new4(
|
609
|
+
return rb_ary_new4(2, v);
|
607
610
|
}
|
608
611
|
|
609
612
|
/*
|
@@ -667,9 +670,9 @@ static VALUE insn_SETINSTANCEVARIABLE_name(VALUE self)
|
|
667
670
|
static VALUE insn_SETINSTANCEVARIABLE_operand_names(VALUE self)
|
668
671
|
{
|
669
672
|
VALUE v[] = {
|
670
|
-
ID2SYM(rb_intern("id"))
|
673
|
+
ID2SYM(rb_intern("id")), ID2SYM(rb_intern("ic"))
|
671
674
|
};
|
672
|
-
return rb_ary_new4(
|
675
|
+
return rb_ary_new4(2, v);
|
673
676
|
}
|
674
677
|
|
675
678
|
/*
|
@@ -3571,7 +3574,7 @@ static VALUE insn_GETINLINECACHE_name(VALUE self)
|
|
3571
3574
|
static VALUE insn_GETINLINECACHE_operand_names(VALUE self)
|
3572
3575
|
{
|
3573
3576
|
VALUE v[] = {
|
3574
|
-
ID2SYM(rb_intern("
|
3577
|
+
ID2SYM(rb_intern("dst")), ID2SYM(rb_intern("ic"))
|
3575
3578
|
};
|
3576
3579
|
return rb_ary_new4(2, v);
|
3577
3580
|
}
|
@@ -3637,7 +3640,7 @@ static VALUE insn_ONCEINLINECACHE_name(VALUE self)
|
|
3637
3640
|
static VALUE insn_ONCEINLINECACHE_operand_names(VALUE self)
|
3638
3641
|
{
|
3639
3642
|
VALUE v[] = {
|
3640
|
-
ID2SYM(rb_intern("
|
3643
|
+
ID2SYM(rb_intern("dst")), ID2SYM(rb_intern("ic"))
|
3641
3644
|
};
|
3642
3645
|
return rb_ary_new4(2, v);
|
3643
3646
|
}
|
@@ -3703,7 +3706,7 @@ static VALUE insn_SETINLINECACHE_name(VALUE self)
|
|
3703
3706
|
static VALUE insn_SETINLINECACHE_operand_names(VALUE self)
|
3704
3707
|
{
|
3705
3708
|
VALUE v[] = {
|
3706
|
-
ID2SYM(rb_intern("
|
3709
|
+
ID2SYM(rb_intern("ic"))
|
3707
3710
|
};
|
3708
3711
|
return rb_ary_new4(1, v);
|
3709
3712
|
}
|
@@ -3901,9 +3904,9 @@ static VALUE insn_OPT_PLUS_name(VALUE self)
|
|
3901
3904
|
static VALUE insn_OPT_PLUS_operand_names(VALUE self)
|
3902
3905
|
{
|
3903
3906
|
VALUE v[] = {
|
3904
|
-
|
3907
|
+
ID2SYM(rb_intern("ic"))
|
3905
3908
|
};
|
3906
|
-
return rb_ary_new4(
|
3909
|
+
return rb_ary_new4(1, v);
|
3907
3910
|
}
|
3908
3911
|
|
3909
3912
|
/*
|
@@ -3967,9 +3970,9 @@ static VALUE insn_OPT_MINUS_name(VALUE self)
|
|
3967
3970
|
static VALUE insn_OPT_MINUS_operand_names(VALUE self)
|
3968
3971
|
{
|
3969
3972
|
VALUE v[] = {
|
3970
|
-
|
3973
|
+
ID2SYM(rb_intern("ic"))
|
3971
3974
|
};
|
3972
|
-
return rb_ary_new4(
|
3975
|
+
return rb_ary_new4(1, v);
|
3973
3976
|
}
|
3974
3977
|
|
3975
3978
|
/*
|
@@ -4033,9 +4036,9 @@ static VALUE insn_OPT_MULT_name(VALUE self)
|
|
4033
4036
|
static VALUE insn_OPT_MULT_operand_names(VALUE self)
|
4034
4037
|
{
|
4035
4038
|
VALUE v[] = {
|
4036
|
-
|
4039
|
+
ID2SYM(rb_intern("ic"))
|
4037
4040
|
};
|
4038
|
-
return rb_ary_new4(
|
4041
|
+
return rb_ary_new4(1, v);
|
4039
4042
|
}
|
4040
4043
|
|
4041
4044
|
/*
|
@@ -4099,9 +4102,9 @@ static VALUE insn_OPT_DIV_name(VALUE self)
|
|
4099
4102
|
static VALUE insn_OPT_DIV_operand_names(VALUE self)
|
4100
4103
|
{
|
4101
4104
|
VALUE v[] = {
|
4102
|
-
|
4105
|
+
ID2SYM(rb_intern("ic"))
|
4103
4106
|
};
|
4104
|
-
return rb_ary_new4(
|
4107
|
+
return rb_ary_new4(1, v);
|
4105
4108
|
}
|
4106
4109
|
|
4107
4110
|
/*
|
@@ -4165,9 +4168,9 @@ static VALUE insn_OPT_MOD_name(VALUE self)
|
|
4165
4168
|
static VALUE insn_OPT_MOD_operand_names(VALUE self)
|
4166
4169
|
{
|
4167
4170
|
VALUE v[] = {
|
4168
|
-
|
4171
|
+
ID2SYM(rb_intern("ic"))
|
4169
4172
|
};
|
4170
|
-
return rb_ary_new4(
|
4173
|
+
return rb_ary_new4(1, v);
|
4171
4174
|
}
|
4172
4175
|
|
4173
4176
|
/*
|
@@ -4297,7 +4300,7 @@ static VALUE insn_OPT_NEQ_name(VALUE self)
|
|
4297
4300
|
static VALUE insn_OPT_NEQ_operand_names(VALUE self)
|
4298
4301
|
{
|
4299
4302
|
VALUE v[] = {
|
4300
|
-
ID2SYM(rb_intern("
|
4303
|
+
ID2SYM(rb_intern("ic")), ID2SYM(rb_intern("ic_eq"))
|
4301
4304
|
};
|
4302
4305
|
return rb_ary_new4(2, v);
|
4303
4306
|
}
|
@@ -4363,9 +4366,9 @@ static VALUE insn_OPT_LT_name(VALUE self)
|
|
4363
4366
|
static VALUE insn_OPT_LT_operand_names(VALUE self)
|
4364
4367
|
{
|
4365
4368
|
VALUE v[] = {
|
4366
|
-
|
4369
|
+
ID2SYM(rb_intern("ic"))
|
4367
4370
|
};
|
4368
|
-
return rb_ary_new4(
|
4371
|
+
return rb_ary_new4(1, v);
|
4369
4372
|
}
|
4370
4373
|
|
4371
4374
|
/*
|
@@ -4429,9 +4432,9 @@ static VALUE insn_OPT_LE_name(VALUE self)
|
|
4429
4432
|
static VALUE insn_OPT_LE_operand_names(VALUE self)
|
4430
4433
|
{
|
4431
4434
|
VALUE v[] = {
|
4432
|
-
|
4435
|
+
ID2SYM(rb_intern("ic"))
|
4433
4436
|
};
|
4434
|
-
return rb_ary_new4(
|
4437
|
+
return rb_ary_new4(1, v);
|
4435
4438
|
}
|
4436
4439
|
|
4437
4440
|
/*
|
@@ -4495,9 +4498,9 @@ static VALUE insn_OPT_GT_name(VALUE self)
|
|
4495
4498
|
static VALUE insn_OPT_GT_operand_names(VALUE self)
|
4496
4499
|
{
|
4497
4500
|
VALUE v[] = {
|
4498
|
-
|
4501
|
+
ID2SYM(rb_intern("ic"))
|
4499
4502
|
};
|
4500
|
-
return rb_ary_new4(
|
4503
|
+
return rb_ary_new4(1, v);
|
4501
4504
|
}
|
4502
4505
|
|
4503
4506
|
/*
|
@@ -4561,9 +4564,9 @@ static VALUE insn_OPT_GE_name(VALUE self)
|
|
4561
4564
|
static VALUE insn_OPT_GE_operand_names(VALUE self)
|
4562
4565
|
{
|
4563
4566
|
VALUE v[] = {
|
4564
|
-
|
4567
|
+
ID2SYM(rb_intern("ic"))
|
4565
4568
|
};
|
4566
|
-
return rb_ary_new4(
|
4569
|
+
return rb_ary_new4(1, v);
|
4567
4570
|
}
|
4568
4571
|
|
4569
4572
|
/*
|
@@ -4627,9 +4630,9 @@ static VALUE insn_OPT_LTLT_name(VALUE self)
|
|
4627
4630
|
static VALUE insn_OPT_LTLT_operand_names(VALUE self)
|
4628
4631
|
{
|
4629
4632
|
VALUE v[] = {
|
4630
|
-
|
4633
|
+
ID2SYM(rb_intern("ic"))
|
4631
4634
|
};
|
4632
|
-
return rb_ary_new4(
|
4635
|
+
return rb_ary_new4(1, v);
|
4633
4636
|
}
|
4634
4637
|
|
4635
4638
|
/*
|
@@ -4693,9 +4696,9 @@ static VALUE insn_OPT_AREF_name(VALUE self)
|
|
4693
4696
|
static VALUE insn_OPT_AREF_operand_names(VALUE self)
|
4694
4697
|
{
|
4695
4698
|
VALUE v[] = {
|
4696
|
-
|
4699
|
+
ID2SYM(rb_intern("ic"))
|
4697
4700
|
};
|
4698
|
-
return rb_ary_new4(
|
4701
|
+
return rb_ary_new4(1, v);
|
4699
4702
|
}
|
4700
4703
|
|
4701
4704
|
/*
|
@@ -4759,9 +4762,9 @@ static VALUE insn_OPT_ASET_name(VALUE self)
|
|
4759
4762
|
static VALUE insn_OPT_ASET_operand_names(VALUE self)
|
4760
4763
|
{
|
4761
4764
|
VALUE v[] = {
|
4762
|
-
|
4765
|
+
ID2SYM(rb_intern("ic"))
|
4763
4766
|
};
|
4764
|
-
return rb_ary_new4(
|
4767
|
+
return rb_ary_new4(1, v);
|
4765
4768
|
}
|
4766
4769
|
|
4767
4770
|
/*
|
@@ -4825,9 +4828,9 @@ static VALUE insn_OPT_LENGTH_name(VALUE self)
|
|
4825
4828
|
static VALUE insn_OPT_LENGTH_operand_names(VALUE self)
|
4826
4829
|
{
|
4827
4830
|
VALUE v[] = {
|
4828
|
-
|
4831
|
+
ID2SYM(rb_intern("ic"))
|
4829
4832
|
};
|
4830
|
-
return rb_ary_new4(
|
4833
|
+
return rb_ary_new4(1, v);
|
4831
4834
|
}
|
4832
4835
|
|
4833
4836
|
/*
|
@@ -4836,7 +4839,7 @@ static VALUE insn_OPT_LENGTH_operand_names(VALUE self)
|
|
4836
4839
|
*
|
4837
4840
|
* Returns the length of the instruction.
|
4838
4841
|
*/
|
4839
|
-
static VALUE
|
4842
|
+
static VALUE insn_OPT_SIZE_length(VALUE self)
|
4840
4843
|
{
|
4841
4844
|
return LONG2NUM(insn_len(72));
|
4842
4845
|
}
|
@@ -4847,7 +4850,7 @@ static VALUE insn_OPT_SUCC_length(VALUE self)
|
|
4847
4850
|
*
|
4848
4851
|
* Returns the numeric instruction number.
|
4849
4852
|
*/
|
4850
|
-
static VALUE
|
4853
|
+
static VALUE insn_OPT_SIZE_to_i(VALUE self)
|
4851
4854
|
{
|
4852
4855
|
return NUM2LONG(72);
|
4853
4856
|
}
|
@@ -4858,7 +4861,7 @@ static VALUE insn_OPT_SUCC_to_i(VALUE self)
|
|
4858
4861
|
*
|
4859
4862
|
* Returns an array containing the types of the operands.
|
4860
4863
|
*/
|
4861
|
-
static VALUE
|
4864
|
+
static VALUE insn_OPT_SIZE_operand_types(VALUE self)
|
4862
4865
|
{
|
4863
4866
|
VALUE operand_types = rb_ary_new();
|
4864
4867
|
char const * s;
|
@@ -4871,6 +4874,72 @@ static VALUE insn_OPT_SUCC_operand_types(VALUE self)
|
|
4871
4874
|
return operand_types;
|
4872
4875
|
}
|
4873
4876
|
|
4877
|
+
/*
|
4878
|
+
* call-seq:
|
4879
|
+
* insn.name => Symbol
|
4880
|
+
*
|
4881
|
+
* Returns the name of the instruction.
|
4882
|
+
*/
|
4883
|
+
static VALUE insn_OPT_SIZE_name(VALUE self)
|
4884
|
+
{
|
4885
|
+
return rb_intern("OPT_SIZE");
|
4886
|
+
}
|
4887
|
+
|
4888
|
+
/*
|
4889
|
+
* call-seq:
|
4890
|
+
* insn.name => Symbol
|
4891
|
+
*
|
4892
|
+
* Returns the name of the operands for this instruction.
|
4893
|
+
*/
|
4894
|
+
static VALUE insn_OPT_SIZE_operand_names(VALUE self)
|
4895
|
+
{
|
4896
|
+
VALUE v[] = {
|
4897
|
+
ID2SYM(rb_intern("ic"))
|
4898
|
+
};
|
4899
|
+
return rb_ary_new4(1, v);
|
4900
|
+
}
|
4901
|
+
|
4902
|
+
/*
|
4903
|
+
* call-seq:
|
4904
|
+
* insn.length => Integer
|
4905
|
+
*
|
4906
|
+
* Returns the length of the instruction.
|
4907
|
+
*/
|
4908
|
+
static VALUE insn_OPT_SUCC_length(VALUE self)
|
4909
|
+
{
|
4910
|
+
return LONG2NUM(insn_len(73));
|
4911
|
+
}
|
4912
|
+
|
4913
|
+
/*
|
4914
|
+
* call-seq:
|
4915
|
+
* insn.to_i => Integer
|
4916
|
+
*
|
4917
|
+
* Returns the numeric instruction number.
|
4918
|
+
*/
|
4919
|
+
static VALUE insn_OPT_SUCC_to_i(VALUE self)
|
4920
|
+
{
|
4921
|
+
return NUM2LONG(73);
|
4922
|
+
}
|
4923
|
+
|
4924
|
+
/*
|
4925
|
+
* call-seq:
|
4926
|
+
* insn.operand_types => Array of Symbol
|
4927
|
+
*
|
4928
|
+
* Returns an array containing the types of the operands.
|
4929
|
+
*/
|
4930
|
+
static VALUE insn_OPT_SUCC_operand_types(VALUE self)
|
4931
|
+
{
|
4932
|
+
VALUE operand_types = rb_ary_new();
|
4933
|
+
char const * s;
|
4934
|
+
|
4935
|
+
for(s = insn_op_types(73); *s != '\0'; ++s)
|
4936
|
+
{
|
4937
|
+
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
4938
|
+
}
|
4939
|
+
|
4940
|
+
return operand_types;
|
4941
|
+
}
|
4942
|
+
|
4874
4943
|
/*
|
4875
4944
|
* call-seq:
|
4876
4945
|
* insn.name => Symbol
|
@@ -4891,9 +4960,9 @@ static VALUE insn_OPT_SUCC_name(VALUE self)
|
|
4891
4960
|
static VALUE insn_OPT_SUCC_operand_names(VALUE self)
|
4892
4961
|
{
|
4893
4962
|
VALUE v[] = {
|
4894
|
-
|
4963
|
+
ID2SYM(rb_intern("ic"))
|
4895
4964
|
};
|
4896
|
-
return rb_ary_new4(
|
4965
|
+
return rb_ary_new4(1, v);
|
4897
4966
|
}
|
4898
4967
|
|
4899
4968
|
/*
|
@@ -4904,7 +4973,7 @@ static VALUE insn_OPT_SUCC_operand_names(VALUE self)
|
|
4904
4973
|
*/
|
4905
4974
|
static VALUE insn_OPT_NOT_length(VALUE self)
|
4906
4975
|
{
|
4907
|
-
return LONG2NUM(insn_len(
|
4976
|
+
return LONG2NUM(insn_len(74));
|
4908
4977
|
}
|
4909
4978
|
|
4910
4979
|
/*
|
@@ -4915,7 +4984,7 @@ static VALUE insn_OPT_NOT_length(VALUE self)
|
|
4915
4984
|
*/
|
4916
4985
|
static VALUE insn_OPT_NOT_to_i(VALUE self)
|
4917
4986
|
{
|
4918
|
-
return NUM2LONG(
|
4987
|
+
return NUM2LONG(74);
|
4919
4988
|
}
|
4920
4989
|
|
4921
4990
|
/*
|
@@ -4929,7 +4998,7 @@ static VALUE insn_OPT_NOT_operand_types(VALUE self)
|
|
4929
4998
|
VALUE operand_types = rb_ary_new();
|
4930
4999
|
char const * s;
|
4931
5000
|
|
4932
|
-
for(s = insn_op_types(
|
5001
|
+
for(s = insn_op_types(74); *s != '\0'; ++s)
|
4933
5002
|
{
|
4934
5003
|
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
4935
5004
|
}
|
@@ -4970,7 +5039,7 @@ static VALUE insn_OPT_NOT_operand_names(VALUE self)
|
|
4970
5039
|
*/
|
4971
5040
|
static VALUE insn_OPT_REGEXPMATCH1_length(VALUE self)
|
4972
5041
|
{
|
4973
|
-
return LONG2NUM(insn_len(
|
5042
|
+
return LONG2NUM(insn_len(75));
|
4974
5043
|
}
|
4975
5044
|
|
4976
5045
|
/*
|
@@ -4981,7 +5050,7 @@ static VALUE insn_OPT_REGEXPMATCH1_length(VALUE self)
|
|
4981
5050
|
*/
|
4982
5051
|
static VALUE insn_OPT_REGEXPMATCH1_to_i(VALUE self)
|
4983
5052
|
{
|
4984
|
-
return NUM2LONG(
|
5053
|
+
return NUM2LONG(75);
|
4985
5054
|
}
|
4986
5055
|
|
4987
5056
|
/*
|
@@ -4995,7 +5064,7 @@ static VALUE insn_OPT_REGEXPMATCH1_operand_types(VALUE self)
|
|
4995
5064
|
VALUE operand_types = rb_ary_new();
|
4996
5065
|
char const * s;
|
4997
5066
|
|
4998
|
-
for(s = insn_op_types(
|
5067
|
+
for(s = insn_op_types(75); *s != '\0'; ++s)
|
4999
5068
|
{
|
5000
5069
|
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
5001
5070
|
}
|
@@ -5036,7 +5105,7 @@ static VALUE insn_OPT_REGEXPMATCH1_operand_names(VALUE self)
|
|
5036
5105
|
*/
|
5037
5106
|
static VALUE insn_OPT_REGEXPMATCH2_length(VALUE self)
|
5038
5107
|
{
|
5039
|
-
return LONG2NUM(insn_len(
|
5108
|
+
return LONG2NUM(insn_len(76));
|
5040
5109
|
}
|
5041
5110
|
|
5042
5111
|
/*
|
@@ -5047,7 +5116,7 @@ static VALUE insn_OPT_REGEXPMATCH2_length(VALUE self)
|
|
5047
5116
|
*/
|
5048
5117
|
static VALUE insn_OPT_REGEXPMATCH2_to_i(VALUE self)
|
5049
5118
|
{
|
5050
|
-
return NUM2LONG(
|
5119
|
+
return NUM2LONG(76);
|
5051
5120
|
}
|
5052
5121
|
|
5053
5122
|
/*
|
@@ -5061,7 +5130,7 @@ static VALUE insn_OPT_REGEXPMATCH2_operand_types(VALUE self)
|
|
5061
5130
|
VALUE operand_types = rb_ary_new();
|
5062
5131
|
char const * s;
|
5063
5132
|
|
5064
|
-
for(s = insn_op_types(
|
5133
|
+
for(s = insn_op_types(76); *s != '\0'; ++s)
|
5065
5134
|
{
|
5066
5135
|
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
5067
5136
|
}
|
@@ -5102,7 +5171,7 @@ static VALUE insn_OPT_REGEXPMATCH2_operand_names(VALUE self)
|
|
5102
5171
|
*/
|
5103
5172
|
static VALUE insn_OPT_CALL_C_FUNCTION_length(VALUE self)
|
5104
5173
|
{
|
5105
|
-
return LONG2NUM(insn_len(
|
5174
|
+
return LONG2NUM(insn_len(77));
|
5106
5175
|
}
|
5107
5176
|
|
5108
5177
|
/*
|
@@ -5113,7 +5182,7 @@ static VALUE insn_OPT_CALL_C_FUNCTION_length(VALUE self)
|
|
5113
5182
|
*/
|
5114
5183
|
static VALUE insn_OPT_CALL_C_FUNCTION_to_i(VALUE self)
|
5115
5184
|
{
|
5116
|
-
return NUM2LONG(
|
5185
|
+
return NUM2LONG(77);
|
5117
5186
|
}
|
5118
5187
|
|
5119
5188
|
/*
|
@@ -5127,7 +5196,7 @@ static VALUE insn_OPT_CALL_C_FUNCTION_operand_types(VALUE self)
|
|
5127
5196
|
VALUE operand_types = rb_ary_new();
|
5128
5197
|
char const * s;
|
5129
5198
|
|
5130
|
-
for(s = insn_op_types(
|
5199
|
+
for(s = insn_op_types(77); *s != '\0'; ++s)
|
5131
5200
|
{
|
5132
5201
|
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
5133
5202
|
}
|
@@ -5168,7 +5237,7 @@ static VALUE insn_OPT_CALL_C_FUNCTION_operand_names(VALUE self)
|
|
5168
5237
|
*/
|
5169
5238
|
static VALUE insn_BITBLT_length(VALUE self)
|
5170
5239
|
{
|
5171
|
-
return LONG2NUM(insn_len(
|
5240
|
+
return LONG2NUM(insn_len(78));
|
5172
5241
|
}
|
5173
5242
|
|
5174
5243
|
/*
|
@@ -5179,7 +5248,7 @@ static VALUE insn_BITBLT_length(VALUE self)
|
|
5179
5248
|
*/
|
5180
5249
|
static VALUE insn_BITBLT_to_i(VALUE self)
|
5181
5250
|
{
|
5182
|
-
return NUM2LONG(
|
5251
|
+
return NUM2LONG(78);
|
5183
5252
|
}
|
5184
5253
|
|
5185
5254
|
/*
|
@@ -5193,7 +5262,7 @@ static VALUE insn_BITBLT_operand_types(VALUE self)
|
|
5193
5262
|
VALUE operand_types = rb_ary_new();
|
5194
5263
|
char const * s;
|
5195
5264
|
|
5196
|
-
for(s = insn_op_types(
|
5265
|
+
for(s = insn_op_types(78); *s != '\0'; ++s)
|
5197
5266
|
{
|
5198
5267
|
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
5199
5268
|
}
|
@@ -5234,7 +5303,7 @@ static VALUE insn_BITBLT_operand_names(VALUE self)
|
|
5234
5303
|
*/
|
5235
5304
|
static VALUE insn_ANSWER_length(VALUE self)
|
5236
5305
|
{
|
5237
|
-
return LONG2NUM(insn_len(
|
5306
|
+
return LONG2NUM(insn_len(79));
|
5238
5307
|
}
|
5239
5308
|
|
5240
5309
|
/*
|
@@ -5245,7 +5314,7 @@ static VALUE insn_ANSWER_length(VALUE self)
|
|
5245
5314
|
*/
|
5246
5315
|
static VALUE insn_ANSWER_to_i(VALUE self)
|
5247
5316
|
{
|
5248
|
-
return NUM2LONG(
|
5317
|
+
return NUM2LONG(79);
|
5249
5318
|
}
|
5250
5319
|
|
5251
5320
|
/*
|
@@ -5259,7 +5328,7 @@ static VALUE insn_ANSWER_operand_types(VALUE self)
|
|
5259
5328
|
VALUE operand_types = rb_ary_new();
|
5260
5329
|
char const * s;
|
5261
5330
|
|
5262
|
-
for(s = insn_op_types(
|
5331
|
+
for(s = insn_op_types(79); *s != '\0'; ++s)
|
5263
5332
|
{
|
5264
5333
|
rb_ary_push(operand_types, ID2SYM(operand_type_name_of(*s)));
|
5265
5334
|
}
|
@@ -5875,7 +5944,15 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5875
5944
|
rb_define_method(rb_cInstruction_OPT_LENGTH, "name", insn_OPT_LENGTH_name, 0);
|
5876
5945
|
}
|
5877
5946
|
{
|
5878
|
-
VALUE
|
5947
|
+
VALUE rb_cInstruction_OPT_SIZE = instruction_class[72] = rb_define_class_under(rb_cInstruction, "OPT_SIZE", rb_cInstruction);
|
5948
|
+
rb_define_method(rb_cInstruction_OPT_SIZE, "length", insn_OPT_SIZE_length, 0);
|
5949
|
+
rb_define_method(rb_cInstruction_OPT_SIZE, "to_i", insn_OPT_SIZE_to_i, 0);
|
5950
|
+
rb_define_method(rb_cInstruction_OPT_SIZE, "operand_types", insn_OPT_SIZE_operand_types, 0);
|
5951
|
+
rb_define_method(rb_cInstruction_OPT_SIZE, "operand_names", insn_OPT_SIZE_operand_names, 0);
|
5952
|
+
rb_define_method(rb_cInstruction_OPT_SIZE, "name", insn_OPT_SIZE_name, 0);
|
5953
|
+
}
|
5954
|
+
{
|
5955
|
+
VALUE rb_cInstruction_OPT_SUCC = instruction_class[73] = rb_define_class_under(rb_cInstruction, "OPT_SUCC", rb_cInstruction);
|
5879
5956
|
rb_define_method(rb_cInstruction_OPT_SUCC, "length", insn_OPT_SUCC_length, 0);
|
5880
5957
|
rb_define_method(rb_cInstruction_OPT_SUCC, "to_i", insn_OPT_SUCC_to_i, 0);
|
5881
5958
|
rb_define_method(rb_cInstruction_OPT_SUCC, "operand_types", insn_OPT_SUCC_operand_types, 0);
|
@@ -5883,7 +5960,7 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5883
5960
|
rb_define_method(rb_cInstruction_OPT_SUCC, "name", insn_OPT_SUCC_name, 0);
|
5884
5961
|
}
|
5885
5962
|
{
|
5886
|
-
VALUE rb_cInstruction_OPT_NOT = instruction_class[
|
5963
|
+
VALUE rb_cInstruction_OPT_NOT = instruction_class[74] = rb_define_class_under(rb_cInstruction, "OPT_NOT", rb_cInstruction);
|
5887
5964
|
rb_define_method(rb_cInstruction_OPT_NOT, "length", insn_OPT_NOT_length, 0);
|
5888
5965
|
rb_define_method(rb_cInstruction_OPT_NOT, "to_i", insn_OPT_NOT_to_i, 0);
|
5889
5966
|
rb_define_method(rb_cInstruction_OPT_NOT, "operand_types", insn_OPT_NOT_operand_types, 0);
|
@@ -5891,7 +5968,7 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5891
5968
|
rb_define_method(rb_cInstruction_OPT_NOT, "name", insn_OPT_NOT_name, 0);
|
5892
5969
|
}
|
5893
5970
|
{
|
5894
|
-
VALUE rb_cInstruction_OPT_REGEXPMATCH1 = instruction_class[
|
5971
|
+
VALUE rb_cInstruction_OPT_REGEXPMATCH1 = instruction_class[75] = rb_define_class_under(rb_cInstruction, "OPT_REGEXPMATCH1", rb_cInstruction);
|
5895
5972
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH1, "length", insn_OPT_REGEXPMATCH1_length, 0);
|
5896
5973
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH1, "to_i", insn_OPT_REGEXPMATCH1_to_i, 0);
|
5897
5974
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH1, "operand_types", insn_OPT_REGEXPMATCH1_operand_types, 0);
|
@@ -5899,7 +5976,7 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5899
5976
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH1, "name", insn_OPT_REGEXPMATCH1_name, 0);
|
5900
5977
|
}
|
5901
5978
|
{
|
5902
|
-
VALUE rb_cInstruction_OPT_REGEXPMATCH2 = instruction_class[
|
5979
|
+
VALUE rb_cInstruction_OPT_REGEXPMATCH2 = instruction_class[76] = rb_define_class_under(rb_cInstruction, "OPT_REGEXPMATCH2", rb_cInstruction);
|
5903
5980
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH2, "length", insn_OPT_REGEXPMATCH2_length, 0);
|
5904
5981
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH2, "to_i", insn_OPT_REGEXPMATCH2_to_i, 0);
|
5905
5982
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH2, "operand_types", insn_OPT_REGEXPMATCH2_operand_types, 0);
|
@@ -5907,7 +5984,7 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5907
5984
|
rb_define_method(rb_cInstruction_OPT_REGEXPMATCH2, "name", insn_OPT_REGEXPMATCH2_name, 0);
|
5908
5985
|
}
|
5909
5986
|
{
|
5910
|
-
VALUE rb_cInstruction_OPT_CALL_C_FUNCTION = instruction_class[
|
5987
|
+
VALUE rb_cInstruction_OPT_CALL_C_FUNCTION = instruction_class[77] = rb_define_class_under(rb_cInstruction, "OPT_CALL_C_FUNCTION", rb_cInstruction);
|
5911
5988
|
rb_define_method(rb_cInstruction_OPT_CALL_C_FUNCTION, "length", insn_OPT_CALL_C_FUNCTION_length, 0);
|
5912
5989
|
rb_define_method(rb_cInstruction_OPT_CALL_C_FUNCTION, "to_i", insn_OPT_CALL_C_FUNCTION_to_i, 0);
|
5913
5990
|
rb_define_method(rb_cInstruction_OPT_CALL_C_FUNCTION, "operand_types", insn_OPT_CALL_C_FUNCTION_operand_types, 0);
|
@@ -5915,7 +5992,7 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5915
5992
|
rb_define_method(rb_cInstruction_OPT_CALL_C_FUNCTION, "name", insn_OPT_CALL_C_FUNCTION_name, 0);
|
5916
5993
|
}
|
5917
5994
|
{
|
5918
|
-
VALUE rb_cInstruction_BITBLT = instruction_class[
|
5995
|
+
VALUE rb_cInstruction_BITBLT = instruction_class[78] = rb_define_class_under(rb_cInstruction, "BITBLT", rb_cInstruction);
|
5919
5996
|
rb_define_method(rb_cInstruction_BITBLT, "length", insn_BITBLT_length, 0);
|
5920
5997
|
rb_define_method(rb_cInstruction_BITBLT, "to_i", insn_BITBLT_to_i, 0);
|
5921
5998
|
rb_define_method(rb_cInstruction_BITBLT, "operand_types", insn_BITBLT_operand_types, 0);
|
@@ -5923,7 +6000,7 @@ void define_instruction_subclasses(VALUE rb_cInstruction)
|
|
5923
6000
|
rb_define_method(rb_cInstruction_BITBLT, "name", insn_BITBLT_name, 0);
|
5924
6001
|
}
|
5925
6002
|
{
|
5926
|
-
VALUE rb_cInstruction_ANSWER = instruction_class[
|
6003
|
+
VALUE rb_cInstruction_ANSWER = instruction_class[79] = rb_define_class_under(rb_cInstruction, "ANSWER", rb_cInstruction);
|
5927
6004
|
rb_define_method(rb_cInstruction_ANSWER, "length", insn_ANSWER_length, 0);
|
5928
6005
|
rb_define_method(rb_cInstruction_ANSWER, "to_i", insn_ANSWER_to_i, 0);
|
5929
6006
|
rb_define_method(rb_cInstruction_ANSWER, "operand_types", insn_ANSWER_operand_types, 0);
|