Skip to content

Commit 780c4a3

Browse files
committed
Fix ops...and we have a working/test-passing NQP build again.
1 parent af15c58 commit 780c4a3

File tree

3 files changed

+42
-42
lines changed

3 files changed

+42
-42
lines changed

src/ops/nqp.ops

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ inline op repr_get_attr_obj(out PMC, in PMC, in PMC, in STR) :base_core {
269269
PMC *ch = decontainerize(interp, $3);
270270
if ($2->vtable->base_type == smo_id) {
271271
if (IS_CONCRETE($2))
272-
$1 = REPR($2)->get_attribute_boxed(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT);
272+
$1 = REPR($2)->attr_funcs->get_attribute_boxed(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT);
273273
else
274274
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
275275
"Cannot look up attributes in a type object");
@@ -294,7 +294,7 @@ inline op repr_get_attr_int(out INT, in PMC, in PMC, in STR) :base_core {
294294
PMC *ch = decontainerize(interp, $3);
295295
if ($2->vtable->base_type == smo_id) {
296296
if (IS_CONCRETE($2))
297-
$1 = *((INTVAL *)REPR($2)->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT));
297+
$1 = *((INTVAL *)REPR($2)->attr_funcs->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT));
298298
else
299299
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
300300
"Cannot look up attributes in a type object");
@@ -318,7 +318,7 @@ inline op repr_get_attr_num(out NUM, in PMC, in PMC, in STR) :base_core {
318318
PMC *ch = decontainerize(interp, $3);
319319
if ($2->vtable->base_type == smo_id) {
320320
if (IS_CONCRETE($2))
321-
$1 = *((FLOATVAL *)REPR($2)->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT));
321+
$1 = *((FLOATVAL *)REPR($2)->attr_funcs->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT));
322322
else
323323
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
324324
"Cannot look up attributes in a type object");
@@ -343,7 +343,7 @@ inline op repr_get_attr_str(out STR, in PMC, in PMC, in STR) :base_core {
343343
PMC *ch = decontainerize(interp, $3);
344344
if ($2->vtable->base_type == smo_id) {
345345
if (IS_CONCRETE($2))
346-
$1 = *((STRING **)REPR($2)->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT));
346+
$1 = *((STRING **)REPR($2)->attr_funcs->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT));
347347
else
348348
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
349349
"Cannot look up attributes in a type object");
@@ -368,7 +368,7 @@ inline op repr_bind_attr_obj(in PMC, in PMC, in STR, in PMC) :base_core {
368368
PMC *ch = decontainerize(interp, $2);
369369
if ($1->vtable->base_type == smo_id) {
370370
if (IS_CONCRETE($1))
371-
REPR($1)->bind_attribute_boxed(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, $4);
371+
REPR($1)->attr_funcs->bind_attribute_boxed(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, $4);
372372
else
373373
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
374374
"Cannot bind to attributes in a type object");
@@ -394,7 +394,7 @@ inline op repr_bind_attr_int(in PMC, in PMC, in STR, in INT) :base_core {
394394
PMC *ch = decontainerize(interp, $2);
395395
if ($1->vtable->base_type == smo_id) {
396396
if (IS_CONCRETE($1))
397-
REPR($1)->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, &$4);
397+
REPR($1)->attr_funcs->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, &$4);
398398
else
399399
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
400400
"Cannot bind to attributes in a type object");
@@ -419,7 +419,7 @@ inline op repr_bind_attr_num(in PMC, in PMC, in STR, in NUM) :base_core {
419419
PMC *ch = decontainerize(interp, $2);
420420
if ($1->vtable->base_type == smo_id) {
421421
if (IS_CONCRETE($1))
422-
REPR($1)->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, &$4);
422+
REPR($1)->attr_funcs->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, &$4);
423423
else
424424
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
425425
"Cannot bind to attributes in a type object");
@@ -444,7 +444,7 @@ inline op repr_bind_attr_str(in PMC, in PMC, in STR, in STR) :base_core {
444444
PMC *ch = decontainerize(interp, $2);
445445
if ($1->vtable->base_type == smo_id) {
446446
if (IS_CONCRETE($1))
447-
REPR($1)->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, &$4);
447+
REPR($1)->attr_funcs->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, NO_HINT, &$4);
448448
else
449449
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
450450
"Cannot bind to attributes in a type object");
@@ -469,7 +469,7 @@ inline op repr_get_attr_obj(out PMC, in PMC, in PMC, in STR, in INT) :base_core
469469
PMC *ch = decontainerize(interp, $3);
470470
if ($2->vtable->base_type == smo_id) {
471471
if (IS_CONCRETE($2))
472-
$1 = REPR($2)->get_attribute_boxed(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5);
472+
$1 = REPR($2)->attr_funcs->get_attribute_boxed(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5);
473473
else
474474
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
475475
"Cannot look up attributes in a type object");
@@ -494,7 +494,7 @@ inline op repr_get_attr_int(out INT, in PMC, in PMC, in STR, in INT) :base_core
494494
PMC *ch = decontainerize(interp, $3);
495495
if ($2->vtable->base_type == smo_id) {
496496
if (IS_CONCRETE($2))
497-
$1 = *((INTVAL *)REPR($2)->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5));
497+
$1 = *((INTVAL *)REPR($2)->attr_funcs->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5));
498498
else
499499
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
500500
"Cannot look up attributes in a type object");
@@ -519,7 +519,7 @@ inline op repr_get_attr_num(out NUM, in PMC, in PMC, in STR, in INT) :base_core
519519
PMC *ch = decontainerize(interp, $3);
520520
if ($2->vtable->base_type == smo_id) {
521521
if (IS_CONCRETE($2))
522-
$1 = *((FLOATVAL *)REPR($2)->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5));
522+
$1 = *((FLOATVAL *)REPR($2)->attr_funcs->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5));
523523
else
524524
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
525525
"Cannot look up attributes in a type object");
@@ -544,7 +544,7 @@ inline op repr_get_attr_str(out STR, in PMC, in PMC, in STR, in INT) :base_core
544544
PMC *ch = decontainerize(interp, $3);
545545
if ($2->vtable->base_type == smo_id) {
546546
if (IS_CONCRETE($2))
547-
$1 = *((STRING **)REPR($2)->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5));
547+
$1 = *((STRING **)REPR($2)->attr_funcs->get_attribute_ref(interp, STABLE($2), OBJECT_BODY($2), ch, $4, $5));
548548
else
549549
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
550550
"Cannot look up attributes in a type object");
@@ -569,7 +569,7 @@ inline op repr_bind_attr_obj(in PMC, in PMC, in STR, in INT, in PMC) :base_core
569569
PMC *ch = decontainerize(interp, $2);
570570
if ($1->vtable->base_type == smo_id) {
571571
if (IS_CONCRETE($1))
572-
REPR($1)->bind_attribute_boxed(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, $5);
572+
REPR($1)->attr_funcs->bind_attribute_boxed(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, $5);
573573
else
574574
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
575575
"Cannot bind to attributes in a type object");
@@ -595,7 +595,7 @@ inline op repr_bind_attr_int(in PMC, in PMC, in STR, in INT, in INT) :base_core
595595
PMC *ch = decontainerize(interp, $2);
596596
if ($1->vtable->base_type == smo_id) {
597597
if (IS_CONCRETE($1))
598-
REPR($1)->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, &$5);
598+
REPR($1)->attr_funcs->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, &$5);
599599
else
600600
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
601601
"Cannot bind to attributes in a type object");
@@ -620,7 +620,7 @@ inline op repr_bind_attr_num(in PMC, in PMC, in STR, in INT, in NUM) :base_core
620620
PMC *ch = decontainerize(interp, $2);
621621
if ($1->vtable->base_type == smo_id) {
622622
if (IS_CONCRETE($1))
623-
REPR($1)->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, &$5);
623+
REPR($1)->attr_funcs->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, &$5);
624624
else
625625
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
626626
"Cannot bind to attributes in a type object");
@@ -645,7 +645,7 @@ inline op repr_bind_attr_str(in PMC, in PMC, in STR, in INT, in STR) :base_core
645645
PMC *ch = decontainerize(interp, $2);
646646
if ($1->vtable->base_type == smo_id) {
647647
if (IS_CONCRETE($1))
648-
REPR($1)->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, &$5);
648+
REPR($1)->attr_funcs->bind_attribute_ref(interp, STABLE($1), OBJECT_BODY($1), ch, $3, $4, &$5);
649649
else
650650
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
651651
"Cannot bind to attributes in a type object");
@@ -671,7 +671,7 @@ inline op repr_is_attr_initialized(out INT, in PMC, in PMC, in STR) :base_core {
671671
PMC *ch = decontainerize(interp, $3);
672672
if ($2->vtable->base_type == smo_id) {
673673
if (IS_CONCRETE($2))
674-
$1 = REPR($2)->is_attribute_initialized(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT);
674+
$1 = REPR($2)->attr_funcs->is_attribute_initialized(interp, STABLE($2), OBJECT_BODY($2), ch, $4, NO_HINT);
675675
else
676676
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
677677
"Cannot check initializedness of attributes in a type object");
@@ -866,7 +866,7 @@ inline op repr_unbox_str(out STR, in PMC) :base_core {
866866
PMC *var = decontainerize(interp, $2);
867867
if (var->vtable->base_type == smo_id) {
868868
if (IS_CONCRETE(var))
869-
$1 = REPR(var)->get_str(interp, STABLE(var), OBJECT_BODY(var));
869+
$1 = REPR(var)->box_funcs->get_str(interp, STABLE(var), OBJECT_BODY(var));
870870
else
871871
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
872872
"Cannot unbox a type object as a native str");
@@ -890,7 +890,7 @@ inline op repr_unbox_int(out INT, in PMC) :base_core {
890890
PMC *var = decontainerize(interp, $2);
891891
if (var->vtable->base_type == smo_id) {
892892
if (IS_CONCRETE(var))
893-
$1 = REPR(var)->get_int(interp, STABLE(var), OBJECT_BODY(var));
893+
$1 = REPR(var)->box_funcs->get_int(interp, STABLE(var), OBJECT_BODY(var));
894894
else
895895
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
896896
"Cannot unbox a type object as a native int");
@@ -914,7 +914,7 @@ inline op repr_unbox_num(out NUM, in PMC) :base_core {
914914
PMC *var = decontainerize(interp, $2);
915915
if (var->vtable->base_type == smo_id) {
916916
if (IS_CONCRETE(var))
917-
$1 = REPR(var)->get_num(interp, STABLE(var), OBJECT_BODY(var));
917+
$1 = REPR(var)->box_funcs->get_num(interp, STABLE(var), OBJECT_BODY(var));
918918
else
919919
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
920920
"Cannot unbox a type object as a native num");
@@ -939,7 +939,7 @@ inline op repr_box_str(out PMC, in STR, in PMC) :base_core {
939939
if (type->vtable->base_type == smo_id) {
940940
$1 = REPR(type)->allocate(interp, STABLE(type));
941941
REPR($1)->initialize(interp, STABLE(type), OBJECT_BODY($1));
942-
REPR($1)->set_str(interp, STABLE($1), OBJECT_BODY($1), $2);
942+
REPR($1)->box_funcs->set_str(interp, STABLE($1), OBJECT_BODY($1), $2);
943943
PARROT_GC_WRITE_BARRIER(interp, $1);
944944
}
945945
else
@@ -961,7 +961,7 @@ inline op repr_box_int(out PMC, in INT, in PMC) :base_core {
961961
if (type->vtable->base_type == smo_id) {
962962
$1 = REPR(type)->allocate(interp, STABLE(type));
963963
REPR($1)->initialize(interp, STABLE(type), OBJECT_BODY($1));
964-
REPR($1)->set_int(interp, STABLE($1), OBJECT_BODY($1), $2);
964+
REPR($1)->box_funcs->set_int(interp, STABLE($1), OBJECT_BODY($1), $2);
965965
}
966966
else
967967
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
@@ -982,7 +982,7 @@ inline op repr_box_num(out PMC, in NUM, in PMC) :base_core {
982982
if (type->vtable->base_type == smo_id) {
983983
$1 = REPR(type)->allocate(interp, STABLE(type));
984984
REPR($1)->initialize(interp, STABLE(type), OBJECT_BODY($1));
985-
REPR($1)->set_num(interp, STABLE($1), OBJECT_BODY($1), $2);
985+
REPR($1)->box_funcs->set_num(interp, STABLE($1), OBJECT_BODY($1), $2);
986986
}
987987
else
988988
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
@@ -1260,7 +1260,7 @@ inline op stable_publish_vtable_handler_mapping(in PMC, in PMC) :base_core {
12601260
st->parrot_vtable_handler_mapping[idx].class_handle = class_handle;
12611261
st->parrot_vtable_handler_mapping[idx].attr_name = attr_name;
12621262
st->parrot_vtable_handler_mapping[idx].hint =
1263-
REPR(class_handle)->hint_for(interp, st, class_handle, attr_name);
1263+
REPR(class_handle)->attr_funcs->hint_for(interp, st, class_handle, attr_name);
12641264
}
12651265
else
12661266
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
@@ -1501,7 +1501,7 @@ Gets lookup hint for an attribute.
15011501
inline op repr_hint_for(out INT, in PMC, in PMC, in STR) :base_core {
15021502
PMC *ch = decontainerize(interp, $3);
15031503
if ($2->vtable->base_type == smo_id)
1504-
$1 = REPR($2)->hint_for(interp, STABLE($2), $3, $4);
1504+
$1 = REPR($2)->attr_funcs->hint_for(interp, STABLE($2), $3, $4);
15051505
else
15061506
$1 = NO_HINT;
15071507
}

src/ops/nqp_bigint.ops

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static mp_int * get_bigint(PARROT_INTERP, PMC *obj) {
1515
if (r->ID == bigint_repr_id)
1616
return &((P6bigintInstance *)PMC_data(obj))->body.i;
1717
else
18-
return &((P6bigintBody *)r->get_boxed_ref(interp, STABLE(obj), OBJECT_BODY(obj),
18+
return &((P6bigintBody *)r->box_funcs->get_boxed_ref(interp, STABLE(obj), OBJECT_BODY(obj),
1919
bigint_repr_id))->i;
2020
}
2121

@@ -418,7 +418,7 @@ inline op nqp_bigint_radix(out PMC, in INT, in STR, in INT, in INT, in PMC) :bas
418418

419419
pos_obj = REPR($6)->allocate(interp, STABLE($6));
420420
REPR(pos_obj)->initialize(interp, STABLE(pos_obj), OBJECT_BODY(pos_obj));
421-
REPR(pos_obj)->set_int(interp, STABLE(pos_obj), OBJECT_BODY(pos_obj), pos);
421+
REPR(pos_obj)->box_funcs->set_int(interp, STABLE(pos_obj), OBJECT_BODY(pos_obj), pos);
422422

423423
if (neg || flags & 0x01) { mp_neg(value, value); }
424424
out = Parrot_pmc_new(interp, enum_class_FixedPMCArray);
@@ -466,10 +466,10 @@ inline op nqp_bigint_pow(out PMC, in PMC, in PMC, in PMC) :base_core {
466466
REPR($1)->initialize(interp, STABLE($1), OBJECT_BODY($1));
467467
/* TODO: better ways to create +- Inf */
468468
if (MP_GT == cmp) {
469-
REPR($1)->set_num(interp, STABLE($1), OBJECT_BODY($1), (FLOATVAL) 1.0/ZERO);
469+
REPR($1)->box_funcs->set_num(interp, STABLE($1), OBJECT_BODY($1), (FLOATVAL) 1.0/ZERO);
470470
}
471471
else {
472-
REPR($1)->set_num(interp, STABLE($1), OBJECT_BODY($1), (FLOATVAL) -1.0/ZERO);
472+
REPR($1)->box_funcs->set_num(interp, STABLE($1), OBJECT_BODY($1), (FLOATVAL) -1.0/ZERO);
473473
}
474474
}
475475
}
@@ -485,7 +485,7 @@ inline op nqp_bigint_pow(out PMC, in PMC, in PMC, in PMC) :base_core {
485485
FLOATVAL f_exp = mp_get_double(exponent);
486486
$1 = REPR($4)->allocate(interp, STABLE($4));
487487
REPR($1)->initialize(interp, STABLE($1), OBJECT_BODY($1));
488-
REPR($1)->set_num(interp, STABLE($1), OBJECT_BODY($1), pow(f_base, f_exp));
488+
REPR($1)->box_funcs->set_num(interp, STABLE($1), OBJECT_BODY($1), pow(f_base, f_exp));
489489
}
490490
}
491491

0 commit comments

Comments
 (0)