7
7
#include " dispatch.hpp"
8
8
#include " memory.hpp"
9
9
#include " marshal.hpp"
10
+ #include " on_stack.hpp"
10
11
11
12
#include " object_utils.hpp"
12
13
@@ -96,13 +97,16 @@ namespace rubinius {
96
97
}
97
98
98
99
Object* UnMarshaller::get_rational () {
99
- Object* objs[2 ];
100
+ Object* a;
101
+ Object* b;
102
+ OnStack<2 > os (state, a, b);
100
103
101
- objs[ 0 ] = unmarshal ();
102
- objs[ 1 ] = unmarshal ();
104
+ a = unmarshal ();
105
+ b = unmarshal ();
103
106
104
107
Symbol* name = state->symbol (" unmarshal_rational" );
105
- Arguments args (name, G (runtime), 2 , objs);
108
+ Arguments args (name, G (runtime),
109
+ Array::from_tuple (state, Tuple::from (state, 2 , a, b)));
106
110
Dispatch dispatch (name);
107
111
108
112
if (Object* r = dispatch.send (state, args)) {
@@ -113,13 +117,16 @@ namespace rubinius {
113
117
}
114
118
115
119
Object* UnMarshaller::get_complex () {
116
- Object* objs[2 ];
120
+ Object* a;
121
+ Object* b;
122
+ OnStack<2 > os (state, a, b);
117
123
118
- objs[ 0 ] = unmarshal ();
119
- objs[ 1 ] = unmarshal ();
124
+ a = unmarshal ();
125
+ b = unmarshal ();
120
126
121
127
Symbol* name = state->symbol (" unmarshal_complex" );
122
- Arguments args (name, G (runtime), 2 , objs);
128
+ Arguments args (name, G (runtime),
129
+ Array::from_tuple (state, Tuple::from (state, 2 , a, b)));
123
130
Dispatch dispatch (name);
124
131
125
132
if (Object* c = dispatch.send (state, args)) {
@@ -186,6 +193,7 @@ namespace rubinius {
186
193
stream >> count;
187
194
188
195
Tuple* tup = state->memory ()->new_fields <Tuple>(state, G (tuple), count);
196
+ OnStack<1 > os (state, tup);
189
197
190
198
if (tup->young_object_p ()) {
191
199
for (size_t i = 0 ; i < count; i++) {
@@ -266,6 +274,7 @@ namespace rubinius {
266
274
267
275
InstructionSequence* iseq = InstructionSequence::create (state, count);
268
276
Tuple* ops = iseq->opcodes ();
277
+ OnStack<2 > os (state, iseq, ops);
269
278
270
279
for (size_t i = 0 ; i < count; i++) {
271
280
stream.getline (data, OPCODE_LENGTH);
@@ -283,6 +292,7 @@ namespace rubinius {
283
292
stream >> ver;
284
293
285
294
CompiledCode* code = CompiledCode::create (state);
295
+ OnStack<1 > os (state, code);
286
296
287
297
code->metadata (state, unmarshal ());
288
298
code->primitive (state, force_as<Symbol>(unmarshal ()));
0 commit comments