# HG changeset patch # User Doug Simon # Date 1335188972 -7200 # Node ID d0877209410da7e7b0cf92b06d011be91c95a708 # Parent 290b3025b66ff49ce0f3544dc3c9c8ec9fb2f6b6# Parent 558ea5229886f55ab07e81ee91c8a24ec1d70616 Merge. diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon Apr 23 15:49:32 2012 +0200 @@ -170,9 +170,6 @@ if (GraalOptions.OptLoopTransform) { new LoopTransformPhase().apply(graph); } - if (GraalOptions.OptSafepointElimination) { - new SafepointPollingEliminationPhase().apply(graph); - } } new RemoveValueProxyPhase().apply(graph); if (GraalOptions.OptCanonicalizer) { @@ -211,6 +208,11 @@ plan.runPhases(PhasePosition.LOW_LEVEL, graph); + // Add safepoints to loops + if (GraalOptions.GenLoopSafepoints) { + new LoopSafepointInsertionPhase().apply(graph); + } + final SchedulePhase schedule = new SchedulePhase(); schedule.apply(graph); Debug.dump(schedule, "final schedule"); diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopSafepointInsertionPhase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopSafepointInsertionPhase.java Mon Apr 23 15:49:32 2012 +0200 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.compiler.phases; + +import com.oracle.graal.compiler.*; +import com.oracle.graal.graph.iterators.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.util.*; + +/** + * Adds safepoints to loops. + */ +public class LoopSafepointInsertionPhase extends Phase { + + @Override + protected void run(StructuredGraph graph) { + nextLoop: + for (LoopEndNode loopEnd : graph.getNodes(LoopEndNode.class)) { + if (GraalOptions.OptSafepointElimination) { + // We 'eliminate' safepoints by simply never placing them into loops that have at least one call + NodeIterable it = NodeIterators.dominators(loopEnd).until(loopEnd.loopBegin()); + for (FixedNode n : it) { + if (n instanceof Invoke) { + continue nextLoop; + } + } + } + SafepointNode safepoint = graph.add(new SafepointNode()); + graph.addBeforeFixed(loopEnd, safepoint); + } + } +} diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SafepointPollingEliminationPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SafepointPollingEliminationPhase.java Mon Apr 23 10:43:16 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.compiler.phases; - -import com.oracle.graal.graph.iterators.*; -import com.oracle.graal.nodes.*; -import com.oracle.graal.util.*; - -/** - * Removes safepoints from loops that include calls. - * This optimization is conservative; it does not try to remove safepoints from outer loops. - */ -public class SafepointPollingEliminationPhase extends Phase { - - @Override - protected void run(StructuredGraph graph) { - for (SafepointNode safepoint : graph.getNodes(SafepointNode.class)) { - LoopEndNode loopEnd = safepoint.loopEnd(); - if (loopEnd != null) { - NodeIterable it = NodeIterators.dominators(loopEnd).until(loopEnd.loopBegin()); - for (FixedNode n : it) { - if (n instanceof Invoke) { - graph.removeFixed(safepoint); - break; - } - } - } - } - } -} diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java Mon Apr 23 15:49:32 2012 +0200 @@ -68,4 +68,9 @@ AMD64Call.directCall(tasm, masm, CiRuntimeCall.Deoptimize, info); AMD64Call.shouldNotReachHere(tasm, masm); } + + @Override + public String description() { + return "deopt stub[reason=" + reason + ", action=" + action + "]"; + } } diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java Mon Apr 23 15:49:32 2012 +0200 @@ -553,7 +553,7 @@ protected LabelRef createDeoptStub(RiDeoptAction action, RiDeoptReason reason, LIRDebugInfo info, Object deoptInfo) { assert info.topFrame.bci >= 0 : "invalid bci for deopt framestate"; AMD64DeoptimizationStub stub = new AMD64DeoptimizationStub(action, reason, info, deoptInfo); - lir.deoptimizationStubs.add(stub); + lir.stubs.add(stub); return LabelRef.forLabel(stub.label); } diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java Mon Apr 23 15:49:32 2012 +0200 @@ -81,7 +81,7 @@ } if (snippet.template.slowPath != null) { - tasm.slowPaths.add(new SlowPath(labels)); + tasm.stubs.add(new SlowPath(labels)); } } @@ -97,6 +97,11 @@ emitXirInstructions(tasm, masm, snippet.template.slowPath, labels, getOperands(), snippet.marks); masm.nop(); } + + @Override + public String description() { + return "slow path for " + snippet.template.name; + } } diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Mon Apr 23 15:49:32 2012 +0200 @@ -128,7 +128,8 @@ TTY.println(String.format("%-6d Graal %-70s %-45s %-50s | %4dnodes %5dB", id, "", "", "", 0, (result != null ? result.targetCodeSize() : -1))); } } - compiler.getRuntime().installMethod(method, result); + + installMethod(result); } catch (CiBailout bailout) { Debug.metric("Bailouts").increment(); if (GraalOptions.ExitVMOnBailout) { @@ -148,6 +149,20 @@ stats.finish(method); } + private void installMethod(final CiTargetMethod tm) { + Debug.scope("CodeInstall", new Object[] {compiler.getCompiler(), method}, new Runnable() { + @Override + public void run() { + final HotSpotCodeInfo info = Debug.isDumpEnabled() ? new HotSpotCodeInfo(compiler, tm, method) : null; + compiler.getRuntime().installMethod(method, tm, info); + if (info != null) { + Debug.dump(info, "After code installation"); + } + } + + }); + } + @Override public int compareTo(CompilationTask o) { if (priority < o.priority) { diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java Mon Apr 23 15:49:32 2012 +0200 @@ -100,8 +100,8 @@ return result; } - public static Object installStub(Compiler compiler, CiTargetMethod targetMethod, String name) { - return compiler.getVMEntries().installStub(new HotSpotTargetMethod(compiler, targetMethod, name)); + public static Object installStub(Compiler compiler, CiTargetMethod targetMethod, String name, HotSpotCodeInfo info) { + return compiler.getVMEntries().installStub(new HotSpotTargetMethod(compiler, targetMethod, name), info); } } diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon Apr 23 15:49:32 2012 +0200 @@ -63,9 +63,9 @@ void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode); - HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode); + HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode, HotSpotCodeInfo info); - long installStub(HotSpotTargetMethod targetMethod); + long installStub(HotSpotTargetMethod targetMethod, HotSpotCodeInfo info); HotSpotVMConfig getConfiguration(); diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Mon Apr 23 15:49:32 2012 +0200 @@ -78,10 +78,10 @@ public native RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode); @Override - public native HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode); + public native HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode, HotSpotCodeInfo info); @Override - public native long installStub(HotSpotTargetMethod targetMethod); + public native long installStub(HotSpotTargetMethod targetMethod, HotSpotCodeInfo info); @Override public native HotSpotVMConfig getConfiguration(); diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java Mon Apr 23 15:49:32 2012 +0200 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.hotspot.ri; + +import com.oracle.graal.hotspot.*; +import com.oracle.graal.hotspot.Compiler; +import com.oracle.max.cri.ci.*; +import com.oracle.max.cri.ri.*; + +/** + * Implementation of {@link RiCodeInfo} for HotSpot. + */ +public class HotSpotCodeInfo extends CompilerObject implements RiCodeInfo { + + private static final long serialVersionUID = -6766490427732498354L; + + private long start; + private byte[] code; + public final CiTargetMethod targetMethod; + private HotSpotMethodResolved method; + + public HotSpotCodeInfo(Compiler compiler, CiTargetMethod targetMethod, HotSpotMethodResolved method) { + super(compiler); + assert targetMethod != null; + this.method = method; + this.targetMethod = targetMethod; + } + + @Override + public long start() { + return start; + } + + @Override + public byte[] code() { + return code; + } + + @Override + public String toString() { + int size = code == null ? 0 : code.length; + return "installed code @[" + Long.toHexString(start) + "-" + Long.toHexString(start + size) + "]"; + + } + + @Override + public CiTargetMethod targetMethod() { + return targetMethod; + } + + @Override + public RiResolvedMethod method() { + return method; + } +} diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java Mon Apr 23 15:49:32 2012 +0200 @@ -30,14 +30,17 @@ import com.oracle.graal.hotspot.Compiler; /** - * Implementation of RiCompiledMethod for HotSpot. Stores a reference to the nmethod which contains the compiled code. + * Implementation of RiCompiledMethod for HotSpot. + * Stores a reference to the nmethod which contains the compiled code. + * The nmethod also stores a weak reference to the HotSpotCompiledMethod + * instance which is necessary to keep the nmethod from being unloaded. */ public class HotSpotCompiledMethod extends CompilerObject implements RiCompiledMethod { private static final long serialVersionUID = 156632908220561612L; private final RiResolvedMethod method; - public long nmethod; + private long nmethod; public HotSpotCompiledMethod(Compiler compiler, RiResolvedMethod method) { super(compiler); diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Mon Apr 23 15:49:32 2012 +0200 @@ -82,8 +82,38 @@ } @Override - public String disassemble(byte[] code, long address) { - return compiler.getVMEntries().disassembleNative(code, address); + public String disassemble(RiCodeInfo info) { + byte[] code = info.code(); + CiTarget target = compiler.getTarget(); + HexCodeFile hcf = new HexCodeFile(code, info.start(), target.arch.name, target.wordSize * 8); + CiTargetMethod tm = info.targetMethod(); + if (tm != null) { + HexCodeFile.addAnnotations(hcf, tm.annotations()); + addExceptionHandlersComment(tm, hcf); + CiRegister fp = regConfig.getFrameRegister(); + RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0); + for (Safepoint safepoint : tm.safepoints) { + if (safepoint instanceof Call) { + Call call = (Call) safepoint; + if (call.debugInfo != null) { + hcf.addComment(call.pcOffset + call.size, CiUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString()); + } + addOperandComment(hcf, call.pcOffset, "{" + getTargetName(call) + "}"); + } else { + if (safepoint.debugInfo != null) { + hcf.addComment(safepoint.pcOffset, CiUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString()); + } + addOperandComment(hcf, safepoint.pcOffset, "{safepoint}"); + } + } + for (DataPatch site : tm.dataReferences) { + hcf.addOperandComment(site.pcOffset, "{" + site.constant + "}"); + } + for (Mark mark : tm.marks) { + hcf.addComment(mark.pcOffset, getMarkName(mark)); + } + } + return hcf.toEmbeddedString(); } /** @@ -124,38 +154,6 @@ return "MARK:" + mark.id; } - @Override - public String disassemble(CiTargetMethod tm) { - byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize()); - CiTarget target = compiler.getTarget(); - HexCodeFile hcf = new HexCodeFile(code, 0L, target.arch.name, target.wordSize * 8); - HexCodeFile.addAnnotations(hcf, tm.annotations()); - addExceptionHandlersComment(tm, hcf); - CiRegister fp = regConfig.getFrameRegister(); - RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0); - for (Safepoint safepoint : tm.safepoints) { - if (safepoint instanceof Call) { - Call call = (Call) safepoint; - if (call.debugInfo != null) { - hcf.addComment(call.pcOffset + call.size, CiUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString()); - } - addOperandComment(hcf, call.pcOffset, "{" + getTargetName(call) + "}"); - } else { - if (safepoint.debugInfo != null) { - hcf.addComment(safepoint.pcOffset, CiUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString()); - } - addOperandComment(hcf, safepoint.pcOffset, "{safepoint}"); - } - } - for (DataPatch site : tm.dataReferences) { - hcf.addOperandComment(site.pcOffset, "{" + site.constant + "}"); - } - for (Mark mark : tm.marks) { - hcf.addComment(mark.pcOffset, getMarkName(mark)); - } - return hcf.toEmbeddedString(); - } - private static void addExceptionHandlersComment(CiTargetMethod tm, HexCodeFile hcf) { if (!tm.exceptionHandlers.isEmpty()) { String nl = HexCodeFile.NEW_LINE; @@ -198,8 +196,8 @@ } @Override - public Object registerCompilerStub(CiTargetMethod targetMethod, String name) { - return HotSpotTargetMethod.installStub(compiler, targetMethod, name); + public Object registerCompilerStub(CiTargetMethod targetMethod, String name, RiCodeInfo info) { + return HotSpotTargetMethod.installStub(compiler, targetMethod, name, (HotSpotCodeInfo) info); } @Override @@ -481,13 +479,13 @@ } @Override - public void installMethod(RiResolvedMethod method, CiTargetMethod code) { - compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), true); + public void installMethod(RiResolvedMethod method, CiTargetMethod code, RiCodeInfo info) { + compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), true, (HotSpotCodeInfo) info); } @Override public RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code) { - return compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), false); + return compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), false, null); } @Override diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java Mon Apr 23 15:49:32 2012 +0200 @@ -161,7 +161,7 @@ AbstractAssembler masm = new AMD64MacroAssembler(target, frameMap.registerConfig); HotSpotFrameContext frameContext = canOmitFrame ? null : new HotSpotFrameContext(); - TargetMethodAssembler tasm = new TargetMethodAssembler(target, runtime, frameMap, masm, frameContext); + TargetMethodAssembler tasm = new TargetMethodAssembler(target, runtime, frameMap, masm, frameContext, lir.stubs); tasm.setFrameSize(frameMap.frameSize()); tasm.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea()); return tasm; diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon Apr 23 15:49:32 2012 +0200 @@ -186,14 +186,6 @@ currentGraph.removeFixed(n); } - // Add safepoints to loop ends - if (GraalOptions.GenLoopSafepoints) { - for (LoopEndNode loopEnd : currentGraph.getNodes(LoopEndNode.class)) { - SafepointNode safepoint = currentGraph.add(new SafepointNode()); - currentGraph.addBeforeFixed(loopEnd, safepoint); - } - } - // remove dead FrameStates for (Node n : currentGraph.getNodes(FrameState.class)) { if (n.usages().size() == 0 && n.predecessor() == null) { diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Mon Apr 23 15:49:32 2012 +0200 @@ -500,7 +500,7 @@ private static void emitConvertFixup(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue x) { ConvertSlowPath slowPath = new ConvertSlowPath(result, x); - tasm.slowPaths.add(slowPath); + tasm.stubs.add(slowPath); switch (result.kind) { case Int: masm.cmpl(asIntReg(result), Integer.MIN_VALUE); break; case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(CiConstant.forLong(java.lang.Long.MIN_VALUE))); break; @@ -547,6 +547,11 @@ masm.xorptr(asRegister(result), asRegister(result)); masm.jmp(continuation); } + + @Override + public String description() { + return "convert " + x + " to " + result; + } } diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java Mon Apr 23 15:49:32 2012 +0200 @@ -54,9 +54,11 @@ */ private final List codeEmittingOrder; - public final List slowPaths; - - public final List deoptimizationStubs; + /** + * Various out-of-line stubs to be emitted near the end of the method + * after all other LIR code has been emitted. + */ + public final List stubs; private int numVariables; @@ -74,6 +76,10 @@ */ public interface Code { void emitCode(TargetMethodAssembler tasm); + /** + * A description of this code stub useful for commenting the code in a disassembly. + */ + String description(); } /** @@ -87,8 +93,7 @@ this.codeEmittingOrder = codeEmittingOrder; this.linearScanOrder = linearScanOrder; - slowPaths = new ArrayList<>(); - deoptimizationStubs = new ArrayList<>(); + stubs = new ArrayList<>(); } /** @@ -141,16 +146,9 @@ emitBlock(tasm, b); } - // generate code for slow cases - for (Code sp : slowPaths) { - emitSlowPath(tasm, sp); - } - for (Code sp : tasm.slowPaths) { - emitSlowPath(tasm, sp); - } - // generate deoptimization stubs - for (Code sp : deoptimizationStubs) { - emitSlowPath(tasm, sp); + // generate code stubs + for (Code c : stubs) { + emitCodeStub(tasm, c); } } @@ -182,11 +180,11 @@ } } - private static void emitSlowPath(TargetMethodAssembler tasm, Code sp) { + private static void emitCodeStub(TargetMethodAssembler tasm, Code code) { if (Debug.isDumpEnabled()) { - tasm.blockComment(String.format("slow case %s", sp.getClass().getName())); + tasm.blockComment(String.format("code stub: %s", code.description())); } - sp.emitCode(tasm); + code.emitCode(tasm); } public void setHasArgInCallerFrame() { diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Mon Apr 23 15:49:32 2012 +0200 @@ -26,13 +26,13 @@ import java.util.*; +import com.oracle.graal.debug.*; +import com.oracle.graal.graph.*; +import com.oracle.graal.lir.*; +import com.oracle.graal.lir.LIR.Code; import com.oracle.max.asm.*; import com.oracle.max.cri.ci.*; import com.oracle.max.cri.ri.*; -import com.oracle.graal.debug.*; -import com.oracle.graal.graph.*; -import com.oracle.graal.lir.*; -import com.oracle.graal.lir.LIR.*; public class TargetMethodAssembler { @@ -51,7 +51,11 @@ public final CiTarget target; public final RiRuntime runtime; public final FrameMap frameMap; - public final List slowPaths; + + /** + * Out-of-line stubs to be emitted. + */ + public final List stubs; /** * The object that emits code for managing a method's frame. @@ -62,11 +66,11 @@ private List exceptionInfoList; private int lastSafepointPos; - public TargetMethodAssembler(CiTarget target, RiRuntime runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext) { + public TargetMethodAssembler(CiTarget target, RiRuntime runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, List stubs) { this.target = target; this.runtime = runtime; this.frameMap = frameMap; - this.slowPaths = new ArrayList<>(); + this.stubs = stubs; this.asm = asm; this.targetMethod = new CiTargetMethod(); this.frameContext = frameContext; diff -r 558ea5229886 -r d0877209410d graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Mon Apr 23 15:49:32 2012 +0200 @@ -46,7 +46,7 @@ public class CFGPrinterObserver implements DebugDumpHandler { private CFGPrinter cfgPrinter; - private Graph curGraph; + private RiResolvedMethod curMethod; @Override public void dump(Object object, String message) { @@ -57,6 +57,16 @@ } } + private static RiResolvedMethod lookupMethod() { + RiResolvedMethod method = Debug.contextLookup(RiResolvedMethod.class); + if (method != null) { + return method; + } + StructuredGraph graph = Debug.contextLookup(StructuredGraph.class); + assert graph != null && graph.method() != null : "cannot find method context for CFG dump"; + return graph.method(); + } + public void dumpSandboxed(Object object, String message) { GraalCompiler compiler = Debug.contextLookup(GraalCompiler.class); if (compiler == null) { @@ -74,11 +84,12 @@ TTY.println("CFGPrinter: Output to file %s", file); } - StructuredGraph newGraph = Debug.contextLookup(StructuredGraph.class); - if (newGraph != curGraph) { - cfgPrinter.printCompilation(newGraph.method()); - TTY.println("CFGPrinter: Dumping method %s", newGraph.method()); - curGraph = newGraph; + RiResolvedMethod newMethod = lookupMethod(); + + if (newMethod != curMethod) { + cfgPrinter.printCompilation(newMethod); + TTY.println("CFGPrinter: Dumping method %s", newMethod); + curMethod = newMethod; } cfgPrinter.target = compiler.target; @@ -109,8 +120,25 @@ cfgPrinter.printCFG(message, Arrays.asList(cfgPrinter.cfg.getBlocks())); } else if (object instanceof CiTargetMethod) { - cfgPrinter.printMachineCode(runtime.disassemble((CiTargetMethod) object), message); - + final CiTargetMethod tm = (CiTargetMethod) object; + final byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize()); + RiCodeInfo info = new RiCodeInfo() { + public CiTargetMethod targetMethod() { + return tm; + } + public long start() { + return 0L; + } + public RiResolvedMethod method() { + return null; + } + public byte[] code() { + return code; + } + }; + cfgPrinter.printMachineCode(runtime.disassemble(info), message); + } else if (object instanceof RiCodeInfo) { + cfgPrinter.printMachineCode(runtime.disassemble((RiCodeInfo) object), message); } else if (object instanceof Interval[]) { cfgPrinter.printIntervals(message, (Interval[]) object); diff -r 558ea5229886 -r d0877209410d graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiCodeInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiCodeInfo.java Mon Apr 23 15:49:32 2012 +0200 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.max.cri.ri; + +import com.oracle.max.cri.ci.*; + + +/** + * Represents some code installed in the code cache of the runtime. + * This encapsulated details are only for informational purposes. + * At any time, the runtime may invalidate the underlying code (e.g. due to deopt etc). + */ +public interface RiCodeInfo { + + /** + * Gets the start address of this installed code. + */ + long start(); + + /** + * Gets a copy of this installed code. + */ + byte[] code(); + + /** + * Gets the target method (if any) from which this installed code was produced. + */ + CiTargetMethod targetMethod(); + + /** + * Gets the method (if any) from which this installed code was compiled. + */ + RiResolvedMethod method(); +} diff -r 558ea5229886 -r d0877209410d graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java Mon Apr 23 10:43:16 2012 +0200 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java Mon Apr 23 15:49:32 2012 +0200 @@ -61,25 +61,15 @@ int codeOffset(); /** - * Returns the disassembly of the given code bytes. Used for debugging purposes only. + * Returns a disassembly of the given installed code. * - * @param code the code bytes that should be disassembled - * @param address an address at which the bytes are located. This can be used for an address prefix per line of disassembly. - * @return the disassembly. This will be of length 0 if the runtime does not support disassembling. + * @param code the code that should be disassembled + * @return a disassembly. This will be of length 0 if the runtime does not support disassembling. */ - String disassemble(byte[] code, long address); - - /** - * Returns the disassembly of the given code bytes. Used for debugging purposes only. - * - * @param targetMethod the {@link CiTargetMethod} containing the code bytes that should be disassembled - * @return the disassembly. This will be of length 0 if the runtime does not support disassembling. - */ - String disassemble(CiTargetMethod targetMethod); + String disassemble(RiCodeInfo code); /** * Returns the disassembly of the given method in a {@code javap}-like format. - * Used for debugging purposes only. * * @param method the method that should be disassembled * @return the disassembly. This will be of length 0 if the runtime does not support disassembling. @@ -92,9 +82,10 @@ * * @param targetMethod the target method representing the code of the compiler stub * @param name the name of the stub, used for debugging purposes only + * @param info the object into which details of the installed code will be written (ignored if null) * @return the identification object */ - Object registerCompilerStub(CiTargetMethod targetMethod, String name); + Object registerCompilerStub(CiTargetMethod targetMethod, String name, RiCodeInfo info); /** * Returns the RiType object representing the base type for the given kind. @@ -185,8 +176,9 @@ * * @param method a method whose executable code is being modified * @param code the code to be executed when {@code method} is called + * @param info the object into which details of the installed code will be written (ignored if null) */ - void installMethod(RiResolvedMethod method, CiTargetMethod code); + void installMethod(RiResolvedMethod method, CiTargetMethod code, RiCodeInfo info); /** * Adds the given machine code as an implementation of the given method without making it the default implementation. diff -r 558ea5229886 -r d0877209410d src/share/vm/classfile/systemDictionary.hpp --- a/src/share/vm/classfile/systemDictionary.hpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/classfile/systemDictionary.hpp Mon Apr 23 15:49:32 2012 +0200 @@ -192,6 +192,7 @@ template(HotSpotType_klass, com_oracle_graal_hotspot_HotSpotType, Opt) \ template(HotSpotField_klass, com_oracle_graal_hotspot_HotSpotField, Opt) \ template(HotSpotCompiledMethod_klass, com_oracle_graal_hotspot_HotSpotCompiledMethod, Opt) \ + template(HotSpotCodeInfo_klass, com_oracle_graal_hotspot_HotSpotCodeInfo, Opt) \ template(HotSpotMethodResolved_klass, com_oracle_graal_hotspot_ri_HotSpotMethodResolved, Opt) \ template(HotSpotMethodData_klass, com_oracle_graal_hotspot_ri_HotSpotMethodData, Opt) \ template(HotSpotTargetMethod_klass, com_oracle_graal_hotspot_HotSpotTargetMethod, Opt) \ diff -r 558ea5229886 -r d0877209410d src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/classfile/vmSymbols.hpp Mon Apr 23 15:49:32 2012 +0200 @@ -273,6 +273,7 @@ template(com_oracle_graal_hotspot_ri_HotSpotMethodResolved, "com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl") \ template(com_oracle_graal_hotspot_HotSpotTargetMethod, "com/oracle/graal/hotspot/HotSpotTargetMethod") \ template(com_oracle_graal_hotspot_ri_HotSpotMethodData, "com/oracle/graal/hotspot/ri/HotSpotMethodData") \ + template(com_oracle_graal_hotspot_HotSpotCodeInfo, "com/oracle/graal/hotspot/ri/HotSpotCodeInfo") \ template(com_oracle_graal_hotspot_HotSpotField, "com/oracle/graal/hotspot/ri/HotSpotField") \ template(com_oracle_graal_hotspot_HotSpotCompiledMethod, "com/oracle/graal/hotspot/ri/HotSpotCompiledMethod") \ template(com_oracle_graal_hotspot_HotSpotOptions, "com/oracle/graal/hotspot/HotSpotOptions") \ diff -r 558ea5229886 -r d0877209410d src/share/vm/code/nmethod.hpp --- a/src/share/vm/code/nmethod.hpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/code/nmethod.hpp Mon Apr 23 15:49:32 2012 +0200 @@ -116,6 +116,7 @@ int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method jmethodID _jmethod_id; // Cache of method()->jmethod_id() + // Needed to keep nmethods alive that are not the default nmethod for the associated methodOop oop _graal_compiled_method; // To support simple linked-list chaining of nmethods: diff -r 558ea5229886 -r d0877209410d src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Mon Apr 23 15:49:32 2012 +0200 @@ -297,7 +297,7 @@ } // constructor used to create a stub -CodeInstaller::CodeInstaller(Handle& target_method, jlong& id) { +CodeInstaller::CodeInstaller(Handle& target_method, BufferBlob*& blob, jlong& id) { No_Safepoint_Verifier no_safepoint; _env = CURRENT_ENV; @@ -312,7 +312,7 @@ initialize_buffer(buffer); const char* cname = java_lang_String::as_utf8_string(_name); - BufferBlob* blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created + blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created IF_TRACE_graal_3 Disassembler::decode((CodeBlob*) blob); id = VmIds::addStub(blob->code_begin()); } diff -r 558ea5229886 -r d0877209410d src/share/vm/graal/graalCodeInstaller.hpp --- a/src/share/vm/graal/graalCodeInstaller.hpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.hpp Mon Apr 23 15:49:32 2012 +0200 @@ -85,7 +85,7 @@ CodeInstaller(Handle& target_method, nmethod*& nm, bool install_code); // constructor used to create a stub - CodeInstaller(Handle& target_method, jlong& id); + CodeInstaller(Handle& target_method, BufferBlob*& blob, jlong& id); static address runtime_call_target_address(oop runtime_call); diff -r 558ea5229886 -r d0877209410d src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Mon Apr 23 15:49:32 2012 +0200 @@ -877,7 +877,7 @@ } // public HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode); -JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod, jboolean install_code) { +JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod, jboolean install_code, jobject info) { VM_ENTRY_MARK; ResourceMark rm; HandleMark hm; @@ -887,6 +887,13 @@ ciEnv env(&arena); CodeInstaller installer(targetMethodHandle, nm, install_code != 0); + if (info != NULL) { + arrayOop codeCopy = oopFactory::new_byteArray(nm->code_size(), CHECK_0); + memcpy(codeCopy->base(T_BYTE), nm->code_begin(), nm->code_size()); + HotSpotCodeInfo::set_code(info, codeCopy); + HotSpotCodeInfo::set_start(info, (jlong) nm->code_begin()); + } + // if install_code is true then we installed the code into the given method, no need to return an RiCompiledMethod if (!install_code && nm != NULL) { instanceKlass::cast(HotSpotCompiledMethod::klass())->initialize(CHECK_NULL); @@ -903,7 +910,7 @@ } // public long installStub(HotSpotTargetMethod targetMethod, String name); -JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { +JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod, jobject info) { VM_ENTRY_MARK; ResourceMark rm; HandleMark hm; @@ -911,7 +918,16 @@ jlong id; Arena arena; ciEnv env(&arena); - CodeInstaller installer(targetMethodHandle, id); + BufferBlob* blob; + CodeInstaller installer(targetMethodHandle, blob, id); + + if (info != NULL) { + arrayOop codeCopy = oopFactory::new_byteArray(blob->code_size(), CHECK_0); + memcpy(codeCopy->base(T_BYTE), blob->code_begin(), blob->code_size()); + HotSpotCodeInfo::set_code(info, codeCopy); + HotSpotCodeInfo::set_start(info, (jlong) blob->code_begin()); + } + return id; } @@ -1114,6 +1130,7 @@ #define CONFIG "Lcom/oracle/graal/hotspot/HotSpotVMConfig;" #define HS_METHOD "Lcom/oracle/graal/hotspot/ri/HotSpotMethod;" #define HS_COMP_METHOD "Lcom/oracle/graal/hotspot/ri/HotSpotCompiledMethod;" +#define HS_CODE_INFO "Lcom/oracle/graal/hotspot/ri/HotSpotCodeInfo;" #define METHOD_DATA "Lcom/oracle/graal/hotspot/ri/HotSpotMethodData;" #define CI_CONSTANT "Lcom/oracle/max/cri/ci/CiConstant;" #define CI_KIND "Lcom/oracle/max/cri/ci/CiKind;" @@ -1153,8 +1170,8 @@ {CC"getMaxCallTargetOffset", CC"("CI_RUNTIME_CALL")J", FN_PTR(getMaxCallTargetOffset)}, {CC"getType", CC"("CLASS")"TYPE, FN_PTR(getType)}, {CC"getConfiguration", CC"()"CONFIG, FN_PTR(getConfiguration)}, - {CC"installMethod", CC"("TARGET_METHOD"Z)"HS_COMP_METHOD, FN_PTR(installMethod)}, - {CC"installStub", CC"("TARGET_METHOD")"PROXY, FN_PTR(installStub)}, + {CC"installMethod", CC"("TARGET_METHOD"Z"HS_CODE_INFO")"HS_COMP_METHOD, FN_PTR(installMethod)}, + {CC"installStub", CC"("TARGET_METHOD HS_CODE_INFO")"PROXY, FN_PTR(installStub)}, {CC"disassembleNative", CC"([BJ)"STRING, FN_PTR(disassembleNative)}, {CC"disassembleJava", CC"("RESOLVED_METHOD")"STRING, FN_PTR(disassembleJava)}, {CC"RiMethod_toStackTraceElement", CC"("RESOLVED_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(RiMethod_1toStackTraceElement)}, diff -r 558ea5229886 -r d0877209410d src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Mon Apr 23 10:43:16 2012 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Mon Apr 23 15:49:32 2012 +0200 @@ -46,7 +46,7 @@ #define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, static_oop_field) \ start_class(HotSpotTypeResolved) \ - oop_field(HotSpotTypeResolved, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ + oop_field(HotSpotTypeResolved, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ oop_field(HotSpotTypeResolved, javaMirror, "Ljava/lang/Class;") \ oop_field(HotSpotTypeResolved, simpleName, "Ljava/lang/String;") \ int_field(HotSpotTypeResolved, accessFlags) \ @@ -59,7 +59,7 @@ int_field(HotSpotTypeResolved, instanceSize) \ end_class \ start_class(HotSpotMethodResolved) \ - oop_field(HotSpotMethodResolved, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ + oop_field(HotSpotMethodResolved, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ oop_field(HotSpotMethodResolved, name, "Ljava/lang/String;") \ oop_field(HotSpotMethodResolved, holder, "Lcom/oracle/max/cri/ri/RiResolvedType;") \ oop_field(HotSpotMethodResolved, javaMirror, "Ljava/lang/Object;") \ @@ -70,7 +70,7 @@ boolean_field(HotSpotMethodResolved, canBeInlined) \ end_class \ start_class(HotSpotMethodData) \ - oop_field(HotSpotMethodData, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ + oop_field(HotSpotMethodData, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ oop_field(HotSpotMethodData, hotspotMirror, "Ljava/lang/Object;") \ int_field(HotSpotMethodData, normalDataSize) \ int_field(HotSpotMethodData, extraDataSize) \ @@ -84,9 +84,13 @@ int_field(HotSpotField, accessFlags) \ end_class \ start_class(HotSpotCompiledMethod) \ - oop_field(HotSpotCompiledMethod, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ + oop_field(HotSpotCompiledMethod, compiler, "Lcom/oracle/graal/hotspot/Compiler;") \ long_field(HotSpotCompiledMethod, nmethod) \ - oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/max/cri/ri/RiResolvedMethod;") \ + oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/max/cri/ri/RiResolvedMethod;")\ + end_class \ + start_class(HotSpotCodeInfo) \ + long_field(HotSpotCodeInfo, start) \ + oop_field(HotSpotCodeInfo, code, "[B") \ end_class \ start_class(HotSpotProxy) \ static_oop_field(HotSpotProxy, DUMMY_CONSTANT_OBJ, "Ljava/lang/Long;") \