# HG changeset patch # User Christian Wimmer # Date 1352509456 28800 # Node ID f5715c5a106ae67a50361ee3ffd3868697826144 # Parent 45661f68f3172d5a10d332d88c7df07312dd4896 Make CalleeSaveLayout available in CompilationResult diff -r 45661f68f317 -r f5715c5a106a graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Fri Nov 09 17:03:40 2012 -0800 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Fri Nov 09 17:04:16 2012 -0800 @@ -326,6 +326,9 @@ private int frameSize = -1; private int customStackAreaOffset = -1; private int registerRestoreEpilogueOffset = -1; + + private CalleeSaveLayout calleeSaveLayout; + /** * The buffer containing the emitted machine code. */ @@ -370,6 +373,15 @@ } /** + * Sets the info on callee-saved registers used by this method. + * + * @param csl the register-saving info. + */ + public void setCalleeSaveLayout(CalleeSaveLayout csl) { + calleeSaveLayout = csl; + } + + /** * Records a reference to the data section in the code section (e.g. to load an integer or floating point constant). * * @param codePos the position in the code where the data reference occurs @@ -483,6 +495,13 @@ } /** + * @return the layout information for callee-saved registers used by this method. + */ + public CalleeSaveLayout getCalleeSaveLayout() { + return calleeSaveLayout; + } + + /** * @return the machine code generated for this method */ public byte[] getTargetCode() { diff -r 45661f68f317 -r f5715c5a106a 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 Fri Nov 09 17:03:40 2012 -0800 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Fri Nov 09 17:04:16 2012 -0800 @@ -108,6 +108,9 @@ } } + // Set the info on callee-saved registers + targetMethod.setCalleeSaveLayout(frameMap.registerConfig.getCalleeSaveLayout()); + Debug.metric("TargetMethods").increment(); Debug.metric("CodeBytesEmitted").add(targetMethod.getTargetCodeSize()); Debug.metric("SafepointsEmitted").add(targetMethod.getSafepoints().size());