@@ -315,14 +315,14 @@ static bool _no_progress_skip_increment = false;
315315// These checks are required for wait, notify and exit to avoid inflating the monitor to
316316// find out this inline type object cannot be locked.
317317#define CHECK_THROW_NOSYNC_IMSE (obj ) \
318- if (EnableValhalla && (obj)->mark ().is_inline_type()) { \
318+ if ((obj)->mark ().is_inline_type()) { \
319319 JavaThread* THREAD = current; \
320320 ResourceMark rm (THREAD); \
321321 THROW_MSG (vmSymbols::java_lang_IllegalMonitorStateException (), obj->klass ()->external_name ()); \
322322 }
323323
324324#define CHECK_THROW_NOSYNC_IMSE_0 (obj ) \
325- if (EnableValhalla && (obj)->mark ().is_inline_type()) { \
325+ if ((obj)->mark ().is_inline_type()) { \
326326 JavaThread* THREAD = current; \
327327 ResourceMark rm (THREAD); \
328328 THROW_MSG_0 (vmSymbols::java_lang_IllegalMonitorStateException (), obj->klass ()->external_name ()); \
@@ -354,7 +354,7 @@ bool ObjectSynchronizer::quick_notify(oopDesc* obj, JavaThread* current, bool al
354354 assert (current->thread_state () == _thread_in_Java, " invariant" );
355355 NoSafepointVerifier nsv;
356356 if (obj == nullptr ) return false ; // slow-path for invalid obj
357- assert (!EnableValhalla || ! obj->klass ()->is_inline_klass (), " monitor op on inline type" );
357+ assert (!obj->klass ()->is_inline_klass (), " monitor op on inline type" );
358358 const markWord mark = obj->mark ();
359359
360360 if (mark.is_fast_locked () && current->lock_stack ().contains (cast_to_oop (obj))) {
@@ -446,7 +446,7 @@ void ObjectSynchronizer::enter_for(Handle obj, BasicLock* lock, JavaThread* lock
446446 // the locking_thread with respect to the current thread. Currently only used when
447447 // deoptimizing and re-locking locks. See Deoptimization::relock_objects
448448 assert (locking_thread == Thread::current () || locking_thread->is_obj_deopt_suspend (), " must be" );
449- assert (!EnableValhalla || ! obj->klass ()->is_inline_klass (), " JITed code should never have locked an instance of a value class" );
449+ assert (!obj->klass ()->is_inline_klass (), " JITed code should never have locked an instance of a value class" );
450450 return LightweightSynchronizer::enter_for (obj, lock, locking_thread);
451451}
452452
@@ -463,7 +463,7 @@ void ObjectSynchronizer::jni_enter(Handle obj, JavaThread* current) {
463463 handle_sync_on_value_based_class (obj, current);
464464 }
465465
466- if (EnableValhalla && obj->klass ()->is_inline_klass ()) {
466+ if (obj->klass ()->is_inline_klass ()) {
467467 ResourceMark rm (THREAD);
468468 const char * desc = " Cannot synchronize on an instance of value class " ;
469469 const char * className = obj->klass ()->external_name ();
@@ -681,10 +681,9 @@ static intptr_t install_hash_code(Thread* current, oop obj) {
681681}
682682
683683intptr_t ObjectSynchronizer::FastHashCode (Thread* current, oop obj) {
684- if (EnableValhalla && obj->klass ()->is_inline_klass ()) {
685- // VM should be calling bootstrap method
686- ShouldNotReachHere ();
687- }
684+ // VM should be calling bootstrap method.
685+ assert (!obj->klass ()->is_inline_klass (), " FastHashCode should not be called for inline classes" );
686+
688687 if (UseObjectMonitorTable) {
689688 // Since the monitor isn't in the object header, the hash can simply be
690689 // installed in the object header.
@@ -786,7 +785,7 @@ intptr_t ObjectSynchronizer::FastHashCode(Thread* current, oop obj) {
786785
787786bool ObjectSynchronizer::current_thread_holds_lock (JavaThread* current,
788787 Handle h_obj) {
789- if (EnableValhalla && h_obj->mark ().is_inline_type ()) {
788+ if (h_obj->mark ().is_inline_type ()) {
790789 return false ;
791790 }
792791 assert (current == JavaThread::current (), " Can only be called on current thread" );
0 commit comments