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
data/spec/valias_spec.rb DELETED
@@ -1,11 +0,0 @@
1
- describe "A Valias node" do
2
- relates "alias $y $x" do
3
- compile do |g|
4
- g.push_rubinius
5
- g.find_const :Globals
6
- g.push_literal :$x
7
- g.push_literal :$y
8
- g.send :add_alias, 2
9
- end
10
- end
11
- end
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