Add assert to ensure we never reach this code unless we have a mach-node with a barrier.
Proposed change in src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
RegMask& ZLoadBarrierStubC2::live() const {
- return *barrier_set_state()->live(_node);
+ RegMask* mask = barrier_set_state()->live(_node);
+ assert(mask!=NULL, "must be mach-node with barrier");
+ return *mask;
}
With the current code this passes, it is only to ensure we do not violate assumptions in the future.
Proposed change in src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
RegMask& ZLoadBarrierStubC2::live() const {
- return *barrier_set_state()->live(_node);
+ RegMask* mask = barrier_set_state()->live(_node);
+ assert(mask!=NULL, "must be mach-node with barrier");
+ return *mask;
}
With the current code this passes, it is only to ensure we do not violate assumptions in the future.