src/hotspot/share/runtime/stackValue.cpp
changeset 54995 181986c54764
parent 54780 f8d182aedc92
child 55307 ed12027517c0
equal deleted inserted replaced
54994:faf89c9568bd 54995:181986c54764
    29 #include "runtime/frame.inline.hpp"
    29 #include "runtime/frame.inline.hpp"
    30 #include "runtime/handles.inline.hpp"
    30 #include "runtime/handles.inline.hpp"
    31 #include "runtime/stackValue.hpp"
    31 #include "runtime/stackValue.hpp"
    32 #if INCLUDE_ZGC
    32 #if INCLUDE_ZGC
    33 #include "gc/z/zBarrier.inline.hpp"
    33 #include "gc/z/zBarrier.inline.hpp"
       
    34 #endif
       
    35 #if INCLUDE_SHENANDOAHGC
       
    36 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
    34 #endif
    37 #endif
    35 
    38 
    36 StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv) {
    39 StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv) {
    37   if (sv->is_location()) {
    40   if (sv->is_location()) {
    38     // Stack or register value
    41     // Stack or register value
   104         // saved long to the int that the JVM wants.
   107         // saved long to the int that the JVM wants.
   105         value.noop =  (narrowOop) *(julong*) value_addr;
   108         value.noop =  (narrowOop) *(julong*) value_addr;
   106       } else {
   109       } else {
   107         value.noop = *(narrowOop*) value_addr;
   110         value.noop = *(narrowOop*) value_addr;
   108       }
   111       }
   109       // Decode narrowoop and wrap a handle around the oop
   112       // Decode narrowoop
   110       Handle h(Thread::current(), CompressedOops::decode(value.noop));
   113       oop val = CompressedOops::decode(value.noop);
       
   114       // Deoptimization must make sure all oops have passed load barriers
       
   115 #if INCLUDE_SHENANDOAHGC
       
   116       if (UseShenandoahGC) {
       
   117         val = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(val);
       
   118       }
       
   119 #endif
       
   120       Handle h(Thread::current(), val); // Wrap a handle around the oop
   111       return new StackValue(h);
   121       return new StackValue(h);
   112     }
   122     }
   113 #endif
   123 #endif
   114     case Location::oop: {
   124     case Location::oop: {
   115       oop val = *(oop *)value_addr;
   125       oop val = *(oop *)value_addr;
   120          // The narrow_oop_base could be NULL or be the address
   130          // The narrow_oop_base could be NULL or be the address
   121          // of the page below heap. Use NULL value for both cases.
   131          // of the page below heap. Use NULL value for both cases.
   122          val = (oop)NULL;
   132          val = (oop)NULL;
   123       }
   133       }
   124 #endif
   134 #endif
       
   135       // Deoptimization must make sure all oops have passed load barriers
   125 #if INCLUDE_ZGC
   136 #if INCLUDE_ZGC
   126       // Deoptimization must make sure all oop have passed load barrier
       
   127       if (UseZGC) {
   137       if (UseZGC) {
   128         val = ZBarrier::load_barrier_on_oop_field_preloaded((oop*)value_addr, val);
   138         val = ZBarrier::load_barrier_on_oop_field_preloaded((oop*)value_addr, val);
   129       }
   139       }
   130 #endif
   140 #endif
   131 
   141 #if INCLUDE_SHENANDOAHGC
       
   142       if (UseShenandoahGC) {
       
   143         val = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(val);
       
   144       }
       
   145 #endif
   132       Handle h(Thread::current(), val); // Wrap a handle around the oop
   146       Handle h(Thread::current(), val); // Wrap a handle around the oop
   133       return new StackValue(h);
   147       return new StackValue(h);
   134     }
   148     }
   135     case Location::addr: {
   149     case Location::addr: {
   136       ShouldNotReachHere(); // both C1 and C2 now inline jsrs
   150       ShouldNotReachHere(); // both C1 and C2 now inline jsrs