< prev index next >

src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp

Print this page
@@ -625,11 +625,11 @@
          assert(!UseBiasedLocking, "Not implemented");
  
          // Traditional lightweight locking.
          markWord displaced = rcvr->mark().set_unlocked();
          mon->lock()->set_displaced_header(displaced);
-         bool call_vm = UseHeavyMonitors;
+         bool call_vm = (LockingMode == LM_MONITOR);
          if (call_vm || rcvr->cas_set_mark(markWord::from_pointer(mon), displaced) != displaced) {
            // Is it simple recursive case?
            if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) {
              mon->lock()->set_displaced_header(markWord::from_pointer(NULL));
            } else {

@@ -721,11 +721,11 @@
        assert(!UseBiasedLocking, "Not implemented");
  
        // traditional lightweight locking
        markWord displaced = lockee->mark().set_unlocked();
        entry->lock()->set_displaced_header(displaced);
-       bool call_vm = UseHeavyMonitors;
+       bool call_vm = (LockingMode == LM_MONITOR);
        if (call_vm || lockee->cas_set_mark(markWord::from_pointer(entry), displaced) != displaced) {
          // Is it simple recursive case?
          if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) {
            entry->lock()->set_displaced_header(markWord::from_pointer(NULL));
          } else {

@@ -1631,11 +1631,11 @@
            assert(!UseBiasedLocking, "Not implemented");
  
            // traditional lightweight locking
            markWord displaced = lockee->mark().set_unlocked();
            entry->lock()->set_displaced_header(displaced);
-           bool call_vm = UseHeavyMonitors;
+           bool call_vm = (LockingMode == LM_MONITOR);
            if (call_vm || lockee->cas_set_mark(markWord::from_pointer(entry), displaced) != displaced) {
              // Is it simple recursive case?
              if (!call_vm && THREAD->is_lock_owned((address) displaced.clear_lock_bits().to_pointer())) {
                entry->lock()->set_displaced_header(markWord::from_pointer(NULL));
              } else {

@@ -1663,11 +1663,11 @@
              most_recent->set_obj(NULL);
  
              assert(!UseBiasedLocking, "Not implemented");
  
              // If it isn't recursive we either must swap old header or call the runtime
-             bool call_vm = UseHeavyMonitors;
+             bool call_vm = (LockingMode == LM_MONITOR);
              if (header.to_pointer() != NULL || call_vm) {
                markWord old_header = markWord::encode(lock);
                if (call_vm || lockee->cas_set_mark(header, old_header) != old_header) {
                  // restore object for the slow case
                  most_recent->set_obj(lockee);

@@ -1953,14 +1953,16 @@
  
                oop obj = cast_to_oop(result);
  
                // Initialize header
                assert(!UseBiasedLocking, "Not implemented");
-               obj->set_mark(markWord::prototype());
-               obj->set_klass_gap(0);
-               obj->set_klass(ik);
- 
+               if (UseCompactObjectHeaders) {
+                 oopDesc::release_set_mark(result, ik->prototype_header());
+               } else {
+                 obj->set_mark(markWord::prototype());
+                 obj->set_klass(ik);
+               }
                // Must prevent reordering of stores for object initialization
                // with stores that publish the new object.
                OrderAccess::storestore();
                SET_STACK_OBJECT(obj, 0);
                UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);

@@ -3144,11 +3146,11 @@
              if (!suppress_error) {
                VM_JAVA_ERROR_NO_JUMP(vmSymbols::java_lang_NullPointerException(), "");
                illegal_state_oop = Handle(THREAD, THREAD->pending_exception());
                THREAD->clear_pending_exception();
              }
-           } else if (UseHeavyMonitors) {
+           } else if (LockingMode == LM_MONITOR) {
              InterpreterRuntime::monitorexit(base);
              if (THREAD->has_pending_exception()) {
                if (!suppress_error) illegal_state_oop = Handle(THREAD, THREAD->pending_exception());
                THREAD->clear_pending_exception();
              }
< prev index next >