rubinius-compiler 2.3.1 → 3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubinius/code/compiler.rb +10 -0
- data/lib/rubinius/{compiler → code/compiler}/compiled_file.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/compiler.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/evaluator.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/generator.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/generator_methods.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/iseq.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/locals.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/opcodes.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/printers.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/stages.rb +0 -0
- data/lib/rubinius/{compiler → code/compiler}/version.rb +1 -1
- metadata +23 -271
- data/.gitignore +0 -17
- data/.travis.yml +0 -8
- data/Gemfile +0 -4
- data/LICENSE +0 -25
- data/README.md +0 -29
- data/Rakefile +0 -1
- data/lib/rubinius/compiler.rb +0 -10
- data/rubinius-compiler.gemspec +0 -28
- data/spec/alias_spec.rb +0 -39
- data/spec/and_spec.rb +0 -44
- data/spec/array_spec.rb +0 -110
- data/spec/attrasgn_spec.rb +0 -186
- data/spec/back_ref_spec.rb +0 -11
- data/spec/call_spec.rb +0 -580
- data/spec/case_spec.rb +0 -576
- data/spec/cdecl_spec.rb +0 -70
- data/spec/class_spec.rb +0 -120
- data/spec/colon2_spec.rb +0 -8
- data/spec/colon3_spec.rb +0 -8
- data/spec/const_spec.rb +0 -7
- data/spec/custom/guards/profiler.rb +0 -18
- data/spec/custom/helpers/generator.rb +0 -828
- data/spec/custom/matchers/compile_as.rb +0 -46
- data/spec/custom/mspec.rb +0 -15
- data/spec/custom/runner/actions/debug.rb +0 -10
- data/spec/custom/runner/actions/gcstats.rb +0 -17
- data/spec/custom/runner/actions/memory.rb +0 -11
- data/spec/custom/runner/actions/parser.rb +0 -14
- data/spec/custom/runner/actions/profiler.rb +0 -19
- data/spec/custom/runner/relates.rb +0 -86
- data/spec/custom/utils/options.rb +0 -40
- data/spec/custom/utils/script.rb +0 -50
- data/spec/cvar_spec.rb +0 -39
- data/spec/cvasgn_spec.rb +0 -33
- data/spec/cvdecl_spec.rb +0 -17
- data/spec/defined_spec.rb +0 -616
- data/spec/defn_spec.rb +0 -732
- data/spec/defs_spec.rb +0 -113
- data/spec/dot2_spec.rb +0 -16
- data/spec/dot3_spec.rb +0 -17
- data/spec/dregx_spec.rb +0 -160
- data/spec/dstr_spec.rb +0 -424
- data/spec/dsym_spec.rb +0 -18
- data/spec/dxstr_spec.rb +0 -24
- data/spec/ensure_spec.rb +0 -196
- data/spec/false_spec.rb +0 -7
- data/spec/flip2_spec.rb +0 -21
- data/spec/flip3_spec.rb +0 -12
- data/spec/for_spec.rb +0 -228
- data/spec/gasgn_spec.rb +0 -15
- data/spec/generator/encode_spec.rb +0 -34
- data/spec/gvar_spec.rb +0 -37
- data/spec/hash_spec.rb +0 -108
- data/spec/iasgn_spec.rb +0 -26
- data/spec/if_spec.rb +0 -415
- data/spec/iter_spec.rb +0 -1011
- data/spec/lasgn_spec.rb +0 -561
- data/spec/lit_spec.rb +0 -61
- data/spec/masgn_spec.rb +0 -1558
- data/spec/match2_spec.rb +0 -42
- data/spec/match3_spec.rb +0 -54
- data/spec/match_spec.rb +0 -29
- data/spec/module_spec.rb +0 -73
- data/spec/nil_spec.rb +0 -7
- data/spec/not_spec.rb +0 -47
- data/spec/nth_ref_spec.rb +0 -7
- data/spec/op_asgn_spec.rb +0 -563
- data/spec/or_spec.rb +0 -126
- data/spec/postexe_spec.rb +0 -11
- data/spec/preexe_spec.rb +0 -21
- data/spec/regex_spec.rb +0 -54
- data/spec/rescue_spec.rb +0 -763
- data/spec/return_spec.rb +0 -152
- data/spec/sclass_spec.rb +0 -138
- data/spec/spec_helper.rb +0 -12
- data/spec/str_spec.rb +0 -118
- data/spec/super_spec.rb +0 -170
- data/spec/transforms/assembly_spec.rb +0 -195
- data/spec/transforms/block_given_spec.rb +0 -75
- data/spec/transforms/fast_coerce_spec.rb +0 -112
- data/spec/transforms/fast_new_spec.rb +0 -255
- data/spec/transforms/invoke_primitive_spec.rb +0 -14
- data/spec/transforms/kernel_methods_spec.rb +0 -29
- data/spec/transforms/primitive_spec.rb +0 -33
- data/spec/transforms/privately_spec.rb +0 -24
- data/spec/true_spec.rb +0 -7
- data/spec/undef_spec.rb +0 -133
- data/spec/until_spec.rb +0 -254
- data/spec/valias_spec.rb +0 -11
- data/spec/while_spec.rb +0 -494
- data/spec/xstr_spec.rb +0 -10
- data/spec/yield_spec.rb +0 -92
- data/spec/zsuper_spec.rb +0 -63
data/spec/valias_spec.rb
DELETED
data/spec/while_spec.rb
DELETED
@@ -1,494 +0,0 @@
|
|
1
|
-
describe "A While node" do
|
2
|
-
pre_while = 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.gif 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
|
-
relates <<-ruby do
|
35
|
-
while a
|
36
|
-
b + 1
|
37
|
-
end
|
38
|
-
ruby
|
39
|
-
|
40
|
-
compile(&pre_while)
|
41
|
-
end
|
42
|
-
|
43
|
-
ruby_version_is "1.9" do
|
44
|
-
while_not = lambda do |g|
|
45
|
-
top = g.new_label
|
46
|
-
rdo = g.new_label
|
47
|
-
brk = g.new_label
|
48
|
-
post = g.new_label
|
49
|
-
bottom = g.new_label
|
50
|
-
|
51
|
-
g.push_modifiers
|
52
|
-
|
53
|
-
top.set!
|
54
|
-
g.push :self
|
55
|
-
g.send :a, 0, true
|
56
|
-
g.send :"!", 0, false
|
57
|
-
g.gif bottom
|
58
|
-
|
59
|
-
rdo.set!
|
60
|
-
g.push :self
|
61
|
-
g.send :b, 0, true
|
62
|
-
g.push 1
|
63
|
-
g.send :+, 1, false
|
64
|
-
|
65
|
-
post.set!
|
66
|
-
g.pop
|
67
|
-
g.check_interrupts
|
68
|
-
g.goto top
|
69
|
-
|
70
|
-
bottom.set!
|
71
|
-
g.push :nil
|
72
|
-
|
73
|
-
brk.set!
|
74
|
-
g.pop_modifiers
|
75
|
-
end
|
76
|
-
|
77
|
-
relates <<-ruby do
|
78
|
-
while not a
|
79
|
-
b + 1
|
80
|
-
end
|
81
|
-
ruby
|
82
|
-
|
83
|
-
compile(&while_not)
|
84
|
-
end
|
85
|
-
|
86
|
-
relates "b + 1 while not a" do
|
87
|
-
compile(&while_not)
|
88
|
-
end
|
89
|
-
|
90
|
-
relates <<-ruby do
|
91
|
-
begin
|
92
|
-
b + 1
|
93
|
-
end while not a
|
94
|
-
ruby
|
95
|
-
|
96
|
-
compile do |g|
|
97
|
-
top = g.new_label
|
98
|
-
brk = g.new_label
|
99
|
-
post = g.new_label
|
100
|
-
bottom = g.new_label
|
101
|
-
|
102
|
-
g.push_modifiers
|
103
|
-
|
104
|
-
top.set!
|
105
|
-
|
106
|
-
g.push :self
|
107
|
-
g.send :b, 0, true
|
108
|
-
g.push 1
|
109
|
-
g.send :+, 1, false
|
110
|
-
|
111
|
-
post.set!
|
112
|
-
g.pop
|
113
|
-
g.check_interrupts
|
114
|
-
|
115
|
-
g.push :self
|
116
|
-
g.send :a, 0, true
|
117
|
-
g.send :"!", 0, false
|
118
|
-
g.gif bottom
|
119
|
-
|
120
|
-
g.goto top
|
121
|
-
|
122
|
-
bottom.set!
|
123
|
-
g.push :nil
|
124
|
-
|
125
|
-
brk.set!
|
126
|
-
g.pop_modifiers
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
relates <<-ruby do
|
132
|
-
while 1
|
133
|
-
next 2
|
134
|
-
end
|
135
|
-
ruby
|
136
|
-
|
137
|
-
compile do |g|
|
138
|
-
top = g.new_label
|
139
|
-
rdo = g.new_label
|
140
|
-
brk = g.new_label
|
141
|
-
post = g.new_label
|
142
|
-
bottom = g.new_label
|
143
|
-
|
144
|
-
g.push_modifiers
|
145
|
-
|
146
|
-
top.set!
|
147
|
-
g.push 1
|
148
|
-
g.gif bottom
|
149
|
-
|
150
|
-
rdo.set!
|
151
|
-
g.push 2
|
152
|
-
g.goto post
|
153
|
-
|
154
|
-
post.set!
|
155
|
-
g.pop
|
156
|
-
g.check_interrupts
|
157
|
-
g.goto top
|
158
|
-
|
159
|
-
bottom.set!
|
160
|
-
g.push :nil
|
161
|
-
|
162
|
-
brk.set!
|
163
|
-
g.pop_modifiers
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
relates <<-ruby do
|
168
|
-
a = x
|
169
|
-
while a.b
|
170
|
-
1
|
171
|
-
end
|
172
|
-
ruby
|
173
|
-
|
174
|
-
compile do |g|
|
175
|
-
top = g.new_label
|
176
|
-
rdo = g.new_label
|
177
|
-
brk = g.new_label
|
178
|
-
post = g.new_label
|
179
|
-
bottom = g.new_label
|
180
|
-
|
181
|
-
g.push :self
|
182
|
-
g.send :x, 0, true
|
183
|
-
g.set_local 0
|
184
|
-
g.pop
|
185
|
-
|
186
|
-
g.push_modifiers
|
187
|
-
top.set!
|
188
|
-
|
189
|
-
g.push_local 0
|
190
|
-
g.send :b, 0, false
|
191
|
-
g.gif bottom
|
192
|
-
|
193
|
-
rdo.set!
|
194
|
-
g.push 1
|
195
|
-
|
196
|
-
post.set!
|
197
|
-
g.pop
|
198
|
-
g.check_interrupts
|
199
|
-
g.goto top
|
200
|
-
|
201
|
-
bottom.set!
|
202
|
-
g.push :nil
|
203
|
-
|
204
|
-
brk.set!
|
205
|
-
g.pop_modifiers
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
relates "b + 1 while a" do
|
210
|
-
compile(&pre_while)
|
211
|
-
end
|
212
|
-
|
213
|
-
ruby_version_is ""..."1.9" do
|
214
|
-
relates <<-ruby do
|
215
|
-
until not a
|
216
|
-
b + 1
|
217
|
-
end
|
218
|
-
ruby
|
219
|
-
|
220
|
-
compile(&pre_while)
|
221
|
-
end
|
222
|
-
|
223
|
-
relates "b + 1 until not a" do
|
224
|
-
compile(&pre_while)
|
225
|
-
end
|
226
|
-
end
|
227
|
-
|
228
|
-
post_while = lambda do |g|
|
229
|
-
top = g.new_label
|
230
|
-
brk = g.new_label
|
231
|
-
post = g.new_label
|
232
|
-
bottom = g.new_label
|
233
|
-
|
234
|
-
g.push_modifiers
|
235
|
-
|
236
|
-
top.set!
|
237
|
-
|
238
|
-
g.push :self
|
239
|
-
g.send :b, 0, true
|
240
|
-
g.push 1
|
241
|
-
g.send :+, 1, false
|
242
|
-
|
243
|
-
post.set!
|
244
|
-
g.pop
|
245
|
-
g.check_interrupts
|
246
|
-
|
247
|
-
g.push :self
|
248
|
-
g.send :a, 0, true
|
249
|
-
g.gif bottom
|
250
|
-
|
251
|
-
g.goto top
|
252
|
-
|
253
|
-
bottom.set!
|
254
|
-
g.push :nil
|
255
|
-
|
256
|
-
brk.set!
|
257
|
-
g.pop_modifiers
|
258
|
-
end
|
259
|
-
|
260
|
-
relates <<-ruby do
|
261
|
-
begin
|
262
|
-
b + 1
|
263
|
-
end while a
|
264
|
-
ruby
|
265
|
-
|
266
|
-
compile(&post_while)
|
267
|
-
end
|
268
|
-
|
269
|
-
ruby_version_is ""..."1.9" do
|
270
|
-
relates <<-ruby do
|
271
|
-
begin
|
272
|
-
b + 1
|
273
|
-
end until not a
|
274
|
-
ruby
|
275
|
-
|
276
|
-
compile(&post_while)
|
277
|
-
end
|
278
|
-
end
|
279
|
-
|
280
|
-
nil_condition = lambda do |g|
|
281
|
-
top = g.new_label
|
282
|
-
rdo = g.new_label
|
283
|
-
brk = g.new_label
|
284
|
-
post = g.new_label
|
285
|
-
bottom = g.new_label
|
286
|
-
|
287
|
-
g.push_modifiers
|
288
|
-
|
289
|
-
top.set!
|
290
|
-
g.push :nil
|
291
|
-
g.gif bottom
|
292
|
-
|
293
|
-
rdo.set!
|
294
|
-
g.push :self
|
295
|
-
g.send :a, 0, true
|
296
|
-
|
297
|
-
post.set!
|
298
|
-
g.pop
|
299
|
-
g.check_interrupts
|
300
|
-
g.goto top
|
301
|
-
|
302
|
-
bottom.set!
|
303
|
-
g.push :nil
|
304
|
-
|
305
|
-
brk.set!
|
306
|
-
g.pop_modifiers
|
307
|
-
end
|
308
|
-
|
309
|
-
relates "a while ()" do
|
310
|
-
compile(&nil_condition)
|
311
|
-
end
|
312
|
-
|
313
|
-
relates <<-ruby do
|
314
|
-
while ()
|
315
|
-
a
|
316
|
-
end
|
317
|
-
ruby
|
318
|
-
|
319
|
-
compile(&nil_condition)
|
320
|
-
end
|
321
|
-
|
322
|
-
ruby_version_is ""..."1.9" do
|
323
|
-
relates "a until not ()" do
|
324
|
-
compile(&nil_condition)
|
325
|
-
end
|
326
|
-
|
327
|
-
relates <<-ruby do
|
328
|
-
until not ()
|
329
|
-
a
|
330
|
-
end
|
331
|
-
ruby
|
332
|
-
|
333
|
-
compile(&nil_condition)
|
334
|
-
end
|
335
|
-
|
336
|
-
relates "a until ! ()" do
|
337
|
-
compile(&nil_condition)
|
338
|
-
end
|
339
|
-
|
340
|
-
relates <<-ruby do
|
341
|
-
until ! ()
|
342
|
-
a
|
343
|
-
end
|
344
|
-
ruby
|
345
|
-
|
346
|
-
compile(&nil_condition)
|
347
|
-
end
|
348
|
-
|
349
|
-
end
|
350
|
-
|
351
|
-
relates <<-ruby do
|
352
|
-
while 1
|
353
|
-
2
|
354
|
-
break :brk
|
355
|
-
end
|
356
|
-
ruby
|
357
|
-
|
358
|
-
compile do |g|
|
359
|
-
top = g.new_label
|
360
|
-
rdo = g.new_label
|
361
|
-
brk = g.new_label
|
362
|
-
post = g.new_label
|
363
|
-
bottom = g.new_label
|
364
|
-
|
365
|
-
g.push_modifiers
|
366
|
-
top.set!
|
367
|
-
|
368
|
-
g.push 1
|
369
|
-
g.gif bottom
|
370
|
-
|
371
|
-
rdo.set!
|
372
|
-
g.push 2
|
373
|
-
g.pop
|
374
|
-
g.push_literal :brk
|
375
|
-
g.goto brk
|
376
|
-
|
377
|
-
post.set!
|
378
|
-
g.pop
|
379
|
-
g.check_interrupts
|
380
|
-
g.goto top
|
381
|
-
|
382
|
-
bottom.set!
|
383
|
-
g.push :nil
|
384
|
-
|
385
|
-
brk.set!
|
386
|
-
g.pop_modifiers
|
387
|
-
end
|
388
|
-
end
|
389
|
-
|
390
|
-
relates <<-ruby do
|
391
|
-
while 1
|
392
|
-
begin
|
393
|
-
2
|
394
|
-
break :brk
|
395
|
-
rescue
|
396
|
-
3
|
397
|
-
end
|
398
|
-
end
|
399
|
-
ruby
|
400
|
-
|
401
|
-
compile do |g|
|
402
|
-
top = g.new_label
|
403
|
-
post = g.new_label
|
404
|
-
bottom = g.new_label
|
405
|
-
brk = g.break = g.new_label
|
406
|
-
|
407
|
-
g.push_modifiers
|
408
|
-
top.set!
|
409
|
-
|
410
|
-
g.push 1
|
411
|
-
g.gif bottom
|
412
|
-
|
413
|
-
# redo
|
414
|
-
g.new_label.set!
|
415
|
-
|
416
|
-
g.for_rescue do |rb|
|
417
|
-
rb.body do
|
418
|
-
g.push 2
|
419
|
-
g.pop
|
420
|
-
g.push_literal :brk
|
421
|
-
rb.break
|
422
|
-
end
|
423
|
-
|
424
|
-
rb.condition :StandardError, true do
|
425
|
-
g.push 3
|
426
|
-
end
|
427
|
-
end
|
428
|
-
|
429
|
-
post.set!
|
430
|
-
g.pop
|
431
|
-
g.check_interrupts
|
432
|
-
g.goto top
|
433
|
-
|
434
|
-
bottom.set!
|
435
|
-
g.push :nil
|
436
|
-
|
437
|
-
brk.set!
|
438
|
-
g.pop_modifiers
|
439
|
-
end
|
440
|
-
|
441
|
-
end
|
442
|
-
|
443
|
-
relates <<-ruby do
|
444
|
-
while 1
|
445
|
-
begin
|
446
|
-
2
|
447
|
-
rescue
|
448
|
-
3
|
449
|
-
break :brk
|
450
|
-
end
|
451
|
-
end
|
452
|
-
ruby
|
453
|
-
|
454
|
-
compile do |g|
|
455
|
-
top = g.new_label
|
456
|
-
post = g.new_label
|
457
|
-
bottom = g.new_label
|
458
|
-
brk = g.break = g.new_label
|
459
|
-
|
460
|
-
g.push_modifiers
|
461
|
-
top.set!
|
462
|
-
|
463
|
-
g.push 1
|
464
|
-
g.gif bottom
|
465
|
-
|
466
|
-
# redo
|
467
|
-
g.new_label.set!
|
468
|
-
|
469
|
-
g.for_rescue do |rb|
|
470
|
-
rb.body do
|
471
|
-
g.push 2
|
472
|
-
end
|
473
|
-
|
474
|
-
rb.condition :StandardError, true do
|
475
|
-
g.push 3
|
476
|
-
g.pop
|
477
|
-
g.push_literal :brk
|
478
|
-
rb.break
|
479
|
-
end
|
480
|
-
end
|
481
|
-
|
482
|
-
post.set!
|
483
|
-
g.pop
|
484
|
-
g.check_interrupts
|
485
|
-
g.goto top
|
486
|
-
|
487
|
-
bottom.set!
|
488
|
-
g.push :nil
|
489
|
-
|
490
|
-
brk.set!
|
491
|
-
g.pop_modifiers
|
492
|
-
end
|
493
|
-
end
|
494
|
-
end
|