# HG changeset patch # User Thomas Wuerthinger # Date 1290523545 -3600 # Node ID ef7761803480261572bf47dc466fd4146201da8d # Parent 52bb06250d35519ffb006f09ded2f7615d8e5778 Fixes to get running again after C1X changes to pointer maps and register configuration. diff -r 52bb06250d35 -r ef7761803480 c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java Fri Nov 19 21:16:36 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java Tue Nov 23 15:45:45 2010 +0100 @@ -147,7 +147,7 @@ runtime = new HotSpotRuntime(config); final int wordSize = 8; final int stackFrameAlignment = 16; - registerConfig = runtime.regConfig; + registerConfig = runtime.globalStubRegConfig; target = new HotSpotTarget(new AMD64(), true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true); if (Logger.ENABLED) { diff -r 52bb06250d35 -r ef7761803480 c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java Fri Nov 19 21:16:36 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java Tue Nov 23 15:45:45 2010 +0100 @@ -67,23 +67,29 @@ private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7}; private final CiRegister[] allParameterRegisters; - public static final CiCalleeSaveArea RSA; - static { - CiRegister[] rsaRegs = { - rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, - r8, r9, r10, r11, r12, r13, r14, r15, - xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, - xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 - }; - RSA = new CiCalleeSaveArea(-1, rsaRegs, 8); - } + private final CiRegister[] rsaRegs = { + rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, + r8, r9, r10, r11, r12, r13, r14, r15, + xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 + }; - public HotSpotRegisterConfig(HotSpotVMConfig config) { + private final CiCalleeSaveArea registerSaveArea; + + + public HotSpotRegisterConfig(HotSpotVMConfig config, boolean globalStubConfig) { if (config.windowsOs) { generalParameterRegisters = new CiRegister[] {rdx, r8, r9, rdi, rsi, rcx}; } else { generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi}; } + + if (globalStubConfig) { + registerSaveArea = new CiCalleeSaveArea(-1, rsaRegs, 8); + } else { + registerSaveArea = CiCalleeSaveArea.EMPTY; + } + attributesMap = RiRegisterAttributes.createMap(this, AMD64.allRegisters); allParameterRegisters = Arrays.copyOf(generalParameterRegisters, generalParameterRegisters.length + xmmParameterRegisters.length); System.arraycopy(xmmParameterRegisters, 0, allParameterRegisters, generalParameterRegisters.length, xmmParameterRegisters.length); @@ -190,7 +196,7 @@ } public CiCalleeSaveArea getCalleeSaveArea() { - return RSA; + return registerSaveArea; } @Override diff -r 52bb06250d35 -r ef7761803480 c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java Fri Nov 19 21:16:36 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java Tue Nov 23 15:45:45 2010 +0100 @@ -42,11 +42,13 @@ final HotSpotVMConfig config; final HotSpotRegisterConfig regConfig; + final HotSpotRegisterConfig globalStubRegConfig; public HotSpotRuntime(HotSpotVMConfig config) { this.config = config; - regConfig = new HotSpotRegisterConfig(config); + regConfig = new HotSpotRegisterConfig(config, false); + globalStubRegConfig = new HotSpotRegisterConfig(config, true); } @Override diff -r 52bb06250d35 -r ef7761803480 c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExits.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExits.java Fri Nov 19 21:16:36 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExits.java Tue Nov 23 15:45:45 2010 +0100 @@ -51,7 +51,7 @@ RiConstantPool createRiConstantPool(long vmId); - CiConstant createCiConstantLong(long value); + CiConstant createCiConstant(CiKind kind, long value); CiConstant createCiConstantFloat(float value); diff -r 52bb06250d35 -r ef7761803480 c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Fri Nov 19 21:16:36 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Tue Nov 23 15:45:45 2010 +0100 @@ -235,8 +235,22 @@ } @Override - public CiConstant createCiConstantLong(long value) { - return CiConstant.forLong(value); + public CiConstant createCiConstant(CiKind kind, long value) { + if (kind == CiKind.Long) { + return CiConstant.forLong(value); + } else if (kind == CiKind.Int) { + return CiConstant.forInt((int) value); + } else if (kind == CiKind.Short) { + return CiConstant.forShort((short) value); + } else if (kind == CiKind.Char) { + return CiConstant.forChar((char) value); + } else if (kind == CiKind.Byte) { + return CiConstant.forByte((byte) value); + } else if (kind == CiKind.Boolean) { + return (value == 0) ? CiConstant.FALSE : CiConstant.TRUE; + } else { + throw new IllegalArgumentException(); + } } @Override diff -r 52bb06250d35 -r ef7761803480 runscimark.sh --- a/runscimark.sh Fri Nov 19 21:16:36 2010 +0100 +++ b/runscimark.sh Tue Nov 23 15:45:45 2010 +0100 @@ -18,5 +18,5 @@ for (( i = 1; i <= 5000; i++ )) ### Outer for loop ### do echo "$i " - ${JRE7}/bin/java -client -esa -ea -XX:+UseC1X -Xms32m -Xmx100m -Xbootclasspath/p:${MAXINE}/C1X/bin:${MAXINE}/CRI/bin:${MAXINE}/Base/bin:${MAXINE}/Assembler/bin:${C1X}/c1x4hotspotsrc/HotSpotVM/bin -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers jnt.scimark2.commandline -large + ${JRE7}/bin/java -client -esa -ea -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+PrintCompilation -XX:+UseC1X -Xms32m -Xmx100m -Xbootclasspath/p:${MAXINE}/C1X/bin:${MAXINE}/CRI/bin:${MAXINE}/Base/bin:${MAXINE}/Assembler/bin:${C1X}/c1x4hotspotsrc/HotSpotVM/bin -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers jnt.scimark2.commandline -large done diff -r 52bb06250d35 -r ef7761803480 src/share/vm/c1x/c1x_CodeInstaller.cpp --- a/src/share/vm/c1x/c1x_CodeInstaller.cpp Fri Nov 19 21:16:36 2010 +0100 +++ b/src/share/vm/c1x/c1x_CodeInstaller.cpp Tue Nov 23 15:45:45 2010 +0100 @@ -47,16 +47,16 @@ } static bool is_bit_set(oop bit_map, int i) { - if (i < 64) { + const int MapWordBits = 64; + if (i < MapWordBits) { jlong low = CiBitMap::low(bit_map); - return (low & (1 << i)) != 0; + return (low & (1L << i)) != 0; } else { - const unsigned int MapWordBits = 64; jint extra_idx = (i - MapWordBits) / MapWordBits; arrayOop extra = (arrayOop) CiBitMap::extra(bit_map); assert(extra_idx >= 0 && extra_idx < extra->length(), "unexpected index"); jlong word = ((jlong*) extra->base(T_LONG))[extra_idx]; - return (word & (1 << (i % MapWordBits))) != 0; + return (word & (1L << (i % MapWordBits))) != 0; } } @@ -88,6 +88,7 @@ // hotspot stack slots are 4 bytes VMReg reg = VMRegImpl::stack2reg(i * 2); if (is_oop) { + tty->print_cr("oop is set at %d (%d)", i, i*8); map->set_oop(reg); } else { map->set_value(reg); diff -r 52bb06250d35 -r ef7761803480 src/share/vm/c1x/c1x_TargetMethod.hpp --- a/src/share/vm/c1x/c1x_TargetMethod.hpp Fri Nov 19 21:16:36 2010 +0100 +++ b/src/share/vm/c1x/c1x_TargetMethod.hpp Tue Nov 23 15:45:45 2010 +0100 @@ -143,6 +143,7 @@ static_oop_field(CiKind, Char, "Lcom/sun/cri/ci/CiKind;"); \ static_oop_field(CiKind, Short, "Lcom/sun/cri/ci/CiKind;"); \ static_oop_field(CiKind, Int, "Lcom/sun/cri/ci/CiKind;"); \ + static_oop_field(CiKind, Long, "Lcom/sun/cri/ci/CiKind;"); \ end_class \ start_class(CiRuntimeCall) \ static_oop_field(CiRuntimeCall, UnwindException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ diff -r 52bb06250d35 -r ef7761803480 src/share/vm/c1x/c1x_VMEntries.cpp --- a/src/share/vm/c1x/c1x_VMEntries.cpp Fri Nov 19 21:16:36 2010 +0100 +++ b/src/share/vm/c1x/c1x_VMEntries.cpp Tue Nov 23 15:45:45 2010 +0100 @@ -168,10 +168,9 @@ oop result = NULL; constantTag tag = cp->tag_at(index); if (tag.is_int()) { - result = VMExits::createCiConstantLong(cp->int_at(index), CHECK_0); - CiValue::set_kind(result, CiKind::Int()); + result = VMExits::createCiConstant(CiKind::Int(), cp->int_at(index), CHECK_0); } else if (tag.is_long()) { - result = VMExits::createCiConstantLong(cp->long_at(index), CHECK_0); + result = VMExits::createCiConstant(CiKind::Long(), cp->long_at(index), CHECK_0); } else if (tag.is_float()) { result = VMExits::createCiConstantFloat(cp->float_at(index), CHECK_0); } else if (tag.is_double()) { @@ -274,27 +273,22 @@ constant_object = VMExits::createCiConstantDouble(constant.as_double(), CHECK_0); break; case T_LONG: - constant_object = VMExits::createCiConstantLong(constant.as_long(), CHECK_0); + constant_object = VMExits::createCiConstant(CiKind::Long(), constant.as_long(), CHECK_0); break; case T_INT: - constant_object = VMExits::createCiConstantLong(constant.as_int(), CHECK_0); - CiValue::set_kind(constant_object, CiKind::Int()); + constant_object = VMExits::createCiConstant(CiKind::Int(), constant.as_int(), CHECK_0); break; case T_SHORT: - constant_object = VMExits::createCiConstantLong(constant.as_int(), CHECK_0); - CiValue::set_kind(constant_object, CiKind::Short()); + constant_object = VMExits::createCiConstant(CiKind::Short(), constant.as_int(), CHECK_0); break; case T_CHAR: - constant_object = VMExits::createCiConstantLong(constant.as_int(), CHECK_0); - CiValue::set_kind(constant_object, CiKind::Char()); + constant_object = VMExits::createCiConstant(CiKind::Char(), constant.as_int(), CHECK_0); break; case T_BYTE: - constant_object = VMExits::createCiConstantLong(constant.as_int(), CHECK_0); - CiValue::set_kind(constant_object, CiKind::Byte()); + constant_object = VMExits::createCiConstant(CiKind::Byte(), constant.as_int(), CHECK_0); break; case T_BOOLEAN: - constant_object = VMExits::createCiConstantLong(constant.as_int(), CHECK_0); - CiValue::set_kind(constant_object, CiKind::Boolean()); + constant_object = VMExits::createCiConstant(CiKind::Boolean(), constant.as_int(), CHECK_0); break; default: constant.print(); diff -r 52bb06250d35 -r ef7761803480 src/share/vm/c1x/c1x_VMExits.cpp --- a/src/share/vm/c1x/c1x_VMExits.cpp Fri Nov 19 21:16:36 2010 +0100 +++ b/src/share/vm/c1x/c1x_VMExits.cpp Tue Nov 23 15:45:45 2010 +0100 @@ -174,12 +174,13 @@ return (oop) result.get_jobject(); } -oop VMExits::createCiConstantLong(jlong value, TRAPS) { +oop VMExits::createCiConstant(Handle kind, jlong value, TRAPS) { JavaValue result(T_OBJECT); JavaCallArguments args; args.push_oop(instance()); + args.push_oop(kind()); args.push_long(value); - JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, THREAD); + JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstant_name(), vmSymbols::createCiConstant_signature(), &args, THREAD); check_pending_exception("Error while calling createCiConstantFloat"); return (oop) result.get_jobject(); diff -r 52bb06250d35 -r ef7761803480 src/share/vm/c1x/c1x_VMExits.hpp --- a/src/share/vm/c1x/c1x_VMExits.hpp Fri Nov 19 21:16:36 2010 +0100 +++ b/src/share/vm/c1x/c1x_VMExits.hpp Tue Nov 23 15:45:45 2010 +0100 @@ -63,8 +63,8 @@ // public abstract RiSignature createRiSignature(String signature); static oop createRiSignature(Handle name, TRAPS); - // public abstract CiConstant createCiConstantLong(long value); - static oop createCiConstantLong(jlong value, TRAPS); + // public abstract CiConstant createCiConstant(CiKind kind, long value); + static oop createCiConstant(Handle kind, jlong value, TRAPS); // public abstract CiConstant createCiConstantFloat(float value); static oop createCiConstantFloat(jfloat value, TRAPS); diff -r 52bb06250d35 -r ef7761803480 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Fri Nov 19 21:16:36 2010 +0100 +++ b/src/share/vm/classfile/vmSymbols.hpp Tue Nov 23 15:45:45 2010 +0100 @@ -295,8 +295,8 @@ template(createRiTypeUnresolved_signature, "(Ljava/lang/String;J)Lcom/sun/cri/ri/RiType;") \ template(createRiConstantPool_name, "createRiConstantPool") \ template(createRiConstantPool_signature, "(J)Lcom/sun/cri/ri/RiConstantPool;") \ - template(createCiConstantLong_name, "createCiConstantLong") \ - template(createCiConstantLong_signature, "(J)Lcom/sun/cri/ci/CiConstant;") \ + template(createCiConstant_name, "createCiConstant") \ + template(createCiConstant_signature, "(Lcom/sun/cri/ci/CiKind;J)Lcom/sun/cri/ci/CiConstant;") \ template(createCiConstantFloat_name, "createCiConstantFloat") \ template(createCiConstantFloat_signature, "(F)Lcom/sun/cri/ci/CiConstant;") \ template(createCiConstantDouble_name, "createCiConstantDouble") \