diff src/share/vm/opto/output.cpp @ 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 9c2ecc2ffb12
children 4d9884b01ba6
line wrap: on
line diff
--- a/src/share/vm/opto/output.cpp	Wed Sep 10 14:29:32 2008 -0700
+++ b/src/share/vm/opto/output.cpp	Wed Sep 10 18:23:32 2008 -0700
@@ -685,6 +685,8 @@
     } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
       array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long
                                    ? Location::int_in_long : Location::normal ));
+    } else if( t->base() == Type::NarrowOop ) {
+      array->append(new_loc_value( _regalloc, regnum, Location::narrowoop ));
     } else {
       array->append(new_loc_value( _regalloc, regnum, _regalloc->is_oop(local) ? Location::oop : Location::normal ));
     }
@@ -704,6 +706,13 @@
   case Type::KlassPtr:          // fall through
     array->append(new ConstantOopWriteValue(t->isa_oopptr()->const_oop()->encoding()));
     break;
+  case Type::NarrowOop:
+    if (t == TypeNarrowOop::NULL_PTR) {
+      array->append(new ConstantOopWriteValue(NULL));
+    } else {
+      array->append(new ConstantOopWriteValue(t->make_ptr()->isa_oopptr()->const_oop()->encoding()));
+    }
+    break;
   case Type::Int:
     array->append(new ConstantIntValue(t->is_int()->get_con()));
     break;
@@ -878,9 +887,14 @@
         }
       } else if( !obj_node->is_Con() ) {
         OptoReg::Name obj_reg = _regalloc->get_reg_first(obj_node);
-        scval = new_loc_value( _regalloc, obj_reg, Location::oop );
+        if( obj_node->bottom_type()->base() == Type::NarrowOop ) {
+          scval = new_loc_value( _regalloc, obj_reg, Location::narrowoop );
+        } else {
+          scval = new_loc_value( _regalloc, obj_reg, Location::oop );
+        }
       } else {
-        scval = new ConstantOopWriteValue(obj_node->bottom_type()->is_instptr()->const_oop()->encoding());
+        const TypePtr *tp = obj_node->bottom_type()->make_ptr();
+        scval = new ConstantOopWriteValue(tp->is_instptr()->const_oop()->encoding());
       }
 
       OptoReg::Name box_reg = BoxLockNode::stack_slot(box_node);