< prev index next >

src/hotspot/share/runtime/stackValue.cpp

Print this page

        

@@ -34,30 +34,21 @@
 #endif
 #if INCLUDE_SHENANDOAHGC
 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
 #endif
 
-StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv) {
+StackValue* StackValue::create_stack_value(ScopeValue* sv, address value_addr, bool in_cont) {
   if (sv->is_location()) {
     // Stack or register value
     Location loc = ((LocationValue *)sv)->location();
 
 #ifdef SPARC
     // %%%%% Callee-save floats will NOT be working on a Sparc until we
     // handle the case of a 2 floats in a single double register.
     assert( !(loc.is_register() && loc.type() == Location::float_in_dbl), "Sparc does not handle callee-save floats yet" );
 #endif // SPARC
 
-    // First find address of value
-
-    address value_addr = loc.is_register()
-      // Value was in a callee-save register
-      ? reg_map->location(VMRegImpl::as_VMReg(loc.register_number()))
-      // Else value was directly saved on the stack. The frame's original stack pointer,
-      // before any extension by its callee (due to Compiler1 linkage on SPARC), must be used.
-      : ((address)fr->unextended_sp()) + loc.stack_offset();
-
     // Then package it right depending on type
     // Note: the transfer of the data is thru a union that contains
     // an intptr_t. This is because an interpreter stack slot is
     // really an intptr_t. The use of a union containing an intptr_t
     // ensures that on a 64 bit platform we have proper alignment

@@ -96,10 +87,11 @@
       return new StackValue(*(intptr_t*)value_addr);
     case Location::lng:
       // Long   value in an aligned adjacent pair
       return new StackValue(*(intptr_t*)value_addr);
     case Location::narrowoop: {
+      assert (UseCompressedOops, "");
       union { intptr_t p; narrowOop noop;} value;
       value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
       if (loc.is_register()) {
         // The callee has no clue whether the register holds an int,
         // long or is unused.  He always saves a long.  Here we know

@@ -120,10 +112,16 @@
       Handle h(Thread::current(), val); // Wrap a handle around the oop
       return new StackValue(h);
     }
 #endif
     case Location::oop: {
+      if (in_cont && UseCompressedOops) {
+        narrowOop noop = *(narrowOop*) value_addr;
+        Handle h(Thread::current(), CompressedOops::decode(noop));
+        return new StackValue(h);
+      } 
+      
       oop val = *(oop *)value_addr;
 #ifdef _LP64
       if (CompressedOops::is_base(val)) {
          // Compiled code may produce decoded oop = narrow_oop_base
          // when a narrow oop implicit null check is used.
< prev index next >