#1138: Create a 'vivify' opcode
-----------------------------+----------------------------------------------
Reporter: Austin_Hastings | Type: todo
Status: new | Priority: normal
Milestone: | Component: core
Version: 1.7.0 | Severity: medium
Keywords: | Lang:
Patch: | Platform:
-----------------------------+----------------------------------------------
PCT generates a lot of code that looks like:
{{{
find_lex $P99, '$var'
unless_null $P99, vivify_22
$P99 = new 'Undef'
vivify_22:
}}}
In kakapo.pir, a library of 21872 lines (wc-l) of NQP generated pir, there
were 1381 occurrences of this pattern. (Grep ", vivify_" | wc -l)
This is 6.3% of the total file size, including infrastructure. It's surely
a larger fraction of the "real" code. (In fact, that's one of three lines
the pattern uses. So the pattern is actually something like 19% of the
total lines in the file.)
Converting these two opcodes:
{{{
unless-null P, IC
new P, SC
}}}
into 1 opcode:
{{{
vivify P, SC
}}}
would reduce the pir size by that 6%, since it eliminates one of the lines
entirely. Per a conversation with chromatic this evening, we expect about
a 2-3% reduction is pbc size (pir lines != opcode words) and a
corresponding 2-3% increase in execution speed.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1138>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets