comparison src/share/vm/runtime/deoptimization.cpp @ 18133:5c1bd485c54b

Truffle: fix deoptimization of int[] with double/long values
author Andreas Woess <andreas.woess@jku.at>
date Tue, 21 Oct 2014 02:31:32 +0200
parents 2a69cbe850a8
children 17c98fad6980 40074f6ac788
comparison
equal deleted inserted replaced
18132:b00fc4dc6dc2 18133:5c1bd485c54b
830 obj->long_at_put(index, res); 830 obj->long_at_put(index, res);
831 break; 831 break;
832 } 832 }
833 833
834 // Have to cast to INT (32 bits) pointer to avoid little/big-endian problem. 834 // Have to cast to INT (32 bits) pointer to avoid little/big-endian problem.
835 case T_INT: case T_FLOAT: // 4 bytes. 835 case T_INT: case T_FLOAT: { // 4 bytes.
836 assert(value->type() == T_INT, "Agreement."); 836 assert(value->type() == T_INT, "Agreement.");
837 val = value->get_int(); 837 bool big_value = false;
838 obj->int_at_put(index, (jint)*((jint*)&val)); 838 if (i + 1 < sv->field_size() && type == T_INT) {
839 if (sv->field_at(i)->is_location()) {
840 Location::Type type = ((LocationValue*) sv->field_at(i))->location().type();
841 if (type == Location::dbl || type == Location::lng) {
842 big_value = true;
843 }
844 } else if (sv->field_at(i)->is_constant_int()) {
845 ScopeValue* next_scope_field = sv->field_at(i + 1);
846 if (next_scope_field->is_constant_long() || next_scope_field->is_constant_double()) {
847 big_value = true;
848 }
849 }
850 }
851
852 if (big_value) {
853 StackValue* low = StackValue::create_stack_value(fr, reg_map, sv->field_at(++i));
854 #ifdef _LP64
855 jlong res = (jlong)low->get_int();
856 #else
857 #ifdef SPARC
858 // For SPARC we have to swap high and low words.
859 jlong res = jlong_from((jint)low->get_int(), (jint)value->get_int());
860 #else
861 jlong res = jlong_from((jint)value->get_int(), (jint)low->get_int());
862 #endif //SPARC
863 #endif
864 obj->int_at_put(index, (jint)*((jint*)&res));
865 obj->int_at_put(++index, (jint)*(((jint*)&res) + 1));
866 } else {
867 val = value->get_int();
868 obj->int_at_put(index, (jint)*((jint*)&val));
869 }
839 break; 870 break;
871 }
840 872
841 case T_SHORT: case T_CHAR: // 2 bytes 873 case T_SHORT: case T_CHAR: // 2 bytes
842 assert(value->type() == T_INT, "Agreement."); 874 assert(value->type() == T_INT, "Agreement.");
843 val = value->get_int(); 875 val = value->get_int();
844 obj->short_at_put(index, (jshort)*((jint*)&val)); 876 obj->short_at_put(index, (jshort)*((jint*)&val));