rubinius-compiler 2.3.1 → 3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubinius/code/compiler.rb +10 -0
  3. data/lib/rubinius/{compiler → code/compiler}/compiled_file.rb +0 -0
  4. data/lib/rubinius/{compiler → code/compiler}/compiler.rb +0 -0
  5. data/lib/rubinius/{compiler → code/compiler}/evaluator.rb +0 -0
  6. data/lib/rubinius/{compiler → code/compiler}/generator.rb +0 -0
  7. data/lib/rubinius/{compiler → code/compiler}/generator_methods.rb +0 -0
  8. data/lib/rubinius/{compiler → code/compiler}/iseq.rb +0 -0
  9. data/lib/rubinius/{compiler → code/compiler}/locals.rb +0 -0
  10. data/lib/rubinius/{compiler → code/compiler}/opcodes.rb +0 -0
  11. data/lib/rubinius/{compiler → code/compiler}/printers.rb +0 -0
  12. data/lib/rubinius/{compiler → code/compiler}/stages.rb +0 -0
  13. data/lib/rubinius/{compiler → code/compiler}/version.rb +1 -1
  14. metadata +23 -271
  15. data/.gitignore +0 -17
  16. data/.travis.yml +0 -8
  17. data/Gemfile +0 -4
  18. data/LICENSE +0 -25
  19. data/README.md +0 -29
  20. data/Rakefile +0 -1
  21. data/lib/rubinius/compiler.rb +0 -10
  22. data/rubinius-compiler.gemspec +0 -28
  23. data/spec/alias_spec.rb +0 -39
  24. data/spec/and_spec.rb +0 -44
  25. data/spec/array_spec.rb +0 -110
  26. data/spec/attrasgn_spec.rb +0 -186
  27. data/spec/back_ref_spec.rb +0 -11
  28. data/spec/call_spec.rb +0 -580
  29. data/spec/case_spec.rb +0 -576
  30. data/spec/cdecl_spec.rb +0 -70
  31. data/spec/class_spec.rb +0 -120
  32. data/spec/colon2_spec.rb +0 -8
  33. data/spec/colon3_spec.rb +0 -8
  34. data/spec/const_spec.rb +0 -7
  35. data/spec/custom/guards/profiler.rb +0 -18
  36. data/spec/custom/helpers/generator.rb +0 -828
  37. data/spec/custom/matchers/compile_as.rb +0 -46
  38. data/spec/custom/mspec.rb +0 -15
  39. data/spec/custom/runner/actions/debug.rb +0 -10
  40. data/spec/custom/runner/actions/gcstats.rb +0 -17
  41. data/spec/custom/runner/actions/memory.rb +0 -11
  42. data/spec/custom/runner/actions/parser.rb +0 -14
  43. data/spec/custom/runner/actions/profiler.rb +0 -19
  44. data/spec/custom/runner/relates.rb +0 -86
  45. data/spec/custom/utils/options.rb +0 -40
  46. data/spec/custom/utils/script.rb +0 -50
  47. data/spec/cvar_spec.rb +0 -39
  48. data/spec/cvasgn_spec.rb +0 -33
  49. data/spec/cvdecl_spec.rb +0 -17
  50. data/spec/defined_spec.rb +0 -616
  51. data/spec/defn_spec.rb +0 -732
  52. data/spec/defs_spec.rb +0 -113
  53. data/spec/dot2_spec.rb +0 -16
  54. data/spec/dot3_spec.rb +0 -17
  55. data/spec/dregx_spec.rb +0 -160
  56. data/spec/dstr_spec.rb +0 -424
  57. data/spec/dsym_spec.rb +0 -18
  58. data/spec/dxstr_spec.rb +0 -24
  59. data/spec/ensure_spec.rb +0 -196
  60. data/spec/false_spec.rb +0 -7
  61. data/spec/flip2_spec.rb +0 -21
  62. data/spec/flip3_spec.rb +0 -12
  63. data/spec/for_spec.rb +0 -228
  64. data/spec/gasgn_spec.rb +0 -15
  65. data/spec/generator/encode_spec.rb +0 -34
  66. data/spec/gvar_spec.rb +0 -37
  67. data/spec/hash_spec.rb +0 -108
  68. data/spec/iasgn_spec.rb +0 -26
  69. data/spec/if_spec.rb +0 -415
  70. data/spec/iter_spec.rb +0 -1011
  71. data/spec/lasgn_spec.rb +0 -561
  72. data/spec/lit_spec.rb +0 -61
  73. data/spec/masgn_spec.rb +0 -1558
  74. data/spec/match2_spec.rb +0 -42
  75. data/spec/match3_spec.rb +0 -54
  76. data/spec/match_spec.rb +0 -29
  77. data/spec/module_spec.rb +0 -73
  78. data/spec/nil_spec.rb +0 -7
  79. data/spec/not_spec.rb +0 -47
  80. data/spec/nth_ref_spec.rb +0 -7
  81. data/spec/op_asgn_spec.rb +0 -563
  82. data/spec/or_spec.rb +0 -126
  83. data/spec/postexe_spec.rb +0 -11
  84. data/spec/preexe_spec.rb +0 -21
  85. data/spec/regex_spec.rb +0 -54
  86. data/spec/rescue_spec.rb +0 -763
  87. data/spec/return_spec.rb +0 -152
  88. data/spec/sclass_spec.rb +0 -138
  89. data/spec/spec_helper.rb +0 -12
  90. data/spec/str_spec.rb +0 -118
  91. data/spec/super_spec.rb +0 -170
  92. data/spec/transforms/assembly_spec.rb +0 -195
  93. data/spec/transforms/block_given_spec.rb +0 -75
  94. data/spec/transforms/fast_coerce_spec.rb +0 -112
  95. data/spec/transforms/fast_new_spec.rb +0 -255
  96. data/spec/transforms/invoke_primitive_spec.rb +0 -14
  97. data/spec/transforms/kernel_methods_spec.rb +0 -29
  98. data/spec/transforms/primitive_spec.rb +0 -33
  99. data/spec/transforms/privately_spec.rb +0 -24
  100. data/spec/true_spec.rb +0 -7
  101. data/spec/undef_spec.rb +0 -133
  102. data/spec/until_spec.rb +0 -254
  103. data/spec/valias_spec.rb +0 -11
  104. data/spec/while_spec.rb +0 -494
  105. data/spec/xstr_spec.rb +0 -10
  106. data/spec/yield_spec.rb +0 -92
  107. data/spec/zsuper_spec.rb +0 -63
@@ -1,14 +0,0 @@
1
- describe "A Call node using InvokePrimitive transform" do
2
- relates <<-ruby do
3
- Rubinius.invoke_primitive :name, 1, 2, a
4
- ruby
5
-
6
- compile :invoke_primitive do |g|
7
- g.push 1
8
- g.push 2
9
- g.push :self
10
- g.send :a, 0, true
11
- g.invoke_primitive :name, 3
12
- end
13
- end
14
- end
@@ -1,29 +0,0 @@
1
- describe "A Call node using kernel_methods transform" do
2
- relates "4 / 2" do
3
- compile do |g|
4
- g.push 4
5
- g.push 2
6
- g.send :/, 1, false
7
- end
8
-
9
- compile :kernel_methods do |g|
10
- g.push 4
11
- g.push 2
12
- g.send :divide, 1, false
13
- end
14
- end
15
-
16
- relates "a.class" do
17
- compile do |g|
18
- g.push :self
19
- g.send :a, 0, true
20
- g.send :class, 0, false
21
- end
22
-
23
- compile :kernel_methods do |g|
24
- g.push :self
25
- g.send :a, 0, true
26
- g.send :__class__, 0, false
27
- end
28
- end
29
- end
@@ -1,33 +0,0 @@
1
- describe "A Call node using PrimitiveDeclaration transform" do
2
- relates <<-ruby do
3
- def m
4
- Rubinius.primitive :prim
5
- raise PrimitiveFailure, "failed"
6
- end
7
- ruby
8
-
9
- compile do |g|
10
- in_method :m do |d|
11
- d.push_const :Rubinius
12
- d.push_literal :prim
13
- d.send :primitive, 1, false
14
- d.pop
15
- d.push :self
16
- d.push_const :PrimitiveFailure
17
- d.push_literal "failed"
18
- d.string_dup
19
- d.send :raise, 2, true
20
- end
21
- end
22
-
23
- compile :primitive do |g|
24
- in_method :m do |d|
25
- d.push :self
26
- d.push_const :PrimitiveFailure
27
- d.push_literal "failed"
28
- d.string_dup
29
- d.send :raise, 2, true
30
- end
31
- end
32
- end
33
- end
@@ -1,24 +0,0 @@
1
- describe "A Call node using SendPrivately transform" do
2
- relates <<-ruby do
3
- def m
4
- c = 1
5
- Rubinius.privately {
6
- a.b c
7
- }
8
- end
9
- ruby
10
-
11
- compile :privately do |g|
12
- in_method :m do |d|
13
- d.push 1
14
- d.set_local 0
15
- d.pop
16
-
17
- d.push :self
18
- d.send :a, 0, true
19
- d.push_local 0
20
- d.send :b, 1, true
21
- end
22
- end
23
- end
24
- end
data/spec/true_spec.rb DELETED
@@ -1,7 +0,0 @@
1
- describe "A True node" do
2
- relates "true" do
3
- compile do |g|
4
- g.push :true
5
- end
6
- end
7
- end
data/spec/undef_spec.rb DELETED
@@ -1,133 +0,0 @@
1
- describe "An Undef node" do
2
- relates "undef :x" do
3
- compile do |g|
4
- undef_bytecode :x
5
- end
6
- end
7
-
8
- relates "undef :x, :y" do
9
- compile do |g|
10
- undef_bytecode :x, :y
11
- end
12
- end
13
-
14
- relates "undef :x, :y, :z" do
15
- compile do |g|
16
- undef_bytecode :x, :y, :z
17
- end
18
- end
19
-
20
- relates <<-ruby do
21
- f1
22
- undef :x
23
- ruby
24
-
25
- compile do |g|
26
- g.push :self
27
- g.send :f1, 0, true
28
- g.pop
29
-
30
- undef_bytecode :x
31
- end
32
- end
33
-
34
- relates <<-ruby do
35
- f1
36
- undef :x, :y
37
- ruby
38
-
39
- compile do |g|
40
- g.push :self
41
- g.send :f1, 0, true
42
- g.pop
43
-
44
- undef_bytecode :x, :y
45
- end
46
- end
47
-
48
- relates <<-ruby do
49
- undef :x, :y, :z
50
- f2
51
- ruby
52
-
53
- compile do |g|
54
- undef_bytecode :x, :y, :z
55
- g.pop
56
-
57
- g.push :self
58
- g.send :f2, 0, true
59
- end
60
- end
61
-
62
- relates <<-ruby do
63
- f1
64
- undef :x, :y, :z
65
- ruby
66
-
67
- compile do |g|
68
- g.push :self
69
- g.send :f1, 0, true
70
- g.pop
71
-
72
- undef_bytecode :x, :y, :z
73
- end
74
- end
75
-
76
- relates <<-ruby do
77
- f1
78
- undef :x, :y, :z
79
- f2
80
- ruby
81
-
82
- compile do |g|
83
- g.push :self
84
- g.send :f1, 0, true
85
- g.pop
86
-
87
- undef_bytecode :x, :y, :z
88
- g.pop
89
-
90
- g.push :self
91
- g.send :f2, 0, true
92
- end
93
- end
94
-
95
- relates "class B; undef :blah; end" do
96
- compile do |g|
97
- g.in_class :B do |d|
98
- d.push_scope
99
- d.push_literal :blah
100
- d.send :__undef_method__, 1
101
- end
102
- end
103
- end
104
-
105
- relates <<-ruby do
106
- undef :"x\#{1}", :"x\#{2}"
107
- ruby
108
-
109
- compile do |g|
110
- g.push_scope
111
- g.push_literal "x"
112
-
113
- g.push 1
114
- g.meta_to_s
115
-
116
- g.string_build 2
117
-
118
- g.send :to_sym, 0, true
119
- g.send :__undef_method__, 1
120
- g.pop
121
-
122
- g.push_scope
123
-
124
- g.push_literal "x"
125
- g.push 2
126
- g.meta_to_s
127
- g.string_build 2
128
-
129
- g.send :to_sym, 0, true
130
- g.send :__undef_method__, 1
131
- end
132
- end
133
- end
data/spec/until_spec.rb DELETED
@@ -1,254 +0,0 @@
1
- describe "An Until node" do
2
- pre_until = lambda do |g|
3
- top = g.new_label
4
- rdo = g.new_label
5
- brk = g.new_label
6
- post = g.new_label
7
- bottom = g.new_label
8
-
9
- g.push_modifiers
10
-
11
- top.set!
12
- g.push :self
13
- g.send :a, 0, true
14
- g.git bottom
15
-
16
- rdo.set!
17
- g.push :self
18
- g.send :b, 0, true
19
- g.push 1
20
- g.send :+, 1, false
21
-
22
- post.set!
23
- g.pop
24
- g.check_interrupts
25
- g.goto top
26
-
27
- bottom.set!
28
- g.push :nil
29
-
30
- brk.set!
31
- g.pop_modifiers
32
- end
33
-
34
- post_until = lambda do |g|
35
- top = g.new_label
36
- brk = g.new_label
37
- post = g.new_label
38
- bottom = g.new_label
39
-
40
- g.push_modifiers
41
-
42
- top.set!
43
-
44
- g.push :self
45
- g.send :b, 0, true
46
- g.push 1
47
- g.send :+, 1, false
48
-
49
- post.set!
50
- g.pop
51
- g.check_interrupts
52
-
53
- g.push :self
54
- g.send :a, 0, true
55
- g.git bottom
56
-
57
- g.goto top
58
-
59
- bottom.set!
60
- g.push :nil
61
-
62
- brk.set!
63
-
64
- g.pop_modifiers
65
- end
66
-
67
- ruby_version_is ""..."1.9" do
68
- nil_condition = lambda do |g|
69
- top = g.new_label
70
- rdo = g.new_label
71
- brk = g.new_label
72
- post = g.new_label
73
- bottom = g.new_label
74
-
75
- g.push_modifiers
76
- top.set!
77
-
78
- g.push :nil
79
- g.git bottom
80
-
81
- rdo.set!
82
- g.push :self
83
- g.send :a, 0, true
84
-
85
- post.set!
86
- g.pop
87
- g.check_interrupts
88
- g.goto top
89
-
90
- bottom.set!
91
- g.push :nil
92
-
93
- brk.set!
94
- g.pop_modifiers
95
- end
96
-
97
- relates <<-ruby do
98
- while not a
99
- b + 1
100
- end
101
- ruby
102
-
103
- compile(&pre_until)
104
- end
105
-
106
- relates "b + 1 while not a" do
107
- compile(&pre_until)
108
- end
109
-
110
- relates <<-ruby do
111
- begin
112
- b + 1
113
- end while not a
114
- ruby
115
-
116
- compile(&post_until)
117
- end
118
-
119
- relates "a while not ()" do
120
- compile(&nil_condition)
121
- end
122
-
123
- relates <<-ruby do
124
- while not ()
125
- a
126
- end
127
- ruby
128
-
129
- compile(&nil_condition)
130
- end
131
-
132
- relates "a while ! ()" do
133
- compile(&nil_condition)
134
- end
135
-
136
- relates <<-ruby do
137
- while ! ()
138
- a
139
- end
140
- ruby
141
-
142
- compile(&nil_condition)
143
- end
144
- end
145
-
146
- ruby_version_is "1.9" do
147
- nil_condition = lambda do |g|
148
- top = g.new_label
149
- rdo = g.new_label
150
- brk = g.new_label
151
- post = g.new_label
152
- bottom = g.new_label
153
-
154
- g.push_modifiers
155
- top.set!
156
-
157
- g.push :nil
158
- g.git bottom
159
-
160
- rdo.set!
161
- g.push :self
162
- g.send :a, 0, true
163
-
164
- post.set!
165
- g.pop
166
- g.check_interrupts
167
- g.goto top
168
-
169
- bottom.set!
170
- g.push :nil
171
-
172
- brk.set!
173
- g.pop_modifiers
174
- end
175
-
176
- relates "a until ()" do
177
- compile(&nil_condition)
178
- end
179
-
180
- relates <<-ruby do
181
- until ()
182
- a
183
- end
184
- ruby
185
-
186
- compile(&nil_condition)
187
- end
188
-
189
- not_nil_condition = lambda do |g|
190
- top = g.new_label
191
- rdo = g.new_label
192
- brk = g.new_label
193
- post = g.new_label
194
- bottom = g.new_label
195
-
196
- g.push_modifiers
197
- top.set!
198
-
199
- g.push :nil
200
- g.send :"!", 0, false
201
- g.git bottom
202
-
203
- rdo.set!
204
- g.push :self
205
- g.send :a, 0, true
206
-
207
- post.set!
208
- g.pop
209
- g.check_interrupts
210
- g.goto top
211
-
212
- bottom.set!
213
- g.push :nil
214
-
215
- brk.set!
216
- g.pop_modifiers
217
- end
218
-
219
- relates "a until ! ()" do
220
- compile(&not_nil_condition)
221
- end
222
-
223
- relates <<-ruby do
224
- until ! ()
225
- a
226
- end
227
- ruby
228
-
229
- compile(&not_nil_condition)
230
- end
231
- end
232
-
233
- relates <<-ruby do
234
- until a
235
- b + 1
236
- end
237
- ruby
238
-
239
- compile(&pre_until)
240
- end
241
-
242
- relates "b + 1 until a" do
243
- compile(&pre_until)
244
- end
245
-
246
- relates <<-ruby do
247
- begin
248
- b + 1
249
- end until a
250
- ruby
251
-
252
- compile(&post_until)
253
- end
254
- end