@@ -529,11 +529,17 @@ OopMapValue* ExplodedOopMap::copyOopMapValues(const ImmutableOopMap* oopMap, int
529
529
void ImmutableOopMap::generate_stub (const CodeBlob* cb) const {
530
530
/* The address of the ImmutableOopMap is put into the _freeze_stub and _thaw_stub
531
531
* if we can't generate the stub for some reason */
532
- if (_freeze_stub == NULL ) {
532
+ address default_value = Continuations::default_freeze_oops_stub ();
533
+ address slow_value = Continuations::freeze_oops_slow ();
534
+
535
+ assert (default_value != slow_value, " should not reach here!" );
536
+
537
+ if (_freeze_stub == default_value) {
533
538
OopMapStubGenerator cgen (cb, *this );
534
- if (Atomic::cmpxchg ((address) this , &_freeze_stub, (address) NULL ) == NULL ) {
539
+ // lock this by putting the slow path in place
540
+ if (Atomic::cmpxchg (slow_value, &_freeze_stub, default_value) == default_value) {
535
541
if (!cgen.generate ()) {
536
- Atomic::store ((address) this , &_thaw_stub);
542
+ Atomic::store ((address) Continuations::thaw_oops_slow () , &_thaw_stub);
537
543
cgen.free ();
538
544
return ;
539
545
}
@@ -833,7 +839,7 @@ const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) con
833
839
return last->get_from (this );
834
840
}
835
841
836
- ImmutableOopMap::ImmutableOopMap (const OopMap* oopmap) : _exploded(NULL ), _freeze_stub(NULL ) , _thaw_stub(NULL ), _count(oopmap->count ()), _num_oops(oopmap->num_oops ()) {
842
+ ImmutableOopMap::ImmutableOopMap (const OopMap* oopmap) : _exploded(NULL ), _freeze_stub(Continuations::default_freeze_oops_stub()) , _thaw_stub(Continuations::default_thaw_oops_stub() ), _count(oopmap->count ()), _num_oops(oopmap->num_oops ()) {
837
843
_num_oops = oopmap->num_oops ();
838
844
address addr = data_addr ();
839
845
// oopmap->copy_data_to(addr);
0 commit comments