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/dsym_spec.rb DELETED
@@ -1,18 +0,0 @@
1
- describe "A Dsym node" do
2
- relates ':"x#{(1 + 1)}y"' do
3
- compile do |g|
4
- g.push_literal "x"
5
-
6
- g.push 1
7
- g.push 1
8
- g.send :+, 1, false
9
- g.meta_to_s
10
-
11
- g.push_literal "y"
12
-
13
- g.string_build 3
14
-
15
- g.send :to_sym, 0, true
16
- end
17
- end
18
- end
data/spec/dxstr_spec.rb DELETED
@@ -1,24 +0,0 @@
1
- describe "A Dxstr node" do
2
- relates <<-ruby do
3
- t = 5
4
- `touch \#{t}`
5
- ruby
6
-
7
- compile do |g|
8
- g.push 5
9
- g.set_local 0
10
- g.pop
11
-
12
- g.push :self
13
-
14
- g.push_literal "touch "
15
-
16
- g.push_local 0
17
- g.meta_to_s
18
-
19
- g.string_build 2
20
-
21
- g.send :"`", 1, true
22
- end
23
- end
24
- end
data/spec/ensure_spec.rb DELETED
@@ -1,196 +0,0 @@
1
- describe "An Ensure node" do
2
- relates <<-ruby do
3
- begin
4
- # do nothing
5
- rescue
6
- # do nothing
7
- ensure
8
- # do nothing
9
- end
10
- ruby
11
-
12
- compile do |g|
13
- g.for_ensure do |eb|
14
- eb.body do
15
- g.for_rescue do |rb|
16
- rb.body do
17
- g.push :nil
18
- end
19
-
20
- rb.condition :StandardError, true do
21
- g.push :nil
22
- end
23
- end
24
- end
25
-
26
- eb.handler do
27
- g.push :nil
28
- g.pop
29
- end
30
- end
31
- end
32
- end
33
-
34
- relates <<-ruby do
35
- begin
36
- (1 + 1)
37
- rescue SyntaxError => e1
38
- 2
39
- rescue Exception => e2
40
- 3
41
- else
42
- 4
43
- ensure
44
- 5
45
- end
46
- ruby
47
-
48
- compile do |g|
49
- g.for_ensure do |eb|
50
- eb.body do
51
- g.for_rescue do |rb|
52
- rb.body do
53
- g.push 1
54
- g.push 1
55
- g.send :+, 1, false
56
- end
57
-
58
- rb.condition :SyntaxError do
59
- g.push_current_exception
60
- g.set_local 0
61
- g.pop
62
- g.push 2
63
- end
64
-
65
- rb.condition :Exception do
66
- g.push_current_exception
67
- g.set_local 1
68
- g.pop
69
- g.push 3
70
- end
71
-
72
- rb.els do
73
- g.pop # TODO: should this be built in?
74
- g.push 4
75
- end
76
- end
77
- end
78
-
79
- eb.handler do
80
- g.push 5
81
- g.pop
82
- end
83
- end
84
- end
85
- end
86
-
87
- relates <<-ruby do
88
- begin
89
- a
90
- rescue
91
- # do nothing
92
- ensure
93
- # do nothing
94
- end
95
- ruby
96
-
97
- compile do |g|
98
- g.for_ensure do |eb|
99
- eb.body do
100
- g.for_rescue do |rb|
101
- rb.body do
102
- g.push :self
103
- g.send :a, 0, true
104
- end
105
-
106
- rb.condition :StandardError, true do
107
- g.push :nil
108
- end
109
- end
110
- end
111
-
112
- eb.handler do
113
- g.push :nil
114
- g.pop
115
- end
116
- end
117
- end
118
- end
119
-
120
- relates <<-ruby do
121
- begin
122
- 14
123
- return 2
124
- ensure
125
- 13
126
- end
127
- ruby
128
-
129
- compile do |g|
130
- top = g.new_label
131
- exc_lbl = g.new_label
132
- noexc_lbl = g.new_label
133
-
134
- g.setup_unwind exc_lbl
135
-
136
- top.set!
137
-
138
- saved = save_exception()
139
-
140
- g.push 14
141
- g.pop
142
- g.push 2
143
- g.ensure_return
144
-
145
- g.pop_unwind
146
- g.goto noexc_lbl
147
-
148
- exc_lbl.set!
149
- g.push_exception_state
150
-
151
- g.push 13
152
- g.pop
153
-
154
- g.restore_exception_state
155
- g.reraise
156
-
157
- noexc_lbl.set!
158
-
159
- g.push 13
160
- g.pop
161
- end
162
- end
163
-
164
- relates <<-ruby do
165
- begin
166
- begin
167
- 14
168
- return 2
169
- ensure
170
- 13
171
- end
172
- ensure
173
- 15
174
- end
175
- ruby
176
-
177
- # TODO
178
- end
179
-
180
- relates <<-ruby do
181
- begin
182
- 14
183
- return 2
184
- ensure
185
- begin
186
- 15
187
- return 3
188
- ensure
189
- 16
190
- end
191
- end
192
- ruby
193
-
194
- # TODO
195
- end
196
- end
data/spec/false_spec.rb DELETED
@@ -1,7 +0,0 @@
1
- describe "A False node" do
2
- relates "false" do
3
- compile do |g|
4
- g.push :false
5
- end
6
- end
7
- end
data/spec/flip2_spec.rb DELETED
@@ -1,21 +0,0 @@
1
- describe "A Flip2 node" do
2
- relates <<-ruby do
3
- x = if ((i % 4) == 0)..((i % 3) == 0) then
4
- i
5
- else
6
- nil
7
- end
8
- ruby
9
-
10
- # flip2
11
- end
12
-
13
- relates <<-ruby do
14
- if 1..2.a?(b) then
15
- nil
16
- end
17
- ruby
18
-
19
- # flip2 method
20
- end
21
- end
data/spec/flip3_spec.rb DELETED
@@ -1,12 +0,0 @@
1
- describe "A Flip3 node" do
2
- relates <<-ruby do
3
- x = if ((i % 4) == 0)...((i % 3) == 0) then
4
- i
5
- else
6
- nil
7
- end
8
- ruby
9
-
10
- # flip3
11
- end
12
- end
data/spec/for_spec.rb DELETED
@@ -1,228 +0,0 @@
1
- describe "A For node" do
2
- relates <<-ruby do
3
- for o in ary do
4
- puts(o)
5
- end
6
- ruby
7
-
8
- compile do |g|
9
- g.push :self
10
- g.send :ary, 0, true
11
-
12
- d = new_block_generator(g)
13
-
14
- ruby_version_is ""..."1.9" do
15
- d.cast_for_single_block_arg
16
- end
17
-
18
- ruby_version_is "1.9" do
19
- d.push_local 0
20
- end
21
-
22
- d.set_local_depth 1, 0
23
-
24
- d.pop
25
- d.push_modifiers
26
- d.new_label.set!
27
-
28
- d.push :self
29
- d.push_local_depth 1, 0
30
- d.send :puts, 1, true
31
-
32
- d.pop_modifiers
33
- d.ret
34
-
35
- g.create_block(d)
36
-
37
- g.send_with_block :each, 0, false
38
- end
39
- end
40
-
41
- relates <<-ruby do
42
- for i in (0..max) do
43
- # do nothing
44
- end
45
- ruby
46
-
47
- compile do |g|
48
- g.push_cpath_top
49
- g.find_const :Range
50
- g.send :allocate, 0, true
51
- g.dup
52
- g.push 0
53
- g.push :self
54
- g.send :max, 0, true
55
- g.send :initialize, 2, true
56
- g.pop
57
-
58
- d = new_block_generator(g)
59
-
60
- ruby_version_is ""..."1.9" do
61
- d.cast_for_single_block_arg
62
- end
63
-
64
- ruby_version_is "1.9" do
65
- d.push_local 0
66
- end
67
-
68
- d.set_local_depth 1, 0
69
-
70
- d.pop
71
- d.push_modifiers
72
- d.new_label.set!
73
-
74
- d.push :nil
75
-
76
- d.pop_modifiers
77
- d.ret
78
-
79
- g.create_block(d)
80
-
81
- g.send_with_block :each, 0, false
82
- end
83
- end
84
-
85
- relates <<-ruby do
86
- for a, b in x do
87
- 5
88
- end
89
- ruby
90
-
91
- compile do |g|
92
- d = new_block_generator(g)
93
-
94
- ruby_version_is ""..."1.9" do
95
- d.cast_for_multi_block_arg
96
- end
97
-
98
- d.push_literal Rubinius::ToolSets::Spec::Compiler::Runtime
99
- d.push_local 0
100
- d.send :unwrap_block_arg, 1
101
- d.cast_array
102
-
103
- d.shift_array
104
- d.set_local_depth 1, 0
105
- d.pop
106
- d.shift_array
107
- d.set_local_depth 1, 1
108
- d.pop
109
- d.pop
110
- d.push_modifiers
111
- d.new_label.set!
112
- d.push 5
113
- d.pop_modifiers
114
- d.ret
115
-
116
- g.push :self
117
- g.send :x, 0, true
118
- g.create_block d
119
-
120
- g.send_with_block :each, 0, false
121
- end
122
- end
123
-
124
- relates <<-ruby do
125
- for i in ()
126
- i
127
- end
128
- ruby
129
-
130
- compile do |g|
131
- g.push :nil
132
-
133
- d = new_block_generator(g)
134
-
135
- ruby_version_is ""..."1.9" do
136
- d.cast_for_single_block_arg
137
- end
138
-
139
- ruby_version_is "1.9" do
140
- d.push_local 0
141
- end
142
-
143
- d.set_local_depth 1, 0
144
-
145
- d.pop
146
- d.push_modifiers
147
- d.new_label.set!
148
-
149
- d.push_local_depth 1, 0
150
-
151
- d.pop_modifiers
152
- d.ret
153
-
154
- g.create_block(d)
155
-
156
- g.send_with_block :each, 0, false
157
- end
158
- end
159
-
160
- relates <<-ruby do
161
- c = 1
162
- for i in a
163
- for j in b
164
- c
165
- end
166
- end
167
- ruby
168
-
169
- compile do |g|
170
- g.push 1
171
- g.set_local 0
172
- g.pop
173
-
174
- g.push :self
175
- g.send :a, 0, true
176
-
177
- # outer for
178
- d = new_block_generator(g)
179
-
180
- ruby_version_is ""..."1.9" do
181
- d.cast_for_single_block_arg
182
- end
183
-
184
- ruby_version_is "1.9" do
185
- d.push_local 0
186
- end
187
-
188
- d.set_local_depth 1, 1
189
- d.pop
190
-
191
- d.push_modifiers
192
- d.new_label.set!
193
-
194
- d.push :self
195
- d.send :b, 0, true
196
-
197
- # inner for
198
- e = new_block_generator(g)
199
-
200
- ruby_version_is ""..."1.9" do
201
- e.cast_for_single_block_arg
202
- end
203
-
204
- ruby_version_is "1.9" do
205
- e.push_local 0
206
- end
207
-
208
- e.set_local_depth 2, 2
209
- e.pop
210
-
211
- e.push_modifiers
212
- e.new_label.set!
213
- e.push_local_depth 2, 0
214
-
215
- e.pop_modifiers
216
- e.ret
217
-
218
- d.create_block(e)
219
- d.send_with_block :each, 0, false
220
-
221
- d.pop_modifiers
222
- d.ret
223
-
224
- g.create_block(d)
225
- g.send_with_block :each, 0, false
226
- end
227
- end
228
- end