Mercurial > hg > truffle
changeset 1444:c0e244017dad
Corrections of oop map generation.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 09 Nov 2010 12:30:21 +0100 |
parents | 1b7acf75f900 |
children | a7b84a5e16c6 |
files | c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java c1x4hotspotsrc/hotspot/hotspot SciMark.launch src/share/vm/c1x/c1x_CodeInstaller.cpp |
diffstat | 5 files changed, 11 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java Thu Nov 04 15:34:50 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java Tue Nov 09 12:30:21 2010 +0100 @@ -180,7 +180,6 @@ C1XOptions.UseDeopt = false; C1XOptions.IRChecking = Logger.ENABLED; C1XOptions.GenAssertionCode = Logger.ENABLED; - C1XOptions.DetailedAsserts = Logger.ENABLED; // these options are important - c1x4hotspot will not generate correct code without them C1XOptions.GenSpecialDivChecks = true;
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java Thu Nov 04 15:34:50 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java Tue Nov 09 12:30:21 2010 +0100 @@ -444,8 +444,7 @@ UnresolvedClassPatching patching = new UnresolvedClassPatching(asm, arg, config); patching.emitInline(); - useRegisters(asm, AMD64.rbx, AMD64.rcx, AMD64.rsi); - useRegisters(asm, AMD64.rax); + useRegisters(asm, AMD64.rbx, AMD64.rcx, AMD64.rsi, AMD64.rax); asm.callRuntime(config.unresolvedNewInstanceStub, result); // -- out of line ------------------------------------------------------- @@ -476,8 +475,7 @@ } asm.mov(length, lengthParam); - useRegisters(asm, AMD64.rsi, AMD64.rcx, AMD64.rdi); - useRegisters(asm, AMD64.rax); + useRegisters(asm, AMD64.rsi, AMD64.rcx, AMD64.rdi, AMD64.rax); asm.callRuntime(config.newObjectArrayStub, result); if (is(UNRESOLVED, flags)) { patching.emitOutOfLine(); @@ -500,8 +498,7 @@ asm.mov(hub, hubParam); asm.mov(length, lengthParam); - useRegisters(asm, AMD64.rsi, AMD64.rcx, AMD64.rdi); - useRegisters(asm, AMD64.rax); + useRegisters(asm, AMD64.rsi, AMD64.rcx, AMD64.rdi, AMD64.rax); asm.callRuntime(config.newTypeArrayStub, result); return asm.finishTemplate("newTypeArray");
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Thu Nov 04 15:34:50 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Tue Nov 09 12:30:21 2010 +0100 @@ -127,7 +127,6 @@ t.printStackTrace(new PrintWriter(out)); Logger.info("Compilation interrupted:\n" + out.toString()); } - System.gc(); } @Override
--- a/c1x4hotspotsrc/hotspot/hotspot SciMark.launch Thu Nov 04 15:34:50 2010 +0100 +++ b/c1x4hotspotsrc/hotspot/hotspot SciMark.launch Tue Nov 09 12:30:21 2010 +0100 @@ -28,17 +28,17 @@ <booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/> <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="org.eclipse.cdt.debug.mi.core.CDebuggerNew"/> +<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/> <booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/> <booleanAttribute key="org.eclipse.cdt.launch.ENABLE_REGISTER_BOOKKEEPING" value="false"/> <booleanAttribute key="org.eclipse.cdt.launch.ENABLE_VARIABLE_BOOKKEEPING" value="false"/> -<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList/>"/> +<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="r10-(format)" val="4"/></contentList>"/> <stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/> <stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList/> "/> -<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-client -XX:+UseC1X -XX:+PrintGC -Xms1g -Xmx1g -Xbootclasspath/p:${workspace_loc:hotspot}/../../../maxine/C1X/bin:${workspace_loc:hotspot}/../../../maxine/CRI/bin:${workspace_loc:hotspot}/../../../maxine/Base/bin:${workspace_loc:hotspot}/../../../maxine/Assembler/bin:${workspace_loc:hotspot}/../HotSpotVM/bin -Xbootclasspath/a:/home/tw/Benchmarks/scimark/ -classpath "/home/tw/Benchmarks/scimark" -Dc1x.debug -C1X:-PrintAssembly -XX:+PrintCompilation -C1X:+PrintCompilation -XX:+BackgroundCompilation -C1X:+PrintTimers jnt.scimark2.commandline"/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-client -C1X:-DetailedAsserts -XX:+UseC1X -XX:+PrintGC -Xms1g -Xmx1g -Xbootclasspath/p:${workspace_loc:hotspot}/../../../maxine/C1X/bin:${workspace_loc:hotspot}/../../../maxine/CRI/bin:${workspace_loc:hotspot}/../../../maxine/Base/bin:${workspace_loc:hotspot}/../../../maxine/Assembler/bin:${workspace_loc:hotspot}/../HotSpotVM/bin -Xbootclasspath/a:/home/tw/Benchmarks/scimark/ -classpath "/home/tw/Benchmarks/scimark" -C1X:-PrintCFGToFile -C1X:-PrintAssembly -XX:+PrintCompilation -C1X:+PrintCompilation -XX:+BackgroundCompilation -XX:CompileOnly=*.visitIf -C1X:+PrintTimers jnt.scimark2.commandline -large"/> <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="/home/tw/Projects/jre1.7.0/bin/java"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="hotspot"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.solaris.base.945602881"/> @@ -51,7 +51,7 @@ <listEntry value="4"/> </listAttribute> <mapAttribute key="org.eclipse.debug.core.preferred_launchers"> -<mapEntry key="[debug]" value="org.eclipse.cdt.cdi.launch.localCLaunch"/> +<mapEntry key="[debug]" value="org.eclipse.cdt.dsf.gdb.launch.localCLaunch"/> </mapAttribute> <stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"/> "/> </launchConfiguration>
--- a/src/share/vm/c1x/c1x_CodeInstaller.cpp Thu Nov 04 15:34:50 2010 +0100 +++ b/src/share/vm/c1x/c1x_CodeInstaller.cpp Tue Nov 09 12:30:21 2010 +0100 @@ -27,7 +27,8 @@ // TODO this should be handled in a more robust way - not hard coded... -Register CPU_REGS[] = { rax, rbx, rcx, rdx, rsi, rdi, r8, r9, r11, r12, r13, r14 }; +Register CPU_REGS[] = { rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 }; +bool OOP_ALLOWED[] = {true, true, true, true, false, false, true, true, true, true, false, true, true, true, true, true}; const static int NUM_CPU_REGS = sizeof(CPU_REGS) / sizeof(Register); XMMRegister XMM_REGS[] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 }; const static int NUM_XMM_REGS = sizeof(XMM_REGS) / sizeof(XMMRegister); @@ -52,11 +53,12 @@ assert(register_map->length() == (NUM_CPU_REGS + 7) / 8, "unexpected register_map length"); - for (jint i = 0; i < NUM_REGS; i++) { + for (jint i = 0; i < NUM_CPU_REGS; i++) { unsigned char byte = ((unsigned char*) register_map->base(T_BYTE))[i / 8]; bool is_oop = (byte & (1 << (i % 8))) != 0; VMReg reg = get_hotspot_reg(i); if (is_oop) { + assert(OOP_ALLOWED[i], "this register may never be an oop, register map misaligned?"); map->set_oop(reg); } else { map->set_value(reg);