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,11 +0,0 @@
1
- describe "An Back_ref node" do
2
- relates "[$&, $`, $', $+]" do
3
- compile do |g|
4
- g.last_match 1, 0
5
- g.last_match 2, 0
6
- g.last_match 3, 0
7
- g.last_match 4, 0
8
- g.make_array 4
9
- end
10
- end
11
- end
data/spec/call_spec.rb DELETED
@@ -1,580 +0,0 @@
1
- describe "A Call node" do
2
- relates "self.method" do
3
- compile do |g|
4
- g.push :self
5
- g.send :method, 0, false
6
- end
7
- end
8
-
9
- relates "1.m(2)" do
10
- compile do |g|
11
- g.push 1
12
- g.push 2
13
- g.send :m, 1, false
14
- end
15
- end
16
-
17
- relates "h(1, 2, *a)" do
18
- compile do |g|
19
- g.push :self
20
- g.push 1
21
- g.push 2
22
- g.push :self
23
- g.send :a, 0, true
24
- g.cast_array
25
-
26
- g.push :nil
27
- g.send_with_splat :h, 2, true, false
28
- end
29
- end
30
-
31
- relates <<-ruby do
32
- begin
33
- (1 + 1)
34
- end
35
- ruby
36
-
37
- compile do |g|
38
- g.push 1
39
- g.push 1
40
- g.send :+, 1, false
41
- end
42
- end
43
-
44
- relates "blah(*a)" do
45
- compile do |g|
46
- g.push :self
47
- g.push :self
48
- g.send :a, 0, true
49
- g.cast_array
50
- g.push :nil
51
- g.send_with_splat :blah, 0, true, false
52
- end
53
- end
54
-
55
- relates "a.b(&c)" do
56
- compile do |g|
57
- t = g.new_label
58
-
59
- g.push :self
60
- g.send :a, 0, true
61
- g.push :self
62
- g.send :c, 0, true
63
-
64
- g.dup
65
- g.is_nil
66
- g.git t
67
-
68
- g.push_cpath_top
69
- g.find_const :Proc
70
- g.swap
71
- g.send :__from_block__, 1
72
-
73
- t.set!
74
-
75
- g.send_with_block :b, 0, false
76
- end
77
- end
78
-
79
- relates "a.b(4, &c)" do
80
- compile do |g|
81
- t = g.new_label
82
-
83
- g.push :self
84
- g.send :a, 0, true
85
- g.push 4
86
- g.push :self
87
- g.send :c, 0, true
88
-
89
- g.dup
90
- g.is_nil
91
- g.git t
92
-
93
- g.push_cpath_top
94
- g.find_const :Proc
95
- g.swap
96
- g.send :__from_block__, 1
97
-
98
- t.set!
99
-
100
- g.send_with_block :b, 1, false
101
- end
102
- end
103
-
104
- relates "a.b(1, 2, 3, &c)" do
105
- compile do |g|
106
- t = g.new_label
107
-
108
- g.push :self
109
- g.send :a, 0, true
110
- g.push 1
111
- g.push 2
112
- g.push 3
113
- g.push :self
114
- g.send :c, 0, true
115
-
116
- g.dup
117
- g.is_nil
118
- g.git t
119
-
120
- g.push_cpath_top
121
- g.find_const :Proc
122
- g.swap
123
- g.send :__from_block__, 1
124
-
125
- t.set!
126
-
127
- g.send_with_block :b, 3, false
128
- end
129
- end
130
-
131
- relates "a(&b)" do
132
- compile do |g|
133
- t = g.new_label
134
-
135
- g.push :self
136
- g.push :self
137
- g.send :b, 0, true
138
-
139
- g.dup
140
- g.is_nil
141
- g.git t
142
-
143
- g.push_cpath_top
144
- g.find_const :Proc
145
- g.swap
146
- g.send :__from_block__, 1
147
-
148
- t.set!
149
-
150
- g.send_with_block :a, 0, true
151
- end
152
- end
153
-
154
- relates "a(4, &b)" do
155
- compile do |g|
156
- t = g.new_label
157
-
158
- g.push :self
159
- g.push 4
160
- g.push :self
161
- g.send :b, 0, true
162
-
163
- g.dup
164
- g.is_nil
165
- g.git t
166
-
167
- g.push_cpath_top
168
- g.find_const :Proc
169
- g.swap
170
- g.send :__from_block__, 1
171
-
172
- t.set!
173
-
174
- g.send_with_block :a, 1, true
175
- end
176
- end
177
-
178
- relates "a(1, 2, 3, &b)" do
179
- compile do |g|
180
- t = g.new_label
181
-
182
- g.push :self
183
- g.push 1
184
- g.push 2
185
- g.push 3
186
- g.push :self
187
- g.send :b, 0, true
188
-
189
- g.dup
190
- g.is_nil
191
- g.git t
192
-
193
- g.push_cpath_top
194
- g.find_const :Proc
195
- g.swap
196
- g.send :__from_block__, 1
197
-
198
- t.set!
199
-
200
- g.send_with_block :a, 3, true
201
- end
202
- end
203
-
204
- relates "define_attr_method(:x, :sequence_name, &Proc.new { |*args| nil })" do
205
- compile do |g|
206
- t = g.new_label
207
-
208
- g.push :self
209
- g.push_literal :x
210
- g.push_literal :sequence_name
211
-
212
- g.push_const :Proc
213
- in_block_send :new, :splat, nil, 0, false do |d|
214
- d.push :nil
215
- end
216
-
217
- g.dup
218
- g.is_nil
219
- g.git t
220
-
221
- g.push_cpath_top
222
- g.find_const :Proc
223
- g.swap
224
- g.send :__from_block__, 1
225
-
226
- t.set!
227
-
228
- g.send_with_block :define_attr_method, 2, true
229
- end
230
- end
231
-
232
- relates "r.read_body(dest, &block)" do
233
- compile do |g|
234
- t = g.new_label
235
-
236
- g.push :self
237
- g.send :r, 0, true
238
- g.push :self
239
- g.send :dest, 0, true
240
- g.push :self
241
- g.send :block, 0, true
242
-
243
- g.dup
244
- g.is_nil
245
- g.git t
246
-
247
- g.push_cpath_top
248
- g.find_const :Proc
249
- g.swap
250
- g.send :__from_block__, 1
251
-
252
- t.set!
253
-
254
- g.send_with_block :read_body, 1, false
255
- end
256
- end
257
-
258
- relates "o.m(:a => 1, :b => 2)" do
259
- compile do |g|
260
- g.push :self
261
- g.send :o, 0, true
262
- g.push_cpath_top
263
- g.find_const :Hash
264
- g.push 2
265
- g.send :new_from_literal, 1
266
-
267
- g.dup
268
- g.push_literal :a
269
- g.push 1
270
- g.send :[]=, 2
271
- g.pop
272
-
273
- g.dup
274
- g.push_literal :b
275
- g.push 2
276
- g.send :[]=, 2
277
- g.pop
278
-
279
- g.send :m, 1, false
280
- end
281
- end
282
-
283
- relates "o.m(42, :a => 1, :b => 2)" do
284
- compile do |g|
285
- g.push :self
286
- g.send :o, 0, true
287
- g.push 42
288
- g.push_cpath_top
289
- g.find_const :Hash
290
- g.push 2
291
- g.send :new_from_literal, 1
292
-
293
- g.dup
294
- g.push_literal :a
295
- g.push 1
296
- g.send :[]=, 2
297
- g.pop
298
-
299
- g.dup
300
- g.push_literal :b
301
- g.push 2
302
- g.send :[]=, 2
303
- g.pop
304
-
305
- g.send :m, 2, false
306
- end
307
- end
308
-
309
- ruby_version_is ""..."1.9" do
310
- relates "o.m(42, :a => 1, :b => 2, *c)" do
311
- compile do |g|
312
- g.push :self
313
- g.send :o, 0, true
314
- g.push 42
315
- g.push_cpath_top
316
- g.find_const :Hash
317
- g.push 2
318
- g.send :new_from_literal, 1
319
-
320
- g.dup
321
- g.push_literal :a
322
- g.push 1
323
- g.send :[]=, 2
324
- g.pop
325
-
326
- g.dup
327
- g.push_literal :b
328
- g.push 2
329
- g.send :[]=, 2
330
- g.pop
331
-
332
- g.push :self
333
- g.send :c, 0, true
334
- g.cast_array
335
- g.push :nil
336
- g.send_with_splat :m, 2, false, false
337
- end
338
- end
339
- end
340
-
341
- ruby_version_is ""..."1.9" do
342
- relates "a (1,2,3)" do
343
- compile do |g|
344
- g.push :self
345
- g.push 1
346
- g.push 2
347
- g.push 3
348
- g.send :a, 3, true
349
- end
350
- end
351
- end
352
-
353
- relates "o.puts(42)" do
354
- compile do |g|
355
- g.push :self
356
- g.send :o, 0, true
357
- g.push 42
358
- g.send :puts, 1, false
359
- end
360
- end
361
-
362
- relates "1.b(c)" do
363
- compile do |g|
364
- g.push 1
365
- g.push :self
366
- g.send :c, 0, true
367
- g.send :b, 1, false
368
- end
369
- end
370
-
371
- relates "(v = (1 + 1)).zero?" do
372
- compile do |g|
373
- g.push 1
374
- g.push 1
375
- g.send :+, 1, false
376
- g.set_local 0
377
- g.send :zero?, 0, false
378
- end
379
- end
380
-
381
- relates "-2**31" do
382
- compile do |g|
383
- g.push 2
384
- g.push 31
385
- g.send :**, 1, false
386
- g.send :-@, 0, false
387
- end
388
- end
389
-
390
- relates "a[]" do
391
- compile do |g|
392
- g.push :self
393
- g.send :a, 0, true
394
- g.send :[], 0, false
395
- end
396
- end
397
-
398
- relates "m(:a => 1, :b => 2)" do
399
- compile do |g|
400
- g.push :self
401
- g.push_cpath_top
402
- g.find_const :Hash
403
- g.push 2
404
- g.send :new_from_literal, 1
405
-
406
- g.dup
407
- g.push_literal :a
408
- g.push 1
409
- g.send :[]=, 2
410
- g.pop
411
-
412
- g.dup
413
- g.push_literal :b
414
- g.push 2
415
- g.send :[]=, 2
416
- g.pop
417
-
418
- g.send :m, 1, true
419
- end
420
- end
421
-
422
- relates "m(42, :a => 1, :b => 2)" do
423
- compile do |g|
424
- g.push :self
425
- g.push 42
426
- g.push_cpath_top
427
- g.find_const :Hash
428
- g.push 2
429
- g.send :new_from_literal, 1
430
-
431
- g.dup
432
- g.push_literal :a
433
- g.push 1
434
- g.send :[]=, 2
435
- g.pop
436
-
437
- g.dup
438
- g.push_literal :b
439
- g.push 2
440
- g.send :[]=, 2
441
- g.pop
442
-
443
- g.send :m, 2, true
444
- end
445
- end
446
-
447
- ruby_version_is ""..."1.9" do
448
- relates "m(42, :a => 1, :b => 2, *c)" do
449
- compile do |g|
450
- g.push :self
451
- g.push 42
452
- g.push_cpath_top
453
- g.find_const :Hash
454
- g.push 2
455
- g.send :new_from_literal, 1
456
-
457
- g.dup
458
- g.push_literal :a
459
- g.push 1
460
- g.send :[]=, 2
461
- g.pop
462
-
463
- g.dup
464
- g.push_literal :b
465
- g.push 2
466
- g.send :[]=, 2
467
- g.pop
468
-
469
- g.push :self
470
- g.send :c, 0, true
471
- g.cast_array
472
- g.push :nil
473
-
474
- g.send_with_splat :m, 2, true, false
475
- end
476
- end
477
- end
478
-
479
- relates "m(42)" do
480
- compile do |g|
481
- g.push :self
482
- g.push 42
483
- g.send :m, 1, true
484
- end
485
- end
486
-
487
- relates "a(:b) { :c }" do
488
- compile do |g|
489
- g.push :self
490
- g.push_literal :b
491
-
492
- g.in_block_send :a, :none, nil, 1 do |d|
493
- d.push_literal :c
494
- end
495
- end
496
- end
497
-
498
- relates "a [42]" do
499
- compile do |g|
500
- g.push :self
501
- g.push 42
502
- g.make_array 1
503
- g.send :a, 1, true
504
- end
505
- end
506
-
507
- relates "42 if block_given?" do
508
- compile do |g|
509
- t = g.new_label
510
- f = g.new_label
511
-
512
- g.push :self
513
- g.send :block_given?, 0, true
514
- g.gif f
515
- g.push 42
516
- g.goto t
517
- f.set!
518
- g.push :nil
519
- t.set!
520
- end
521
- end
522
-
523
- relates "method" do
524
- compile do |g|
525
- g.push :self
526
- g.send :method, 0, true
527
- end
528
- end
529
-
530
- relates <<-ruby do
531
- a << begin
532
- b
533
- rescue
534
- c
535
- end
536
- ruby
537
-
538
- compile do |g|
539
- g.push :self
540
- g.send :a, 0, true
541
-
542
- for_rescue do |rb|
543
- rb.body do
544
- g.push :self
545
- g.send :b, 0, true
546
- end
547
-
548
- rb.condition :StandardError, true do
549
- g.push :self
550
- g.send :c, 0, true
551
- end
552
- end
553
-
554
- g.send :<<, 1, false
555
- end
556
- end
557
-
558
- relates "meth([*[1]])" do
559
- compile do |g|
560
- g.push :self
561
- g.push 1
562
- g.make_array 1
563
- g.send :meth, 1, true
564
- end
565
- end
566
-
567
- relates "meth(*[1])" do
568
- compile do |g|
569
- g.push :self
570
-
571
- g.push 1
572
- g.make_array 1
573
- g.cast_array
574
-
575
- g.push :nil
576
-
577
- g.send_with_splat :meth, 0, true, false
578
- end
579
- end
580
- end