comparison src/share/vm/runtime/deoptimization.cpp @ 12617:bca33c3135de

PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
author Lukas Stadler <lukas.stadler@jku.at>
date Mon, 28 Oct 2013 13:01:16 +0100
parents d1f8d0538b79
children 38b84d5a66fd
comparison
equal deleted inserted replaced
12616:b292dd6d02ac 12617:bca33c3135de
912 } 912 }
913 } 913 }
914 fields->sort(compare); 914 fields->sort(compare);
915 for (int i = 0; i < fields->length(); i++) { 915 for (int i = 0; i < fields->length(); i++) {
916 intptr_t val; 916 intptr_t val;
917 StackValue* value = StackValue::create_stack_value(fr, reg_map, sv->field_at(svIndex)); 917 ScopeValue* scope_field = sv->field_at(svIndex);
918 StackValue* value = StackValue::create_stack_value(fr, reg_map, scope_field);
918 int offset = fields->at(i)._offset; 919 int offset = fields->at(i)._offset;
919 BasicType type = fields->at(i)._type; 920 BasicType type = fields->at(i)._type;
920 switch (type) { 921 switch (type) {
921 case T_OBJECT: case T_ARRAY: 922 case T_OBJECT: case T_ARRAY:
922 assert(value->type() == T_OBJECT, "Agreement."); 923 assert(value->type() == T_OBJECT, "Agreement.");
923 obj->obj_field_put(offset, value->get_obj()()); 924 obj->obj_field_put(offset, value->get_obj()());
924 break; 925 break;
926
927 // Have to cast to INT (32 bits) pointer to avoid little/big-endian problem.
928 case T_INT: case T_FLOAT: { // 4 bytes.
929 assert(value->type() == T_INT, "Agreement.");
930 bool big_value = false;
931 if (i+1 < fields->length() && fields->at(i+1)._type == T_INT) {
932 if (scope_field->is_location()) {
933 Location::Type type = ((LocationValue*) scope_field)->location().type();
934 if (type == Location::dbl || type == Location::lng) {
935 big_value = true;
936 }
937 }
938 if (scope_field->is_constant_int()) {
939 ScopeValue* next_scope_field = sv->field_at(svIndex + 1);
940 if (next_scope_field->is_constant_long() || next_scope_field->is_constant_double()) {
941 big_value = true;
942 }
943 }
944 }
945
946 if (big_value) {
947 i++;
948 assert(i < fields->length(), "second T_INT field needed");
949 assert(fields->at(i)._type == T_INT, "T_INT field needed");
950 } else {
951 val = value->get_int();
952 obj->int_field_put(offset, (jint)*((jint*)&val));
953 break;
954 }
955 }
956 /* no break */
925 957
926 case T_LONG: case T_DOUBLE: { 958 case T_LONG: case T_DOUBLE: {
927 assert(value->type() == T_INT, "Agreement."); 959 assert(value->type() == T_INT, "Agreement.");
928 StackValue* low = StackValue::create_stack_value(fr, reg_map, sv->field_at(++svIndex)); 960 StackValue* low = StackValue::create_stack_value(fr, reg_map, sv->field_at(++svIndex));
929 #ifdef _LP64 961 #ifdef _LP64
937 #endif //SPARC 969 #endif //SPARC
938 #endif 970 #endif
939 obj->long_field_put(offset, res); 971 obj->long_field_put(offset, res);
940 break; 972 break;
941 } 973 }
942 // Have to cast to INT (32 bits) pointer to avoid little/big-endian problem.
943 case T_INT: case T_FLOAT: // 4 bytes.
944 assert(value->type() == T_INT, "Agreement.");
945 val = value->get_int();
946 obj->int_field_put(offset, (jint)*((jint*)&val));
947 break;
948 974
949 case T_SHORT: case T_CHAR: // 2 bytes 975 case T_SHORT: case T_CHAR: // 2 bytes
950 assert(value->type() == T_INT, "Agreement."); 976 assert(value->type() == T_INT, "Agreement.");
951 val = value->get_int(); 977 val = value->get_int();
952 obj->short_field_put(offset, (jshort)*((jint*)&val)); 978 obj->short_field_put(offset, (jshort)*((jint*)&val));