~ubuntu-branches/ubuntu/vivid/nqp/vivid-proposed

« back to all changes in this revision

Viewing changes to src/pmc/qrpa.pmc

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2013-11-01 12:09:18 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131101120918-kx51sl0sxl3exsxi
Tags: 2013.10-1
* New upstream release
* Bump versioned (Build-)Depends on parrot
* Update patches
* Install new README.pod
* Fix vcs-field-not-canonical
* Do not install rubyish examples
* Do not Depends on parrot-devel anymore
* Add 07_disable-serialization-tests.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* QRPA is a replacment for Parrot's ResizablePMCArray (RPA) class.
2
 
 * The key distinguishing feature of QRPA is that it's much
3
 
 * more efficient for shift and unshift, providing a O(1)
4
 
 * algorithm instead of the O(n) version that RPA has.
5
 
 * It also means that splice can be performed a lot more
6
 
 * efficiently in many common cases. */
7
 
 
8
 
pmclass QRPA 
9
 
    provides array 
10
 
    auto_attrs 
11
 
    dynpmc 
12
 
    group nqp
13
 
    hll nqp
14
 
{
15
 
    ATTR INTVAL   elems;        /* number of elements */
16
 
    ATTR INTVAL   start;        /* slot index of first element */
17
 
    ATTR INTVAL   ssize;        /* size of slots array */
18
 
    ATTR PMC    **slots;        /* array of PMC slots */
19
 
 
20
 
 
21
 
    VTABLE void destroy() {
22
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
23
 
        if (qrpa->slots) {
24
 
            mem_gc_free(INTERP, qrpa->slots);
25
 
            qrpa->slots = 0;
26
 
        }
27
 
    }
28
 
 
29
 
 
30
 
    VTABLE void mark() {
31
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
32
 
        INTVAL elems = qrpa->elems;
33
 
        INTVAL start = qrpa->start;
34
 
        PMC **slots  = qrpa->slots;
35
 
 
36
 
        slots += start;
37
 
        for (elems--; elems >= 0; elems--) {
38
 
            Parrot_gc_mark_PMC_alive(INTERP, slots[elems]);
39
 
        }
40
 
    }
41
 
 
42
 
 
43
 
    VTABLE PMC * clone() {
44
 
        PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
45
 
        Parrot_QRPA_attributes * const qrpa0 = PARROT_QRPA(SELF);
46
 
        Parrot_QRPA_attributes * const qrpa1 = PARROT_QRPA(dest);
47
 
        INTVAL elems = qrpa0->elems;
48
 
 
49
 
        if (elems > 0) {
50
 
            qrpa1->slots = mem_gc_allocate_n_typed(INTERP, elems, PMC *);
51
 
            qrpa1->elems = elems;
52
 
            qrpa1->ssize = elems;
53
 
            mem_copy_n_typed(qrpa1->slots, qrpa0->slots + qrpa0->start,
54
 
                elems, PMC *);
55
 
            PObj_custom_mark_destroy_SETALL(dest);
56
 
        }
57
 
 
58
 
        return dest;
59
 
    }
60
 
 
61
 
 
62
 
/*
63
 
 
64
 
=item C<void set_integer_native(INTVAL n)>
65
 
 
66
 
Resizes the array to C<n> elements.
67
 
 
68
 
=cut
69
 
 
70
 
*/
71
 
 
72
 
    VTABLE void set_integer_native(INTVAL n) {
73
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
74
 
        INTVAL   elems = qrpa->elems;
75
 
        INTVAL   start = qrpa->start;
76
 
        INTVAL   ssize = qrpa->ssize;
77
 
        PMC    **slots = qrpa->slots;
78
 
 
79
 
        if (n < 0)
80
 
            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
81
 
                    "QRPA: Can't resize to negative elements");
82
 
 
83
 
        if (n == elems) { return; }
84
 
 
85
 
        /* if there aren't enough slots at the end, shift off empty slots 
86
 
         * from the beginning first */
87
 
        if (start > 0 && n + start > ssize) {
88
 
            if (elems > 0) 
89
 
                memmove(slots, slots + start, elems * sizeof (PMC *));
90
 
            qrpa->start = 0;
91
 
            /* fill out any unused slots with PMCNULL pointers */
92
 
            while (elems < ssize) {
93
 
                slots[elems] = PMCNULL;
94
 
                elems++;
95
 
            }
96
 
        }
97
 
 
98
 
        qrpa->elems = n;
99
 
        if (n <= ssize) { 
100
 
            /* we already have n slots available, we can just return */
101
 
            return;
102
 
        }
103
 
 
104
 
        /* We need more slots.  If the current slot size is less
105
 
         * than 8K, use the larger of twice the current slot size
106
 
         * or the actual number of elements needed.  Otherwise,
107
 
         * grow the slots to the next multiple of 4096 (0x1000). */
108
 
        if (ssize < 8192) {
109
 
            ssize *= 2;
110
 
            if (n > ssize) ssize = n;
111
 
            if (ssize < 8) ssize = 8;
112
 
        }
113
 
        else {
114
 
            ssize = (n + 0x1000) & ~0xfff;
115
 
        }
116
 
 
117
 
        /* now allocate the new slot buffer */
118
 
        slots = (slots)
119
 
                ? mem_gc_realloc_n_typed(INTERP, slots, ssize, PMC *)
120
 
                : mem_gc_allocate_n_typed(INTERP, ssize, PMC *);
121
 
 
122
 
        /* fill out any unused slots with PMCNULL pointers */
123
 
        while (elems < ssize) {
124
 
            slots[elems] = PMCNULL;
125
 
            elems++;
126
 
        }
127
 
 
128
 
        qrpa->ssize = ssize;
129
 
        qrpa->slots = slots;
130
 
        PObj_custom_mark_destroy_SETALL(SELF);
131
 
    }
132
 
 
133
 
 
134
 
    VTABLE INTVAL defined_keyed_int(INTVAL pos) {
135
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
136
 
        PMC    *value;
137
 
 
138
 
        if (pos < 0)
139
 
            pos += qrpa->elems;
140
 
 
141
 
        if (pos < 0 || pos >= qrpa->elems)
142
 
            return 0;
143
 
 
144
 
        value = qrpa->slots[qrpa->start + pos];
145
 
        return !PMC_IS_NULL(value) && VTABLE_defined(INTERP, value);
146
 
    }
147
 
 
148
 
 
149
 
    VTABLE INTVAL elements() {
150
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
151
 
        UNUSED(INTERP);
152
 
        return qrpa->elems;
153
 
    }
154
 
 
155
 
 
156
 
    VTABLE INTVAL exists_keyed_int(INTVAL pos) {
157
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
158
 
        PMC    *value;
159
 
        UNUSED(INTERP);
160
 
 
161
 
        if (pos < 0)
162
 
            pos += qrpa->elems;
163
 
 
164
 
        if (pos < 0 || pos >= qrpa->elems)
165
 
            return 0;
166
 
 
167
 
        return !PMC_IS_NULL(qrpa->slots[qrpa->start + pos]);
168
 
    }
169
 
 
170
 
 
171
 
    VTABLE INTVAL exists_keyed(PMC *key) {
172
 
        INTVAL pos = VTABLE_get_integer(INTERP, key);
173
 
        return SELF.exists_keyed_int(pos);
174
 
    }    
175
 
 
176
 
 
177
 
    VTABLE INTVAL get_bool() {
178
 
        const INTVAL elems = SELF.elements();
179
 
        return (INTVAL)(elems != 0);
180
 
    }
181
 
 
182
 
 
183
 
    VTABLE INTVAL get_integer() {
184
 
        return SELF.elements();
185
 
    }
186
 
 
187
 
 
188
 
    VTABLE PMC * get_iter() {
189
 
        return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
190
 
    }
191
 
 
192
 
 
193
 
    VTABLE FLOATVAL get_number() {
194
 
        const INTVAL e = SELF.elements();
195
 
        return (FLOATVAL)e;
196
 
    }
197
 
 
198
 
 
199
 
    VTABLE PMC * get_pmc_keyed_int(INTVAL pos) {
200
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
201
 
 
202
 
        if (pos < 0) {
203
 
            pos += qrpa->elems;
204
 
            if (pos < 0)
205
 
                Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
206
 
                        "QRPA: index out of bounds");
207
 
        }
208
 
        else if (pos >= qrpa->elems)
209
 
            return PMCNULL;
210
 
 
211
 
        return qrpa->slots[qrpa->start + pos];
212
 
    }
213
 
 
214
 
 
215
 
    VTABLE PMC *get_pmc_keyed(PMC *key) {
216
 
        const INTVAL pos = VTABLE_get_integer(INTERP, key);
217
 
        PMC * const nextkey = Parrot_key_next(INTERP, key);
218
 
        PMC * box;
219
 
 
220
 
        if (!nextkey) 
221
 
            return SELF.get_pmc_keyed_int(pos);
222
 
 
223
 
        box = SELF.get_pmc_keyed_int(pos);
224
 
        if (PMC_IS_NULL(box))
225
 
            return PMCNULL;
226
 
 
227
 
        return VTABLE_get_pmc_keyed(INTERP, box, nextkey);
228
 
    }
229
 
 
230
 
 
231
 
    VTABLE void set_pmc_keyed_int(INTVAL pos, PMC *value) {
232
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
233
 
 
234
 
        if (pos < 0) {
235
 
            pos += qrpa->elems;
236
 
            if (pos < 0)
237
 
                Parrot_ex_throw_from_c_args(INTERP, NULL, 
238
 
                        EXCEPTION_OUT_OF_BOUNDS, "QRPA: index out of bounds");
239
 
        }
240
 
        else if (pos >= qrpa->elems) 
241
 
            SELF.set_integer_native(pos + 1);
242
 
 
243
 
        qrpa->slots[qrpa->start + pos] = value;
244
 
    }
245
 
 
246
 
 
247
 
    VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
248
 
        const INTVAL pos = VTABLE_get_integer(INTERP, key);
249
 
        PMC * const nextkey = Parrot_key_next(INTERP, key);
250
 
 
251
 
        if (!nextkey) {
252
 
            SELF.set_pmc_keyed_int(pos, value);
253
 
        }
254
 
        else {
255
 
            PMC * const box = SELF.get_pmc_keyed_int(pos);
256
 
            if (PMC_IS_NULL(box)) {
257
 
                Parrot_ex_throw_from_c_args(interp, NULL,
258
 
                        EXCEPTION_INVALID_OPERATION,
259
 
                        "Cannot autovivify nested arrays");
260
 
            }
261
 
            VTABLE_set_pmc_keyed(INTERP, box, nextkey, value);
262
 
        }
263
 
    }
264
 
 
265
 
 
266
 
    VTABLE PMC * pop_pmc() {
267
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
268
 
 
269
 
        if (qrpa->elems < 1) {
270
 
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
271
 
                    "QRPA: Can't pop from an empty array!");
272
 
        }
273
 
 
274
 
        qrpa->elems--;
275
 
        return qrpa->slots[qrpa->start + qrpa->elems];
276
 
    }
277
 
 
278
 
 
279
 
    VTABLE void push_pmc(PMC *value) {
280
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
281
 
 
282
 
        SELF.set_integer_native(qrpa->elems + 1);
283
 
        qrpa->slots[qrpa->start + qrpa->elems - 1] = value;
284
 
    }
285
 
 
286
 
 
287
 
    VTABLE PMC * shift_pmc() {
288
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
289
 
        PMC    *value;
290
 
 
291
 
        if (qrpa->elems < 1) {
292
 
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
293
 
                    "QRPA: Can't shift from an empty array!");
294
 
        }
295
 
 
296
 
        value = qrpa->slots[qrpa->start];
297
 
        qrpa->start++;
298
 
        qrpa->elems--;
299
 
        return value;
300
 
    }
301
 
 
302
 
 
303
 
    VTABLE void unshift_pmc(PMC *value) {
304
 
        Parrot_QRPA_attributes * const qrpa = PARROT_QRPA(SELF);
305
 
 
306
 
        /* If we don't have room at the beginning of the slots,
307
 
         * make some room (8 slots) for unshifting */
308
 
        if (qrpa->start < 1) {
309
 
            INTVAL n = 8;
310
 
            INTVAL elems = qrpa->elems;
311
 
            INTVAL i;
312
 
 
313
 
            /* grow the array */
314
 
            SELF.set_integer_native(elems + n);
315
 
            /* move elements and set start */
316
 
            memmove(qrpa->slots + n, qrpa->slots, elems * sizeof (PMC *));
317
 
            qrpa->start = n;
318
 
            qrpa->elems = elems;
319
 
            /* clear out beginning elements */
320
 
            for (i = 0; i < n; i++)
321
 
                qrpa->slots[i] = PMCNULL;
322
 
        }
323
 
 
324
 
        /* Now do the unshift */
325
 
        qrpa->start--;
326
 
        qrpa->slots[qrpa->start] = value;
327
 
        qrpa->elems++;
328
 
    }
329
 
 
330
 
    VTABLE void splice(PMC *from, INTVAL offset, INTVAL count) {
331
 
        /* TODO: use qrpa->foo instead of GET_ATTR_* */
332
 
        INTVAL elems0 = VTABLE_elements(INTERP, SELF);
333
 
        INTVAL elems1 = VTABLE_elements(INTERP, from);
334
 
        PMC **slots = 0;
335
 
        INTVAL start;
336
 
        INTVAL tail;
337
 
 
338
 
        /* start from end? */
339
 
        if (offset < 0)
340
 
            offset += elems0;
341
 
 
342
 
        if (offset < 0)
343
 
            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
344
 
                "QRPA: illegal splice offset\n");
345
 
 
346
 
        /* When offset == 0, then we may be able to reduce the memmove
347
 
         * calls and reallocs by adjusting SELF's start, elems0, and 
348
 
         * count to better match the incoming splice.  In particular, 
349
 
         * we're seeking to adjust C<count> to as close to C<elems1> 
350
 
         * as we can. */
351
 
        if (offset == 0) {
352
 
            INTVAL n = elems1 - count;
353
 
            GET_ATTR_start(INTERP, SELF, start);
354
 
            if (n > start) n = start;
355
 
            if (n <= -elems0) {
356
 
                elems0 = 0;
357
 
                count = 0;
358
 
                SET_ATTR_start(INTERP, SELF, 0);
359
 
                SET_ATTR_elems(INTERP, SELF, elems0);
360
 
            }
361
 
            else if (n != 0) {
362
 
                elems0 += n;
363
 
                count += n;
364
 
                SET_ATTR_start(INTERP, SELF, start - n);
365
 
                SET_ATTR_elems(INTERP, SELF, elems0);
366
 
            }
367
 
        }
368
 
 
369
 
        /* if count == 0 and elems1 == 0, there's nothing left
370
 
         * to copy or remove, so the splice is done! */
371
 
        if (count == 0 && elems1 == 0)
372
 
            return;
373
 
 
374
 
        /* number of elements to right of splice (the "tail") */
375
 
        tail = elems0 - offset - count;
376
 
        if (tail < 0) tail = 0;
377
 
 
378
 
        if (tail > 0 && count > elems1) {
379
 
            /* We're shrinking the array, so first move the tail left */
380
 
            GET_ATTR_slots(INTERP, SELF, slots);
381
 
            GET_ATTR_start(INTERP, SELF, start);
382
 
            memmove(slots + start + offset + elems1,
383
 
                    slots + start + offset + count,
384
 
                    tail * sizeof (PMC *));
385
 
        }
386
 
 
387
 
        /* now resize the array */
388
 
        SELF.set_integer_native(offset + elems1 + tail);
389
 
 
390
 
        GET_ATTR_slots(INTERP, SELF, slots);
391
 
        GET_ATTR_start(INTERP, SELF, start);
392
 
        if (tail > 0 && count < elems1) {
393
 
            /* The array grew, so move the tail to the right */
394
 
            memmove(slots + start + offset + elems1,
395
 
                    slots + start + offset + count,
396
 
                    tail * sizeof (PMC *));
397
 
        }
398
 
 
399
 
        /* now copy C<from>'s elements into SELF */
400
 
        if (elems1 > 0) {
401
 
            PMC *iter = VTABLE_get_iter(INTERP, from);
402
 
            INTVAL i;         
403
 
            for (i = 0; i < elems1; i++)
404
 
                slots[start + offset + i] = VTABLE_shift_pmc(INTERP, iter);
405
 
        }
406
 
    }
407
 
  
408
 
 
409
 
    VTABLE INTVAL get_integer_keyed(PMC *key) {
410
 
        PMC * const val = SELF.get_pmc_keyed(key);
411
 
        return VTABLE_get_integer(INTERP, val);
412
 
    }
413
 
 
414
 
 
415
 
    VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
416
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_Integer));
417
 
        VTABLE_set_integer_native(INTERP, val, value);
418
 
        SELF.set_pmc_keyed(key, val);
419
 
    }
420
 
 
421
 
 
422
 
    VTABLE void set_integer_keyed_int(INTVAL pos, INTVAL value) {
423
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_Integer));
424
 
        VTABLE_set_integer_native(INTERP, val, value);
425
 
        SELF.set_pmc_keyed_int(pos, val);
426
 
    }
427
 
 
428
 
 
429
 
    VTABLE INTVAL pop_integer() {
430
 
        PMC * const val = SELF.pop_pmc();
431
 
        return VTABLE_get_integer(INTERP, val);
432
 
    }
433
 
 
434
 
 
435
 
    VTABLE void push_integer(INTVAL value) {
436
 
        INTVAL elems;
437
 
        GET_ATTR_elems(INTERP, SELF, elems);
438
 
        SELF.set_integer_keyed_int(elems, value);
439
 
    }
440
 
 
441
 
 
442
 
    VTABLE INTVAL shift_integer() {
443
 
        PMC * const val = SELF.shift_pmc();
444
 
        return VTABLE_get_integer(INTERP, val);
445
 
    }
446
 
 
447
 
    VTABLE void unshift_integer(INTVAL value) {
448
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_Integer));
449
 
        VTABLE_set_integer_native(INTERP, val, value);
450
 
        SELF.unshift_pmc(val);
451
 
    }
452
 
 
453
 
 
454
 
 
455
 
    VTABLE FLOATVAL get_number_keyed(PMC *key) {
456
 
        PMC * const val = SELF.get_pmc_keyed(key);
457
 
        return VTABLE_get_number(INTERP, val);
458
 
    }
459
 
 
460
 
 
461
 
    VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
462
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_Float));
463
 
        VTABLE_set_number_native(INTERP, val, value);
464
 
        SELF.set_pmc_keyed(key, val);
465
 
    }
466
 
 
467
 
 
468
 
    VTABLE void set_number_keyed_int(INTVAL pos, FLOATVAL value) {
469
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_Float));
470
 
        VTABLE_set_number_native(INTERP, val, value);
471
 
        SELF.set_pmc_keyed_int(pos, val);
472
 
    }
473
 
 
474
 
 
475
 
    VTABLE FLOATVAL pop_float() {
476
 
        PMC * const val = SELF.pop_pmc();
477
 
        return VTABLE_get_number(INTERP, val);
478
 
    }
479
 
 
480
 
 
481
 
    VTABLE void push_float(FLOATVAL value) {
482
 
        INTVAL elems;
483
 
        GET_ATTR_elems(INTERP, SELF, elems);
484
 
        SELF.set_number_keyed_int(elems, value);
485
 
    }
486
 
 
487
 
 
488
 
    VTABLE FLOATVAL shift_float() {
489
 
        PMC * const val = SELF.shift_pmc();
490
 
        return VTABLE_get_number(INTERP, val);
491
 
    }
492
 
 
493
 
 
494
 
    VTABLE void unshift_float(FLOATVAL value) {
495
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_Float));
496
 
        VTABLE_set_number_native(INTERP, val, value);
497
 
        SELF.unshift_pmc(val);
498
 
    }
499
 
 
500
 
 
501
 
    VTABLE STRING * get_string_keyed(PMC *key) {
502
 
        PMC * const val = SELF.get_pmc_keyed(key);
503
 
        return VTABLE_get_string(INTERP, val);
504
 
    }
505
 
 
506
 
 
507
 
    VTABLE void set_string_keyed(PMC *key, STRING *value) {
508
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_String));
509
 
        VTABLE_set_string_native(INTERP, val, value);
510
 
        SELF.set_pmc_keyed(key, val);
511
 
    }
512
 
 
513
 
 
514
 
    VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
515
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_String));
516
 
        VTABLE_set_string_native(INTERP, val, value);
517
 
        SELF.set_pmc_keyed_int(key, val);
518
 
    }
519
 
 
520
 
 
521
 
    VTABLE STRING * pop_string() {
522
 
        PMC * const val = SELF.pop_pmc();
523
 
        return VTABLE_get_string(INTERP, val);
524
 
    }
525
 
 
526
 
 
527
 
    VTABLE void push_string(STRING *value) {
528
 
        INTVAL elems;
529
 
        GET_ATTR_elems(INTERP, SELF, elems);
530
 
        SELF.set_string_keyed_int(elems, value);
531
 
    }
532
 
 
533
 
 
534
 
    VTABLE STRING * shift_string() {
535
 
        PMC * const val = SELF.shift_pmc();
536
 
        return VTABLE_get_string(INTERP, val);
537
 
    }
538
 
 
539
 
 
540
 
    VTABLE void unshift_string(STRING *value) {
541
 
        PMC * const val = Parrot_pmc_new(INTERP, Parrot_hll_get_ctx_HLL_type(INTERP, enum_class_String));
542
 
        VTABLE_set_string_native(INTERP, val, value);
543
 
        SELF.unshift_pmc(val);
544
 
    }
545
 
 
546
 
}
547
 
 
548
 
/*
549
 
 
550
 
=back
551
 
 
552
 
=cut
553
 
 
554
 
*/