< prev index next >

src/hotspot/share/runtime/stackValue.cpp

Print this page
@@ -39,17 +39,10 @@
  #endif
  
  class RegisterMap;
  class SmallRegisterMap;
  
- template StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv);
- template StackValue* StackValue::create_stack_value(const frame* fr, const SmallRegisterMap* reg_map, ScopeValue* sv);
- 
- template<typename RegisterMapT>
- StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMapT* reg_map, ScopeValue* sv) {
-   return create_stack_value(sv, stack_value_address(fr, reg_map, sv), reg_map);
- }
  
  static oop oop_from_oop_location(stackChunkOop chunk, void* addr) {
    if (addr == nullptr) {
      return nullptr;
    }

@@ -146,12 +139,17 @@
           p2i(addr), chunk != nullptr, chunk != nullptr && chunk->has_bitmap() && UseCompressedOops);
    Handle h(Thread::current(), val); // Wrap a handle around the oop
    return new StackValue(h);
  }
  
+ 
+ template StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv);
+ template StackValue* StackValue::create_stack_value(const frame* fr, const SmallRegisterMap* reg_map, ScopeValue* sv);
+ 
  template<typename RegisterMapT>
- StackValue* StackValue::create_stack_value(ScopeValue* sv, address value_addr, const RegisterMapT* reg_map) {
+ StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMapT* reg_map, ScopeValue* sv) {
+   address value_addr = stack_value_address(fr, reg_map, sv);
    stackChunkOop chunk = reg_map->stack_chunk()();
    if (sv->is_location()) {
      // Stack or register value
      Location loc = ((LocationValue *)sv)->location();
  

@@ -246,12 +244,18 @@
      value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
      value.jl = ((ConstantLongValue *)sv)->value();
      return new StackValue(value.p);
  #endif
    } else if (sv->is_object()) { // Scalar replaced object in compiled frame
-     Handle ov = ((ObjectValue *)sv)->value();
-     return new StackValue(ov, (ov.is_null()) ? 1 : 0);
+     ObjectValue* ov = ((ObjectValue *)sv);
+     bool scalar_replaced = ov->value().is_null();
+     if (ov->maybe_null()) {
+       // Don't treat inline type as scalar replaced if it is null
+       jint is_init = StackValue::create_stack_value(fr, reg_map, ov->is_init())->get_jint();
+       scalar_replaced &= (is_init != 0);
+     }
+     return new StackValue(ov->value(), scalar_replaced ? 1 : 0);
    } else if (sv->is_marker()) {
      // Should never need to directly construct a marker.
      ShouldNotReachHere();
    }
    // Unknown ScopeValue type
< prev index next >