docs/deprecations/deprecations_3_0.pod - Parrot Deprecations for 3.0
Parrot Deprecations for 3.0.
The PARROT_ERRORS_GLOBALS_FLAG constant has been removed.
This flag does not modify the behaviour of parrot in any way.
Remove all code attempting to set/unset this flag.
It didn't do anything anyways.
The CodeString PMC has been removed
Equivalent and more efficient functionality is available from StringBuilder.
CodeString contains a number of convenience methods in addition to its core functionality.
It is easier to replace these first.
CodeString.lineof can be replaced by PGE;Util;line_number
CodeString.unique can be replaced by PGE;Util;unique, PAST;Compiler;unique, or PAST;Compiler;uniquereg
CodeString.escape can be replaced by PGE;Util;pir_str_escape
CodeString.key can be replaced by PGE;Util;pir_key_escape
CodeString.charname_to_ord can be replaced by the find_codepoint opcode
After these replacements, StringBuilder can be substituted for CodeString by changing .emit to .append_format. append_format does not add newlines, so these must be added to the format string.
The :unique_reg flag on registers in PIR is no longer available.
It doesn't do anything.
Also, this is a terrible way to work around register allocator failures if/when we get a register allocator.
s/:unique_reg//g
Specifying the type of call being performed is no longer required thanks to the magic of virtual dispatch.
They're old, crufty, and don't do anything that cannot be achieved by .call.
Except obfuscasion of course.
Use .call. It should be a simple text replacement fix.
Opcodes that access registers that are not their direct arguments are deprecated.
Note, however, that direct arguments does include keys and pcc ops.
Ops that are known to have this behaviour are clear{i,n,s,p} and set{i,n,s,p}_ind.
These have been removed. No other core ops are known to have this behaviour. If you've created a dynop that has this behaviour, it and code using it is subject to breakage without notice (we reserve the right to implement optimizers).
They don't fit well with the level of the rest of parrot's opcodes. They make register lifetime analysis impossible, preventing many optimizations.
If you really are using this, rethink your code. Stop using the register frame as an aggregate. Use an object aggregate in stead.
The exchange ops are deprecated.
They operate at too low a level to be useful as parrot ops.
You aren't using this. Seriously?
.macro xchg_int(a, b)
$I0 = .a
.a = .b
.b = $I0
.endm
PIR string literals of the form
encoding:charset:"string"
are deprecated.
After the charset/encoding merge, they're unneeded.
They can be replaced with
encoding:"string"
The encoding should be one of the new unified encodings.
The string_* functions have been deprecated for a while.
The remaining functions are:
string_make
string_ord
string_chr
string_to_cstring_nullable
string_max_bytes
string_increment
They're old cruft.
string_make should be replaced with Parrot_str_new_init. You can use Parrot_find_encoding to get an encoding from a cstring.
Replace string_ord with Parrot_str_indexed.
Replace string_chr with Parrot_str_chr.
Replace string_to_cstring_nullable with Parrot_str_to_cstring.
string_max_bytes and string_increment will be removed.
The method lower in the String PMC has been removed.
HLLs may need its own version with different name and semantic, having a generic one is confusing. For other usages string registers are more convenient.
Use string registers and the downcase opcode.
For HLLs, provide its own version in the HLL mapped String type.