# HG changeset patch # User Lukas Stadler # Date 1335442744 -7200 # Node ID 19ed2e2391a06d50d96e4e11c0fd8033036b97ca # Parent 820fce52a244910fa2489241c401b54e19362c71# Parent 31110c447ad2991b4048f0f8fdc520688c3b9798 Merge diff -r 820fce52a244 -r 19ed2e2391a0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java Thu Apr 26 14:18:17 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java Thu Apr 26 14:19:04 2012 +0200 @@ -488,15 +488,15 @@ // -- out of line ------------------------------------------------------- asm.bindOutOfLine(slowPath); } else { - XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10); // if we get an exact match: succeed immediately + XirOperand hintHub = asm.createTemp("hintHub", CiKind.Object); for (int i = 0; i < hintCount; i++) { - XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object); - asm.mov(scratchObject, hintHub); + XirParameter hintMirror = asm.createConstantInputParameter("hintMirror" + i, CiKind.Object); + asm.pload(CiKind.Object, hintHub, hintMirror, asm.i(config.klassOopOffset), false); if (i < hintCount - 1) { - asm.jeq(end, objHub, scratchObject); + asm.jeq(end, objHub, hintHub); } else { - asm.jneq(slowPath, objHub, scratchObject); + asm.jneq(slowPath, objHub, hintHub); } } asm.bindInline(end); @@ -545,21 +545,21 @@ asm.jmp(trueSucc); } else { XirLabel slowPath = null; - XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10); + XirOperand hintHub = asm.createTemp("hintHub", CiKind.Object); // if we get an exact match: succeed immediately for (int i = 0; i < hintCount; i++) { - XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object); - asm.mov(scratchObject, hintHub); + XirParameter hintMirror = asm.createConstantInputParameter("hintMirror" + i, CiKind.Object); + asm.pload(CiKind.Object, hintHub, hintMirror, asm.i(config.klassOopOffset), false); if (i < hintCount - 1) { - asm.jeq(trueSucc, objHub, scratchObject); + asm.jeq(trueSucc, objHub, hintHub); } else { if (is(EXACT_HINTS, flags)) { - asm.jneq(falseSucc, objHub, scratchObject); + asm.jneq(falseSucc, objHub, hintHub); asm.jmp(trueSucc); } else { slowPath = asm.createOutOfLineLabel("slow path"); - asm.jneq(slowPath, objHub, scratchObject); + asm.jneq(slowPath, objHub, hintHub); asm.jmp(trueSucc); } } @@ -610,20 +610,20 @@ asm.bindInline(end); } else { XirLabel slowPath = null; - XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10); + XirOperand hintHub = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10); // if we get an exact match: succeed immediately for (int i = 0; i < hintCount; i++) { - XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object); - asm.mov(scratchObject, hintHub); + XirParameter hintMirror = asm.createConstantInputParameter("hintMirror" + i, CiKind.Object); + asm.pload(CiKind.Object, hintHub, hintMirror, asm.i(config.klassOopOffset), false); if (i < hintCount - 1) { - asm.jeq(end, objHub, scratchObject); + asm.jeq(end, objHub, hintHub); } else { if (is(EXACT_HINTS, flags)) { - asm.jeq(end, objHub, scratchObject); + asm.jeq(end, objHub, hintHub); } else { slowPath = asm.createOutOfLineLabel("slow path"); - asm.jeq(end, objHub, scratchObject); + asm.jeq(end, objHub, hintHub); asm.jmp(slowPath); } } @@ -906,7 +906,8 @@ params[i++] = hub; } for (RiResolvedType hint : hints) { - params[i++] = XirArgument.forObject(hint); + Object hintMirror = hint.toJava(); + params[i++] = XirArgument.forObject(hintMirror); } XirTemplate template = hintsExact ? checkCastTemplates.get(site, hints.length, EXACT_HINTS) : checkCastTemplates.get(site, hints.length); return new XirSnippet(template, params); @@ -925,7 +926,8 @@ params[i++] = hub; } for (RiResolvedType hint : hints) { - params[i++] = XirArgument.forObject(hint); + Object hintMirror = hint.toJava(); + params[i++] = XirArgument.forObject(hintMirror); } XirTemplate template = hintsExact ? instanceOfTemplates.get(site, hints.length, EXACT_HINTS) : instanceOfTemplates.get(site, hints.length); return new XirSnippet(template, params); @@ -946,7 +948,8 @@ params[i++] = trueValue; params[i++] = falseValue; for (RiResolvedType hint : hints) { - params[i++] = XirArgument.forObject(hint); + Object hintMirror = hint.toJava(); + params[i++] = XirArgument.forObject(hintMirror); } XirTemplate template = hintsExact ? materializeInstanceOfTemplates.get(site, hints.length, EXACT_HINTS) : materializeInstanceOfTemplates.get(site, hints.length); return new XirSnippet(template, params);