668 #endif //SPARC
669 if( t->base() == Type::DoubleBot || t->base() == Type::DoubleCon || t->base() == Type::Long ) {
670 // Repack the double/long as two jints.
671 // The convention the interpreter uses is that the second local
672 // holds the first raw word of the native double representation.
673 // This is actually reasonable, since locals and stack arrays
674 // grow downwards in all implementations.
675 // (If, on some machine, the interpreter's Java locals or stack
676 // were to grow upwards, the embedded doubles would be word-swapped.)
677 array->append(new_loc_value( _regalloc, OptoReg::add(regnum,1), Location::normal ));
678 array->append(new_loc_value( _regalloc, regnum , Location::normal ));
679 }
680 #endif //_LP64
681 else if( (t->base() == Type::FloatBot || t->base() == Type::FloatCon) &&
682 OptoReg::is_reg(regnum) ) {
683 array->append(new_loc_value( _regalloc, regnum, Matcher::float_in_double
684 ? Location::float_in_dbl : Location::normal ));
685 } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
686 array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long
687 ? Location::int_in_long : Location::normal ));
688 } else {
689 array->append(new_loc_value( _regalloc, regnum, _regalloc->is_oop(local) ? Location::oop : Location::normal ));
690 }
691 return;
692 }
693
694 // No register. It must be constant data.
695 switch (t->base()) {
696 case Type::Half: // Second half of a double
697 ShouldNotReachHere(); // Caller should skip 2nd halves
698 break;
699 case Type::AnyPtr:
700 array->append(new ConstantOopWriteValue(NULL));
701 break;
702 case Type::AryPtr:
703 case Type::InstPtr:
704 case Type::KlassPtr: // fall through
705 array->append(new ConstantOopWriteValue(t->isa_oopptr()->const_oop()->encoding()));
706 break;
707 case Type::Int:
708 array->append(new ConstantIntValue(t->is_int()->get_con()));
709 break;
710 case Type::RawPtr:
711 // A return address (T_ADDRESS).
712 assert((intptr_t)t->is_ptr()->get_con() < (intptr_t)0x10000, "must be a valid BCI");
713 #ifdef _LP64
714 // Must be restored to the full-width 64-bit stack slot.
715 array->append(new ConstantLongValue(t->is_ptr()->get_con()));
716 #else
717 array->append(new ConstantIntValue(t->is_ptr()->get_con()));
718 #endif
719 break;
720 case Type::FloatCon: {
721 float f = t->is_float_constant()->getf();
722 array->append(new ConstantIntValue(jint_cast(f)));
723 break;
724 }
725 case Type::DoubleCon: {
726 jdouble d = t->is_double_constant()->getd();
861 SafePointScalarObjectNode* spobj = obj_node->as_SafePointScalarObject();
862 scval = Compile::sv_for_node_id(objs, spobj->_idx);
863 if (scval == NULL) {
864 const Type *t = obj_node->bottom_type();
865 ciKlass* cik = t->is_oopptr()->klass();
866 assert(cik->is_instance_klass() ||
867 cik->is_array_klass(), "Not supported allocation.");
868 ObjectValue* sv = new ObjectValue(spobj->_idx,
869 new ConstantOopWriteValue(cik->encoding()));
870 Compile::set_sv_for_object_node(objs, sv);
871
872 uint first_ind = spobj->first_index();
873 for (uint i = 0; i < spobj->n_fields(); i++) {
874 Node* fld_node = sfn->in(first_ind+i);
875 (void)FillLocArray(sv->field_values()->length(), sfn, fld_node, sv->field_values(), objs);
876 }
877 scval = sv;
878 }
879 } else if( !obj_node->is_Con() ) {
880 OptoReg::Name obj_reg = _regalloc->get_reg_first(obj_node);
881 scval = new_loc_value( _regalloc, obj_reg, Location::oop );
882 } else {
883 scval = new ConstantOopWriteValue(obj_node->bottom_type()->is_instptr()->const_oop()->encoding());
884 }
885
886 OptoReg::Name box_reg = BoxLockNode::stack_slot(box_node);
887 Location basic_lock = Location::new_stk_loc(Location::normal,_regalloc->reg2offset(box_reg));
888 monarray->append(new MonitorValue(scval, basic_lock, box_node->as_BoxLock()->is_eliminated()));
889 }
890
891 // We dump the object pool first, since deoptimization reads it in first.
892 debug_info()->dump_object_pool(objs);
893
894 // Build first class objects to pass to scope
895 DebugToken *locvals = debug_info()->create_scope_values(locarray);
896 DebugToken *expvals = debug_info()->create_scope_values(exparray);
897 DebugToken *monvals = debug_info()->create_monitor_values(monarray);
898
899 // Make method available for all Safepoints
900 ciMethod* scope_method = method ? method : _method;
901 // Describe the scope here
902 assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
903 // Now we can describe the scope.
|
668 #endif //SPARC
669 if( t->base() == Type::DoubleBot || t->base() == Type::DoubleCon || t->base() == Type::Long ) {
670 // Repack the double/long as two jints.
671 // The convention the interpreter uses is that the second local
672 // holds the first raw word of the native double representation.
673 // This is actually reasonable, since locals and stack arrays
674 // grow downwards in all implementations.
675 // (If, on some machine, the interpreter's Java locals or stack
676 // were to grow upwards, the embedded doubles would be word-swapped.)
677 array->append(new_loc_value( _regalloc, OptoReg::add(regnum,1), Location::normal ));
678 array->append(new_loc_value( _regalloc, regnum , Location::normal ));
679 }
680 #endif //_LP64
681 else if( (t->base() == Type::FloatBot || t->base() == Type::FloatCon) &&
682 OptoReg::is_reg(regnum) ) {
683 array->append(new_loc_value( _regalloc, regnum, Matcher::float_in_double
684 ? Location::float_in_dbl : Location::normal ));
685 } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
686 array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long
687 ? Location::int_in_long : Location::normal ));
688 } else if( t->base() == Type::NarrowOop ) {
689 array->append(new_loc_value( _regalloc, regnum, Location::narrowoop ));
690 } else {
691 array->append(new_loc_value( _regalloc, regnum, _regalloc->is_oop(local) ? Location::oop : Location::normal ));
692 }
693 return;
694 }
695
696 // No register. It must be constant data.
697 switch (t->base()) {
698 case Type::Half: // Second half of a double
699 ShouldNotReachHere(); // Caller should skip 2nd halves
700 break;
701 case Type::AnyPtr:
702 array->append(new ConstantOopWriteValue(NULL));
703 break;
704 case Type::AryPtr:
705 case Type::InstPtr:
706 case Type::KlassPtr: // fall through
707 array->append(new ConstantOopWriteValue(t->isa_oopptr()->const_oop()->encoding()));
708 break;
709 case Type::NarrowOop:
710 if (t == TypeNarrowOop::NULL_PTR) {
711 array->append(new ConstantOopWriteValue(NULL));
712 } else {
713 array->append(new ConstantOopWriteValue(t->make_ptr()->isa_oopptr()->const_oop()->encoding()));
714 }
715 break;
716 case Type::Int:
717 array->append(new ConstantIntValue(t->is_int()->get_con()));
718 break;
719 case Type::RawPtr:
720 // A return address (T_ADDRESS).
721 assert((intptr_t)t->is_ptr()->get_con() < (intptr_t)0x10000, "must be a valid BCI");
722 #ifdef _LP64
723 // Must be restored to the full-width 64-bit stack slot.
724 array->append(new ConstantLongValue(t->is_ptr()->get_con()));
725 #else
726 array->append(new ConstantIntValue(t->is_ptr()->get_con()));
727 #endif
728 break;
729 case Type::FloatCon: {
730 float f = t->is_float_constant()->getf();
731 array->append(new ConstantIntValue(jint_cast(f)));
732 break;
733 }
734 case Type::DoubleCon: {
735 jdouble d = t->is_double_constant()->getd();
870 SafePointScalarObjectNode* spobj = obj_node->as_SafePointScalarObject();
871 scval = Compile::sv_for_node_id(objs, spobj->_idx);
872 if (scval == NULL) {
873 const Type *t = obj_node->bottom_type();
874 ciKlass* cik = t->is_oopptr()->klass();
875 assert(cik->is_instance_klass() ||
876 cik->is_array_klass(), "Not supported allocation.");
877 ObjectValue* sv = new ObjectValue(spobj->_idx,
878 new ConstantOopWriteValue(cik->encoding()));
879 Compile::set_sv_for_object_node(objs, sv);
880
881 uint first_ind = spobj->first_index();
882 for (uint i = 0; i < spobj->n_fields(); i++) {
883 Node* fld_node = sfn->in(first_ind+i);
884 (void)FillLocArray(sv->field_values()->length(), sfn, fld_node, sv->field_values(), objs);
885 }
886 scval = sv;
887 }
888 } else if( !obj_node->is_Con() ) {
889 OptoReg::Name obj_reg = _regalloc->get_reg_first(obj_node);
890 if( obj_node->bottom_type()->base() == Type::NarrowOop ) {
891 scval = new_loc_value( _regalloc, obj_reg, Location::narrowoop );
892 } else {
893 scval = new_loc_value( _regalloc, obj_reg, Location::oop );
894 }
895 } else {
896 const TypePtr *tp = obj_node->bottom_type()->make_ptr();
897 scval = new ConstantOopWriteValue(tp->is_instptr()->const_oop()->encoding());
898 }
899
900 OptoReg::Name box_reg = BoxLockNode::stack_slot(box_node);
901 Location basic_lock = Location::new_stk_loc(Location::normal,_regalloc->reg2offset(box_reg));
902 monarray->append(new MonitorValue(scval, basic_lock, box_node->as_BoxLock()->is_eliminated()));
903 }
904
905 // We dump the object pool first, since deoptimization reads it in first.
906 debug_info()->dump_object_pool(objs);
907
908 // Build first class objects to pass to scope
909 DebugToken *locvals = debug_info()->create_scope_values(locarray);
910 DebugToken *expvals = debug_info()->create_scope_values(exparray);
911 DebugToken *monvals = debug_info()->create_monitor_values(monarray);
912
913 // Make method available for all Safepoints
914 ciMethod* scope_method = method ? method : _method;
915 // Describe the scope here
916 assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
917 // Now we can describe the scope.
|