Code Review for 6793828

Prepared by: Thomas Rodriguez (never) on Wed Feb 4 17:01:20 PST 2009
Workspace:/export/ws/g1
Compare against: /net/smite.sfbay/export/ws/baseline
Summary of changes: 7 lines changed: 3 ins; 2 del; 2 mod; 7393 unchg
Patch of changes: 6793828.patch
Author comments:
6793828: G1: invariant: queues are empty when activated
Reviewed-by:

G1 was failing because it was violating some invariants around the
SATB queue. It appeared that some code had updated the queue at a
time when they shouldn't have been. Inspection of compiled code
around safepoint taken near the failure indicated that loads from the
queue were floating above a safepoint poll, resulting in inconsistent
states in the SATB queue.

The root of the problem is that SafePointNodes don't produce a new raw
memory state so using memory dependence to ensure proper code emission
for the g1 write barrier doesn't work correctly all the time. The
load of raw memory can be moved above a prior safepoint. For now the
fix is to assign control to the all the loads involved in the write
barrier. Additionally there's some suspicious code in LoadNode::Ideal
that strips useless control that I've added a check for raw memory
too. Currently it won't trigger for these loads because the
ThreadLocal that forms the base is TypeRawPtr::BOTTOM but I think the
proper type for ThreadLocal is TypeRawPtr::NOTNULL. There are other
nodes which use TypeRawPtr::NOTNULL that might be at risk.

tested with g1 jbb

Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/opto/graphKit.cpp

5 lines changed: 2 ins; 2 del; 1 mod; 3440 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw src/share/vm/opto/memnode.cpp

2 lines changed: 1 ins; 0 del; 1 mod; 3953 unchg

This code review page was prepared using /net/smite.sfbay/never/bin/hgwebrev (vers 23.16-hg-never).