We're updating the issue view to help you get more done. 

[enhancement from MRP] Improve edge counters for baseline compilers

Description

Quote from the original MRP issue ( https://web.archive.org/web/20150521201215/http://jira.codehaus.org/browse/MRP-11 ):

Currently our edge counters saturate at 0x7FFFFFFF which means hot code will often have saturated values on both branch edges. We should saturate at 0xFFFFFFFF.
Currently our code to increment an edge counter is:

1 2 3 4 5 mov x, [counter] add x, 1 js saturated mov [counter], x saturated:

by subtracting the carry if it occurs this code can saturate at 0xFFFFFFFF with:

1 2 3 4 mov x, [counter] add x, 1 sbb x, 0 mov [counter], x

We should check if the improvements could be applied to PPC. AFAIK PPC doesn't have instructions that can directly subtract the carry flag, but I might be wrong. I suppose we could add the carry flag to another empty scratch register and subtract that but I'm not sure if that would be a good idea.

Environment

None

Status

Assignee

Erik Brangs

Reporter

Erik Brangs

Labels

None

External issue ID

None

Components

Fix versions

Affects versions

3.1.3

Priority

Medium