Skip to content

Commit

Permalink
Stub in fc (fold case) op.
Browse files Browse the repository at this point in the history
Just as an alias for lc at present.
  • Loading branch information
jnthn committed Oct 7, 2015
1 parent f09c782 commit 6aecd2a
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 149 deletions.
192 changes: 99 additions & 93 deletions lib/MAST/Ops.nqp
Expand Up @@ -698,58 +698,59 @@ BEGIN {
1721,
1723,
1725,
1725,
1727,
1727,
1729,
1732,
1735,
1731,
1734,
1737,
1739,
1741,
1743,
1745,
1748,
1751,
1754,
1757,
1758,
1747,
1750,
1753,
1756,
1759,
1760,
1764,
1767,
1770,
1773,
1776,
1779,
1782,
1785,
1788,
1791,
1794,
1797,
1800,
1803,
1806,
1809,
1812,
1816,
1820,
1823,
1826,
1829,
1832,
1835,
1838,
1841,
1842,
1762,
1766,
1769,
1772,
1775,
1778,
1781,
1784,
1787,
1790,
1793,
1796,
1799,
1802,
1805,
1808,
1811,
1814,
1818,
1822,
1825,
1828,
1831,
1834,
1837,
1840,
1843,
1844,
1846,
1848,
1848,
1848,
1849,
1850,
1850,
1851);
1850,
1851,
1852,
1852,
1853);
MAST::Ops.WHO<@counts> := nqp::list_i(0,
2,
2,
Expand Down Expand Up @@ -1444,6 +1445,7 @@ BEGIN {
2,
2,
2,
2,
0,
2,
2,
Expand Down Expand Up @@ -3220,6 +3222,8 @@ BEGIN {
65,
34,
65,
58,
57,
65,
16,
65,
Expand Down Expand Up @@ -4043,60 +4047,61 @@ BEGIN {
'numdimensions', 690,
'ctxcode', 691,
'isrwcont', 692,
'sp_log', 693,
'sp_osrfinalize', 694,
'sp_guardconc', 695,
'sp_guardtype', 696,
'sp_guardcontconc', 697,
'sp_guardconttype', 698,
'sp_getarg_o', 699,
'sp_getarg_i', 700,
'sp_getarg_n', 701,
'sp_getarg_s', 702,
'sp_fastinvoke_v', 703,
'sp_fastinvoke_i', 704,
'sp_fastinvoke_n', 705,
'sp_fastinvoke_s', 706,
'sp_fastinvoke_o', 707,
'sp_namedarg_used', 708,
'sp_getspeshslot', 709,
'sp_findmeth', 710,
'sp_fastcreate', 711,
'sp_get_o', 712,
'sp_get_i64', 713,
'sp_get_i32', 714,
'sp_get_i16', 715,
'sp_get_i8', 716,
'sp_get_n', 717,
'sp_get_s', 718,
'sp_bind_o', 719,
'sp_bind_i64', 720,
'sp_bind_i32', 721,
'sp_bind_i16', 722,
'sp_bind_i8', 723,
'sp_bind_n', 724,
'sp_bind_s', 725,
'sp_p6oget_o', 726,
'sp_p6ogetvt_o', 727,
'sp_p6ogetvc_o', 728,
'sp_p6oget_i', 729,
'sp_p6oget_n', 730,
'sp_p6oget_s', 731,
'sp_p6obind_o', 732,
'sp_p6obind_i', 733,
'sp_p6obind_n', 734,
'sp_p6obind_s', 735,
'sp_jit_enter', 736,
'sp_boolify_iter', 737,
'sp_boolify_iter_arr', 738,
'sp_boolify_iter_hash', 739,
'prof_enter', 740,
'prof_enterspesh', 741,
'prof_enterinline', 742,
'prof_enternative', 743,
'prof_exit', 744,
'prof_allocated', 745,
'ctw_check', 746);
'fc', 693,
'sp_log', 694,
'sp_osrfinalize', 695,
'sp_guardconc', 696,
'sp_guardtype', 697,
'sp_guardcontconc', 698,
'sp_guardconttype', 699,
'sp_getarg_o', 700,
'sp_getarg_i', 701,
'sp_getarg_n', 702,
'sp_getarg_s', 703,
'sp_fastinvoke_v', 704,
'sp_fastinvoke_i', 705,
'sp_fastinvoke_n', 706,
'sp_fastinvoke_s', 707,
'sp_fastinvoke_o', 708,
'sp_namedarg_used', 709,
'sp_getspeshslot', 710,
'sp_findmeth', 711,
'sp_fastcreate', 712,
'sp_get_o', 713,
'sp_get_i64', 714,
'sp_get_i32', 715,
'sp_get_i16', 716,
'sp_get_i8', 717,
'sp_get_n', 718,
'sp_get_s', 719,
'sp_bind_o', 720,
'sp_bind_i64', 721,
'sp_bind_i32', 722,
'sp_bind_i16', 723,
'sp_bind_i8', 724,
'sp_bind_n', 725,
'sp_bind_s', 726,
'sp_p6oget_o', 727,
'sp_p6ogetvt_o', 728,
'sp_p6ogetvc_o', 729,
'sp_p6oget_i', 730,
'sp_p6oget_n', 731,
'sp_p6oget_s', 732,
'sp_p6obind_o', 733,
'sp_p6obind_i', 734,
'sp_p6obind_n', 735,
'sp_p6obind_s', 736,
'sp_jit_enter', 737,
'sp_boolify_iter', 738,
'sp_boolify_iter_arr', 739,
'sp_boolify_iter_hash', 740,
'prof_enter', 741,
'prof_enterspesh', 742,
'prof_enterinline', 743,
'prof_enternative', 744,
'prof_exit', 745,
'prof_allocated', 746,
'ctw_check', 747);
MAST::Ops.WHO<@names> := nqp::list_s('no_op',
'const_i8',
'const_i16',
Expand Down Expand Up @@ -4790,6 +4795,7 @@ BEGIN {
'numdimensions',
'ctxcode',
'isrwcont',
'fc',
'sp_log',
'sp_osrfinalize',
'sp_guardconc',
Expand Down
4 changes: 4 additions & 0 deletions src/core/interp.c
Expand Up @@ -4707,6 +4707,10 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
cur_op += 4;
goto NEXT;
}
OP(fc):
GET_REG(cur_op, 0).s = MVM_string_fc(tc, GET_REG(cur_op, 2).s);
cur_op += 4;
goto NEXT;
OP(sp_log):
if (tc->cur_frame->spesh_log_idx >= 0) {
MVM_ASSIGN_REF(tc, &(tc->cur_frame->static_info->common.header),
Expand Down
2 changes: 1 addition & 1 deletion src/core/oplabels.h
Expand Up @@ -694,6 +694,7 @@ static const void * const LABELS[] = {
&&OP_numdimensions,
&&OP_ctxcode,
&&OP_isrwcont,
&&OP_fc,
&&OP_sp_log,
&&OP_sp_osrfinalize,
&&OP_sp_guardconc,
Expand Down Expand Up @@ -1024,7 +1025,6 @@ static const void * const LABELS[] = {
NULL,
NULL,
NULL,
NULL,
&&OP_CALL_EXTOP,
&&OP_CALL_EXTOP,
&&OP_CALL_EXTOP,
Expand Down
1 change: 1 addition & 0 deletions src/core/oplist
Expand Up @@ -731,6 +731,7 @@ setdimensions r(obj) r(obj)
numdimensions w(int64) r(obj)
ctxcode w(obj) r(obj)
isrwcont w(int64) r(obj)
fc w(str) r(str) :pure

# Spesh ops. Naming convention: start with sp_. Must all be marked .s, which
# is how the validator knows to exclude them.
Expand Down
13 changes: 12 additions & 1 deletion src/core/ops.c
Expand Up @@ -7616,6 +7616,17 @@ static const MVMOpInfo MVM_op_infos[] = {
0,
{ MVM_operand_write_reg | MVM_operand_int64, MVM_operand_read_reg | MVM_operand_obj }
},
{
MVM_OP_fc,
"fc",
" ",
2,
1,
0,
0,
0,
{ MVM_operand_write_reg | MVM_operand_str, MVM_operand_read_reg | MVM_operand_str }
},
{
MVM_OP_sp_log,
"sp_log",
Expand Down Expand Up @@ -8208,7 +8219,7 @@ static const MVMOpInfo MVM_op_infos[] = {
},
};

static const unsigned short MVM_op_counts = 747;
static const unsigned short MVM_op_counts = 748;

MVM_PUBLIC const MVMOpInfo * MVM_op_get_op(unsigned short op) {
if (op >= MVM_op_counts)
Expand Down

0 comments on commit 6aecd2a

Please sign in to comment.