src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java

src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java

Print this page

        

*** 38,65 **** import jdk.tools.jaotc.binformat.elf.JELFRelocObject; import jdk.tools.jaotc.binformat.macho.JMachORelocObject; import jdk.tools.jaotc.binformat.pecoff.JPECoffRelocObject; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; /** * A format-agnostic container class that holds various components of a binary. * * <p> * This class holds information necessary to create platform-specific binary containers such as ! * ELFContainer for Linux and Solaris operating systems or MachOContainer for Mac ! * OS or PEContainer for MS Windows operating systems. * * <p> * Method APIs provided by this class are used to construct and populate platform-independent * contents of a binary as the first step to create a binary representation of code generated by a * compiler backend such as Graal. * * <p> * Methods to record and access code section contents, symbols and relocations are provided. */ public class BinaryContainer implements SymbolTable { private final int codeSegmentSize; private final int codeEntryAlignment; --- 38,67 ---- import jdk.tools.jaotc.binformat.elf.JELFRelocObject; import jdk.tools.jaotc.binformat.macho.JMachORelocObject; import jdk.tools.jaotc.binformat.pecoff.JPECoffRelocObject; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; + import org.graalvm.compiler.options.OptionValues; /** * A format-agnostic container class that holds various components of a binary. * * <p> * This class holds information necessary to create platform-specific binary containers such as ! * ELFContainer for Linux and Solaris operating systems or MachOContainer for Mac OS or PEContainer ! * for MS Windows operating systems. * * <p> * Method APIs provided by this class are used to construct and populate platform-independent * contents of a binary as the first step to create a binary representation of code generated by a * compiler backend such as Graal. * * <p> * Methods to record and access code section contents, symbols and relocations are provided. */ public class BinaryContainer implements SymbolTable { + private final OptionValues graalOptions; private final int codeSegmentSize; private final int codeEntryAlignment;
*** 257,268 **** /** * Allocates a {@code BinaryContainer} object whose content will be generated in a file with the * prefix {@code prefix}. It also initializes internal code container, symbol table and * relocation tables. */ ! public BinaryContainer(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, String jvmVersion) { this.codeSegmentSize = graalHotSpotVMConfig.codeSegmentSize; this.codeEntryAlignment = graalHotSpotVMConfig.codeEntryAlignment; // read only, code codeContainer = new CodeContainer(".text", this); --- 259,274 ---- /** * Allocates a {@code BinaryContainer} object whose content will be generated in a file with the * prefix {@code prefix}. It also initializes internal code container, symbol table and * relocation tables. + * + * @param graalOptions */ ! public BinaryContainer(OptionValues graalOptions, GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, String jvmVersion) { ! this.graalOptions = graalOptions; ! this.codeSegmentSize = graalHotSpotVMConfig.codeSegmentSize; this.codeEntryAlignment = graalHotSpotVMConfig.codeEntryAlignment; // read only, code codeContainer = new CodeContainer(".text", this);
*** 303,323 **** graalHotSpotVMConfig.compactFields, graalHotSpotVMConfig.useG1GC, graalHotSpotVMConfig.useCMSGC, graalHotSpotVMConfig.useTLAB, graalHotSpotVMConfig.useBiasedLocking, ! TieredAOT.getValue(), graalHotSpotVMConfig.enableContended, graalHotSpotVMConfig.restrictContended, graphBuilderConfig.omitAssertions() }; ! int[] intFlags = { graalHotSpotVMConfig.getOopEncoding().shift, ! graalHotSpotVMConfig.getKlassEncoding().shift, graalHotSpotVMConfig.contendedPaddingWidth, graalHotSpotVMConfig.fieldsAllocationStyle, ! 1 << graalHotSpotVMConfig.getOopEncoding().alignment, graalHotSpotVMConfig.codeSegmentSize, }; // @formatter:on byte[] booleanFlagsAsBytes = flagsToByteArray(booleanFlags); --- 309,329 ---- graalHotSpotVMConfig.compactFields, graalHotSpotVMConfig.useG1GC, graalHotSpotVMConfig.useCMSGC, graalHotSpotVMConfig.useTLAB, graalHotSpotVMConfig.useBiasedLocking, ! TieredAOT.getValue(graalOptions), graalHotSpotVMConfig.enableContended, graalHotSpotVMConfig.restrictContended, graphBuilderConfig.omitAssertions() }; ! int[] intFlags = { graalHotSpotVMConfig.getOopEncoding().getShift(), ! graalHotSpotVMConfig.getKlassEncoding().getShift(), graalHotSpotVMConfig.contendedPaddingWidth, graalHotSpotVMConfig.fieldsAllocationStyle, ! 1 << graalHotSpotVMConfig.logMinObjAlignment(), graalHotSpotVMConfig.codeSegmentSize, }; // @formatter:on byte[] booleanFlagsAsBytes = flagsToByteArray(booleanFlags);
*** 509,520 **** default: if (osName.startsWith("Windows")) { JPECoffRelocObject pecoffobj = new JPECoffRelocObject(this, outputFileName, aotVersion); pecoffobj.createPECoffRelocObject(relocationTable, symbolTable.values()); break; ! } ! else throw new InternalError("Unsupported platform: " + osName); } } /** --- 515,525 ---- default: if (osName.startsWith("Windows")) { JPECoffRelocObject pecoffobj = new JPECoffRelocObject(this, outputFileName, aotVersion); pecoffobj.createPECoffRelocObject(relocationTable, symbolTable.values()); break; ! } else throw new InternalError("Unsupported platform: " + osName); } } /**
src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File