NAME

docs/deprecations/deprecations_3_0.pod - Parrot Deprecations for 3.0

Parrot Deprecations for 3.0

PARROT_ERRORS_GLOBALS_FLAG

Description

The PARROT_ERRORS_GLOBALS_FLAG constant has been removed.

Rational

This flag does not modify the behaviour of parrot in any way.

Replacment

Remove all code attempting to set/unset this flag.

It didn't do anything anyways.

CodeString

Description

The CodeString PMC has been removed

Rational

Equivalent and more efficient functionality is available from StringBuilder.

Replacment

CodeString contains a number of convenience methods in addition to its core functionality.

It is easier to replace these first.

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.

:unique_reg PIR value flag

Description

The :unique_reg flag on registers in PIR is no longer available.

Rational

It doesn't do anything.

Also, this is a terrible way to work around register allocator failures if/when we get a register allocator.

Replacment

    s/:unique_reg//g

.nci_call and .meth_call PIR special forms

Specifying the type of call being performed is no longer required thanks to the magic of virtual dispatch.

Rational

They're old, crufty, and don't do anything that cannot be achieved by .call.

Except obfuscasion of course.

Replacment

Use .call. It should be a simple text replacement fix.

Indirect Register Access Ops

Description

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).

Rational

They don't fit well with the level of the rest of parrot's opcodes. They make register lifetime analysis impossible, preventing many optimizations.

Replacment

If you really are using this, rethink your code. Stop using the register frame as an aggregate. Use an object aggregate in stead.

Exchange Op

Description

The exchange ops are deprecated.

Rational

They operate at too low a level to be useful as parrot ops.

Replacment

You aren't using this. Seriously?

    .macro xchg_int(a, b)
        $I0 = .a
        .a = .b
        .b = $I0
    .endm

PIR string literals with charset and encoding are deprecated

Description

PIR string literals of the form

    encoding:charset:"string"

are deprecated.

Rational

After the charset/encoding merge, they're unneeded.

Replacment

They can be replaced with

    encoding:"string"

The encoding should be one of the new unified encodings.

Remaining string_* functions are deprecated

Description

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

Rational

They're old cruft.

Replacment

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.

Method lower in String PMC

Description

The method lower in the String PMC has been removed.

Rational

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.

Replacment

Use string registers and the downcase opcode.

For HLLs, provide its own version in the HLL mapped String type.