|
69 | 69 | #include "prims/jvmtiThreadState.hpp"
|
70 | 70 | #include "prims/methodComparator.hpp"
|
71 | 71 | #include "runtime/atomic.hpp"
|
| 72 | +#include "runtime/biasedLocking.hpp" |
72 | 73 | #include "runtime/fieldDescriptor.inline.hpp"
|
73 | 74 | #include "runtime/handles.inline.hpp"
|
74 | 75 | #include "runtime/javaCalls.hpp"
|
@@ -456,6 +457,12 @@ InstanceKlass::InstanceKlass(const ClassFileParser& parser, unsigned kind, Klass
|
456 | 457 | if (Arguments::is_dumping_archive()) {
|
457 | 458 | SystemDictionaryShared::init_dumptime_info(this);
|
458 | 459 | }
|
| 460 | + |
| 461 | + // Set biased locking bit for all instances of this class; it will be |
| 462 | + // cleared if revocation occurs too often for this type |
| 463 | + if (UseBiasedLocking && BiasedLocking::enabled()) { |
| 464 | + set_prototype_header(markWord::biased_locking_prototype()); |
| 465 | + } |
459 | 466 | }
|
460 | 467 |
|
461 | 468 | void InstanceKlass::deallocate_methods(ClassLoaderData* loader_data,
|
@@ -2408,6 +2415,11 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl
|
2408 | 2415 | // --> see ArrayKlass::complete_create_array_klass()
|
2409 | 2416 | array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);
|
2410 | 2417 | }
|
| 2418 | + |
| 2419 | + // Initialize current biased locking state. |
| 2420 | + if (UseBiasedLocking && BiasedLocking::enabled()) { |
| 2421 | + set_prototype_header(markWord::biased_locking_prototype()); |
| 2422 | + } |
2411 | 2423 | }
|
2412 | 2424 |
|
2413 | 2425 | // returns true IFF is_in_error_state() has been changed as a result of this call.
|
|
0 commit comments