# HG changeset patch # User Stefan Anzinger # Date 1409269663 25200 # Node ID 6ea6d4c260c81255bdf85245604153ded031c6e5 # Parent 4feac7e51f42400ebb35c4231c034663ed99789c [SPARC/AMD64] Fixing handling of floatingpoint register handling diff -r 4feac7e51f42 -r 6ea6d4c260c8 src/share/vm/classfile/systemDictionary.hpp --- a/src/share/vm/classfile/systemDictionary.hpp Thu Aug 28 15:43:44 2014 -0700 +++ b/src/share/vm/classfile/systemDictionary.hpp Thu Aug 28 16:47:43 2014 -0700 @@ -231,6 +231,7 @@ GRAAL_ONLY(do_klass(InstalledCode_klass, com_oracle_graal_api_code_InstalledCode, Graal)) \ GRAAL_ONLY(do_klass(code_Register_klass, com_oracle_graal_api_code_Register, Graal)) \ GRAAL_ONLY(do_klass(RegisterValue_klass, com_oracle_graal_api_code_RegisterValue, Graal)) \ + GRAAL_ONLY(do_klass(RegisterCategory_klass, com_oracle_graal_api_code_Register_RegisterCategory, Graal)) \ GRAAL_ONLY(do_klass(StackSlot_klass, com_oracle_graal_api_code_StackSlot, Graal)) \ GRAAL_ONLY(do_klass(VirtualObject_klass, com_oracle_graal_api_code_VirtualObject, Graal)) \ GRAAL_ONLY(do_klass(SpeculationLog_klass, com_oracle_graal_api_code_SpeculationLog, Graal)) \ diff -r 4feac7e51f42 -r 6ea6d4c260c8 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Thu Aug 28 15:43:44 2014 -0700 +++ b/src/share/vm/classfile/vmSymbols.hpp Thu Aug 28 16:47:43 2014 -0700 @@ -345,6 +345,7 @@ GRAAL_ONLY(template(com_oracle_graal_api_code_DebugInfo, "com/oracle/graal/api/code/DebugInfo")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_Register, "com/oracle/graal/api/code/Register")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_RegisterValue, "com/oracle/graal/api/code/RegisterValue")) \ + GRAAL_ONLY(template(com_oracle_graal_api_code_Register_RegisterCategory, "com/oracle/graal/api/code/Register$RegisterCategory")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_StackSlot, "com/oracle/graal/api/code/StackSlot")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_VirtualObject, "com/oracle/graal/api/code/VirtualObject")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_RegisterSaveLayout, "com/oracle/graal/api/code/RegisterSaveLayout")) \ diff -r 4feac7e51f42 -r 6ea6d4c260c8 src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Thu Aug 28 15:43:44 2014 -0700 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Thu Aug 28 16:47:43 2014 -0700 @@ -225,8 +225,11 @@ BasicType type = GraalRuntime::kindToBasicType(Kind::typeChar(platformKind)); if (value->is_a(RegisterValue::klass())) { - jint number = code_Register::number(RegisterValue::reg(value)); - jint encoding = code_Register::encoding(RegisterValue::reg(value)); + oop reg = RegisterValue::reg(value); + jint number = code_Register::number(reg); + jint encoding = code_Register::encoding(reg); + oop registerCategory = code_Register::registerCategory(reg); + jint referenceMapOffset = RegisterCategory::referenceMapOffset(registerCategory); if (number < RegisterImpl::number_of_registers) { Location::Type locationType; if (type == T_INT) { @@ -256,15 +259,17 @@ locationType = Location::dbl; } assert(!reference, "unexpected type in floating point register"); + jint floatRegisterNumber = number - referenceMapOffset; #ifdef TARGET_ARCH_x86 - ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_XMMRegister(number - 16)->as_VMReg())); + ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_XMMRegister(floatRegisterNumber)->as_VMReg())); if (type == T_DOUBLE) { second = value; } return value; #else #ifdef TARGET_ARCH_sparc - ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_FloatRegister(encoding)->as_VMReg())); + floatRegisterNumber += MAX2(0, floatRegisterNumber-32); // Beginning with f32, only every second register is going to be addressed + ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_FloatRegister(floatRegisterNumber)->as_VMReg())); if (type == T_DOUBLE) { second = value; } diff -r 4feac7e51f42 -r 6ea6d4c260c8 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Thu Aug 28 15:43:44 2014 -0700 +++ b/src/share/vm/graal/graalJavaAccess.hpp Thu Aug 28 16:47:43 2014 -0700 @@ -237,9 +237,15 @@ start_class(RegisterValue) \ oop_field(RegisterValue, reg, "Lcom/oracle/graal/api/code/Register;") \ end_class \ + start_class(RegisterCategory) \ + oop_field(RegisterCategory, name, "Ljava/lang/String;") \ + int_field(RegisterCategory, referenceMapOffset) \ + int_field(RegisterCategory, referenceMapShift) \ + end_class \ start_class(code_Register) \ int_field(code_Register, number) \ int_field(code_Register, encoding) \ + oop_field(code_Register, registerCategory, "Lcom/oracle/graal/api/code/Register$RegisterCategory;") \ end_class \ start_class(StackSlot) \ int_field(StackSlot, offset) \