1.1 --- a/src/share/vm/opto/output.cpp Wed Sep 10 14:29:32 2008 -0700 1.2 +++ b/src/share/vm/opto/output.cpp Wed Sep 10 18:23:32 2008 -0700 1.3 @@ -685,6 +685,8 @@ 1.4 } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) { 1.5 array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long 1.6 ? Location::int_in_long : Location::normal )); 1.7 + } else if( t->base() == Type::NarrowOop ) { 1.8 + array->append(new_loc_value( _regalloc, regnum, Location::narrowoop )); 1.9 } else { 1.10 array->append(new_loc_value( _regalloc, regnum, _regalloc->is_oop(local) ? Location::oop : Location::normal )); 1.11 } 1.12 @@ -704,6 +706,13 @@ 1.13 case Type::KlassPtr: // fall through 1.14 array->append(new ConstantOopWriteValue(t->isa_oopptr()->const_oop()->encoding())); 1.15 break; 1.16 + case Type::NarrowOop: 1.17 + if (t == TypeNarrowOop::NULL_PTR) { 1.18 + array->append(new ConstantOopWriteValue(NULL)); 1.19 + } else { 1.20 + array->append(new ConstantOopWriteValue(t->make_ptr()->isa_oopptr()->const_oop()->encoding())); 1.21 + } 1.22 + break; 1.23 case Type::Int: 1.24 array->append(new ConstantIntValue(t->is_int()->get_con())); 1.25 break; 1.26 @@ -878,9 +887,14 @@ 1.27 } 1.28 } else if( !obj_node->is_Con() ) { 1.29 OptoReg::Name obj_reg = _regalloc->get_reg_first(obj_node); 1.30 - scval = new_loc_value( _regalloc, obj_reg, Location::oop ); 1.31 + if( obj_node->bottom_type()->base() == Type::NarrowOop ) { 1.32 + scval = new_loc_value( _regalloc, obj_reg, Location::narrowoop ); 1.33 + } else { 1.34 + scval = new_loc_value( _regalloc, obj_reg, Location::oop ); 1.35 + } 1.36 } else { 1.37 - scval = new ConstantOopWriteValue(obj_node->bottom_type()->is_instptr()->const_oop()->encoding()); 1.38 + const TypePtr *tp = obj_node->bottom_type()->make_ptr(); 1.39 + scval = new ConstantOopWriteValue(tp->is_instptr()->const_oop()->encoding()); 1.40 } 1.41 1.42 OptoReg::Name box_reg = BoxLockNode::stack_slot(box_node);