comparison src/share/vm/shark/sharkBlock.cpp @ 7643:3ac7d10a6572

Merge with hsx25/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 31 Jan 2013 15:42:25 +0100
parents 606eada1bf86
children de6a9e811145
comparison
equal deleted inserted replaced
7573:17b6a63fe7c2 7643:3ac7d10a6572
1030 if (is_field) { 1030 if (is_field) {
1031 SharkValue *value = pop(); 1031 SharkValue *value = pop();
1032 check_null(value); 1032 check_null(value);
1033 object = value->generic_value(); 1033 object = value->generic_value();
1034 } 1034 }
1035 if (is_get && field->is_constant()) { 1035 if (is_get && field->is_constant() && field->is_static()) {
1036 SharkConstant *constant = SharkConstant::for_field(iter()); 1036 SharkConstant *constant = SharkConstant::for_field(iter());
1037 if (constant->is_loaded()) 1037 if (constant->is_loaded())
1038 value = constant->value(builder()); 1038 value = constant->value(builder());
1039 } 1039 }
1040 if (!is_get || value == NULL) { 1040 if (!is_get || value == NULL) {
1042 object = builder()->CreateInlineOop(field->holder()->java_mirror()); 1042 object = builder()->CreateInlineOop(field->holder()->java_mirror());
1043 } 1043 }
1044 BasicType basic_type = field->type()->basic_type(); 1044 BasicType basic_type = field->type()->basic_type();
1045 Type *stack_type = SharkType::to_stackType(basic_type); 1045 Type *stack_type = SharkType::to_stackType(basic_type);
1046 Type *field_type = SharkType::to_arrayType(basic_type); 1046 Type *field_type = SharkType::to_arrayType(basic_type);
1047 1047 Type *type = field_type;
1048 if (field->is_volatile()) {
1049 if (field_type == SharkType::jfloat_type()) {
1050 type = SharkType::jint_type();
1051 } else if (field_type == SharkType::jdouble_type()) {
1052 type = SharkType::jlong_type();
1053 }
1054 }
1048 Value *addr = builder()->CreateAddressOfStructEntry( 1055 Value *addr = builder()->CreateAddressOfStructEntry(
1049 object, in_ByteSize(field->offset_in_bytes()), 1056 object, in_ByteSize(field->offset_in_bytes()),
1050 PointerType::getUnqual(field_type), 1057 PointerType::getUnqual(type),
1051 "addr"); 1058 "addr");
1052 1059
1053 // Do the access 1060 // Do the access
1054 if (is_get) { 1061 if (is_get) {
1055 Value* field_value; 1062 Value* field_value;
1056 if (field->is_volatile()) { 1063 if (field->is_volatile()) {
1057 field_value = builder()->CreateAtomicLoad(addr); 1064 field_value = builder()->CreateAtomicLoad(addr);
1065 field_value = builder()->CreateBitCast(field_value, field_type);
1058 } else { 1066 } else {
1059 field_value = builder()->CreateLoad(addr); 1067 field_value = builder()->CreateLoad(addr);
1060 } 1068 }
1061 if (field_type != stack_type) { 1069 if (field_type != stack_type) {
1062 field_value = builder()->CreateIntCast( 1070 field_value = builder()->CreateIntCast(
1072 field_value = builder()->CreateIntCast( 1080 field_value = builder()->CreateIntCast(
1073 field_value, field_type, basic_type != T_CHAR); 1081 field_value, field_type, basic_type != T_CHAR);
1074 } 1082 }
1075 1083
1076 if (field->is_volatile()) { 1084 if (field->is_volatile()) {
1085 field_value = builder()->CreateBitCast(field_value, type);
1077 builder()->CreateAtomicStore(field_value, addr); 1086 builder()->CreateAtomicStore(field_value, addr);
1078 } else { 1087 } else {
1079 builder()->CreateStore(field_value, addr); 1088 builder()->CreateStore(field_value, addr);
1080 } 1089 }
1081 1090