Skip to content

Commit

Permalink
* update post barrier cost estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
tschatzl committed Dec 12, 2024
1 parent a3563e5 commit a4a0ef2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,13 @@ uint G1BarrierSetC2::estimated_barrier_size(const Node* node) const {
nodes += 50;
}
if ((barrier_data & G1C2BarrierPost) != 0) {
// Approximate the number of nodes needed with the number of Assembly instructions
// since we do not have real nodes.
nodes += 12;
// Approximate the number of nodes needed; an if costs 4 nodes (Cmp, Bool,
// If, If projection), any other (Assembly) instruction is approximated with
// a cost of 1.
nodes += 4 // base cost for the card write containing getting base offset, address calculation and the card write;
+ 6 // same region check: Uncompress (new_val) oop, xor, shr, (cmp), jmp
+ 4 // new_val is null check
+ 4; // card not clean check.
}
return nodes;
}
Expand Down

0 comments on commit a4a0ef2

Please sign in to comment.