File tree 4 files changed +12
-9
lines changed
4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 25
25
#include " precompiled.hpp"
26
26
#include " classfile/classLoaderData.inline.hpp"
27
27
#include " classfile/dictionary.hpp"
28
- #include " classfile/javaClasses.hpp"
28
+ #include " classfile/javaClasses.inline. hpp"
29
29
#include " classfile/systemDictionary.hpp"
30
30
#include " classfile/vmSymbols.hpp"
31
31
#include " gc/shared/collectedHeap.inline.hpp"
@@ -735,7 +735,7 @@ void Klass::verify_on(outputStream* st) {
735
735
}
736
736
737
737
if (java_mirror_no_keepalive () != NULL ) {
738
- guarantee (oopDesc::is_oop (java_mirror_no_keepalive ()), " should be instance" );
738
+ guarantee (java_lang_Class::is_instance (java_mirror_no_keepalive ()), " should be instance" );
739
739
}
740
740
}
741
741
Original file line number Diff line number Diff line change @@ -269,9 +269,8 @@ class Klass : public Metadata {
269
269
// Both mirrors are on the ClassLoaderData::_handles list already so no
270
270
// barriers are needed.
271
271
void set_java_mirror_handle (OopHandle mirror) { _java_mirror = mirror; }
272
- OopHandle java_mirror_handle () const {
273
- return _java_mirror;
274
- }
272
+ OopHandle java_mirror_handle () const { return _java_mirror; }
273
+ void swap_java_mirror_handle (OopHandle& mirror) { _java_mirror.swap (mirror); }
275
274
276
275
// modifier flags
277
276
jint modifier_flags () const { return _modifier_flags; }
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2017, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2017, 2022 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,10 @@ class OopHandle {
43
43
OopHandle () : _obj(NULL ) {}
44
44
OopHandle (oop* w) : _obj(w) {}
45
45
46
+ void swap (OopHandle& copy) {
47
+ ::swap (_obj, copy._obj);
48
+ }
49
+
46
50
inline oop resolve () const ;
47
51
inline oop peek () const ;
48
52
Original file line number Diff line number Diff line change @@ -411,14 +411,14 @@ class RedefineVerifyMark : public StackObj {
411
411
JvmtiThreadState *state) : _state(state), _scratch_class(scratch_class)
412
412
{
413
413
_state->set_class_versions_map (the_class, scratch_class);
414
- _scratch_mirror = _scratch_class ->java_mirror_handle ();
415
- _scratch_class->set_java_mirror_handle (the_class-> java_mirror_handle () );
414
+ _scratch_mirror = the_class ->java_mirror_handle (); // this is a copy that is swapped
415
+ _scratch_class->swap_java_mirror_handle (_scratch_mirror );
416
416
}
417
417
418
418
~RedefineVerifyMark () {
419
419
// Restore the scratch class's mirror, so when scratch_class is removed
420
420
// the correct mirror pointing to it can be cleared.
421
- _scratch_class->set_java_mirror_handle (_scratch_mirror);
421
+ _scratch_class->swap_java_mirror_handle (_scratch_mirror);
422
422
_state->clear_class_versions_map ();
423
423
}
424
424
};
You can’t perform that action at this time.
0 commit comments