@@ -1462,79 +1462,6 @@ inline op multi_dispatch_over_lexical_candidates(out PMC) :base_core {
1462
1462
VTABLE_get_string(interp, CONTEXT_STRUCT(CURRENT_CONTEXT(interp))->current_sub));
1463
1463
}
1464
1464
1465
- /*
1466
-
1467
- =item create_dispatch_and_add_candidates()
1468
-
1469
- Creates an instantiation of the dispatch routine (or proto, which may
1470
- serve as one) supplied and augments it with the provided candidates.
1471
- It relies on being passed the instantiation of the dispatcher from the
1472
- last outer scope that had an instantiation, and we thus take its
1473
- candidates.
1474
-
1475
- $1 will be set to the new, augmented dispatch routine. $2 is the proto
1476
- or instantiation of it to clone. $3 is an array of candidates to add.
1477
-
1478
- =cut
1479
-
1480
- */
1481
- inline op create_dispatch_and_add_candidates(out PMC, invar PMC, invar PMC) :base_core {
1482
- /* Ensure we have a dispatcher. */
1483
- if ($2->vtable->base_type == disp_id) {
1484
- /* Copy it (which makes an "instance") and add new candidates. */
1485
- PMC * copy = VTABLE_clone(interp, $2);
1486
- INTVAL i = 0;
1487
- INTVAL to_add = VTABLE_elements(interp, $3);
1488
- PARROT_DISPATCHERSUB(copy)->dispatchees = VTABLE_clone(interp,
1489
- PARROT_DISPATCHERSUB($2)->dispatchees);
1490
- PARROT_GC_WRITE_BARRIER(interp, copy);
1491
- for (i = 0; i < to_add; i++)
1492
- VTABLE_push_pmc(interp, PARROT_DISPATCHERSUB(copy)->dispatchees,
1493
- VTABLE_get_pmc_keyed_int(interp, $3, i));
1494
- $1 = copy;
1495
- }
1496
- else
1497
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
1498
- "Can only use create_dispatch_and_add_candidates if first operand is a DispatcherSub.");
1499
- }
1500
-
1501
- /*
1502
-
1503
- =item push_dispatchee()
1504
-
1505
- Adds a single new code object to the end of a dispatcher's dispatchee list.
1506
-
1507
- =cut
1508
-
1509
- */
1510
- inline op push_dispatchee(invar PMC, invar PMC) :base_core {
1511
- if ($1->vtable->base_type == disp_id) {
1512
- if (PMC_IS_NULL(PARROT_DISPATCHERSUB($1)->dispatchees)) {
1513
- PARROT_DISPATCHERSUB($1)->dispatchees = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
1514
- PARROT_GC_WRITE_BARRIER(interp, $1);
1515
- }
1516
- VTABLE_push_pmc(interp, PARROT_DISPATCHERSUB($1)->dispatchees, $2);
1517
- }
1518
- else
1519
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
1520
- "Can only use push_dispatchee if first operand is a DispatcherSub.");
1521
- }
1522
-
1523
- /*
1524
-
1525
- =item is_dispatcher()
1526
-
1527
- Checks if a routine is considered a dispatcher (that is, if it has a
1528
- list of dispatchees).
1529
-
1530
- =cut
1531
-
1532
- */
1533
- inline op is_dispatcher(out INT, invar PMC) :base_core {
1534
- $1 = $2->vtable->base_type == disp_id;
1535
- }
1536
-
1537
-
1538
1465
/*
1539
1466
1540
1467
=item set_sub_multisig()
0 commit comments