ruby-internal 0.6.0 → 0.7.0

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.
Files changed (90) hide show
  1. data/README +204 -6
  2. data/ext/cached/ruby-1.6.8/internal/binding/block.h +35 -0
  3. data/ext/cached/ruby-1.6.8/internal/method/method.h +19 -0
  4. data/ext/cached/ruby-1.6.8/internal/module/classpath.c +3 -0
  5. data/ext/cached/ruby-1.6.8/internal/module/classpath.h +8 -0
  6. data/ext/cached/ruby-1.6.8/internal/node/block.h +35 -0
  7. data/ext/cached/ruby-1.6.8/internal/node/global_entry.h +15 -0
  8. data/ext/cached/ruby-1.6.8/internal/node/node_type_descrip.c +149 -0
  9. data/ext/cached/ruby-1.6.8/internal/node/nodeinfo.c +5582 -0
  10. data/ext/cached/ruby-1.6.8/internal/node/nodeinfo.h +69 -0
  11. data/ext/cached/ruby-1.6.8/internal/proc/block.h +35 -0
  12. data/ext/cached/ruby-1.6.8/internal/tag/tag.h +15 -0
  13. data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.c +39 -0
  14. data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.h +21 -0
  15. data/ext/cached/ruby-1.6.8/internal/vm/iseq/insns_info.inc +12 -0
  16. data/ext/cached/ruby-1.6.8/internal/vm/iseq/iseq_load.inc +9 -0
  17. data/ext/cached/ruby-1.8.0/internal/node/node_type_descrip.c +91 -91
  18. data/ext/cached/ruby-1.8.0/internal/node/nodeinfo.c +1909 -1909
  19. data/ext/cached/ruby-1.8.0/internal/vm/iseq/iseq_load.inc +9 -0
  20. data/ext/cached/ruby-1.8.1/internal/node/node_type_descrip.c +90 -90
  21. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.c +1946 -1946
  22. data/ext/cached/ruby-1.8.1/internal/vm/iseq/iseq_load.inc +9 -0
  23. data/ext/cached/ruby-1.8.2/internal/node/node_type_descrip.c +90 -90
  24. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.c +1946 -1946
  25. data/ext/cached/ruby-1.8.2/internal/vm/iseq/iseq_load.inc +9 -0
  26. data/ext/cached/ruby-1.8.3/internal/node/node_type_descrip.c +90 -90
  27. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.c +1946 -1946
  28. data/ext/cached/ruby-1.8.3/internal/vm/iseq/iseq_load.inc +9 -0
  29. data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +90 -90
  30. data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +1946 -1946
  31. data/ext/cached/ruby-1.8.4/internal/vm/iseq/iseq_load.inc +9 -0
  32. data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +90 -90
  33. data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +1909 -1909
  34. data/ext/cached/ruby-1.8.5/internal/vm/iseq/iseq_load.inc +9 -0
  35. data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +90 -90
  36. data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +1909 -1909
  37. data/ext/cached/ruby-1.8.6/internal/vm/iseq/iseq_load.inc +9 -0
  38. data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +90 -90
  39. data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +1909 -1909
  40. data/ext/cached/ruby-1.8.7/internal/vm/iseq/iseq_load.inc +9 -0
  41. data/ext/cached/ruby-1.9.0/internal/node/node_type_descrip.c +85 -85
  42. data/ext/cached/ruby-1.9.0/internal/node/nodeinfo.c +1800 -1800
  43. data/ext/cached/ruby-1.9.0/internal/vm/iseq/iseq_load.inc +13 -0
  44. data/ext/cached/ruby-1.9.0/internal/yarv-headers/transdb.h +51 -51
  45. data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +85 -85
  46. data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +1800 -1800
  47. data/ext/cached/ruby-1.9.1/internal/vm/instruction/insns_info.h +1 -2
  48. data/ext/cached/ruby-1.9.1/internal/vm/iseq/iseq_load.inc +356 -0
  49. data/ext/cached/ruby-1.9.1/internal/yarv-headers/eval_intern.h +15 -9
  50. data/ext/cached/ruby-1.9.1/internal/yarv-headers/id.h +45 -66
  51. data/ext/cached/ruby-1.9.1/internal/yarv-headers/iseq.h +12 -3
  52. data/ext/cached/ruby-1.9.1/internal/yarv-headers/node.h +2 -2
  53. data/ext/cached/ruby-1.9.1/internal/yarv-headers/parse.h +23 -138
  54. data/ext/cached/ruby-1.9.1/internal/yarv-headers/revision.h +1 -1
  55. data/ext/cached/ruby-1.9.1/internal/yarv-headers/transcode_data.h +9 -2
  56. data/ext/cached/ruby-1.9.1/internal/yarv-headers/transdb.h +62 -0
  57. data/ext/cached/ruby-1.9.1/internal/yarv-headers/version.h +17 -23
  58. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_core.h +20 -29
  59. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_exec.h +4 -7
  60. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_insnhelper.h +6 -5
  61. data/ext/internal/module/cfp.h +13 -0
  62. data/ext/internal/module/extconf.rb +2 -2
  63. data/ext/internal/module/module.c +3 -8
  64. data/ext/internal/node/nodes.rb +2 -1
  65. data/ext/internal/vm/iseq/iseq.c +2 -3
  66. data/ext/internal/vm/iseq/iseq_load.inc.rpp +61 -0
  67. data/ext/internal/yarv-headers/debug.h +36 -0
  68. data/ext/internal/yarv-headers/dln.h +41 -0
  69. data/ext/internal/yarv-headers/encdb.h +147 -0
  70. data/ext/internal/yarv-headers/eval_intern.h +215 -0
  71. data/ext/internal/yarv-headers/gc.h +75 -0
  72. data/ext/internal/yarv-headers/id.h +163 -0
  73. data/ext/internal/yarv-headers/iseq.h +103 -0
  74. data/ext/internal/yarv-headers/node.h +516 -0
  75. data/ext/internal/yarv-headers/parse.h +188 -0
  76. data/ext/internal/yarv-headers/regenc.h +207 -0
  77. data/ext/internal/yarv-headers/regint.h +842 -0
  78. data/ext/internal/yarv-headers/regparse.h +351 -0
  79. data/ext/internal/yarv-headers/revision.h +1 -0
  80. data/ext/internal/yarv-headers/thread_pthread.h +24 -0
  81. data/ext/internal/yarv-headers/thread_win32.h +33 -0
  82. data/ext/internal/yarv-headers/transcode_data.h +106 -0
  83. data/ext/internal/yarv-headers/transdb.h +147 -0
  84. data/ext/internal/yarv-headers/version.h +54 -0
  85. data/ext/internal/yarv-headers/vm_core.h +646 -0
  86. data/ext/internal/yarv-headers/vm_exec.h +184 -0
  87. data/ext/internal/yarv-headers/vm_insnhelper.h +195 -0
  88. data/ext/internal/yarv-headers/vm_opts.h +51 -0
  89. data/publish_rdoc.rb +4 -0
  90. metadata +52 -2
@@ -0,0 +1,163 @@
1
+ /* DO NOT EDIT THIS FILE DIRECTLY */
2
+ /**********************************************************************
3
+
4
+ id.h -
5
+
6
+ $Author: nobu $
7
+ created at: Sun Oct 19 21:12:51 2008
8
+
9
+ Copyright (C) 2007 Koichi Sasada
10
+
11
+ **********************************************************************/
12
+
13
+ #ifndef RUBY_ID_H
14
+ #define RUBY_ID_H
15
+
16
+ #define ID_SCOPE_SHIFT 3
17
+ #define ID_SCOPE_MASK 0x07
18
+ #define ID_LOCAL 0x00
19
+ #define ID_INSTANCE 0x01
20
+ #define ID_GLOBAL 0x03
21
+ #define ID_ATTRSET 0x04
22
+ #define ID_CONST 0x05
23
+ #define ID_CLASS 0x06
24
+ #define ID_JUNK 0x07
25
+ #define ID_INTERNAL ID_JUNK
26
+
27
+ #ifdef USE_PARSE_H
28
+ #include "parse.h"
29
+ #endif
30
+
31
+ #define symIFUNC ID2SYM(idIFUNC)
32
+ #define symCFUNC ID2SYM(idCFUNC)
33
+
34
+ #if !defined tLAST_TOKEN && defined YYTOKENTYPE
35
+ #define tLAST_TOKEN tLAST_TOKEN
36
+ #endif
37
+
38
+ enum ruby_method_ids {
39
+ #ifndef tLAST_TOKEN
40
+ tUPLUS = 321,
41
+ tUMINUS = 322,
42
+ tPOW = 323,
43
+ tCMP = 324,
44
+ tEQ = 325,
45
+ tEQQ = 326,
46
+ tNEQ = 327,
47
+ tGEQ = 328,
48
+ tLEQ = 329,
49
+ tANDOP = 330,
50
+ tOROP = 331,
51
+ tMATCH = 332,
52
+ tNMATCH = 333,
53
+ tDOT2 = 334,
54
+ tDOT3 = 335,
55
+ tAREF = 336,
56
+ tASET = 337,
57
+ tLSHFT = 338,
58
+ tRSHFT = 339,
59
+ tLAMBDA = 352,
60
+ idNULL = 365,
61
+ idRespond_to = 366,
62
+ idIFUNC = 367,
63
+ idCFUNC = 368,
64
+ idThrowState = 369,
65
+ id_core_set_method_alias = 370,
66
+ id_core_set_variable_alias = 371,
67
+ id_core_undef_method = 372,
68
+ id_core_define_method = 373,
69
+ id_core_define_singleton_method = 374,
70
+ id_core_set_postexe = 375,
71
+ tLAST_TOKEN = 376,
72
+ #endif
73
+ idPLUS = '+',
74
+ idMINUS = '-',
75
+ idMULT = '*',
76
+ idDIV = '/',
77
+ idMOD = '%',
78
+ idLT = '<',
79
+ idLTLT = tLSHFT,
80
+ idLE = tLEQ,
81
+ idGT = '>',
82
+ idGE = tGEQ,
83
+ idEq = tEQ,
84
+ idEqq = tEQQ,
85
+ idNeq = tNEQ,
86
+ idNot = '!',
87
+ idBackquote = '`',
88
+ idEqTilde = tMATCH,
89
+ idAREF = tAREF,
90
+ idASET = tASET,
91
+ idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
92
+ tIntern,
93
+ tMethodMissing,
94
+ tLength,
95
+ tGets,
96
+ tSucc,
97
+ tEach,
98
+ tLambda,
99
+ tSend,
100
+ t__send__,
101
+ tInitialize,
102
+ #if SUPPORT_JOKE
103
+ tBitblt,
104
+ tAnswer,
105
+ #endif
106
+ tLAST_ID,
107
+ #define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
108
+ #if SUPPORT_JOKE
109
+ TOKEN2ID(Bitblt),
110
+ TOKEN2ID(Answer),
111
+ #endif
112
+ TOKEN2ID(Intern),
113
+ TOKEN2ID(MethodMissing),
114
+ TOKEN2ID(Length),
115
+ TOKEN2ID(Gets),
116
+ TOKEN2ID(Succ),
117
+ TOKEN2ID(Each),
118
+ TOKEN2ID(Lambda),
119
+ TOKEN2ID(Send),
120
+ TOKEN2ID(__send__),
121
+ TOKEN2ID(Initialize)
122
+ };
123
+
124
+ #ifdef tLAST_TOKEN
125
+ struct ruby_method_ids_check {
126
+ #define ruby_method_id_check_for(name, value) \
127
+ int checking_for_##name[name == value ? 1 : -1]
128
+ ruby_method_id_check_for(tUPLUS, 321);
129
+ ruby_method_id_check_for(tUMINUS, 322);
130
+ ruby_method_id_check_for(tPOW, 323);
131
+ ruby_method_id_check_for(tCMP, 324);
132
+ ruby_method_id_check_for(tEQ, 325);
133
+ ruby_method_id_check_for(tEQQ, 326);
134
+ ruby_method_id_check_for(tNEQ, 327);
135
+ ruby_method_id_check_for(tGEQ, 328);
136
+ ruby_method_id_check_for(tLEQ, 329);
137
+ ruby_method_id_check_for(tANDOP, 330);
138
+ ruby_method_id_check_for(tOROP, 331);
139
+ ruby_method_id_check_for(tMATCH, 332);
140
+ ruby_method_id_check_for(tNMATCH, 333);
141
+ ruby_method_id_check_for(tDOT2, 334);
142
+ ruby_method_id_check_for(tDOT3, 335);
143
+ ruby_method_id_check_for(tAREF, 336);
144
+ ruby_method_id_check_for(tASET, 337);
145
+ ruby_method_id_check_for(tLSHFT, 338);
146
+ ruby_method_id_check_for(tRSHFT, 339);
147
+ ruby_method_id_check_for(tLAMBDA, 352);
148
+ ruby_method_id_check_for(idNULL, 365);
149
+ ruby_method_id_check_for(idRespond_to, 366);
150
+ ruby_method_id_check_for(idIFUNC, 367);
151
+ ruby_method_id_check_for(idCFUNC, 368);
152
+ ruby_method_id_check_for(idThrowState, 369);
153
+ ruby_method_id_check_for(id_core_set_method_alias, 370);
154
+ ruby_method_id_check_for(id_core_set_variable_alias, 371);
155
+ ruby_method_id_check_for(id_core_undef_method, 372);
156
+ ruby_method_id_check_for(id_core_define_method, 373);
157
+ ruby_method_id_check_for(id_core_define_singleton_method, 374);
158
+ ruby_method_id_check_for(id_core_set_postexe, 375);
159
+ ruby_method_id_check_for(tLAST_TOKEN, 376);
160
+ };
161
+ #endif
162
+
163
+ #endif /* RUBY_ID_H */
@@ -0,0 +1,103 @@
1
+ /**********************************************************************
2
+
3
+ iseq.h -
4
+
5
+ $Author: yugui $
6
+ created at: 04/01/01 23:36:57 JST
7
+
8
+ Copyright (C) 2004-2008 Koichi Sasada
9
+
10
+ **********************************************************************/
11
+
12
+ #ifndef RUBY_COMPILE_H
13
+ #define RUBY_COMPILE_H
14
+
15
+ /* compile.c */
16
+ VALUE rb_iseq_compile_node(VALUE self, NODE *node);
17
+ int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
18
+ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
19
+ VALUE exception, VALUE body);
20
+
21
+ /* iseq.c */
22
+ VALUE ruby_iseq_load(VALUE data, VALUE parent, VALUE opt);
23
+ struct st_table *ruby_insn_make_insn_table(void);
24
+
25
+ #define ISEQ_TYPE_TOP INT2FIX(1)
26
+ #define ISEQ_TYPE_METHOD INT2FIX(2)
27
+ #define ISEQ_TYPE_BLOCK INT2FIX(3)
28
+ #define ISEQ_TYPE_CLASS INT2FIX(4)
29
+ #define ISEQ_TYPE_RESCUE INT2FIX(5)
30
+ #define ISEQ_TYPE_ENSURE INT2FIX(6)
31
+ #define ISEQ_TYPE_EVAL INT2FIX(7)
32
+ #define ISEQ_TYPE_MAIN INT2FIX(8)
33
+ #define ISEQ_TYPE_DEFINED_GUARD INT2FIX(9)
34
+
35
+ #define CATCH_TYPE_RESCUE INT2FIX(1)
36
+ #define CATCH_TYPE_ENSURE INT2FIX(2)
37
+ #define CATCH_TYPE_RETRY INT2FIX(3)
38
+ #define CATCH_TYPE_BREAK INT2FIX(4)
39
+ #define CATCH_TYPE_REDO INT2FIX(5)
40
+ #define CATCH_TYPE_NEXT INT2FIX(6)
41
+
42
+ struct iseq_insn_info_entry {
43
+ unsigned short position;
44
+ unsigned short line_no;
45
+ unsigned short sp;
46
+ };
47
+
48
+ struct iseq_catch_table_entry {
49
+ VALUE type;
50
+ VALUE iseq;
51
+ unsigned long start;
52
+ unsigned long end;
53
+ unsigned long cont;
54
+ unsigned long sp;
55
+ };
56
+
57
+ #define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
58
+
59
+ struct iseq_compile_data_storage {
60
+ struct iseq_compile_data_storage *next;
61
+ unsigned long pos;
62
+ unsigned long size;
63
+ char *buff;
64
+ };
65
+
66
+ struct iseq_compile_data {
67
+ /* GC is needed */
68
+ VALUE err_info;
69
+ VALUE mark_ary;
70
+ VALUE catch_table_ary; /* Array */
71
+
72
+ /* GC is not needed */
73
+ struct iseq_label_data *start_label;
74
+ struct iseq_label_data *end_label;
75
+ struct iseq_label_data *redo_label;
76
+ VALUE current_block;
77
+ VALUE loopval_popped; /* used by NODE_BREAK */
78
+ VALUE ensure_node;
79
+ VALUE for_iseq;
80
+ struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
81
+ int cached_const;
82
+ struct iseq_compile_data_storage *storage_head;
83
+ struct iseq_compile_data_storage *storage_current;
84
+ int last_line;
85
+ int flip_cnt;
86
+ int label_no;
87
+ int node_level;
88
+ const rb_compile_option_t *option;
89
+ };
90
+
91
+ /* defined? */
92
+ #define DEFINED_IVAR INT2FIX(1)
93
+ #define DEFINED_IVAR2 INT2FIX(2)
94
+ #define DEFINED_GVAR INT2FIX(3)
95
+ #define DEFINED_CVAR INT2FIX(4)
96
+ #define DEFINED_CONST INT2FIX(5)
97
+ #define DEFINED_METHOD INT2FIX(6)
98
+ #define DEFINED_YIELD INT2FIX(7)
99
+ #define DEFINED_REF INT2FIX(8)
100
+ #define DEFINED_ZSUPER INT2FIX(9)
101
+ #define DEFINED_FUNC INT2FIX(10)
102
+
103
+ #endif /* RUBY_COMPILE_H */