Mercurial > hg > graal-compiler
changeset 6698:f5715c5a106a
Make CalleeSaveLayout available in CompilationResult
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Fri, 09 Nov 2012 17:04:16 -0800 |
parents | 45661f68f317 |
children | d79098b9db3b |
files | graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java |
diffstat | 2 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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() {
--- 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());