diff agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java @ 331:cecd8eb4e0ca

6706829: Compressed Oops: add debug info for narrow oops Summary: Add support for narrow oops in debug info to avoid decoding. Reviewed-by: rasbold, never
author kvn
date Wed, 10 Sep 2008 18:23:32 -0700
parents a61af66fc99e
children 9ee9cf798b59
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java	Wed Sep 10 14:29:32 2008 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java	Wed Sep 10 18:23:32 2008 -0700
@@ -206,6 +206,16 @@
           Assert.that( loc.isRegister(), "ints always saved to stack in 1 word" );
         }
         return new StackValue(valueAddr.getJLongAt(0) & 0xFFFFFFFF);
+      } else if (loc.holdsNarrowOop()) {  // Holds an narrow oop?
+        if (loc.isRegister() && VM.getVM().isBigEndian()) {
+          // The callee has no clue whether the register holds an narrow oop,
+          // long or is unused.  He always saves a long.  Here we know
+          // a long was saved, but we only want an narrow oop back.  Narrow the
+          // saved long to the narrow oop that the JVM wants.
+          return new StackValue(valueAddr.getCompOopHandleAt(VM.getVM().getIntSize()));
+        } else {
+          return new StackValue(valueAddr.getCompOopHandleAt(0));
+        }
       } else if( loc.holdsOop() ) {  // Holds an oop?
         return new StackValue(valueAddr.getOopHandleAt(0));
       } else if( loc.holdsDouble() ) {