changeset 52162:091c0d22e735

8206992: Update Graal Reviewed-by: kvn
author iveresov
date Fri, 17 Aug 2018 13:20:53 -0700
parents 72c82bd05971
children 6221a199ec20
files make/CompileJavaModules.gmk 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/ByteContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/CodeContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Container.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/GotSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/HeaderContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/NativeSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/ReadOnlyDataContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Relocation.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Symbol.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/SymbolTable.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/AArch64JELFRelocObject.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/AMD64JELFRelocObject.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/Elf.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfByteBuffer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfHeader.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocEntry.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocTable.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSection.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSymtab.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfTargetInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/JELFRelocObject.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/JMachORelocObject.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachO.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOByteBuffer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachODySymtab.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachORelocEntry.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachORelocTable.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSection.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSegment.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSymtab.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOTargetInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOVersion.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/JPECoffRelocObject.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoff.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffByteBuffer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffContainer.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffHeader.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffRelocEntry.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffRelocTable.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSection.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSymtab.java src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffTargetInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/HelloWorld.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/NativeOrderOutputStreamTest.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/Utils.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompiledClass.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompiler.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTDynamicTypeStore.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTHotSpotResolvedJavaMethod.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CodeOffsets.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CodeSectionProcessor.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompilationSpec.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompiledMethodInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataPatchProcessor.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ELFMacroAssembler.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignCallSiteRelocationInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignCallSiteRelocationSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignGotCallSiteRelocationSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/GraalFilters.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InstructionDecoder.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaMethodInfo.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/LoadedClass.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/LogPrinter.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkProcessor.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MetadataBuilder.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Options.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/StubDirectCallSiteRelocationSymbol.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/StubInformation.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Timer.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/aarch64/AArch64ELFMacroAssembler.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/aarch64/AArch64InstructionDecoder.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/amd64/AMD64ELFMacroAssembler.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/amd64/AMD64InstructionDecoder.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSource.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSystemFinder.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchPath.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SourceProvider.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSource.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/directory/DirectorySource.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/directory/DirectorySourceProvider.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/jar/JarFileSource.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/jar/JarSourceProvider.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/module/ModuleSource.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/module/ModuleSourceProvider.java src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/utils/NativeOrderOutputStream.java src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java src/jdk.internal.vm.compiler/share/classes/module-info.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64BaseAssembler.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64VectorAssembler.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AVXKind.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/NumUtil.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumValuesTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashMapGetTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvocationPluginsTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisIterationTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKeyImpl.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/GraphSnippetTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStackIntrospectionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigBase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOptionKey.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/IntrinsificationPredicate.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/IntegerExactOverflowExceptionStub.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/LongExactOverflowExceptionStub.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/IntegerExactOpSpeculation.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/NotOnDebug.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayCompareToOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRFlagsVersioned.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayIndexOfOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringIndexOfOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorBinary.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorClearOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorLIRInstruction.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorShuffle.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorUnary.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessAnalysisPhase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InliningLog.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionKey.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOfNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/PluginGenerator.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnIntegerExactTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfCharTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionTestBase.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JDK9StringSubstitutions.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringLatin1IndexOfNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringUTF16IndexOfNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/JMXService.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordCastNode.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/StringBenchmark.java
diffstat 340 files changed, 8331 insertions(+), 5759 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileJavaModules.gmk	Fri Aug 17 11:56:59 2018 -0500
+++ b/make/CompileJavaModules.gmk	Fri Aug 17 13:20:53 2018 -0700
@@ -511,6 +511,10 @@
     --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler,jdk.aot \
     #
 
+jdk.aot_EXCLUDES += \
+    jdk.tools.jaotc.test
+    #
+
 ################################################################################
 
 sun.charsets_COPY += .dat
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 import static org.graalvm.compiler.hotspot.meta.HotSpotAOTProfilingPlugin.Options.TieredAOT;
@@ -137,23 +139,23 @@
      */
     private static final HashMap<String, String> functionNamesToAOTSymbols = new HashMap<>();
 
+    //@formatter:off
     private static final String[][] map = {
-//@formatter:off
-        {"CompilerToVM::Data::SharedRuntime_deopt_blob_unpack",        "_aot_deopt_blob_unpack"},
-        {"CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", "_aot_deopt_blob_uncommon_trap"},
-        {"CompilerToVM::Data::SharedRuntime_ic_miss_stub",             "_aot_ic_miss_stub"},
-        {"CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", "_aot_handle_wrong_method_stub"},
-        {"SharedRuntime::exception_handler_for_return_address",        "_aot_exception_handler_for_return_address"},
-        {"SharedRuntime::register_finalizer",                          "_aot_register_finalizer"},
-        {"SharedRuntime::OSR_migration_end",                           "_aot_OSR_migration_end"},
-        {"SharedRuntime::enable_stack_reserved_zone",                  "_aot_enable_stack_reserved_zone"},
-        {"CompilerRuntime::resolve_dynamic_invoke",                    "_aot_resolve_dynamic_invoke"},
-        {"CompilerRuntime::resolve_string_by_symbol",                  "_aot_resolve_string_by_symbol"},
-        {"CompilerRuntime::resolve_klass_by_symbol",                   "_aot_resolve_klass_by_symbol"},
-        {"CompilerRuntime::resolve_method_by_symbol_and_load_counters","_aot_resolve_method_by_symbol_and_load_counters"},
-        {"CompilerRuntime::initialize_klass_by_symbol",                "_aot_initialize_klass_by_symbol"},
-        {"CompilerRuntime::invocation_event",                          "_aot_invocation_event"},
-        {"CompilerRuntime::backedge_event",                            "_aot_backedge_event"},
+        {"CompilerToVM::Data::SharedRuntime_deopt_blob_unpack",         "_aot_deopt_blob_unpack"},
+        {"CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap",  "_aot_deopt_blob_uncommon_trap"},
+        {"CompilerToVM::Data::SharedRuntime_ic_miss_stub",              "_aot_ic_miss_stub"},
+        {"CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub",  "_aot_handle_wrong_method_stub"},
+        {"SharedRuntime::exception_handler_for_return_address",         "_aot_exception_handler_for_return_address"},
+        {"SharedRuntime::register_finalizer",                           "_aot_register_finalizer"},
+        {"SharedRuntime::OSR_migration_end",                            "_aot_OSR_migration_end"},
+        {"SharedRuntime::enable_stack_reserved_zone",                   "_aot_enable_stack_reserved_zone"},
+        {"CompilerRuntime::resolve_dynamic_invoke",                     "_aot_resolve_dynamic_invoke"},
+        {"CompilerRuntime::resolve_string_by_symbol",                   "_aot_resolve_string_by_symbol"},
+        {"CompilerRuntime::resolve_klass_by_symbol",                    "_aot_resolve_klass_by_symbol"},
+        {"CompilerRuntime::resolve_method_by_symbol_and_load_counters", "_aot_resolve_method_by_symbol_and_load_counters"},
+        {"CompilerRuntime::initialize_klass_by_symbol",                 "_aot_initialize_klass_by_symbol"},
+        {"CompilerRuntime::invocation_event",                           "_aot_invocation_event"},
+        {"CompilerRuntime::backedge_event",                             "_aot_backedge_event"},
 
         {"CompilerToVM::Data::dpow", "_aot_shared_runtime_dpow"},
         {"CompilerToVM::Data::dexp", "_aot_shared_runtime_dexp"},
@@ -256,8 +258,8 @@
 
         {"JVMCIRuntime::vm_error", "_aot_jvmci_runtime_vm_error"},
         {"JVMCIRuntime::new_array", "_aot_jvmci_runtime_new_array"}
-        //@formatter:on
     };
+    //@formatter:on
 
     static {
         for (String[] entry : map) {
@@ -320,6 +322,7 @@
     }
 
     private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, int gc) {
+        // @Checkstyle: stop
         // @formatter:off
         boolean[] booleanFlags = { graalHotSpotVMConfig.cAssertions, // Debug VM
                                    graalHotSpotVMConfig.useCompressedOops,
@@ -343,6 +346,7 @@
                                    gc
         };
         // @formatter:on
+        // @Checkstyle: resume
 
         byte[] booleanFlagsAsBytes = flagsToByteArray(booleanFlags);
         int size0 = configContainer.getByteStreamSize();
@@ -447,7 +451,6 @@
         return threadLocalHandshakes;
     }
 
-
     /**
      * Gets the global AOT symbol associated with the function name.
      *
@@ -542,8 +545,9 @@
                     JPECoffRelocObject pecoffobj = new JPECoffRelocObject(this, outputFileName);
                     pecoffobj.createPECoffRelocObject(relocationTable, symbolTable.values());
                     break;
-                } else
+                } else {
                     throw new InternalError("Unsupported platform: " + osName);
+                }
         }
     }
 
@@ -553,6 +557,7 @@
      *
      * @param symInfo symbol information to be added
      */
+    @Override
     public void addSymbol(Symbol symInfo) {
         if (symInfo.getName().startsWith("got.") && !(symInfo instanceof GotSymbol)) {
             throw new InternalError("adding got. without being GotSymbol");
@@ -578,7 +583,8 @@
      * @param info relocation information to be added
      */
     public void addRelocation(Relocation info) {
-        // System.out.println("# Relocation [" + info.getSymbol() + "] [" + info.getOffset() + "] [" +
+        // System.out.println("# Relocation [" + info.getSymbol() + "] [" + info.getOffset() + "] ["
+        // +
         // info.getSection().getContainerName() + "] [" + info.getSymbol().getName() + "] [" +
         // info.getSymbol().getOffset() + " @ " + info.getSymbol().getSection().getContainerName() +
         // "]");
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/ByteContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/ByteContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,11 +21,12 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 import jdk.tools.jaotc.binformat.Symbol.Binding;
 import jdk.tools.jaotc.binformat.Symbol.Kind;
-import jdk.tools.jaotc.binformat.Container;
 
 import java.io.ByteArrayOutputStream;
 import java.nio.ByteBuffer;
@@ -184,6 +185,7 @@
      *
      * @return string containing name
      */
+    @Override
     public String getContainerName() {
         return containerName;
     }
@@ -218,6 +220,7 @@
         sectionId = id;
     }
 
+    @Override
     public int getSectionId() {
         if (sectionId == -1) {
             throw new InternalError("Using sectionId before assigned");
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/CodeContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/CodeContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 /**
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Container.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Container.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 interface Container {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/GotSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/GotSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 public final class GotSymbol extends Symbol {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/HeaderContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/HeaderContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 import java.io.ByteArrayOutputStream;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/NativeSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/NativeSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,10 +21,12 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 /**
- * This class represents ia native OS specific Symbol
+ * This class represents a native OS specific Symbol.
  */
 public abstract class NativeSymbol {
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/ReadOnlyDataContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/ReadOnlyDataContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 public final class ReadOnlyDataContainer extends ByteContainer {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Relocation.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Relocation.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,10 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 public final class Relocation {
 
+    // @formatter:off (workaround for Eclipse formatting bug)
     public enum RelocType {
         UNDEFINED,
         JAVA_CALL_INDIRECT,
@@ -35,6 +38,7 @@
         EXTERNAL_GOT_TO_PLT,
         EXTERNAL_PLT_TO_GOT
     }
+    // @formatter:on
 
     private final RelocType type;
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Symbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/Symbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,14 +21,15 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 import java.util.Objects;
 
-import jdk.tools.jaotc.binformat.NativeSymbol;
-
 public class Symbol {
 
+    // @formatter:off (workaround for Eclipse formatting bug)
     public enum Binding {
         UNDEFINED,
         LOCAL,
@@ -42,6 +43,7 @@
         OBJECT,
         NOTYPE
     }
+    // @formatter:on
 
     private final String name;
     private final int size;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/SymbolTable.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/SymbolTable.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat;
 
 public interface SymbolTable {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/AArch64JELFRelocObject.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/AArch64JELFRelocObject.java	Fri Aug 17 13:20:53 2018 -0700
@@ -22,39 +22,24 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
 import jdk.tools.jaotc.binformat.BinaryContainer;
-import jdk.tools.jaotc.binformat.ByteContainer;
-import jdk.tools.jaotc.binformat.CodeContainer;
-import jdk.tools.jaotc.binformat.ReadOnlyDataContainer;
 import jdk.tools.jaotc.binformat.Relocation;
 import jdk.tools.jaotc.binformat.Relocation.RelocType;
 import jdk.tools.jaotc.binformat.Symbol;
-import jdk.tools.jaotc.binformat.Symbol.Binding;
-import jdk.tools.jaotc.binformat.Symbol.Kind;
-
-import jdk.tools.jaotc.binformat.elf.ElfSymbol;
-import jdk.tools.jaotc.binformat.elf.ElfTargetInfo;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Ehdr;
-import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Shdr;
-import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Sym;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela;
 
-
 public class AArch64JELFRelocObject extends JELFRelocObject {
 
     AArch64JELFRelocObject(BinaryContainer binContainer, String outputFileName) {
         super(binContainer, outputFileName);
     }
 
+    @Override
     void createRelocation(Symbol symbol, Relocation reloc, ElfRelocTable elfRelocTable) {
         RelocType relocType = reloc.getType();
 
@@ -66,38 +51,38 @@
         int addend = 0;
 
         switch (relocType) {
-        case STUB_CALL_DIRECT:
-        case JAVA_CALL_DIRECT: {
-            break;
-        }
-        case EXTERNAL_PLT_TO_GOT:
-            offset -= 16;
-            elfRelocTable.createRelocationEntry(sectindex, offset, symno, Elf64_Rela.R_AARCH64_ADR_PREL_PG_HI21, addend);
-            elfRelocTable.createRelocationEntry(sectindex, offset + 4, symno, Elf64_Rela.R_AARCH64_ADD_ABS_LO12_NC, addend);
-            return;
+            case STUB_CALL_DIRECT:
+            case JAVA_CALL_DIRECT: {
+                break;
+            }
+            case EXTERNAL_PLT_TO_GOT:
+                offset -= 16;
+                elfRelocTable.createRelocationEntry(sectindex, offset, symno, Elf64_Rela.R_AARCH64_ADR_PREL_PG_HI21, addend);
+                elfRelocTable.createRelocationEntry(sectindex, offset + 4, symno, Elf64_Rela.R_AARCH64_ADD_ABS_LO12_NC, addend);
+                return;
 
-        case FOREIGN_CALL_INDIRECT_GOT: {
-            break;
-        }
-        case METASPACE_GOT_REFERENCE: {
-            offset -= 4;
+            case FOREIGN_CALL_INDIRECT_GOT: {
+                break;
+            }
+            case METASPACE_GOT_REFERENCE: {
+                offset -= 4;
 
-            elfRelocTable.createRelocationEntry(sectindex, offset, symno, Elf64_Rela.R_AARCH64_ADR_PREL_PG_HI21, addend);
-            elfRelocTable.createRelocationEntry(sectindex, offset + 4, symno, Elf64_Rela.R_AARCH64_ADD_ABS_LO12_NC, addend);
-            return;
-        }
+                elfRelocTable.createRelocationEntry(sectindex, offset, symno, Elf64_Rela.R_AARCH64_ADR_PREL_PG_HI21, addend);
+                elfRelocTable.createRelocationEntry(sectindex, offset + 4, symno, Elf64_Rela.R_AARCH64_ADD_ABS_LO12_NC, addend);
+                return;
+            }
             // break;
-        case JAVA_CALL_INDIRECT: {
-            addend = -4;
-            offset = offset + addend;
-            break;
-        }
-        case EXTERNAL_GOT_TO_PLT: {
-            // this is load time relocations
-            break;
-        }
-        default:
-            throw new InternalError("Unhandled relocation type: " + relocType);
+            case JAVA_CALL_INDIRECT: {
+                addend = -4;
+                offset = offset + addend;
+                break;
+            }
+            case EXTERNAL_GOT_TO_PLT: {
+                // this is load time relocations
+                break;
+            }
+            default:
+                throw new InternalError("Unhandled relocation type: " + relocType);
         }
 
         elfRelocTable.createRelocationEntry(sectindex, offset, symno, elfRelocType, addend);
@@ -109,14 +94,14 @@
             case Elf64_Ehdr.EM_AARCH64:
                 // Return R_X86_64_* entries based on relocType
                 if (relocType == RelocType.JAVA_CALL_DIRECT ||
-                    relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
+                                relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
                     elfRelocType = Elf64_Rela.R_AARCH64_CALL26;
                 } else if (relocType == RelocType.STUB_CALL_DIRECT) {
                     elfRelocType = Elf64_Rela.R_AARCH64_CALL26;
                 } else if (relocType == RelocType.JAVA_CALL_INDIRECT) {
                     elfRelocType = Elf64_Rela.R_AARCH64_CALL26;
                 } else if (relocType == RelocType.METASPACE_GOT_REFERENCE ||
-                           relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
+                                relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
                     elfRelocType = Elf64_Rela.R_AARCH64_NONE;
                 } else if (relocType == RelocType.EXTERNAL_GOT_TO_PLT) {
                     elfRelocType = Elf64_Rela.R_AARCH64_ABS64;
@@ -126,8 +111,7 @@
                 break;
 
             default:
-                System.out.println("Relocation Type mapping: Unhandled architecture: "
-                                   + ElfTargetInfo.getElfArch());
+                System.out.println("Relocation Type mapping: Unhandled architecture: " + ElfTargetInfo.getElfArch());
         }
         return elfRelocType;
     }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/AMD64JELFRelocObject.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/AMD64JELFRelocObject.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,39 +21,24 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
 import jdk.tools.jaotc.binformat.BinaryContainer;
-import jdk.tools.jaotc.binformat.ByteContainer;
-import jdk.tools.jaotc.binformat.CodeContainer;
-import jdk.tools.jaotc.binformat.ReadOnlyDataContainer;
 import jdk.tools.jaotc.binformat.Relocation;
 import jdk.tools.jaotc.binformat.Relocation.RelocType;
 import jdk.tools.jaotc.binformat.Symbol;
-import jdk.tools.jaotc.binformat.Symbol.Binding;
-import jdk.tools.jaotc.binformat.Symbol.Kind;
-
-import jdk.tools.jaotc.binformat.elf.ElfSymbol;
-import jdk.tools.jaotc.binformat.elf.ElfTargetInfo;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Ehdr;
-import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Shdr;
-import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Sym;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela;
 
-
 public class AMD64JELFRelocObject extends JELFRelocObject {
 
     AMD64JELFRelocObject(BinaryContainer binContainer, String outputFileName) {
         super(binContainer, outputFileName);
     }
 
+    @Override
     protected void createRelocation(Symbol symbol, Relocation reloc, ElfRelocTable elfRelocTable) {
         RelocType relocType = reloc.getType();
 
@@ -65,62 +50,61 @@
         int addend = 0;
 
         switch (relocType) {
-        case JAVA_CALL_DIRECT:
-        case STUB_CALL_DIRECT:
-        case FOREIGN_CALL_INDIRECT_GOT: {
-            // Create relocation entry
-            addend = -4; // Size in bytes of the patch location
-            // Relocation should be applied at the location after call operand
-            offset = offset + reloc.getSize() + addend;
-            break;
-        }
-        case JAVA_CALL_INDIRECT:
-        case METASPACE_GOT_REFERENCE:
-        case EXTERNAL_PLT_TO_GOT: {
-            addend = -4; // Size of 32-bit address of the GOT
-            /*
-             * Relocation should be applied before the test instruction to the move instruction.
-             * reloc.getOffset() points to the test instruction after the instruction that loads the address of
-             * polling page. So set the offset appropriately.
-             */
-            offset = offset + addend;
-            break;
-        }
-        case EXTERNAL_GOT_TO_PLT: {
-            // this is load time relocations
-            break;
-        }
-        default:
-            throw new InternalError("Unhandled relocation type: " + relocType);
+            case JAVA_CALL_DIRECT:
+            case STUB_CALL_DIRECT:
+            case FOREIGN_CALL_INDIRECT_GOT: {
+                // Create relocation entry
+                addend = -4; // Size in bytes of the patch location
+                // Relocation should be applied at the location after call operand
+                offset = offset + reloc.getSize() + addend;
+                break;
+            }
+            case JAVA_CALL_INDIRECT:
+            case METASPACE_GOT_REFERENCE:
+            case EXTERNAL_PLT_TO_GOT: {
+                addend = -4; // Size of 32-bit address of the GOT
+                /*
+                 * Relocation should be applied before the test instruction to the move instruction.
+                 * reloc.getOffset() points to the test instruction after the instruction that loads
+                 * the address of polling page. So set the offset appropriately.
+                 */
+                offset = offset + addend;
+                break;
+            }
+            case EXTERNAL_GOT_TO_PLT: {
+                // this is load time relocations
+                break;
+            }
+            default:
+                throw new InternalError("Unhandled relocation type: " + relocType);
         }
         elfRelocTable.createRelocationEntry(sectindex, offset, symno, elfRelocType, addend);
     }
 
-    private int getELFRelocationType(RelocType relocType) {
+    private static int getELFRelocationType(RelocType relocType) {
         int elfRelocType = 0; // R_<ARCH>_NONE if #define'd to 0 for all values of ARCH
         switch (ElfTargetInfo.getElfArch()) {
-        case Elf64_Ehdr.EM_X86_64:
-            // Return R_X86_64_* entries based on relocType
-            if (relocType == RelocType.JAVA_CALL_DIRECT ||
-                relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
-                elfRelocType = Elf64_Rela.R_X86_64_PLT32;
-            } else if (relocType == RelocType.STUB_CALL_DIRECT) {
-                elfRelocType = Elf64_Rela.R_X86_64_PC32;
-            } else if (relocType == RelocType.JAVA_CALL_INDIRECT) {
-                elfRelocType = Elf64_Rela.R_X86_64_NONE;
-            } else if (relocType == RelocType.METASPACE_GOT_REFERENCE ||
-                       relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
-                elfRelocType = Elf64_Rela.R_X86_64_PC32;
-            } else if (relocType == RelocType.EXTERNAL_GOT_TO_PLT) {
-                elfRelocType = Elf64_Rela.R_X86_64_64;
-            } else {
-                assert false : "Unhandled relocation type: " + relocType;
-            }
-            break;
+            case Elf64_Ehdr.EM_X86_64:
+                // Return R_X86_64_* entries based on relocType
+                if (relocType == RelocType.JAVA_CALL_DIRECT ||
+                                relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
+                    elfRelocType = Elf64_Rela.R_X86_64_PLT32;
+                } else if (relocType == RelocType.STUB_CALL_DIRECT) {
+                    elfRelocType = Elf64_Rela.R_X86_64_PC32;
+                } else if (relocType == RelocType.JAVA_CALL_INDIRECT) {
+                    elfRelocType = Elf64_Rela.R_X86_64_NONE;
+                } else if (relocType == RelocType.METASPACE_GOT_REFERENCE ||
+                                relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
+                    elfRelocType = Elf64_Rela.R_X86_64_PC32;
+                } else if (relocType == RelocType.EXTERNAL_GOT_TO_PLT) {
+                    elfRelocType = Elf64_Rela.R_X86_64_64;
+                } else {
+                    assert false : "Unhandled relocation type: " + relocType;
+                }
+                break;
 
-        default:
-            System.out.println("Relocation Type mapping: Unhandled architecture: "
-                               + ElfTargetInfo.getElfArch());
+            default:
+                System.out.println("Relocation Type mapping: Unhandled architecture: " + ElfTargetInfo.getElfArch());
         }
         return elfRelocType;
     }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/Elf.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/Elf.java	Fri Aug 17 13:20:53 2018 -0700
@@ -22,18 +22,19 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
+//@Checkstyle: stop
+//@formatter:off
+
 /**
- *
  * Support for the creation of Elf Object files. Current support is limited to 64 bit x86_64.
- *
  */
-
 final class Elf {
-    //@formatter:off
     /**
-     * Elf64_Ehdr structure defines
+     * Elf64_Ehdr structure defines.
      */
     enum Elf64_Ehdr {
                e_ident( 0,16),
@@ -103,7 +104,7 @@
     }
 
     /**
-     * Elf64_Shdr structure defines
+     * Elf64_Shdr structure defines.
      */
     enum Elf64_Shdr {
                sh_name( 0, 4),
@@ -190,7 +191,7 @@
     }
 
     /**
-     * Elf64_Rel structure defines
+     * Elf64_Rel structure defines.
      */
     enum Elf64_Rel {
               r_offset( 0, 8),
@@ -207,7 +208,7 @@
         static int totalsize = 16;
 
         /**
-         * Relocation types
+         * Relocation types.
          */
 
         static final int R_X86_64_NONE     = 0x0;
@@ -270,9 +271,7 @@
         static final int R_AARCH64_LDST64_ABS_LO12_NC = 286;
 
         static long ELF64_R_INFO(int symidx, int type) {
-            return (((long)symidx << 32) + type);
+            return (((long) symidx << 32) + type);
         }
-
     }
-    //@formatter:on
 }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfByteBuffer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfByteBuffer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
+
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Ehdr;
-import jdk.tools.jaotc.binformat.elf.ElfTargetInfo;
 
 final class ElfByteBuffer {
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.io.File;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfHeader.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfHeader.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,14 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Ehdr;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Shdr;
-import jdk.tools.jaotc.binformat.elf.ElfTargetInfo;
-import jdk.tools.jaotc.binformat.elf.ElfByteBuffer;
 
 final class ElfHeader {
     private final ByteBuffer header;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocEntry.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocEntry.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela;
-import jdk.tools.jaotc.binformat.elf.ElfByteBuffer;
 
 final class ElfRelocEntry {
     private final ByteBuffer entry;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocTable.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocTable.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,14 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.nio.ByteBuffer;
 
-import jdk.tools.jaotc.binformat.elf.ElfRelocEntry;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela;
-import jdk.tools.jaotc.binformat.elf.ElfByteBuffer;
 
 final class ElfRelocTable {
     private final ArrayList<ArrayList<ElfRelocEntry>> relocEntries;
@@ -45,14 +45,14 @@
         relocEntries.get(sectindex).add(entry);
     }
 
-    int getNumRelocs(int section_index) {
-        return relocEntries.get(section_index).size();
+    int getNumRelocs(int sectionIndex) {
+        return relocEntries.get(sectionIndex).size();
     }
 
     // Return the relocation entries for a single section
     // or null if no entries added to section
-    byte[] getRelocData(int section_index) {
-        ArrayList<ElfRelocEntry> entryList = relocEntries.get(section_index);
+    byte[] getRelocData(int sectionIndex) {
+        ArrayList<ElfRelocEntry> entryList = relocEntries.get(sectionIndex);
 
         if (entryList.size() == 0) {
             return null;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSection.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSection.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,15 +21,16 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteBuffer;
 
-import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Shdr;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rel;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela;
+import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Shdr;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Sym;
-import jdk.tools.jaotc.binformat.elf.ElfByteBuffer;
 
 final class ElfSection {
     private final String name;
@@ -39,9 +40,9 @@
     private final int sectionIndex;
 
     /**
-     * String holding section name strings
+     * String holding section name strings.
      */
-    private final static StringBuilder sectNameTab = new StringBuilder();
+    private static final StringBuilder sectNameTab = new StringBuilder();
 
     /**
      * Keeps track of bytes in section string table since strTabContent.length() is number of chars,
@@ -50,7 +51,7 @@
     private static int shStrTabNrOfBytes = 0;
 
     ElfSection(String sectName, byte[] sectData, int sectFlags, int sectType,
-               boolean hasRelocations, int align, int sectIndex) {
+                    boolean hasRelocations, int align, int sectIndex) {
 
         section = ElfByteBuffer.allocate(Elf64_Shdr.totalsize);
         name = sectName;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,13 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.NativeSymbol;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Sym;
-import jdk.tools.jaotc.binformat.elf.ElfByteBuffer;
 
 final class ElfSymbol extends NativeSymbol {
     private final ByteBuffer sym;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSymtab.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfSymtab.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,14 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Sym;
-import jdk.tools.jaotc.binformat.elf.ElfSymbol;
-import jdk.tools.jaotc.binformat.elf.ElfByteBuffer;
 
 final class ElfSymtab {
 
@@ -36,12 +36,12 @@
     private final ArrayList<ElfSymbol> globalSymbols = new ArrayList<>();
 
     /**
-     * number of symbols added
+     * Number of symbols added.
      */
     private int symbolCount;
 
     /**
-     * String holding symbol table strings
+     * String holding symbol table strings.
      */
     private final StringBuilder strTabContent = new StringBuilder();
 
@@ -77,10 +77,11 @@
             strTabNrOfBytes += (name.getBytes().length + 1);
 
             sym = new ElfSymbol(symbolCount, index, type, bind, secHdrIndex, offset, size);
-            if ((bind & Elf64_Sym.STB_GLOBAL) != 0)
+            if ((bind & Elf64_Sym.STB_GLOBAL) != 0) {
                 globalSymbols.add(sym);
-            else
+            } else {
                 localSymbols.add(sym);
+            }
         }
         symbolCount++;
         return (sym);
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfTargetInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfTargetInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.nio.ByteOrder;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/JELFRelocObject.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/JELFRelocObject.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.elf;
 
 import java.io.IOException;
@@ -34,17 +36,12 @@
 import jdk.tools.jaotc.binformat.CodeContainer;
 import jdk.tools.jaotc.binformat.ReadOnlyDataContainer;
 import jdk.tools.jaotc.binformat.Relocation;
-import jdk.tools.jaotc.binformat.Relocation.RelocType;
 import jdk.tools.jaotc.binformat.Symbol;
 import jdk.tools.jaotc.binformat.Symbol.Binding;
 import jdk.tools.jaotc.binformat.Symbol.Kind;
-
-import jdk.tools.jaotc.binformat.elf.ElfSymbol;
-import jdk.tools.jaotc.binformat.elf.ElfTargetInfo;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Ehdr;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Shdr;
 import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Sym;
-import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela;
 
 public abstract class JELFRelocObject {
 
@@ -64,22 +61,22 @@
         String archStr = System.getProperty("os.arch").toLowerCase();
         if (archStr.equals("amd64") || archStr.equals("x86_64")) {
             return new AMD64JELFRelocObject(binContainer, outputFileName);
-        } else  if (archStr.equals("aarch64")) {
+        } else if (archStr.equals("aarch64")) {
             return new AArch64JELFRelocObject(binContainer, outputFileName);
         }
         throw new InternalError("Unsupported platform: " + archStr);
     }
 
     private static ElfSection createByteSection(ArrayList<ElfSection> sections,
-                                                String sectName,
-                                                byte[] scnData,
-                                                boolean hasRelocs,
-                                                int align,
-                                                int scnFlags,
-                                                int scnType) {
+                    String sectName,
+                    byte[] scnData,
+                    boolean hasRelocs,
+                    int align,
+                    int scnFlags,
+                    int scnType) {
 
         ElfSection sect = new ElfSection(sectName, scnData, scnFlags, scnType,
-                                         hasRelocs, align, sections.size());
+                        hasRelocs, align, sections.size());
         // Add this section to our list
         sections.add(sect);
 
@@ -87,7 +84,7 @@
     }
 
     private void createByteSection(ArrayList<ElfSection> sections,
-                                   ByteContainer c, int scnFlags) {
+                    ByteContainer c, int scnFlags) {
         ElfSection sect;
         boolean hasRelocs = c.hasRelocations();
         byte[] scnData = c.getByteArray();
@@ -107,8 +104,8 @@
         }
 
         sect = createByteSection(sections, c.getContainerName(),
-                                 scnData, hasRelocs, segmentSize,
-                                 scnFlags, scnType);
+                        scnData, hasRelocs, segmentSize,
+                        scnFlags, scnType);
         c.setSectionId(sect.getSectionId());
     }
 
@@ -125,7 +122,7 @@
     }
 
     /**
-     * Create an ELF relocatable object
+     * Creates an ELF relocatable object.
      *
      * @param relocationTable
      * @param symbols
@@ -166,18 +163,18 @@
         // that order since symtab section needs to set the index of
         // strtab in sh_link field
         ElfSection strTabSection = createByteSection(sections, ".strtab",
-                                                     symtab.getStrtabArray(),
-                                                     false, 1, 0,
-                                                     Elf64_Shdr.SHT_STRTAB);
+                        symtab.getStrtabArray(),
+                        false, 1, 0,
+                        Elf64_Shdr.SHT_STRTAB);
 
         // Now create .symtab section with the symtab data constructed.
         // On Linux, sh_link of symtab contains the index of string table
         // its symbols reference and sh_info contains the index of first
         // non-local symbol
         ElfSection symTabSection = createByteSection(sections, ".symtab",
-                                                     symtab.getSymtabArray(),
-                                                     false, 8, 0,
-                                                     Elf64_Shdr.SHT_SYMTAB);
+                        symtab.getSymtabArray(),
+                        false, 8, 0,
+                        Elf64_Shdr.SHT_SYMTAB);
         symTabSection.setLink(strTabSection.getSectionId());
         symTabSection.setInfo(symtab.getNumLocalSyms());
 
@@ -187,35 +184,35 @@
 
         // Now, finally, after creating all sections, create shstrtab section
         ElfSection shStrTabSection = createByteSection(sections, ".shstrtab",
-                                                       null, false, 1, 0,
-                                                       Elf64_Shdr.SHT_STRTAB);
+                        null, false, 1, 0,
+                        Elf64_Shdr.SHT_STRTAB);
         eh.setSectionStrNdx(shStrTabSection.getSectionId());
 
         // Update all section offsets and the Elf header section offset
         // Write the Header followed by the contents of each section
         // and then the section structures (section table).
-        int file_offset = Elf64_Ehdr.totalsize;
+        int fileOffset = Elf64_Ehdr.totalsize;
 
         // and round it up
-        file_offset = (file_offset + (sections.get(1).getDataAlign() - 1)) &
-                      ~((sections.get(1).getDataAlign() - 1));
+        fileOffset = (fileOffset + (sections.get(1).getDataAlign() - 1)) &
+                        ~((sections.get(1).getDataAlign() - 1));
 
         // Calc file offsets for section data skipping null section
         for (int i = 1; i < sections.size(); i++) {
             ElfSection sect = sections.get(i);
-            file_offset = (file_offset + (sect.getDataAlign() - 1)) &
-                          ~((sect.getDataAlign() - 1));
-            sect.setOffset(file_offset);
-            file_offset += sect.getSize();
+            fileOffset = (fileOffset + (sect.getDataAlign() - 1)) &
+                            ~((sect.getDataAlign() - 1));
+            sect.setOffset(fileOffset);
+            fileOffset += sect.getSize();
         }
 
         // Align the section table
-        file_offset = (file_offset + (ElfSection.getShdrAlign() - 1)) &
-                      ~((ElfSection.getShdrAlign() - 1));
+        fileOffset = (fileOffset + (ElfSection.getShdrAlign() - 1)) &
+                        ~((ElfSection.getShdrAlign() - 1));
 
         // Update the Elf Header with the offset of the first Elf64_Shdr
         // and the number of sections.
-        eh.setSectionOff(file_offset);
+        eh.setSectionOff(fileOffset);
         eh.setSectionNum(sections.size());
 
         // Write out the Header
@@ -237,8 +234,8 @@
     }
 
     /**
-     * Construct ELF symbol data from BinaryContainer object's symbol tables. Both dynamic ELF symbol
-     * table and ELF symbol table are created from BinaryContainer's symbol info.
+     * Construct ELF symbol data from BinaryContainer object's symbol tables. Both dynamic ELF
+     * symbol table and ELF symbol table are created from BinaryContainer's symbol info.
      *
      * @param symbols
      */
@@ -283,11 +280,12 @@
      * @param relocationTable
      */
     private ElfRelocTable createElfRelocTable(ArrayList<ElfSection> sections,
-                                              Map<Symbol, List<Relocation>> relocationTable) {
+                    Map<Symbol, List<Relocation>> relocationTable) {
 
         ElfRelocTable elfRelocTable = new ElfRelocTable(sections.size());
         /*
-         * For each of the symbols with associated relocation records, create a Elf relocation entry.
+         * For each of the symbols with associated relocation records, create a Elf relocation
+         * entry.
          */
         for (Map.Entry<Symbol, List<Relocation>> entry : relocationTable.entrySet()) {
             List<Relocation> relocs = entry.getValue();
@@ -306,8 +304,8 @@
     }
 
     private static void createElfRelocSections(ArrayList<ElfSection> sections,
-                                               ElfRelocTable elfRelocTable,
-                                               int symtabsectidx) {
+                    ElfRelocTable elfRelocTable,
+                    int symtabsectidx) {
 
         // Grab count before we create new sections
         int count = sections.size();
@@ -317,8 +315,8 @@
                 ElfSection sect = sections.get(i);
                 String relname = ".rela" + sect.getName();
                 ElfSection relocSection = createByteSection(sections, relname,
-                                                            elfRelocTable.getRelocData(i),
-                                                            false, 8, 0, Elf64_Shdr.SHT_RELA);
+                                elfRelocTable.getRelocData(i),
+                                false, 8, 0, Elf64_Shdr.SHT_RELA);
                 relocSection.setLink(symtabsectidx);
                 relocSection.setInfo(sect.getSectionId());
             }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/JMachORelocObject.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/JMachORelocObject.java	Fri Aug 17 13:20:53 2018 -0700
@@ -38,6 +38,8 @@
  *
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.io.IOException;
@@ -54,19 +56,14 @@
 import jdk.tools.jaotc.binformat.Relocation.RelocType;
 import jdk.tools.jaotc.binformat.Symbol;
 import jdk.tools.jaotc.binformat.Symbol.Kind;
-
-import jdk.tools.jaotc.binformat.macho.MachO.section_64;
+import jdk.tools.jaotc.binformat.macho.MachO.dysymtab_command;
 import jdk.tools.jaotc.binformat.macho.MachO.mach_header_64;
-import jdk.tools.jaotc.binformat.macho.MachO.segment_command_64;
-import jdk.tools.jaotc.binformat.macho.MachO.version_min_command;
-import jdk.tools.jaotc.binformat.macho.MachO.symtab_command;
-import jdk.tools.jaotc.binformat.macho.MachO.dysymtab_command;
 import jdk.tools.jaotc.binformat.macho.MachO.nlist_64;
 import jdk.tools.jaotc.binformat.macho.MachO.reloc_info;
-import jdk.tools.jaotc.binformat.macho.MachOContainer;
-import jdk.tools.jaotc.binformat.macho.MachOTargetInfo;
-import jdk.tools.jaotc.binformat.macho.MachOSymtab;
-import jdk.tools.jaotc.binformat.macho.MachORelocTable;
+import jdk.tools.jaotc.binformat.macho.MachO.section_64;
+import jdk.tools.jaotc.binformat.macho.MachO.segment_command_64;
+import jdk.tools.jaotc.binformat.macho.MachO.symtab_command;
+import jdk.tools.jaotc.binformat.macho.MachO.version_min_command;
 
 public class JMachORelocObject {
 
@@ -83,18 +80,18 @@
     }
 
     private void createByteSection(ArrayList<MachOSection> sections,
-                                   ByteContainer c, String sectName, String segName, int scnFlags) {
+                    ByteContainer c, String sectName, String segName, int scnFlags) {
 
         if (c.getByteArray().length == 0) {
             // System.out.println("Skipping creation of " + sectName + " section, no data\n");
         }
 
         MachOSection sect = new MachOSection(sectName,
-                                             segName,
-                                             c.getByteArray(),
-                                             scnFlags,
-                                             c.hasRelocations(),
-                                             segmentSize);
+                        segName,
+                        c.getByteArray(),
+                        scnFlags,
+                        c.hasRelocations(),
+                        segmentSize);
         // Add this section to our list
         sections.add(sect);
 
@@ -107,13 +104,13 @@
 
     private void createCodeSection(ArrayList<MachOSection> sections, CodeContainer c) {
         createByteSection(sections, c, /* c.getContainerName() */ "__text", "__TEXT",
-                          section_64.S_ATTR_PURE_INSTRUCTIONS |
-                          section_64.S_ATTR_SOME_INSTRUCTIONS);
+                        section_64.S_ATTR_PURE_INSTRUCTIONS |
+                                        section_64.S_ATTR_SOME_INSTRUCTIONS);
     }
 
     private void createReadOnlySection(ArrayList<MachOSection> sections, ReadOnlyDataContainer c) {
         createByteSection(sections, c, c.getContainerName(), "__TEXT",
-                          section_64.S_ATTR_SOME_INSTRUCTIONS);
+                        section_64.S_ATTR_SOME_INSTRUCTIONS);
     }
 
     private void createReadWriteSection(ArrayList<MachOSection> sections, ByteContainer c) {
@@ -121,7 +118,7 @@
     }
 
     /**
-     * Create an MachO relocatable object
+     * Creates an MachO relocatable object.
      *
      * @param relocationTable
      * @param symbols
@@ -130,10 +127,10 @@
     public void createMachORelocObject(Map<Symbol, List<Relocation>> relocationTable, Collection<Symbol> symbols) throws IOException {
         // Allocate MachO Header
         // with 4 load commands
-        //   LC_SEGMENT_64
-        //   LC_VERSION_MIN_MACOSX
-        //   LC_SYMTAB
-        //   LC_DYSYMTAB
+        // LC_SEGMENT_64
+        // LC_VERSION_MIN_MACOSX
+        // LC_SYMTAB
+        // LC_DYSYMTAB
 
         MachOHeader mh = new MachOHeader();
 
@@ -162,37 +159,37 @@
         // Update the Header sizeofcmds size.
         // This doesn't include the Header struct size
         mh.setCmdSizes(4, segment_command_64.totalsize +
-                          (section_64.totalsize * sections.size()) +
-                          version_min_command.totalsize +
-                          symtab_command.totalsize +
-                          dysymtab_command.totalsize);
+                        (section_64.totalsize * sections.size()) +
+                        version_min_command.totalsize +
+                        symtab_command.totalsize +
+                        dysymtab_command.totalsize);
 
         // Initialize file offset for data past commands
-        int file_offset = mach_header_64.totalsize + mh.getCmdSize();
+        int fileOffset = mach_header_64.totalsize + mh.getCmdSize();
         // and round it up
-        file_offset = (file_offset + (sections.get(0).getAlign() - 1)) & ~((sections.get(0).getAlign() - 1));
+        fileOffset = (fileOffset + (sections.get(0).getAlign() - 1)) & ~((sections.get(0).getAlign() - 1));
         long address = 0;
-        int segment_offset = file_offset;
+        int segmentOffset = fileOffset;
 
         for (int i = 0; i < sections.size(); i++) {
             MachOSection sect = sections.get(i);
-            file_offset = (file_offset + (sect.getAlign() - 1)) & ~((sect.getAlign() - 1));
+            fileOffset = (fileOffset + (sect.getAlign() - 1)) & ~((sect.getAlign() - 1));
             address = (address + (sect.getAlign() - 1)) & ~((sect.getAlign() - 1));
-            sect.setOffset(file_offset);
+            sect.setOffset(fileOffset);
             sect.setAddr(address);
-            file_offset += sect.getSize();
+            fileOffset += sect.getSize();
             address += sect.getSize();
         }
 
         // File size for Segment data
-        int segment_size = file_offset - segment_offset;
+        int segSize = fileOffset - segmentOffset;
 
         // Create the LC_SEGMENT_64 Segment which contains the MachOSections
         MachOSegment seg = new MachOSegment(segment_command_64.totalsize +
-                                            (section_64.totalsize * sections.size()),
-                                            segment_offset,
-                                            segment_size,
-                                            sections.size());
+                        (section_64.totalsize * sections.size()),
+                        segmentOffset,
+                        segSize,
+                        sections.size());
 
         MachOVersion vers = new MachOVersion();
 
@@ -201,28 +198,28 @@
 
         // Create LC_DYSYMTAB command
         MachODySymtab dysymtab = new MachODySymtab(symtab.getNumLocalSyms(),
-                                                   symtab.getNumGlobalSyms(),
-                                                   symtab.getNumUndefSyms());
+                        symtab.getNumGlobalSyms(),
+                        symtab.getNumUndefSyms());
 
         // Create the Relocation Tables
         MachORelocTable machORelocs = createMachORelocTable(sections, relocationTable, symtab);
         // Calculate file offset for relocation data
-        file_offset = (file_offset + (MachORelocTable.getAlign() - 1)) & ~((MachORelocTable.getAlign() - 1));
+        fileOffset = (fileOffset + (MachORelocTable.getAlign() - 1)) & ~((MachORelocTable.getAlign() - 1));
 
         // Update relocation sizing information in each section
         for (int i = 0; i < sections.size(); i++) {
             MachOSection sect = sections.get(i);
             if (sect.hasRelocations()) {
                 int nreloc = machORelocs.getNumRelocs(i);
-                sect.setReloff(file_offset);
+                sect.setReloff(fileOffset);
                 sect.setRelcount(nreloc);
-                file_offset += (nreloc * reloc_info.totalsize);
+                fileOffset += (nreloc * reloc_info.totalsize);
             }
         }
 
         // Calculate and set file offset for symbol table data
-        file_offset = (file_offset + (MachOSymtab.getAlign() - 1)) & ~((MachOSymtab.getAlign() - 1));
-        symtab.setOffset(file_offset);
+        fileOffset = (fileOffset + (MachOSymtab.getAlign() - 1)) & ~((MachOSymtab.getAlign() - 1));
+        symtab.setOffset(fileOffset);
 
         // Write Out Header
         machoContainer.writeBytes(mh.getArray());
@@ -271,7 +268,7 @@
      * @param symbols
      */
     private static MachOSymtab createMachOSymbolTables(ArrayList<MachOSection> sections,
-                                                       Collection<Symbol> symbols) {
+                    Collection<Symbol> symbols) {
         MachOSymtab symtab = new MachOSymtab();
         // First, create the initial null symbol. This is a local symbol.
         symtab.addSymbolEntry("", (byte) nlist_64.N_UNDF, (byte) 0, 0);
@@ -284,9 +281,9 @@
             long sectionAddr = sections.get(sectionId).getAddr();
 
             MachOSymbol machoSymbol = symtab.addSymbolEntry(symbol.getName(),
-                                                            getMachOTypeOf(symbol),
-                                                            (byte) sectionId,
-                                                            symbol.getOffset() + sectionAddr);
+                            getMachOTypeOf(symbol),
+                            (byte) sectionId,
+                            symbol.getOffset() + sectionAddr);
             symbol.setNativeSymbol(machoSymbol);
         }
 
@@ -308,8 +305,8 @@
         }
         // If Function or Data, add section type
         if (kind == Symbol.Kind.NATIVE_FUNCTION ||
-            kind == Symbol.Kind.JAVA_FUNCTION   ||
-            kind == Symbol.Kind.OBJECT) {
+                        kind == Symbol.Kind.JAVA_FUNCTION ||
+                        kind == Symbol.Kind.OBJECT) {
             type |= (nlist_64.N_SECT);
         }
 
@@ -324,12 +321,13 @@
      * @param symtab
      */
     private MachORelocTable createMachORelocTable(ArrayList<MachOSection> sections,
-                                                  Map<Symbol, List<Relocation>> relocationTable,
-                                                  MachOSymtab symtab) {
+                    Map<Symbol, List<Relocation>> relocationTable,
+                    MachOSymtab symtab) {
 
         MachORelocTable machORelocTable = new MachORelocTable(sections.size());
         /*
-         * For each of the symbols with associated relocation records, create a MachO relocation entry.
+         * For each of the symbols with associated relocation records, create a MachO relocation
+         * entry.
          */
         for (Map.Entry<Symbol, List<Relocation>> entry : relocationTable.entrySet()) {
             List<Relocation> relocs = entry.getValue();
@@ -380,8 +378,8 @@
                 int addend = -4; // Size of 32-bit address of the GOT
                 /*
                  * Relocation should be applied before the test instruction to the move instruction.
-                 * reloc.getOffset() points to the test instruction after the instruction that loads the address of
-                 * polling page. So set the offset appropriately.
+                 * reloc.getOffset() points to the test instruction after the instruction that loads
+                 * the address of polling page. So set the offset appropriately.
                  */
                 offset = offset + addend;
                 pcrel = 1;
@@ -398,8 +396,8 @@
                 throw new InternalError("Unhandled relocation type: " + relocType);
         }
         machORelocTable.createRelocationEntry(sectindex, offset, symno,
-                                              pcrel, length, isextern,
-                                              machORelocType);
+                        pcrel, length, isextern,
+                        machORelocType);
     }
 
     private static int getMachORelocationType(RelocType relocType) {
@@ -408,14 +406,14 @@
             case mach_header_64.CPU_TYPE_X86_64:
                 // Return X86_64_RELOC_* entries based on relocType
                 if (relocType == RelocType.JAVA_CALL_DIRECT ||
-                    relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
+                                relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
                     machORelocType = reloc_info.X86_64_RELOC_BRANCH;
                 } else if (relocType == RelocType.STUB_CALL_DIRECT) {
                     machORelocType = reloc_info.X86_64_RELOC_BRANCH;
                 } else if (relocType == RelocType.JAVA_CALL_INDIRECT) {
                     machORelocType = reloc_info.X86_64_RELOC_NONE;
                 } else if (relocType == RelocType.METASPACE_GOT_REFERENCE ||
-                           relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
+                                relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
                     machORelocType = reloc_info.X86_64_RELOC_BRANCH;
                 } else if (relocType == RelocType.EXTERNAL_GOT_TO_PLT) {
                     machORelocType = reloc_info.X86_64_RELOC_UNSIGNED;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachO.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachO.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,9 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 //@formatter:off
+//@Checkstyle: stop
+
 /**
  *
  * Support for the creation of Mach-o Object files. Current support is limited to 64 bit x86_64.
@@ -305,4 +309,3 @@
         static final int X86_64_RELOC_UNSIGNED  = 0x0;
     }
 }
-//@formatter:on
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOByteBuffer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOByteBuffer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,11 +21,12 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
-import jdk.tools.jaotc.binformat.macho.MachOTargetInfo;
 
 final class MachOByteBuffer {
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.io.File;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachODySymtab.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachODySymtab.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.macho.MachO.dysymtab_command;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachODySymtab {
     private final ByteBuffer dysymtab;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,13 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.macho.MachO.mach_header_64;
-import jdk.tools.jaotc.binformat.macho.MachOTargetInfo;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachOHeader {
     private final ByteBuffer header;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachORelocEntry.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachORelocEntry.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.macho.MachO.reloc_info;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachORelocEntry {
     private final ByteBuffer entry;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachORelocTable.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachORelocTable.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,14 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.nio.ByteBuffer;
 
-import jdk.tools.jaotc.binformat.macho.MachORelocEntry;
 import jdk.tools.jaotc.binformat.macho.MachO.reloc_info;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachORelocTable {
     private final ArrayList<ArrayList<MachORelocEntry>> relocEntries;
@@ -50,14 +50,14 @@
         return (4);
     }
 
-    int getNumRelocs(int section_index) {
-        return relocEntries.get(section_index).size();
+    int getNumRelocs(int sectionIndex) {
+        return relocEntries.get(sectionIndex).size();
     }
 
     // Return the relocation entries for a single section
     // or null if no entries added to section
-    byte[] getRelocData(int section_index) {
-        ArrayList<MachORelocEntry> entryList = relocEntries.get(section_index);
+    byte[] getRelocData(int sectionIndex) {
+        ArrayList<MachORelocEntry> entryList = relocEntries.get(sectionIndex);
 
         if (entryList.size() == 0) {
             return null;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSection.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSection.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.macho.MachO.section_64;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachOSection {
     private final ByteBuffer section;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSegment.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSegment.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.macho.MachO.segment_command_64;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 public class MachOSegment {
     ByteBuffer segment;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,13 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.NativeSymbol;
 import jdk.tools.jaotc.binformat.macho.MachO.nlist_64;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachOSymbol extends NativeSymbol {
     private final ByteBuffer sym;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSymtab.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOSymtab.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,20 +21,20 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 
+import jdk.tools.jaotc.binformat.macho.MachO.nlist_64;
 import jdk.tools.jaotc.binformat.macho.MachO.symtab_command;
-import jdk.tools.jaotc.binformat.macho.MachO.nlist_64;
-import jdk.tools.jaotc.binformat.macho.MachOSymbol;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachOSymtab {
 
     /**
-     * ByteBuffer holding the LC_SYMTAB command contents
+     * ByteBuffer holding the LC_SYMTAB command contents.
      */
     private final ByteBuffer symtabCmd;
 
@@ -45,17 +45,18 @@
     private final ArrayList<MachOSymbol> undefSymbols = new ArrayList<>();
 
     /**
-     * number of symbols added
+     * Number of symbols added.
      */
     private int symbolCount;
 
     /**
-     * String holding symbol table strings
+     * String holding symbol table strings.
      */
     private final StringBuilder strTabContent = new StringBuilder();
 
     /**
-     * Keeps track of bytes in string table since strTabContent.length() is number of chars, not bytes.
+     * Keeps track of bytes in string table since strTabContent.length() is number of chars, not
+     * bytes.
      */
     private int strTabNrOfBytes = 0;
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOTargetInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOTargetInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteOrder;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOVersion.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOVersion.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.macho;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.macho.MachO.version_min_command;
-import jdk.tools.jaotc.binformat.macho.MachOByteBuffer;
 
 final class MachOVersion {
     private final ByteBuffer version;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/JPECoffRelocObject.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/JPECoffRelocObject.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.io.IOException;
@@ -38,13 +40,10 @@
 import jdk.tools.jaotc.binformat.Symbol;
 import jdk.tools.jaotc.binformat.Symbol.Binding;
 import jdk.tools.jaotc.binformat.Symbol.Kind;
-
-import jdk.tools.jaotc.binformat.pecoff.PECoffSymbol;
-import jdk.tools.jaotc.binformat.pecoff.PECoffTargetInfo;
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_FILE_HEADER;
+import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_RELOCATION;
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_SECTION_HEADER;
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_SYMBOL;
-import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_RELOCATION;
 
 public class JPECoffRelocObject {
 
@@ -102,7 +101,7 @@
     }
 
     /**
-     * Create an PECoff relocatable object
+     * Creates a PECoff relocatable object.
      *
      * @param relocationTable
      * @param symbols
@@ -138,7 +137,11 @@
 
         // Add Linker Directives Section
         int scnFlags = IMAGE_SECTION_HEADER.IMAGE_SCN_LNK_INFO | IMAGE_SECTION_HEADER.IMAGE_SCN_LNK_REMOVE;
-        createByteSection(sections, ".drectve", symtab.getDirectiveArray(), false, scnFlags, 1 /* 1 byte alignment */);
+        createByteSection(sections, ".drectve", symtab.getDirectiveArray(), false, scnFlags, 1 /*
+                                                                                                * 1
+                                                                                                * byte
+                                                                                                * alignment
+                                                                                                */);
 
         // Create the Relocation Tables
         PECoffRelocTable pecoffRelocs = createPECoffRelocTable(sections, relocationTable);
@@ -154,28 +157,28 @@
         // RELOCATION TABLE
 
         // Calculate Offset for Symbol table
-        int file_offset = IMAGE_FILE_HEADER.totalsize +
+        int fileOffset = IMAGE_FILE_HEADER.totalsize +
                         (IMAGE_SECTION_HEADER.totalsize * sections.size());
 
         // Update Header fields
         header.setSectionCount(sections.size());
         header.setSymbolCount(symtab.getSymtabCount());
-        header.setSymbolOff(file_offset);
+        header.setSymbolOff(fileOffset);
 
         // Calculate file offset for first section
-        file_offset += ((symtab.getSymtabCount() * IMAGE_SYMBOL.totalsize) +
+        fileOffset += ((symtab.getSymtabCount() * IMAGE_SYMBOL.totalsize) +
                         symtab.getStrtabSize());
         // And round it up
-        file_offset = (file_offset + (sections.get(0).getDataAlign() - 1)) &
+        fileOffset = (fileOffset + (sections.get(0).getDataAlign() - 1)) &
                         ~((sections.get(0).getDataAlign() - 1));
 
         // Calc file offsets for section data
         for (int i = 0; i < sections.size(); i++) {
             PECoffSection sect = sections.get(i);
-            file_offset = (file_offset + (sect.getDataAlign() - 1)) &
+            fileOffset = (fileOffset + (sect.getDataAlign() - 1)) &
                             ~((sect.getDataAlign() - 1));
-            sect.setOffset(file_offset);
-            file_offset += sect.getSize();
+            sect.setOffset(fileOffset);
+            fileOffset += sect.getSize();
         }
 
         // Update relocation sizing information in each section
@@ -183,13 +186,13 @@
             PECoffSection sect = sections.get(i);
             if (sect.hasRelocations()) {
                 int nreloc = pecoffRelocs.getNumRelocs(i);
-                sect.setReloff(file_offset);
+                sect.setReloff(fileOffset);
                 sect.setRelcount(nreloc);
                 // extended relocations add an addition entry
                 if (nreloc > 0xFFFF) {
                     nreloc++;
                 }
-                file_offset += (nreloc * IMAGE_RELOCATION.totalsize);
+                fileOffset += (nreloc * IMAGE_RELOCATION.totalsize);
             }
         }
 
@@ -269,7 +272,8 @@
 
         PECoffRelocTable pecoffRelocTable = new PECoffRelocTable(sections.size());
         /*
-         * For each of the symbols with associated relocation records, create a PECoff relocation entry.
+         * For each of the symbols with associated relocation records, create a PECoff relocation
+         * entry.
          */
         for (Map.Entry<Symbol, List<Relocation>> entry : relocationTable.entrySet()) {
             List<Relocation> relocs = entry.getValue();
@@ -316,8 +320,8 @@
                 addend = -4; // Size of 32-bit address of the GOT
                 /*
                  * Relocation should be applied before the test instruction to the move instruction.
-                 * reloc.getOffset() points to the test instruction after the instruction that loads the address of
-                 * polling page. So set the offset appropriately.
+                 * reloc.getOffset() points to the test instruction after the instruction that loads
+                 * the address of polling page. So set the offset appropriately.
                  */
                 offset = offset + addend;
                 break;
@@ -338,14 +342,14 @@
         switch (PECoffTargetInfo.getPECoffArch()) {
             case IMAGE_FILE_HEADER.IMAGE_FILE_MACHINE_AMD64:
                 if (relocType == RelocType.JAVA_CALL_DIRECT ||
-                    relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
+                                relocType == RelocType.FOREIGN_CALL_INDIRECT_GOT) {
                     pecoffRelocType = IMAGE_RELOCATION.IMAGE_REL_AMD64_REL32;
                 } else if (relocType == RelocType.STUB_CALL_DIRECT) {
                     pecoffRelocType = IMAGE_RELOCATION.IMAGE_REL_AMD64_REL32;
                 } else if (relocType == RelocType.JAVA_CALL_INDIRECT) {
                     pecoffRelocType = IMAGE_RELOCATION.IMAGE_REL_AMD64_ABSOLUTE;
                 } else if (relocType == RelocType.METASPACE_GOT_REFERENCE ||
-                           relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
+                                relocType == RelocType.EXTERNAL_PLT_TO_GOT) {
                     pecoffRelocType = IMAGE_RELOCATION.IMAGE_REL_AMD64_REL32;
                 } else if (relocType == RelocType.EXTERNAL_GOT_TO_PLT) {
                     pecoffRelocType = IMAGE_RELOCATION.IMAGE_REL_AMD64_ADDR64;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoff.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoff.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 /**
@@ -32,13 +34,13 @@
 final class PECoff {
     //@formatter:off
     /**
-     * IMAGE_FILE_HEADER structure defines
+     * IMAGE_FILE_HEADER structure defines.
      */
     enum IMAGE_FILE_HEADER {
-                     Machine( 0, 2),
-            NumberOfSections( 2, 2),
-               TimeDateStamp( 4, 4),
-        PointerToSymbolTable( 8, 4),
+                     Machine(0, 2),
+            NumberOfSections(2, 2),
+               TimeDateStamp(4, 4),
+        PointerToSymbolTable(8, 4),
              NumberOfSymbols(12, 4),
         SizeOfOptionalHeader(16, 2),
              Characteristics(18, 2);
@@ -58,7 +60,7 @@
          */
 
         /**
-         * Machine
+         * Machine.
          */
         static final char IMAGE_FILE_MACHINE_UNKNOWN = 0x0;
         static final char IMAGE_FILE_MACHINE_AMD64   = 0x8664;
@@ -66,12 +68,12 @@
     }
 
     /**
-     * IMAGE_SECTION_HEADER structure defines
+     * IMAGE_SECTION_HEADER structure defines.
      */
     enum IMAGE_SECTION_HEADER {
-                        Name( 0, 8),
-             PhysicalAddress( 8, 4),
-                 VirtualSize( 8, 4),
+                        Name(0, 8),
+             PhysicalAddress(8, 4),
+                 VirtualSize(8, 4),
               VirtualAddress(12, 4),
                SizeOfRawData(16, 4),
             PointerToRawData(20, 4),
@@ -96,7 +98,7 @@
          */
 
         /**
-         * Characteristics
+         * Characteristics.
          */
         static final int IMAGE_SCN_CNT_CODE               = 0x20;
         static final int IMAGE_SCN_CNT_INITIALIZED_DATA   = 0x40;
@@ -129,15 +131,15 @@
     }
 
     /**
-     * Symbol table entry definitions
+     * Symbol table entry definitions.
      *
      * IMAGE_SYMBOL structure defines
      */
     enum IMAGE_SYMBOL {
-                   ShortName( 0, 8),
-                       Short( 0, 4),
-                        Long( 4, 4),
-                       Value( 8, 4),
+                   ShortName(0, 8),
+                       Short(0, 4),
+                        Long(4, 4),
+                       Value(8, 4),
                SectionNumber(12, 2),
                         Type(14, 2),
                 StorageClass(16, 1),
@@ -154,13 +156,13 @@
         static int totalsize = 18;
 
         /**
-         * Type
+         * Type.
          */
         static final int IMAGE_SYM_DTYPE_NONE     = 0x0;
         static final int IMAGE_SYM_DTYPE_FUNCTION = 0x20;
 
         /**
-         * StorageClass
+         * StorageClass.
          */
         static final int IMAGE_SYM_CLASS_NULL     = 0x0;
         static final int IMAGE_SYM_CLASS_EXTERNAL = 0x2;
@@ -170,12 +172,12 @@
     }
 
     /**
-     * IMAGE_RELOCATION structure defines
+     * IMAGE_RELOCATION structure defines.
      */
     enum IMAGE_RELOCATION {
-              VirtualAddress( 0, 4),
-            SymbolTableIndex( 4, 4),
-                        Type( 8, 2);
+              VirtualAddress(0, 4),
+            SymbolTableIndex(4, 4),
+                        Type(8, 2);
 
         final int off;
         final int sz;
@@ -188,7 +190,7 @@
         static int totalsize = 10;
 
         /**
-         * Relocation types
+         * Relocation types.
          */
         static final int IMAGE_REL_AMD64_ABSOLUTE = 0x0;
         static final int IMAGE_REL_AMD64_ADDR32   = 0x2;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffByteBuffer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffByteBuffer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteBuffer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffContainer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffContainer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.io.File;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffHeader.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffHeader.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_FILE_HEADER;
-import jdk.tools.jaotc.binformat.pecoff.PECoffByteBuffer;
 
 final class PECoffHeader {
     private final ByteBuffer header;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffRelocEntry.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffRelocEntry.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_RELOCATION;
-import jdk.tools.jaotc.binformat.pecoff.PECoffByteBuffer;
 
 final class PECoffRelocEntry {
     private final ByteBuffer entry;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffRelocTable.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffRelocTable.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,14 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_RELOCATION;
-import jdk.tools.jaotc.binformat.pecoff.PECoffRelocEntry;
-import jdk.tools.jaotc.binformat.pecoff.PECoffByteBuffer;
 
 final class PECoffRelocTable {
     ArrayList<ArrayList<PECoffRelocEntry>> relocEntries;
@@ -49,14 +49,14 @@
         return (4);
     }
 
-    int getNumRelocs(int section_index) {
-        return relocEntries.get(section_index).size();
+    int getNumRelocs(int sectionIndex) {
+        return relocEntries.get(sectionIndex).size();
     }
 
     // Return the relocation entries for a single section
     // or null if no entries added to section
-    byte[] getRelocData(int section_index) {
-        ArrayList<PECoffRelocEntry> entryList = relocEntries.get(section_index);
+    byte[] getRelocData(int sectionIndex) {
+        ArrayList<PECoffRelocEntry> entryList = relocEntries.get(sectionIndex);
         int entryCount = entryList.size();
         int allocCount = entryCount;
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSection.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSection.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,13 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_SECTION_HEADER;
-import jdk.tools.jaotc.binformat.pecoff.PECoffByteBuffer;
 
 final class PECoffSection {
     private final ByteBuffer section;
@@ -47,8 +48,8 @@
         }
 
         // Copy only Max allowed bytes to Section Entry
-        byte[] Name = sectName.getBytes();
-        int max = Name.length <= IMAGE_SECTION_HEADER.Name.sz ? Name.length : IMAGE_SECTION_HEADER.Name.sz;
+        byte[] name = sectName.getBytes();
+        int max = name.length <= IMAGE_SECTION_HEADER.Name.sz ? name.length : IMAGE_SECTION_HEADER.Name.sz;
 
         assert !(sectAlign < 1 || sectAlign > 1024 || (sectAlign & (sectAlign - 1)) != 0) : "section alignment is not valid: " + sectAlign;
         align = sectAlign;
@@ -58,7 +59,7 @@
         // Clear and set alignment bits
         int sectFlags = (sectFlags0 & ~IMAGE_SECTION_HEADER.IMAGE_SCN_ALIGN_MASK) | (sectAlignBits & IMAGE_SECTION_HEADER.IMAGE_SCN_ALIGN_MASK);
 
-        section.put(Name, IMAGE_SECTION_HEADER.Name.off, max);
+        section.put(name, IMAGE_SECTION_HEADER.Name.off, max);
 
         section.putInt(IMAGE_SECTION_HEADER.VirtualSize.off, 0);
         section.putInt(IMAGE_SECTION_HEADER.VirtualAddress.off, 0);
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,13 +21,14 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteBuffer;
 
 import jdk.tools.jaotc.binformat.NativeSymbol;
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_SYMBOL;
-import jdk.tools.jaotc.binformat.pecoff.PECoffByteBuffer;
 
 final class PECoffSymbol extends NativeSymbol {
     private final ByteBuffer sym;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSymtab.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffSymtab.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteBuffer;
@@ -28,19 +30,17 @@
 import java.util.ArrayList;
 
 import jdk.tools.jaotc.binformat.pecoff.PECoff.IMAGE_SYMBOL;
-import jdk.tools.jaotc.binformat.pecoff.PECoffSymbol;
-import jdk.tools.jaotc.binformat.pecoff.PECoffByteBuffer;
 
 final class PECoffSymtab {
     ArrayList<PECoffSymbol> symbols = new ArrayList<>();
 
     /**
-     * number of symbols added
+     * Number of symbols added.
      */
     private int symbolCount;
 
     /**
-     * String holding symbol table strings
+     * String holding symbol table strings.
      */
     private final StringBuilder strTabContent;
 
@@ -51,7 +51,7 @@
     private int strTabNrOfBytes;
 
     /**
-     * String holding Linker Directives
+     * String holding Linker Directives.
      */
     private final StringBuilder directives;
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffTargetInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/pecoff/PECoffTargetInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.binformat.pecoff;
 
 import java.nio.ByteOrder;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/HelloWorld.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2018, 2018, 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 jdk.tools.jaotc.test;
+
+public class HelloWorld {
+    public static void main(String[] args) {
+        System.out.println("Hello, world!");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/NativeOrderOutputStreamTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016, 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc.utils
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.tools.jaotc.test.NativeOrderOutputStreamTest
+ */
+
+
+
+package jdk.tools.jaotc.test;
+
+import jdk.tools.jaotc.utils.NativeOrderOutputStream;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+public class NativeOrderOutputStreamTest {
+
+    private NativeOrderOutputStream target;
+
+    @Before
+    public void setup() {
+        target = new NativeOrderOutputStream();
+    }
+
+    @Test
+    public void shouldAdd4BytesForInt() {
+        target.putInt(5);
+        Assert.assertEquals(4, target.position());
+    }
+
+    @Test
+    public void shouldAdd8BytesForLong() {
+        target.putLong(8);
+        Assert.assertEquals(8, target.position());
+    }
+
+    @Test
+    public void shouldHaveCorrectSizeBeforePatch() {
+        target.patchableInt();
+        Assert.assertEquals(4, target.position());
+    }
+
+    @Test
+    public void shouldHaveCorrectSizeAfterPatch() {
+        NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
+        patchableInt.set(12);
+        Assert.assertEquals(4, target.position());
+    }
+
+    @Test
+    public void shouldSetCorrectValueInPatch() {
+        NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
+        patchableInt.set(42);
+        Assert.assertEquals(42, getInt(0));
+    }
+
+    private int getInt(int pos) {
+        ByteBuffer buffer = ByteBuffer.wrap(target.array());
+        buffer.order(ByteOrder.nativeOrder());
+        return buffer.getInt(pos);
+    }
+
+    @Test
+    public void shouldPutArrayCorrectly() {
+        target.put(new byte[]{42, 5, 43, 44});
+        Assert.assertEquals(4, target.position());
+        Assert.assertEquals(42, target.array()[0]);
+        Assert.assertEquals(4, target.position());
+    }
+
+    @Test
+    public void shouldOnlyPatchSlot() {
+        NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
+        target.putInt(7);
+        patchableInt.set(39);
+        Assert.assertEquals(39, getInt(0));
+        Assert.assertEquals(7, getInt(4));
+    }
+
+    @Test
+    public void shouldBeAbleToPatchAnywhere() {
+        target.putInt(19);
+        NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
+        patchableInt.set(242);
+
+        Assert.assertEquals(19, getInt(0));
+        Assert.assertEquals(242, getInt(4));
+    }
+
+    @Test
+    public void shouldHavePatchableAtRightOffset() {
+        target.putInt(27);
+        Assert.assertEquals(4, target.position());
+        NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
+        Assert.assertEquals(4, patchableInt.position());
+    }
+
+    @Test
+    public void shouldAlign() {
+        target.putInt(9);
+        target.align(16);
+        target.put(new byte[]{3});
+        target.align(8);
+        Assert.assertEquals(24, target.position());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ * @run junit/othervm jdk.tools.jaotc.test.collect.ClassSearchTest
+ */
+
+
+
+package jdk.tools.jaotc.test.collect;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import jdk.tools.jaotc.LoadedClass;
+import jdk.tools.jaotc.collect.ClassSearch;
+import jdk.tools.jaotc.collect.ClassSource;
+import jdk.tools.jaotc.collect.SearchFor;
+import jdk.tools.jaotc.collect.SearchPath;
+import jdk.tools.jaotc.collect.SourceProvider;
+
+public class ClassSearchTest {
+    @Test(expected = InternalError.class)
+    public void itShouldThrowExceptionIfNoProvidersAvailable() {
+        ClassSearch target = new ClassSearch();
+        SearchPath searchPath = new SearchPath();
+        target.search(list(new SearchFor("foo")), searchPath);
+    }
+
+    @Test
+    public void itShouldFindAProviderForEachEntry() {
+        Set<String> searched = new HashSet<>();
+        ClassSearch target = new ClassSearch();
+        target.addProvider(provider("", (name, searchPath) -> {
+            searched.add(name);
+            return new NoopSource();
+        }));
+        target.search(searchForList("foo", "bar", "foobar"), null);
+        Assert.assertEquals(hashset("foo", "bar", "foobar"), searched);
+    }
+
+    private static SourceProvider provider(String supports, BiFunction<String, SearchPath, ClassSource> fn) {
+        return new SourceProvider() {
+            @Override
+            public ClassSource findSource(String name, SearchPath searchPath) {
+                return fn.apply(name, searchPath);
+            }
+
+            @Override
+            public boolean supports(String type) {
+                return supports.equals(type);
+            }
+        };
+    }
+
+    @Test
+    public void itShouldOnlySearchSupportedProvidersForKnownType() {
+        Set<String> visited = new HashSet<>();
+        ClassSearch target = new ClassSearch();
+
+        target.addProvider(provider("jar", (name, searchPath) -> {
+            visited.add("jar");
+            return null;
+        }));
+
+        target.addProvider(provider("dir", (name, searchPath) -> {
+            visited.add("dir");
+            return null;
+        }));
+
+        try {
+            target.search(list(new SearchFor("some", "dir")), null);
+        } catch (InternalError e) {
+            // throws because no provider gives a source
+        }
+
+        Assert.assertEquals(hashset("dir"), visited);
+    }
+
+    @Test(expected = InternalError.class)
+    public void itShouldThrowErrorIfMultipleSourcesAreAvailable() {
+        ClassSearch target = new ClassSearch();
+        target.addProvider(provider("", (name, searchPath) -> consumer -> Assert.fail()));
+        target.addProvider(provider("", (name, searchPath) -> consumer -> Assert.fail()));
+
+        target.search(searchForList("somethign"), null);
+    }
+
+    @Test
+    public void itShouldSearchAllProvidersForUnknownType() {
+        Set<String> visited = new HashSet<>();
+        ClassSearch target = new ClassSearch();
+        target.addProvider(provider("", (name, searchPath) -> {
+            visited.add("1");
+            return null;
+        }));
+        target.addProvider(provider("", (name, searchPath) -> {
+            visited.add("2");
+            return null;
+        }));
+
+        try {
+            target.search(searchForList("foo"), null);
+        } catch (InternalError e) {
+            // throws because no provider gives a source
+        }
+
+        Assert.assertEquals(hashset("1", "2"), visited);
+    }
+
+    @Test
+    public void itShouldTryToLoadSaidClassFromClassLoader() {
+        Set<String> loaded = new HashSet<>();
+
+        ClassSearch target = new ClassSearch();
+        target.addProvider(new SourceProvider() {
+            @Override
+            public boolean supports(String type) {
+                return true;
+            }
+
+            @Override
+            public ClassSource findSource(String name, SearchPath searchPath) {
+                return new ClassSource() {
+                    @Override
+                    public void eachClass(BiConsumer<String, ClassLoader> consumer) {
+                        consumer.accept("foo.Bar", new ClassLoader() {
+                            @Override
+                            public Class<?> loadClass(String nm) throws ClassNotFoundException {
+                                loaded.add(nm);
+                                return null;
+                            }
+                        });
+                    }
+                };
+            }
+        });
+
+        java.util.List<LoadedClass> search = target.search(searchForList("/tmp/something"), null);
+        Assert.assertEquals(list(new LoadedClass("foo.Bar", null)), search);
+    }
+
+    @Test(expected = InternalError.class)
+    public void itShouldThrowInternalErrorWhenClassLoaderFails() {
+        ClassLoader classLoader = new ClassLoader() {
+            @Override
+            public Class<?> loadClass(String name1) throws ClassNotFoundException {
+                throw new ClassNotFoundException("failed to find " + name1);
+            }
+        };
+
+        ClassSearch target = new ClassSearch();
+        target.addProvider(provider("", (name, searchPath) -> consumer -> consumer.accept("foo.Bar", classLoader)));
+        target.search(searchForList("foobar"), null);
+    }
+
+    private static List<SearchFor> searchForList(String... entries) {
+        List<SearchFor> list = new ArrayList<>();
+        for (String entry : entries) {
+            list.add(new SearchFor(entry));
+        }
+        return list;
+    }
+
+    @SafeVarargs
+    private static <T> List<T> list(T... entries) {
+        List<T> list = new ArrayList<>();
+        for (T entry : entries) {
+            list.add(entry);
+        }
+        return list;
+    }
+
+    @SafeVarargs
+    private static <T> Set<T> hashset(T... entries) {
+        Set<T> set = new HashSet<>();
+        for (T entry : entries) {
+            set.add(entry);
+        }
+        return set;
+    }
+
+    private static class NoopSource implements ClassSource {
+        @Override
+        public void eachClass(BiConsumer<String, ClassLoader> consumer) {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ * @build jdk.tools.jaotc.test.collect.Utils
+ * @run junit/othervm jdk.tools.jaotc.test.collect.ClassSourceTest
+ */
+
+
+
+package jdk.tools.jaotc.test.collect;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.nio.file.Paths;
+
+import static jdk.tools.jaotc.collect.ClassSource.makeClassName;
+
+import static jdk.tools.jaotc.test.collect.Utils.getpath;
+
+public class ClassSourceTest {
+    @Test(expected = IllegalArgumentException.class)
+    public void itShouldThrowExceptionIfPathDoesntEndWithClass() {
+        makeClassName(Paths.get("Bar.clazz"));
+    }
+
+    @Test
+    public void itShouldReplaceSlashesWithDots() {
+        Assert.assertEquals("foo.Bar", makeClassName(getpath("foo/Bar.class")));
+    }
+
+    @Test
+    public void itShouldStripLeadingSlash() {
+        Assert.assertEquals("Hello", makeClassName(getpath("/Hello.class")));
+    }
+
+    @Test
+    public void itShouldReplaceMultipleDots() {
+        Assert.assertEquals("some.foo.bar.FooBar", makeClassName(getpath("/some/foo/bar/FooBar.class")));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2017, 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 jdk.tools.jaotc.test.collect;
+
+import java.net.MalformedURLException;
+import java.nio.file.Path;
+import java.util.HashSet;
+import java.util.Set;
+
+import jdk.tools.jaotc.collect.FileSupport;
+
+public class FakeFileSupport extends FileSupport {
+    private final Set<String> exists = new HashSet<>();
+    private final Set<String> directories = new HashSet<>();
+
+    private final Set<String> checkedExists = new HashSet<>();
+    private final Set<String> checkedDirectory = new HashSet<>();
+    private final Set<String> checkedJarFileSystemRoots = new HashSet<>();
+    private final Set<String> classloaderPaths = new HashSet<>();
+
+    private Path jarFileSystemRoot = null;
+    private final ClassLoader classLoader;
+
+    public FakeFileSupport(Set<String> existing, Set<String> directories) {
+        this.exists.addAll(existing);
+        this.directories.addAll(directories);
+
+        classLoader = new ClassLoader() {
+            @Override
+            public Class<?> loadClass(String name) throws ClassNotFoundException {
+                return null;
+            }
+        };
+    }
+
+    public void setJarFileSystemRoot(Path path) {
+        jarFileSystemRoot = path;
+    }
+
+    @Override
+    public boolean exists(Path path) {
+        checkedExists.add(path.toString());
+        return exists.contains(path.toString());
+    }
+
+    @Override
+    public boolean isDirectory(Path path) {
+        checkedDirectory.add(path.toString());
+        return directories.contains(path.toString());
+    }
+
+    @Override
+    public ClassLoader createClassLoader(Path path) throws MalformedURLException {
+        classloaderPaths.add(path.toString());
+        return classLoader;
+    }
+
+    @Override
+    public Path getJarFileSystemRoot(Path jarFile) {
+        checkedJarFileSystemRoots.add(jarFile.toString());
+        return jarFileSystemRoot;
+    }
+
+    @Override
+    public boolean isAbsolute(Path entry) {
+        return entry.toString().startsWith("/");
+    }
+
+    public void addExist(String name) {
+        exists.add(name);
+    }
+
+    public void addDirectory(String name) {
+        directories.add(name);
+    }
+
+    public Set<String> getCheckedExists() {
+        return checkedExists;
+    }
+
+    public Set<String> getCheckedDirectory() {
+        return checkedDirectory;
+    }
+
+    public Set<String> getCheckedJarFileSystemRoots() {
+        return checkedJarFileSystemRoots;
+    }
+
+    public Set<String> getClassloaderPaths() {
+        return classloaderPaths;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, 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 jdk.tools.jaotc.test.collect;
+
+import jdk.tools.jaotc.collect.SearchPath;
+
+import java.nio.file.FileSystem;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Set;
+
+import static jdk.tools.jaotc.test.collect.Utils.set;
+
+public class FakeSearchPath extends SearchPath {
+    private Path path = null;
+    public Set<String> entries = set();
+
+    public FakeSearchPath(String name) {
+        if (name != null) {
+            path = Paths.get(name);
+        }
+    }
+
+    @Override
+    public Path find(FileSystem fileSystem, Path entry, String... defaults) {
+        entries.add(entry.toString());
+        return path;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *
+ * @build jdk.tools.jaotc.test.collect.Utils
+ * @build jdk.tools.jaotc.test.collect.FakeFileSupport
+ * @run junit/othervm jdk.tools.jaotc.test.collect.SearchPathTest
+ */
+
+
+
+package jdk.tools.jaotc.test.collect;
+
+import static jdk.tools.jaotc.test.collect.Utils.mkpath;
+import static jdk.tools.jaotc.test.collect.Utils.mkpaths;
+import static jdk.tools.jaotc.test.collect.Utils.set;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import jdk.tools.jaotc.collect.SearchPath;
+
+public class SearchPathTest {
+    private FakeFileSupport fileSupport;
+    private FileSystem fs;
+
+    @Before
+    public void setUp() throws Exception {
+        fs = FileSystems.getDefault();
+    }
+
+    @Test
+    public void itShouldUsePathIfPathIsAbsoluteAndExisting() {
+        fileSupport = new FakeFileSupport(mkpaths("/foo"), set());
+        SearchPath target = new SearchPath(fileSupport);
+        Path foo = Paths.get(mkpath("/foo"));
+        Path result = target.find(fs, foo);
+        assertSame(result, foo);
+    }
+
+    @Test
+    public void itShouldReturnNullIfPathIsAbsoluteAndNonExisting() {
+        fileSupport = new FakeFileSupport(set(), set());
+        SearchPath target = new SearchPath(fileSupport);
+        Path result = target.find(fs, Paths.get(mkpath("/bar")));
+        assertNull(result);
+    }
+
+    @Test
+    public void itShouldUseRelativeExisting() {
+        fileSupport = new FakeFileSupport(mkpaths("hello", "tmp/hello", "search/hello"), set());
+        SearchPath target = new SearchPath(fileSupport);
+        target.add("search");
+        Path hello = Paths.get("hello");
+        Path result = target.find(fs, hello, "tmp");
+        assertSame(result, hello);
+    }
+
+    @Test
+    public void itShouldSearchDefaultsBeforeSearchPaths() {
+        fileSupport = new FakeFileSupport(mkpaths("bar/foobar"), set());
+        SearchPath target = new SearchPath(fileSupport);
+        Path result = target.find(fs, Paths.get("foobar"), "default1", "bar");
+        assertEquals(mkpath("bar/foobar"), result.toString());
+        assertEquals(mkpaths("foobar", "default1/foobar", "bar/foobar"), fileSupport.getCheckedExists());
+    }
+
+    @Test
+    public void itShouldUseSearchPathsIfNotInDefaults() {
+        fileSupport = new FakeFileSupport(mkpaths("bar/tmp/foobar"), set());
+        SearchPath target = new SearchPath(fileSupport);
+        target.add("foo/tmp", "bar/tmp");
+
+        Path result = target.find(fs, Paths.get("foobar"), "foo", "bar");
+        assertEquals(mkpath("bar/tmp/foobar"), result.toString());
+        assertEquals(mkpaths("foobar", "foo/foobar", "bar/foobar", "bar/tmp/foobar", "foo/tmp/foobar"), fileSupport.getCheckedExists());
+    }
+
+    @Test
+    public void itShouldReturnNullIfNoExistingPathIsFound() {
+        fileSupport = new FakeFileSupport(set(), set());
+        SearchPath target = new SearchPath(fileSupport);
+        target.add("dir1", "dir2");
+
+        Path result = target.find(fs, Paths.get("entry"), "dir3", "dir4");
+        assertNull(result);
+        assertEquals(mkpaths("entry", "dir1/entry", "dir2/entry", "dir3/entry", "dir4/entry"), fileSupport.getCheckedExists());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/Utils.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017, 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 jdk.tools.jaotc.test.collect;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Utils {
+    @SafeVarargs
+    public static <T> Set<T> set(T... entries) {
+        Set<T> set = new HashSet<>();
+        for (T entry : entries) {
+            set.add(entry);
+        }
+        return set;
+    }
+
+    public static String mkpath(String path) {
+        return getpath(path).toString();
+    }
+
+    public static Set<String> mkpaths(String... paths) {
+        Set<String> set = new HashSet<>();
+        for (String entry : paths) {
+            set.add(mkpath(entry));
+        }
+        return set;
+    }
+
+    public static Path getpath(String path) {
+        if (path.startsWith("/") && System.getProperty("os.name").startsWith("Windows")) {
+            return Paths.get(new File(path).getAbsolutePath());
+        } else {
+            return Paths.get(path);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *          jdk.aot/jdk.tools.jaotc.collect.directory
+ * @compile ../Utils.java
+ * @compile ../FakeFileSupport.java
+ * @run junit/othervm jdk.tools.jaotc.test.collect.directory.DirectorySourceProviderTest
+ */
+
+
+
+package jdk.tools.jaotc.test.collect.directory;
+
+import jdk.tools.jaotc.collect.ClassSource;
+import jdk.tools.jaotc.collect.directory.DirectorySourceProvider;
+import jdk.tools.jaotc.test.collect.FakeFileSupport;
+import jdk.tools.jaotc.collect.FileSupport;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.net.MalformedURLException;
+import java.nio.file.Path;
+import java.util.Set;
+
+import static jdk.tools.jaotc.test.collect.Utils.set;
+
+public class DirectorySourceProviderTest {
+    @Test
+    public void itShouldReturnNullForNonExistantPath() {
+        DirectorySourceProvider target = new DirectorySourceProvider(new FakeFileSupport(set(), set()));
+        ClassSource result = target.findSource("hello", null);
+        Assert.assertNull(result);
+    }
+
+    @Test
+    public void itShouldReturnNullForNonDirectory() {
+        DirectorySourceProvider target = new DirectorySourceProvider(new FakeFileSupport(set("foobar"), set()));
+        ClassSource result = target.findSource("foobar", null);
+        Assert.assertNull(result);
+    }
+
+    @Test
+    public void itShouldReturnNullForMalformedURI() {
+        Set<String> visited = set();
+        DirectorySourceProvider target = new DirectorySourceProvider(new FakeFileSupport(set("foobar"), set("foobar")) {
+            @Override
+            public ClassLoader createClassLoader(Path path) throws MalformedURLException {
+                visited.add("1");
+                throw new MalformedURLException("...");
+            }
+        });
+        ClassSource result = target.findSource("foobar", null);
+        Assert.assertNull(result);
+        Assert.assertEquals(set("1"), visited);
+    }
+
+    @Test
+    public void itShouldCreateSourceIfNameExistsAndIsADirectory() {
+        FileSupport fileSupport = new FakeFileSupport(set("foo"), set("foo"));
+        DirectorySourceProvider target = new DirectorySourceProvider(fileSupport);
+        ClassSource foo = target.findSource("foo", null);
+        Assert.assertNotNull(foo);
+        Assert.assertEquals("directory:foo", foo.toString());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *          jdk.aot/jdk.tools.jaotc.collect.jar
+ * @compile ../Utils.java
+ * @compile ../FakeFileSupport.java
+ * @compile ../FakeSearchPath.java
+ *
+ * @run junit/othervm jdk.tools.jaotc.test.collect.jar.JarSourceProviderTest
+ */
+
+
+
+package jdk.tools.jaotc.test.collect.jar;
+
+import static jdk.tools.jaotc.test.collect.Utils.mkpath;
+import static jdk.tools.jaotc.test.collect.Utils.set;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.ProviderNotFoundException;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import jdk.tools.jaotc.collect.ClassSource;
+import jdk.tools.jaotc.collect.jar.JarSourceProvider;
+import jdk.tools.jaotc.test.collect.FakeFileSupport;
+import jdk.tools.jaotc.test.collect.FakeSearchPath;
+
+public class JarSourceProviderTest {
+
+    private FakeFileSupport fileSupport;
+    private JarSourceProvider target;
+
+    @Before
+    public void setUp() throws Exception {
+        fileSupport = new FakeFileSupport(set(), set());
+        target = new JarSourceProvider(fileSupport);
+    }
+
+    @Test
+    public void itShouldUseSearchPathToFindPath() {
+        FakeSearchPath searchPath = new FakeSearchPath(null);
+        target.findSource("hello", searchPath);
+
+        Assert.assertEquals(set("hello"), searchPath.entries);
+    }
+
+    @Test
+    public void itShouldReturnNullIfPathIsNull() {
+        ClassSource source = target.findSource("foobar", new FakeSearchPath(null));
+        Assert.assertNull(source);
+    }
+
+    @Test
+    public void itShouldReturnNullIfPathIsDirectory() {
+        fileSupport.addDirectory("hello/foobar");
+        ClassSource source = target.findSource("foobar", new FakeSearchPath("hello/foobar"));
+
+        Assert.assertNull(source);
+        Assert.assertEquals(set(mkpath("hello/foobar")), fileSupport.getCheckedDirectory());
+    }
+
+    @Test
+    public void itShouldReturnNullIfUnableToMakeJarFileSystem() {
+        fileSupport.setJarFileSystemRoot(null);
+        ClassSource result = target.findSource("foobar", new FakeSearchPath("foo/bar"));
+
+        Assert.assertEquals(set(mkpath("foo/bar")), fileSupport.getCheckedJarFileSystemRoots());
+        Assert.assertNull(result);
+    }
+
+    @Test
+    public void itShouldReturnNullIfNotValidJarProvider() {
+        fileSupport = new FakeFileSupport(set(), set()) {
+
+            @Override
+            public Path getJarFileSystemRoot(Path jarFile) {
+                super.getJarFileSystemRoot(jarFile);
+                throw new ProviderNotFoundException();
+            }
+        };
+        fileSupport.setJarFileSystemRoot(null);
+        target = new JarSourceProvider(fileSupport);
+
+        ClassSource result = target.findSource("foobar", new FakeSearchPath("foo/bar"));
+
+        Assert.assertEquals(set(mkpath("foo/bar")), fileSupport.getCheckedJarFileSystemRoots());
+        Assert.assertNull(result);
+    }
+
+    @Test
+    public void itShouldReturnSourceWhenAllIsValid() {
+        fileSupport.setJarFileSystemRoot(Paths.get("some/bar"));
+        ClassSource result = target.findSource("foobar", new FakeSearchPath("this/bar"));
+
+        Assert.assertEquals(set(mkpath("this/bar")), fileSupport.getClassloaderPaths());
+        Assert.assertEquals("jar:" + mkpath("this/bar"), result.toString());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * @test
+ * @requires vm.aot
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *          jdk.aot/jdk.tools.jaotc.collect.module
+ * @compile ../Utils.java
+ * @run junit/othervm jdk.tools.jaotc.test.collect.module.ModuleSourceProviderTest
+ */
+
+
+
+package jdk.tools.jaotc.test.collect.module;
+
+import static jdk.tools.jaotc.test.collect.Utils.mkpath;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.function.BiFunction;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import jdk.tools.jaotc.collect.FileSupport;
+import jdk.tools.jaotc.collect.module.ModuleSource;
+import jdk.tools.jaotc.collect.module.ModuleSourceProvider;
+
+public class ModuleSourceProviderTest {
+    private ClassLoader classLoader;
+    private ModuleSourceProvider target;
+    private FileSupport fileSupport;
+    private BiFunction<Path, Path, Path> getSubDirectory = null;
+
+    @Before
+    public void setUp() {
+        classLoader = new FakeClassLoader();
+        fileSupport = new FileSupport() {
+
+            @Override
+            public boolean isDirectory(Path path) {
+                return true;
+            }
+
+            @Override
+            public Path getSubDirectory(FileSystem fileSystem, Path root, Path path) throws IOException {
+                if (getSubDirectory == null) {
+                    throw new IOException("Nope");
+                }
+                return getSubDirectory.apply(root, path);
+            }
+        };
+        target = new ModuleSourceProvider(FileSystems.getDefault(), classLoader, fileSupport);
+    }
+
+    @Test
+    public void itShouldUseFileSupport() {
+        getSubDirectory = (root, path) -> {
+            if (root.toString().equals("modules") && path.toString().equals("test.module")) {
+                return Paths.get("modules/test.module");
+            }
+            return null;
+        };
+
+        ModuleSource source = (ModuleSource) target.findSource("test.module", null);
+        assertEquals(mkpath("modules/test.module"), source.getModulePath().toString());
+        assertEquals("module:" + mkpath("modules/test.module"), source.toString());
+    }
+
+    private static class FakeClassLoader extends ClassLoader {
+        @Override
+        public Class<?> loadClass(String name) throws ClassNotFoundException {
+            return null;
+        }
+    }
+}
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.ListIterator;
@@ -28,7 +30,6 @@
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.core.GraalCompiler;
 import org.graalvm.compiler.core.common.CompilationIdentifier;
-import org.graalvm.compiler.core.common.CompilationIdentifier.Verbosity;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.hotspot.HotSpotBackend;
 import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.concurrent.TimeUnit;
@@ -87,6 +89,7 @@
     /**
      * Compile a method or a constructor.
      */
+    @Override
     @SuppressWarnings("try")
     public void run() {
         // Ensure a JVMCI runtime is initialized prior to Debug being initialized as the former
@@ -186,12 +189,15 @@
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         AOTCompilationTask other = (AOTCompilationTask) obj;
         return (this.id == other.id);
     }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompiledClass.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompiledClass.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,27 +21,27 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Set;
 
+import jdk.tools.jaotc.AOTDynamicTypeStore.AdapterLocation;
+import jdk.tools.jaotc.AOTDynamicTypeStore.AppendixLocation;
+import jdk.tools.jaotc.AOTDynamicTypeStore.Location;
 import jdk.tools.jaotc.binformat.BinaryContainer;
 import jdk.tools.jaotc.binformat.ReadOnlyDataContainer;
 import jdk.tools.jaotc.binformat.Symbol.Binding;
 import jdk.tools.jaotc.binformat.Symbol.Kind;
-
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.ResolvedJavaField;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
 
-import jdk.tools.jaotc.AOTDynamicTypeStore.AdapterLocation;
-import jdk.tools.jaotc.AOTDynamicTypeStore.AppendixLocation;
-import jdk.tools.jaotc.AOTDynamicTypeStore.Location;
-
 /**
  * Class encapsulating Graal-compiled output of a Java class. The compilation result of all methods
  * of a class {@code className} are maintained in an array list.
@@ -74,7 +74,7 @@
             this.dependentMethods = new ArrayList<>();
             this.classId = classId;
             this.type = type;
-            this.metadataName = type.isAnonymous() ? "anon<"+ classId + ">": type.getName();
+            this.metadataName = type.isAnonymous() ? "anon<" + classId + ">" : type.getName();
             this.gotIndex = binaryContainer.addTwoSlotKlassSymbol(metadataName);
             this.compiledMethodsOffset = -1; // Not compiled classes do not have compiled methods.
             this.dependentMethodsOffset = -1;
@@ -84,9 +84,9 @@
             String name = metadataName;
             Set<Location> locs = dynoStore.getDynamicClassLocationsForType(type);
             if (locs == null) {
-                return new String[] {name};
+                return new String[]{name};
             } else {
-                ArrayList<String> names = new ArrayList<String>();
+                ArrayList<String> names = new ArrayList<>();
                 names.add(name);
                 for (Location l : locs) {
                     HotSpotResolvedObjectType cpType = l.getHolder();
@@ -95,14 +95,14 @@
                     // may record types that don't make it into the final graph.
                     // We can safely ignore those here.
                     if (data == null) {
-                       // Not a compiled or inlined method
-                       continue;
+                        // Not a compiled or inlined method
+                        continue;
                     }
                     int cpi = l.getCpi();
-                    String location = "<"+ data.classId + ":" + cpi + ">";
+                    String location = "<" + data.classId + ":" + cpi + ">";
                     if (l instanceof AdapterLocation) {
                         names.add("adapter" + location);
-                        AdapterLocation a = (AdapterLocation)l;
+                        AdapterLocation a = (AdapterLocation) l;
                         names.add("adapter:" + a.getMethodId() + location);
                     } else {
                         assert l instanceof AppendixLocation;
@@ -319,26 +319,23 @@
     /**
      * Add a klass data.
      */
-    synchronized static AOTKlassData addAOTKlassData(BinaryContainer binaryContainer, HotSpotResolvedObjectType type) {
-        String name = type.getName();
-        AOTKlassData data = klassData.get(name);
-        if (data != null) {
-            assert data.getType() == type : "duplicate classes for name " + name;
-        } else {
+    static synchronized AOTKlassData addAOTKlassData(BinaryContainer binaryContainer, HotSpotResolvedObjectType type) {
+        AOTKlassData data = getAOTKlassData(type);
+        if (data == null) {
             data = new AOTKlassData(binaryContainer, type, classesCount++);
-            klassData.put(name, data);
+            klassData.put(type.getName(), data);
         }
         return data;
     }
 
-    private synchronized static AOTKlassData getAOTKlassData(String name) {
-        return klassData.get(name);
-    }
-
-    synchronized static AOTKlassData getAOTKlassData(HotSpotResolvedObjectType type) {
+    static synchronized AOTKlassData getAOTKlassData(HotSpotResolvedObjectType type) {
         String name = type.getName();
-        AOTKlassData data =  getAOTKlassData(name);
-        assert data == null || data.getType() == type : "duplicate classes for name " + name;
+        AOTKlassData data = klassData.get(name);
+        if (data != null) {
+            HotSpotResolvedObjectType oldType = data.getType();
+            assert oldType == type : "duplicate classes for name " + type.getName() + ", fingerprints old: " + oldType.getFingerprint() + ", new: " + type.getFingerprint() +
+                            ", klass pointers old: " + oldType.klass() + ", new: " + type.klass();
+        }
         return data;
     }
 
@@ -363,17 +360,14 @@
         }
     }
 
-    synchronized static AOTKlassData addFingerprintKlassData(BinaryContainer binaryContainer, HotSpotResolvedObjectType type) {
+    static synchronized AOTKlassData addFingerprintKlassData(BinaryContainer binaryContainer, HotSpotResolvedObjectType type) {
         if (type.isArray()) {
             return addAOTKlassData(binaryContainer, type);
         }
         assert type.getFingerprint() != 0 : "no fingerprint for " + type.getName();
         AOTKlassData old = getAOTKlassData(type);
         if (old != null) {
-            boolean assertsEnabled = false;
-            // Next assignment will be executed when asserts are enabled.
-            assert assertsEnabled = true;
-            if (assertsEnabled) {
+            if (areAssertionsEnabled()) {
                 HotSpotResolvedObjectType s = type.getSuperclass();
                 if (s != null) {
                     assert getAOTKlassData(s) != null : "fingerprint for super " + s.getName() + " needed for " + type.getName();
@@ -397,6 +391,14 @@
         return addAOTKlassData(binaryContainer, type);
     }
 
+    @SuppressWarnings("all")
+    private static boolean areAssertionsEnabled() {
+        boolean assertsEnabled = false;
+        // Next assignment will be executed when asserts are enabled.
+        assert assertsEnabled = true;
+        return assertsEnabled;
+    }
+
     /*
      * Put methods data to contained.
      */
@@ -431,9 +433,7 @@
     }
 
     static HotSpotResolvedObjectType getType(Object ref) {
-        return (ref instanceof HotSpotResolvedObjectType) ?
-            (HotSpotResolvedObjectType)ref :
-            ((HotSpotResolvedJavaMethod)ref).getDeclaringClass();
+        return (ref instanceof HotSpotResolvedObjectType) ? (HotSpotResolvedObjectType) ref : ((HotSpotResolvedJavaMethod) ref).getDeclaringClass();
     }
 
     static String metadataName(HotSpotResolvedObjectType type) {
@@ -448,11 +448,11 @@
 
     static String metadataName(Object ref) {
         if (ref instanceof HotSpotResolvedJavaMethod) {
-            HotSpotResolvedJavaMethod m = (HotSpotResolvedJavaMethod)ref;
+            HotSpotResolvedJavaMethod m = (HotSpotResolvedJavaMethod) ref;
             return metadataName(m);
         } else {
             assert ref instanceof HotSpotResolvedObjectType : "unexpected object type " + ref.getClass().getName();
-            HotSpotResolvedObjectType type = (HotSpotResolvedObjectType)ref;
+            HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) ref;
             return metadataName(type);
         }
     }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompiler.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompiler.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.ArrayList;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTDynamicTypeStore.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTDynamicTypeStore.java	Fri Aug 17 13:20:53 2018 -0700
@@ -20,32 +20,23 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+
 package jdk.tools.jaotc;
 
-import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin.DynamicTypeStore;
-import org.graalvm.compiler.nodes.ConstantNode;
-import org.graalvm.compiler.nodes.StructuredGraph;
-import org.graalvm.compiler.nodes.ValueNode;
-import org.graalvm.compiler.nodes.graphbuilderconf.InvokeDynamicPlugin;
-import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext;
-
-import jdk.vm.ci.hotspot.HotSpotConstantPool;
-import jdk.vm.ci.hotspot.HotSpotConstantPoolObject;
-import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
-import jdk.vm.ci.hotspot.HotSpotObjectConstant;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.vm.ci.meta.ConstantReflectionProvider;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.MetaAccessProvider;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin.DynamicTypeStore;
+
+import jdk.vm.ci.hotspot.HotSpotConstantPool;
+import jdk.vm.ci.hotspot.HotSpotConstantPoolObject;
+import jdk.vm.ci.hotspot.HotSpotObjectConstant;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+import jdk.vm.ci.meta.JavaConstant;
+
 final class AOTDynamicTypeStore implements DynamicTypeStore {
 
     public static class Location {
@@ -60,15 +51,22 @@
         public HotSpotResolvedObjectType getHolder() {
             return holder;
         }
+
         public int getCpi() {
             return cpi;
         }
+
+        @Override
         public String toString() {
             return getHolder().getName() + "@" + cpi;
         }
+
+        @Override
         public int hashCode() {
             return holder.hashCode() + getClass().hashCode() + cpi;
         }
+
+        @Override
         public boolean equals(Object o) {
             if (this == o) {
                 return true;
@@ -76,7 +74,7 @@
             if (getClass() != o.getClass()) {
                 return false;
             }
-            Location l = (Location)o;
+            Location l = (Location) o;
             return cpi == l.cpi && holder.equals(l.holder);
         }
     }
@@ -88,9 +86,12 @@
             super(holder, cpi);
             this.methodId = methodId;
         }
+
         public int getMethodId() {
             return methodId;
         }
+
+        @Override
         public String toString() {
             return "adapter:" + methodId + "@" + super.toString();
         }
@@ -100,6 +101,8 @@
         AppendixLocation(HotSpotResolvedObjectType holder, int cpi) {
             super(holder, cpi);
         }
+
+        @Override
         public String toString() {
             return "appendix@" + super.toString();
         }
@@ -122,7 +125,7 @@
 
     @Override
     public void recordAdapter(int opcode, HotSpotResolvedObjectType holder, int index, HotSpotResolvedJavaMethod adapter) {
-        int cpi = ((HotSpotConstantPool)holder.getConstantPool()).rawIndexToConstantPoolIndex(index, opcode);
+        int cpi = ((HotSpotConstantPool) holder.getConstantPool()).rawIndexToConstantPoolIndex(index, opcode);
         int methodId = adapter.methodIdnum();
         HotSpotResolvedObjectType adapterType = adapter.getDeclaringClass();
         recordDynamicTypeLocation(new AdapterLocation(holder, cpi, methodId), adapterType);
@@ -130,8 +133,8 @@
 
     @Override
     public JavaConstant recordAppendix(int opcode, HotSpotResolvedObjectType holder, int index, JavaConstant appendix) {
-        int cpi = ((HotSpotConstantPool)holder.getConstantPool()).rawIndexToConstantPoolIndex(index, opcode);
-        HotSpotResolvedObjectType appendixType = ((HotSpotObjectConstant)appendix).getType();
+        int cpi = ((HotSpotConstantPool) holder.getConstantPool()).rawIndexToConstantPoolIndex(index, opcode);
+        HotSpotResolvedObjectType appendixType = ((HotSpotObjectConstant) appendix).getType();
         recordDynamicTypeLocation(new AppendixLocation(holder, cpi), appendixType);
         // Make the constant locatable
         return HotSpotConstantPoolObject.forObject(holder, cpi, appendix);
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTHotSpotResolvedJavaMethod.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTHotSpotResolvedJavaMethod.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import org.graalvm.compiler.code.CompilationResult;
@@ -39,15 +41,18 @@
         this.backend = backend;
     }
 
+    @Override
     public String getSymbolName() {
         return JavaMethodInfo.uniqueMethodName(method);
     }
 
+    @Override
     public String getNameAndSignature() {
         String className = method.getDeclaringClass().getName();
         return className + "." + method.getName() + method.getSignature().toMethodDescriptor();
     }
 
+    @Override
     public HotSpotCompiledCode compiledCode(CompilationResult result) {
         return HotSpotCompiledCodeBuilder.createCompiledCode(backend.getCodeCache(), method, null, result);
     }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import org.graalvm.compiler.code.CompilationResult;
@@ -40,14 +42,17 @@
         this.backend = backend;
     }
 
+    @Override
     public String getSymbolName() {
         return stub.toString();
     }
 
+    @Override
     public String getNameAndSignature() {
         return stub.toString();
     }
 
+    @Override
     public HotSpotCompiledCode compiledCode(CompilationResult result) {
         return HotSpotCompiledCodeBuilder.createCompiledCode(backend.getCodeCache(), null, null, result);
     }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import org.graalvm.compiler.bytecode.Bytecodes;
@@ -33,7 +35,7 @@
 final class CallInfo {
 
     static boolean isStaticTarget(Call call) {
-        return !((HotSpotResolvedJavaMethod)call.target).hasReceiver();
+        return !((HotSpotResolvedJavaMethod) call.target).hasReceiver();
     }
 
     private static boolean isStaticOpcode(Call call) {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.Relocation.RelocType;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CodeOffsets.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CodeOffsets.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.List;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CodeSectionProcessor.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CodeSectionProcessor.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,18 +21,18 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.ArrayList;
 
+import org.graalvm.compiler.code.CompilationResult;
+import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
+
 import jdk.tools.jaotc.binformat.BinaryContainer;
 import jdk.tools.jaotc.binformat.CodeContainer;
 import jdk.tools.jaotc.binformat.Symbol;
-import jdk.tools.jaotc.StubInformation;
-import org.graalvm.compiler.code.CompilationResult;
-import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
-
-import jdk.vm.ci.aarch64.AArch64;
 import jdk.vm.ci.amd64.AMD64;
 import jdk.vm.ci.code.TargetDescription;
 import jdk.vm.ci.code.site.Call;
@@ -75,7 +75,7 @@
                 if (infopoint.reason == InfopointReason.CALL) {
                     final Call callInfopoint = (Call) infopoint;
                     if (callInfopoint.target instanceof HotSpotForeignCallLinkage &&
-                        target.arch instanceof AMD64) {
+                                    target.arch instanceof AMD64) {
                         // TODO 4 is x86 size of relative displacement.
                         // For SPARC need something different.
                         int destOffset = infopoint.pcOffset + callInfopoint.size - 4;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.io.BufferedReader;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompilationSpec.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompilationSpec.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.HashSet;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompiledMethodInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompiledMethodInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.concurrent.atomic.AtomicInteger;
@@ -147,7 +149,7 @@
     }
 
     /**
-     * Method name
+     * Method name.
      */
     private String name;
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.ArrayList;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataPatchProcessor.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataPatchProcessor.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,21 +21,22 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
+import org.graalvm.compiler.code.DataSection;
+import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
+
 import jdk.tools.jaotc.binformat.BinaryContainer;
 import jdk.tools.jaotc.binformat.Relocation;
 import jdk.tools.jaotc.binformat.Relocation.RelocType;
 import jdk.tools.jaotc.binformat.Symbol;
 import jdk.tools.jaotc.binformat.Symbol.Binding;
 import jdk.tools.jaotc.binformat.Symbol.Kind;
-import jdk.tools.jaotc.AOTCompiledClass;
-import org.graalvm.compiler.code.DataSection;
-import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
-
 import jdk.vm.ci.code.TargetDescription;
 import jdk.vm.ci.code.site.ConstantReference;
 import jdk.vm.ci.code.site.DataPatch;
@@ -97,7 +98,7 @@
         } else if (constant instanceof HotSpotObjectConstant) {
             HotSpotObjectConstant oopConstant = (HotSpotObjectConstant) constant;
             if (oopConstant instanceof HotSpotConstantPoolObject) {
-                HotSpotConstantPoolObject cpo = (HotSpotConstantPoolObject)oopConstant;
+                HotSpotConstantPoolObject cpo = (HotSpotConstantPoolObject) oopConstant;
                 // Even if two locations use the same object, resolve separately
                 targetSymbol = "ldc." + cpo.getCpType().getName() + cpo.getCpi();
             } else {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ELFMacroAssembler.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ELFMacroAssembler.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,20 +21,20 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
-import jdk.tools.jaotc.StubInformation;
+import jdk.tools.jaotc.aarch64.AArch64ELFMacroAssembler;
 import jdk.tools.jaotc.amd64.AMD64ELFMacroAssembler;
-import jdk.tools.jaotc.aarch64.AArch64ELFMacroAssembler;
-
+import jdk.vm.ci.aarch64.AArch64;
 import jdk.vm.ci.amd64.AMD64;
-import jdk.vm.ci.aarch64.AArch64;
 import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.code.TargetDescription;
 
 public interface ELFMacroAssembler {
 
-    public static ELFMacroAssembler getELFMacroAssembler(TargetDescription target) {
+    static ELFMacroAssembler getELFMacroAssembler(TargetDescription target) {
         Architecture architecture = target.arch;
         if (architecture instanceof AMD64) {
             return new AMD64ELFMacroAssembler(target);
@@ -45,12 +45,12 @@
         }
     }
 
-    public int currentEndOfInstruction();
+    int currentEndOfInstruction();
 
-    public byte[] getPLTJumpCode();
+    byte[] getPLTJumpCode();
 
-    public byte[] getPLTStaticEntryCode(StubInformation stub);
+    byte[] getPLTStaticEntryCode(StubInformation stub);
 
-    public byte[] getPLTVirtualEntryCode(StubInformation stub);
+    byte[] getPLTVirtualEntryCode(StubInformation stub);
 
 }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignCallSiteRelocationInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignCallSiteRelocationInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignCallSiteRelocationSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignCallSiteRelocationSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignGotCallSiteRelocationSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/ForeignGotCallSiteRelocationSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/GraalFilters.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/GraalFilters.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.lang.annotation.Annotation;
@@ -30,12 +32,6 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import jdk.vm.ci.hotspot.HotSpotConstantPool;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.vm.ci.meta.MetaAccessProvider;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
 import org.graalvm.compiler.api.directives.GraalDirectives;
 import org.graalvm.compiler.api.replacements.ClassSubstitution;
 import org.graalvm.compiler.api.replacements.MethodSubstitution;
@@ -47,6 +43,12 @@
 import org.graalvm.compiler.replacements.Snippets;
 import jdk.internal.vm.compiler.word.WordBase;
 
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.hotspot.HotSpotConstantPool;
+
 final class GraalFilters {
     private List<ResolvedJavaType> specialClasses;
     private List<ResolvedJavaType> specialArgumentAndReturnTypes;
@@ -90,7 +92,7 @@
             return false;
         }
         // Skip klass with Condy until Graal is fixed.
-        if (((HotSpotConstantPool)((HotSpotResolvedObjectType) klass).getConstantPool()).hasDynamicConstant()) {
+        if (((HotSpotConstantPool) ((HotSpotResolvedObjectType) klass).getConstantPool()).hasDynamicConstant()) {
             return false;
         }
         return true;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InstructionDecoder.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InstructionDecoder.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.amd64.AMD64InstructionDecoder;
@@ -38,13 +40,13 @@
         if (architecture instanceof AMD64) {
             return new AMD64InstructionDecoder(target);
         } else if (architecture instanceof AArch64) {
-            return new AArch64InstructionDecoder(target);
+            return new AArch64InstructionDecoder();
         } else {
             throw new InternalError("Unsupported architecture " + architecture);
         }
     }
 
-    public abstract void decodePosition(final byte[] code, int pcOffset);
+    public abstract void decodePosition(byte[] code, int pcOffset);
 
     public abstract int currentEndOfInstruction();
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.Relocation.RelocType;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,12 +21,12 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
 import jdk.tools.jaotc.binformat.Symbol;
-import jdk.tools.jaotc.StubInformation;
-
 import jdk.vm.ci.code.site.Call;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 
@@ -44,11 +44,11 @@
         String archStr = System.getProperty("os.arch").toLowerCase();
         if (archStr.equals("aarch64")) {
             // AArch64 is a special case: it uses 48-bit addresses.
-            byte[] non_oop_word = {-1, -1, -1, -1, -1, -1, 0, 0};
-            minusOneSlot = non_oop_word;
+            byte[] nonOopWord = {-1, -1, -1, -1, -1, -1, 0, 0};
+            minusOneSlot = nonOopWord;
         } else {
-            byte[] non_oop_word = {-1, -1, -1, -1, -1, -1, -1, -1};
-            minusOneSlot = non_oop_word;
+            byte[] nonOopWord = {-1, -1, -1, -1, -1, -1, -1, -1};
+            minusOneSlot = nonOopWord;
         }
     }
 
@@ -135,7 +135,6 @@
      */
     private static String getResolveSymbolName(CompiledMethodInfo mi, Call call) {
         String resolveSymbolName;
-        String name = call.target.toString();
         if (CallInfo.isStaticCall(call)) {
             assert mi.hasMark(call, MarkId.INVOKESTATIC);
             resolveSymbolName = BinaryContainer.getResolveStaticEntrySymbolName();
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaMethodInfo.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaMethodInfo.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import org.graalvm.compiler.code.CompilationResult;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.io.BufferedReader;
@@ -148,32 +150,7 @@
     }
 
     /**
-     * Visual Studio supported versions Search Order is: VS2013, VS2015, VS2012
-     */
-    public enum VSVERSIONS {
-        VS2013("VS120COMNTOOLS", "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\link.exe"),
-        VS2015("VS140COMNTOOLS", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe"),
-        VS2012("VS110COMNTOOLS", "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin\\amd64\\link.exe");
-
-        private final String envvariable;
-        private final String wkp;
-
-        VSVERSIONS(String envvariable, String wellknownpath) {
-            this.envvariable = envvariable;
-            this.wkp = wellknownpath;
-        }
-
-        String EnvVariable() {
-            return envvariable;
-        }
-
-        String WellKnownPath() {
-            return wkp;
-        }
-    }
-
-    /**
-     * Search for Visual Studio link.exe Search Order is: VS2013, VS2015, VS2012
+     * Search for Visual Studio link.exe Search Order is: VS2013, VS2015, VS2012.
      */
     private static String getWindowsLinkPath() {
         String link = "\\VC\\bin\\amd64\\link.exe";
@@ -182,7 +159,7 @@
          * First try searching the paths pointed to by the VS environment variables.
          */
         for (VSVERSIONS vs : VSVERSIONS.values()) {
-            String vspath = System.getenv(vs.EnvVariable());
+            String vspath = System.getenv(vs.getEnvVariable());
             if (vspath != null) {
                 File commonTools = new File(vspath);
                 File vsRoot = commonTools.getParentFile().getParentFile();
@@ -197,7 +174,7 @@
          * If we didn't find via the VS environment variables, try the well known paths
          */
         for (VSVERSIONS vs : VSVERSIONS.values()) {
-            String wkp = vs.WellKnownPath();
+            String wkp = vs.getWellKnownPath();
             if (new File(wkp).exists()) {
                 return wkp;
             }
@@ -206,4 +183,30 @@
         return null;
     }
 
+    // @formatter:off (workaround for Eclipse formatting bug)
+    /**
+     * Visual Studio supported versions Search Order is: VS2013, VS2015, VS2012.
+     */
+    enum VSVERSIONS {
+        VS2013("VS120COMNTOOLS", "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\link.exe"),
+        VS2015("VS140COMNTOOLS", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe"),
+        VS2012("VS110COMNTOOLS", "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin\\amd64\\link.exe");
+
+        private final String envvariable;
+        private final String wkp;
+
+        VSVERSIONS(String envvariable, String wellknownpath) {
+            this.envvariable = envvariable;
+            this.wkp = wellknownpath;
+        }
+
+        String getEnvVariable() {
+            return envvariable;
+        }
+
+        String getWellKnownPath() {
+            return wkp;
+        }
+    }
+    // @formatter:on
 }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/LoadedClass.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/LoadedClass.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 public class LoadedClass {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/LogPrinter.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/LogPrinter.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.io.FileWriter;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
@@ -33,9 +35,6 @@
 import java.util.ListIterator;
 import java.util.Set;
 
-import jdk.tools.jaotc.binformat.BinaryContainer;
-import jdk.tools.jaotc.Options.Option;
-
 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
 import org.graalvm.compiler.api.runtime.GraalJVMCICompiler;
 import org.graalvm.compiler.debug.DebugContext;
@@ -45,7 +44,6 @@
 import org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory;
 import org.graalvm.compiler.hotspot.HotSpotGraalOptionValues;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntime;
-import org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC;
 import org.graalvm.compiler.hotspot.HotSpotHostBackend;
 import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin;
 import org.graalvm.compiler.java.GraphBuilderPhase;
@@ -57,6 +55,8 @@
 import org.graalvm.compiler.printer.GraalDebugHandlersFactory;
 import org.graalvm.compiler.runtime.RuntimeProvider;
 
+import jdk.tools.jaotc.Options.Option;
+import jdk.tools.jaotc.binformat.BinaryContainer;
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.runtime.JVMCI;
@@ -182,7 +182,7 @@
                 System.gc();
             }
 
-            int gc = runtime.getGarbageCollector().ordinal()+1;
+            int gc = runtime.getGarbageCollector().ordinal() + 1;
             BinaryContainer binaryContainer = new BinaryContainer(graalOptions, graalHotSpotVMConfig, graphBuilderConfig, gc, JVM_VERSION);
             DataBuilder dataBuilder = new DataBuilder(this, backend, classes, binaryContainer);
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
@@ -55,7 +57,7 @@
 
     private final int value;
 
-    private MarkId(String name) {
+    MarkId(String name) {
         this.value = (int) (long) HotSpotJVMCIRuntime.runtime().getConfigStore().getConstants().get(name);
     }
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkProcessor.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkProcessor.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MetadataBuilder.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MetadataBuilder.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.util.ArrayList;
@@ -33,7 +35,6 @@
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
 
-
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.code.site.DataPatch;
 import jdk.vm.ci.code.site.Infopoint;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Options.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Options.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import java.text.MessageFormat;
@@ -255,7 +257,8 @@
         }
 
         // Make checkstyle happy.
-        for (int i = 0; i < args.length; i++) {
+        int i = 0;
+        while (i < args.length) {
             String arg = args[i];
 
             if (arg.charAt(0) == '-') {
@@ -282,6 +285,7 @@
             } else {
                 task.options.files.add(new SearchFor(arg));
             }
+            i++;
         }
     }
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/StubDirectCallSiteRelocationSymbol.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/StubDirectCallSiteRelocationSymbol.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 import jdk.tools.jaotc.binformat.BinaryContainer;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/StubInformation.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/StubInformation.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,15 +21,20 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 public final class StubInformation {
     private int stubOffset;         // the offset inside the code (text + stubOffset)
     private int stubSize;           // the stub size
     private int dispatchJumpOffset; // offset after main dispatch jump instruction
-    private int resolveJumpOffset;  // offset after jump instruction to runtime call resolution function.
-    private int resolveJumpStart;   // offset of jump instruction to VM runtime call resolution function.
-    private int c2iJumpOffset;      // offset after jump instruction to c2i adapter for static calls.
+    private int resolveJumpOffset;  // offset after jump instruction to runtime call resolution
+                                    // function.
+    private int resolveJumpStart;   // offset of jump instruction to VM runtime call resolution
+                                    // function.
+    private int c2iJumpOffset;      // offset after jump instruction to c2i adapter for static
+                                    // calls.
     private int movOffset;          // offset after move instruction which loads from got cell:
                                     // - Method* for static call
                                     // - Klass* for virtual call
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Timer.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Timer.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc;
 
 final class Timer implements AutoCloseable {
@@ -34,6 +36,7 @@
         main.printer.printInfo(message);
     }
 
+    @Override
     public void close() {
         final long end = System.currentTimeMillis();
         main.printer.printlnInfo(" (" + (end - start) + " ms)");
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/aarch64/AArch64ELFMacroAssembler.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/aarch64/AArch64ELFMacroAssembler.java	Fri Aug 17 13:20:53 2018 -0700
@@ -22,19 +22,21 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.aarch64;
 
-import jdk.tools.jaotc.StubInformation;
-import jdk.tools.jaotc.ELFMacroAssembler;
+import static jdk.vm.ci.aarch64.AArch64.r12;
+import static jdk.vm.ci.aarch64.AArch64.r16;
+import static jdk.vm.ci.aarch64.AArch64.r17;
+import static jdk.vm.ci.aarch64.AArch64.r9;
 
 import org.graalvm.compiler.asm.aarch64.AArch64Address;
 import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler;
 
-
+import jdk.tools.jaotc.ELFMacroAssembler;
+import jdk.tools.jaotc.StubInformation;
 import jdk.vm.ci.code.TargetDescription;
-import jdk.vm.ci.code.Register;
-
-import static jdk.vm.ci.aarch64.AArch64.*;
 
 public final class AArch64ELFMacroAssembler extends AArch64MacroAssembler implements ELFMacroAssembler {
 
@@ -71,7 +73,7 @@
         jmp(r16);
         stub.setDispatchJumpOffset(position());
 
-        // C2I stub used to call interpreter.  First load r12
+        // C2I stub used to call interpreter. First load r12
         // (i.e. rmethod) with a pointer to the Method structure ...
         addressOf(r12);
         ldr(64, r12, AArch64Address.createBaseRegisterOnlyAddress(r12));
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/aarch64/AArch64InstructionDecoder.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/aarch64/AArch64InstructionDecoder.java	Fri Aug 17 13:20:53 2018 -0700
@@ -22,17 +22,17 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.aarch64;
 
 import jdk.tools.jaotc.InstructionDecoder;
 
-import jdk.vm.ci.code.TargetDescription;
-
 public final class AArch64InstructionDecoder extends InstructionDecoder {
 
     private int currentEndOfInstruction;
 
-    public AArch64InstructionDecoder(TargetDescription target) {
+    public AArch64InstructionDecoder() {
     }
 
     @Override
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/amd64/AMD64ELFMacroAssembler.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/amd64/AMD64ELFMacroAssembler.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.amd64;
 
 import static jdk.vm.ci.amd64.AMD64.rax;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/amd64/AMD64InstructionDecoder.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/amd64/AMD64InstructionDecoder.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.amd64;
 
 import jdk.tools.jaotc.InstructionDecoder;
@@ -61,11 +63,13 @@
         static final int VEX_2BYTES = 0xC5;
     }
 
+    @SuppressWarnings("unused")
     private static class VexPrefix {
         static final int VEX_R = 0x80;
         static final int VEX_W = 0x80;
     }
 
+    @SuppressWarnings("unused")
     private static class VexOpcode {
         static final int VEX_OPCODE_NONE = 0x0;
         static final int VEX_OPCODE_0F = 0x1;
@@ -112,7 +116,7 @@
             againAfterPrefix = false;
             switch (0xFF & code[ip++]) {
 
-            // These convenience macros generate groups of "case" labels for the switch.
+                // These convenience macros generate groups of "case" labels for the switch.
 
                 case Prefix.CSSegment:
                 case Prefix.SSSegment:
@@ -421,18 +425,18 @@
                 case Prefix.VEX_3BYTES:
                 case Prefix.VEX_2BYTES:
                     assert ip == pcOffset + 1 : "no prefixes allowed";
-                    int vex_opcode;
+                    int vexOpcode;
                     // First byte
                     if ((code[pcOffset] & 0xFF) == Prefix.VEX_3BYTES) {
-                        vex_opcode = VexOpcode.VEX_OPCODE_MASK & code[ip];
+                        vexOpcode = VexOpcode.VEX_OPCODE_MASK & code[ip];
                         ip++; // third byte
                         is64bit = ((VexPrefix.VEX_W & code[ip]) == VexPrefix.VEX_W);
                     } else {
-                        vex_opcode = VexOpcode.VEX_OPCODE_0F;
+                        vexOpcode = VexOpcode.VEX_OPCODE_0F;
                     }
                     ip++; // opcode
                     // To find the end of instruction (which == end_pc_operand).
-                    switch (vex_opcode) {
+                    switch (vexOpcode) {
                         case VexOpcode.VEX_OPCODE_0F:
                             switch (0xFF & code[ip]) {
                                 case 0x70: // pshufd r, r/a, #8
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
 import jdk.tools.jaotc.LoadedClass;
@@ -37,7 +39,9 @@
     }
 
     public List<LoadedClass> search(List<SearchFor> search, SearchPath searchPath) {
-        return search(search, searchPath, (s, t) -> { throw new InternalError(s + " : " + t, t); } );
+        return search(search, searchPath, (s, t) -> {
+            throw new InternalError(s + " : " + t, t);
+        });
     }
 
     public List<LoadedClass> search(List<SearchFor> search, SearchPath searchPath, BiConsumer<String, Throwable> classLoadingErrorsHandler) {
@@ -53,7 +57,9 @@
             if (source != null) {
                 source.eachClass((name, loader) -> {
                     LoadedClass x = loadClass(name, loader, classLoadingErrorsHandler);
-                    if (x != null) { loaded.add(x); }
+                    if (x != null) {
+                        loaded.add(x);
+                    }
                 });
             }
         }
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSource.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSource.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
 import java.nio.file.Path;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSupport.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,11 +21,21 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
 import java.io.IOException;
-import java.net.*;
-import java.nio.file.*;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.DirectoryStream;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.HashMap;
 
 public class FileSupport {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSystemFinder.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/FileSystemFinder.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,16 +21,23 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
+import static java.nio.file.FileVisitResult.CONTINUE;
+
 import java.io.IOException;
-import java.nio.file.*;
+import java.nio.file.FileVisitResult;
+import java.nio.file.FileVisitor;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
+import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.ArrayList;
 import java.util.Iterator;
 
-import static java.nio.file.FileVisitResult.CONTINUE;
-
 /**
  * {@link FileVisitor} implementation to find class files recursively.
  */
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
 public final class SearchFor {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchPath.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchPath.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
 import java.nio.file.FileSystem;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SourceProvider.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SourceProvider.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect;
 
 public interface SourceProvider {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSource.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSource.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.classname;
 
 import jdk.tools.jaotc.collect.ClassSource;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.classname;
 
 import jdk.tools.jaotc.collect.ClassSource;
@@ -32,7 +34,7 @@
 import java.nio.file.Paths;
 
 public final class ClassNameSourceProvider implements SourceProvider {
-    public final static String TYPE = "class";
+    public static final String TYPE = "class";
     private final ClassLoader classLoader;
 
     public ClassNameSourceProvider(FileSupport fileSupport) {
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/directory/DirectorySource.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/directory/DirectorySource.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.directory;
 
 import jdk.tools.jaotc.collect.ClassSource;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/directory/DirectorySourceProvider.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/directory/DirectorySourceProvider.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.directory;
 
 import jdk.tools.jaotc.collect.ClassSource;
@@ -36,7 +38,7 @@
 public final class DirectorySourceProvider implements SourceProvider {
     private final FileSupport fileSupport;
     private final FileSystem fileSystem;
-    public final static String TYPE = "directory";
+    public static final String TYPE = "directory";
 
     public DirectorySourceProvider(FileSupport fileSupport) {
         this.fileSupport = fileSupport;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/jar/JarFileSource.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/jar/JarFileSource.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.jar;
 
 import jdk.tools.jaotc.collect.ClassSource;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/jar/JarSourceProvider.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/jar/JarSourceProvider.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.jar;
 
 import jdk.tools.jaotc.collect.ClassSource;
@@ -37,7 +39,7 @@
 public final class JarSourceProvider implements SourceProvider {
     private final FileSystem fileSystem;
     private final FileSupport fileSupport;
-    public final static String TYPE = "jar";
+    public static final String TYPE = "jar";
 
     public JarSourceProvider() {
         this(new FileSupport());
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/module/ModuleSource.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/module/ModuleSource.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.module;
 
 import jdk.tools.jaotc.collect.ClassSource;
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/module/ModuleSourceProvider.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/module/ModuleSourceProvider.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.collect.module;
 
 import jdk.tools.jaotc.collect.ClassSource;
@@ -38,7 +40,7 @@
     private final FileSystem fileSystem;
     private final ClassLoader classLoader;
     private final FileSupport fileSupport;
-    public final static String TYPE = "module";
+    public static final String TYPE = "module";
 
     public ModuleSourceProvider() {
         this(FileSystems.getFileSystem(URI.create("jrt:/")), ClassLoader.getSystemClassLoader(), new FileSupport());
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/utils/NativeOrderOutputStream.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/utils/NativeOrderOutputStream.java	Fri Aug 17 13:20:53 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+
+
 package jdk.tools.jaotc.utils;
 
 import java.io.ByteArrayOutputStream;
--- a/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java	Fri Aug 17 13:20:53 2018 -0700
@@ -30,7 +30,7 @@
 import java.util.List;
 
 import org.graalvm.compiler.serviceprovider.ServiceProvider;
-import org.graalvm.compiler.serviceprovider.GraalServices.JMXService;
+import org.graalvm.compiler.serviceprovider.JMXService;
 
 import com.sun.management.ThreadMXBean;
 
--- a/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -114,7 +114,12 @@
             }
         });
         set.addAll(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
-        Assert.assertTrue(set.add(new Integer(0)));
+        Assert.assertTrue(set.add(newInteger(0)));
+    }
+
+    @SuppressWarnings("deprecation")
+    private static Integer newInteger(int value) {
+        return new Integer(value);
     }
 
     @Test(expected = UnsupportedOperationException.class)
--- a/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -142,7 +142,12 @@
         }
         Assert.assertEquals(initialList, removalList);
         Assert.assertEquals(1, finalList.size());
-        Assert.assertEquals(new Integer(9), finalList.get(0));
+        Assert.assertEquals(newInteger(9), finalList.get(0));
+    }
+
+    @SuppressWarnings("deprecation")
+    private static Integer newInteger(int value) {
+        return new Integer(value);
     }
 
 }
--- a/src/jdk.internal.vm.compiler/share/classes/module-info.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/module-info.java	Fri Aug 17 13:20:53 2018 -0700
@@ -39,7 +39,7 @@
     uses org.graalvm.compiler.hotspot.HotSpotCodeCacheListener;
     uses org.graalvm.compiler.hotspot.HotSpotGraalManagementRegistration;
     uses org.graalvm.compiler.nodes.graphbuilderconf.NodeIntrinsicPluginFactory;
-    uses org.graalvm.compiler.serviceprovider.GraalServices.JMXService;
+    uses org.graalvm.compiler.serviceprovider.JMXService;
 
     exports jdk.internal.vm.compiler.collections        to jdk.internal.vm.compiler.management;
     exports org.graalvm.compiler.api.directives         to jdk.aot;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java	Fri Aug 17 13:20:53 2018 -0700
@@ -80,7 +80,6 @@
          * address = base + imm9. base is updated to base + imm9
          */
         IMMEDIATE_PRE_INDEXED,
-        AddressingMode,
     }
 
     private final Register base;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java	Fri Aug 17 13:20:53 2018 -0700
@@ -25,16 +25,23 @@
 
 package org.graalvm.compiler.asm.amd64.test;
 
+import static jdk.vm.ci.code.ValueUtil.asRegister;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMOp.LZCNT;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMOp.TZCNT;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.DWORD;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.QWORD;
-import static jdk.vm.ci.code.ValueUtil.asRegister;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.DWORD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.QWORD;
 import static org.junit.Assume.assumeTrue;
 
 import java.lang.reflect.Field;
 import java.util.EnumSet;
 
+import org.graalvm.compiler.asm.amd64.AMD64Address;
+import org.graalvm.compiler.asm.amd64.AMD64Assembler;
+import org.graalvm.compiler.asm.test.AssemblerTest;
+import org.graalvm.compiler.code.CompilationResult;
+import org.junit.Before;
+import org.junit.Test;
+
 import jdk.vm.ci.amd64.AMD64;
 import jdk.vm.ci.amd64.AMD64.CPUFeature;
 import jdk.vm.ci.code.CallingConvention;
@@ -43,14 +50,6 @@
 import jdk.vm.ci.code.TargetDescription;
 import jdk.vm.ci.meta.JavaKind;
 
-import org.junit.Before;
-import org.junit.Test;
-
-import org.graalvm.compiler.asm.amd64.AMD64Address;
-import org.graalvm.compiler.asm.amd64.AMD64Assembler;
-import org.graalvm.compiler.asm.test.AssemblerTest;
-import org.graalvm.compiler.code.CompilationResult;
-
 public class BitOpsTest extends AssemblerTest {
     private static boolean lzcntSupported;
     private static boolean tzcntSupported;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java	Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java	Fri Aug 17 13:20:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, 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
@@ -25,12 +25,8 @@
 package org.graalvm.compiler.asm.amd64;
 
 import static jdk.vm.ci.amd64.AMD64.CPU;
+import static jdk.vm.ci.amd64.AMD64.MASK;
 import static jdk.vm.ci.amd64.AMD64.XMM;
-import static jdk.vm.ci.amd64.AMD64.r12;
-import static jdk.vm.ci.amd64.AMD64.r13;
-import static jdk.vm.ci.amd64.AMD64.rbp;
-import static jdk.vm.ci.amd64.AMD64.rip;
-import static jdk.vm.ci.amd64.AMD64.rsp;
 import static jdk.vm.ci.code.MemoryBarriers.STORE_LOAD;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseAddressNop;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseNormalNop;
@@ -45,23 +41,39 @@
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MOp.INC;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MOp.NEG;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MOp.NOT;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.BYTE;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.DWORD;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.PD;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.PS;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.QWORD;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.SD;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.SS;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.WORD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.B0;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.Z0;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.BYTE;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.DWORD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.PD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.PS;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.QWORD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.SD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.SS;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.WORD;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L128;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F38;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F3A;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.P_;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.P_66;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.P_F2;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.P_F3;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.W0;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.W1;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.WIG;
 import static org.graalvm.compiler.core.common.NumUtil.isByte;
 import static org.graalvm.compiler.core.common.NumUtil.isInt;
 import static org.graalvm.compiler.core.common.NumUtil.isShiftCount;
 import static org.graalvm.compiler.core.common.NumUtil.isUByte;
 
-import org.graalvm.compiler.asm.Assembler;
+import java.util.EnumSet;
+
 import org.graalvm.compiler.asm.Label;
 import org.graalvm.compiler.asm.amd64.AMD64Address.Scale;
+import org.graalvm.compiler.asm.amd64.AVXKind.AVXSize;
 import org.graalvm.compiler.core.common.NumUtil;
+import org.graalvm.compiler.core.common.calc.Condition;
 import org.graalvm.compiler.debug.GraalError;
 
 import jdk.vm.ci.amd64.AMD64;
@@ -70,14 +82,18 @@
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.Register.RegisterCategory;
 import jdk.vm.ci.code.TargetDescription;
-import jdk.vm.ci.meta.PlatformKind;
 
 /**
  * This class implements an assembler that can encode most X86 instructions.
  */
-public class AMD64Assembler extends Assembler {
-
-    private static final int MinEncodingNeedsRex = 8;
+public class AMD64Assembler extends AMD64BaseAssembler {
+
+    /**
+     * Constructs an assembler for the AMD64 architecture.
+     */
+    public AMD64Assembler(TargetDescription target) {
+        super(target);
+    }
 
     /**
      * The x86 condition codes used for conditional jumps/moves.
@@ -169,214 +185,6 @@
     }
 
     /**
-     * Constants for X86 prefix bytes.
-     */
-    private static class Prefix {
-        private static final int REX = 0x40;
-        private static final int REXB = 0x41;
-        private static final int REXX = 0x42;
-        private static final int REXXB = 0x43;
-        private static final int REXR = 0x44;
-        private static final int REXRB = 0x45;
-        private static final int REXRX = 0x46;
-        private static final int REXRXB = 0x47;
-        private static final int REXW = 0x48;
-        private static final int REXWB = 0x49;
-        private static final int REXWX = 0x4A;
-        private static final int REXWXB = 0x4B;
-        private static final int REXWR = 0x4C;
-        private static final int REXWRB = 0x4D;
-        private static final int REXWRX = 0x4E;
-        private static final int REXWRXB = 0x4F;
-        private static final int VEX_3BYTES = 0xC4;
-        private static final int VEX_2BYTES = 0xC5;
-    }
-
-    private static class VexPrefix {
-        private static final int VEX_R = 0x80;
-        private static final int VEX_W = 0x80;
-    }
-
-    private static class VexSimdPrefix {
-        private static final int VEX_SIMD_NONE = 0x0;
-        private static final int VEX_SIMD_66 = 0x1;
-        private static final int VEX_SIMD_F3 = 0x2;
-        private static final int VEX_SIMD_F2 = 0x3;
-    }
-
-    private static class VexOpcode {
-        private static final int VEX_OPCODE_NONE = 0x0;
-        private static final int VEX_OPCODE_0F = 0x1;
-        private static final int VEX_OPCODE_0F_38 = 0x2;
-        private static final int VEX_OPCODE_0F_3A = 0x3;
-    }
-
-    public static class AvxVectorLen {
-        public static final int AVX_128bit = 0x0;
-        public static final int AVX_256bit = 0x1;
-        public static final int AVX_512bit = 0x2;
-        public static final int AVX_NoVec = 0x4;
-    }
-
-    public static class EvexTupleType {
-        public static final int EVEX_FV = 0;
-        public static final int EVEX_HV = 4;
-        public static final int EVEX_FVM = 6;
-        public static final int EVEX_T1S = 7;
-        public static final int EVEX_T1F = 11;
-        public static final int EVEX_T2 = 13;
-        public static final int EVEX_T4 = 15;
-        public static final int EVEX_T8 = 17;
-        public static final int EVEX_HVM = 18;
-        public static final int EVEX_QVM = 19;
-        public static final int EVEX_OVM = 20;
-        public static final int EVEX_M128 = 21;
-        public static final int EVEX_DUP = 22;
-        public static final int EVEX_ETUP = 23;
-    }
-
-    public static class EvexInputSizeInBits {
-        public static final int EVEX_8bit = 0;
-        public static final int EVEX_16bit = 1;
-        public static final int EVEX_32bit = 2;
-        public static final int EVEX_64bit = 3;
-        public static final int EVEX_NObit = 4;
-    }
-
-    private AMD64InstructionAttr curAttributes;
-
-    AMD64InstructionAttr getCurAttributes() {
-        return curAttributes;
-    }
-
-    void setCurAttributes(AMD64InstructionAttr attributes) {
-        curAttributes = attributes;
-    }
-
-    /**
-     * The x86 operand sizes.
-     */
-    public enum OperandSize {
-        BYTE(1, AMD64Kind.BYTE) {
-            @Override
-            protected void emitImmediate(AMD64Assembler asm, int imm) {
-                assert imm == (byte) imm;
-                asm.emitByte(imm);
-            }
-
-            @Override
-            protected int immediateSize() {
-                return 1;
-            }
-        },
-
-        WORD(2, AMD64Kind.WORD, 0x66) {
-            @Override
-            protected void emitImmediate(AMD64Assembler asm, int imm) {
-                assert imm == (short) imm;
-                asm.emitShort(imm);
-            }
-
-            @Override
-            protected int immediateSize() {
-                return 2;
-            }
-        },
-
-        DWORD(4, AMD64Kind.DWORD) {
-            @Override
-            protected void emitImmediate(AMD64Assembler asm, int imm) {
-                asm.emitInt(imm);
-            }
-
-            @Override
-            protected int immediateSize() {
-                return 4;
-            }
-        },
-
-        QWORD(8, AMD64Kind.QWORD) {
-            @Override
-            protected void emitImmediate(AMD64Assembler asm, int imm) {
-                asm.emitInt(imm);
-            }
-
-            @Override
-            protected int immediateSize() {
-                return 4;
-            }
-        },
-
-        SS(4, AMD64Kind.SINGLE, 0xF3, true),
-
-        SD(8, AMD64Kind.DOUBLE, 0xF2, true),
-
-        PS(16, AMD64Kind.V128_SINGLE, true),
-
-        PD(16, AMD64Kind.V128_DOUBLE, 0x66, true);
-
-        private final int sizePrefix;
-        private final int bytes;
-        private final boolean xmm;
-        private final AMD64Kind kind;
-
-        OperandSize(int bytes, AMD64Kind kind) {
-            this(bytes, kind, 0);
-        }
-
-        OperandSize(int bytes, AMD64Kind kind, int sizePrefix) {
-            this(bytes, kind, sizePrefix, false);
-        }
-
-        OperandSize(int bytes, AMD64Kind kind, boolean xmm) {
-            this(bytes, kind, 0, xmm);
-        }
-
-        OperandSize(int bytes, AMD64Kind kind, int sizePrefix, boolean xmm) {
-            this.sizePrefix = sizePrefix;
-            this.bytes = bytes;
-            this.kind = kind;
-            this.xmm = xmm;
-        }
-
-        public int getBytes() {
-            return bytes;
-        }
-
-        public boolean isXmmType() {
-            return xmm;
-        }
-
-        public AMD64Kind getKind() {
-            return kind;
-        }
-
-        public static OperandSize get(PlatformKind kind) {
-            for (OperandSize operandSize : OperandSize.values()) {
-                if (operandSize.kind.equals(kind)) {
-                    return operandSize;
-                }
-            }
-            throw GraalError.shouldNotReachHere("Unexpected kind: " + kind.toString());
-        }
-
-        /**
-         * Emit an immediate of this size. Note that immediate {@link #QWORD} operands are encoded
-         * as sign-extended 32-bit values.
-         *
-         * @param asm
-         * @param imm
-         */
-        protected void emitImmediate(AMD64Assembler asm, int imm) {
-            throw new UnsupportedOperationException();
-        }
-
-        protected int immediateSize() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    /**
      * Operand size and register type constraints.
      */
     private enum OpAssertion {
@@ -417,261 +225,18 @@
             assert false : "invalid operand size " + size + " used in " + op;
             return false;
         }
+
     }
 
-    public abstract static class OperandDataAnnotation extends CodeAnnotation {
-        /**
-         * The position (bytes from the beginning of the method) of the operand.
-         */
-        public final int operandPosition;
-        /**
-         * The size of the operand, in bytes.
-         */
-        public final int operandSize;
-        /**
-         * The position (bytes from the beginning of the method) of the next instruction. On AMD64,
-         * RIP-relative operands are relative to this position.
-         */
-        public final int nextInstructionPosition;
-
-        OperandDataAnnotation(int instructionPosition, int operandPosition, int operandSize, int nextInstructionPosition) {
-            super(instructionPosition);
-
-            this.operandPosition = operandPosition;
-            this.operandSize = operandSize;
-            this.nextInstructionPosition = nextInstructionPosition;
-        }
-
-        @Override
-        public String toString() {
-            return getClass().getSimpleName() + " instruction [" + instructionPosition + ", " + nextInstructionPosition + "[ operand at " + operandPosition + " size " + operandSize;
-        }
-    }
-
-    /**
-     * Annotation that stores additional information about the displacement of a
-     * {@link Assembler#getPlaceholder placeholder address} that needs patching.
-     */
-    public static class AddressDisplacementAnnotation extends OperandDataAnnotation {
-        AddressDisplacementAnnotation(int instructionPosition, int operandPosition, int operndSize, int nextInstructionPosition) {
-            super(instructionPosition, operandPosition, operndSize, nextInstructionPosition);
-        }
-    }
-
-    /**
-     * Annotation that stores additional information about the immediate operand, e.g., of a call
-     * instruction, that needs patching.
-     */
-    public static class ImmediateOperandAnnotation extends OperandDataAnnotation {
-        ImmediateOperandAnnotation(int instructionPosition, int operandPosition, int operndSize, int nextInstructionPosition) {
-            super(instructionPosition, operandPosition, operndSize, nextInstructionPosition);
-        }
-    }
-
-    /**
-     * Constructs an assembler for the AMD64 architecture.
-     */
-    public AMD64Assembler(TargetDescription target) {
-        super(target);
-    }
-
-    public boolean supports(CPUFeature feature) {
-        return ((AMD64) target.arch).getFeatures().contains(feature);
-    }
-
-    private static int encode(Register r) {
-        assert r.encoding < 16 && r.encoding >= 0 : "encoding out of range: " + r.encoding;
-        return r.encoding & 0x7;
-    }
-
-    /**
-     * Get RXB bits for register-register instruction. In that encoding, ModRM.rm contains a
-     * register index. The R bit extends the ModRM.reg field and the B bit extends the ModRM.rm
-     * field. The X bit must be 0.
-     */
-    protected static int getRXB(Register reg, Register rm) {
-        int rxb = (reg == null ? 0 : reg.encoding & 0x08) >> 1;
-        rxb |= (rm == null ? 0 : rm.encoding & 0x08) >> 3;
-        return rxb;
-    }
-
-    /**
-     * Get RXB bits for register-memory instruction. The R bit extends the ModRM.reg field. There
-     * are two cases for the memory operand:<br>
-     * ModRM.rm contains the base register: In that case, B extends the ModRM.rm field and X = 0.
-     * <br>
-     * There is an SIB byte: In that case, X extends SIB.index and B extends SIB.base.
-     */
-    protected static int getRXB(Register reg, AMD64Address rm) {
-        int rxb = (reg == null ? 0 : reg.encoding & 0x08) >> 1;
-        if (!rm.getIndex().equals(Register.None)) {
-            rxb |= (rm.getIndex().encoding & 0x08) >> 2;
-        }
-        if (!rm.getBase().equals(Register.None)) {
-            rxb |= (rm.getBase().encoding & 0x08) >> 3;
-        }
-        return rxb;
-    }
-
-    /**
-     * Emit the ModR/M byte for one register operand and an opcode extension in the R field.
-     * <p>
-     * Format: [ 11 reg r/m ]
-     */
-    protected void emitModRM(int reg, Register rm) {
-        assert (reg & 0x07) == reg;
-        emitByte(0xC0 | (reg << 3) | (rm.encoding & 0x07));
-    }
-
-    /**
-     * Emit the ModR/M byte for two register operands.
-     * <p>
-     * Format: [ 11 reg r/m ]
-     */
-    protected void emitModRM(Register reg, Register rm) {
-        emitModRM(reg.encoding & 0x07, rm);
-    }
-
-    protected void emitOperandHelper(Register reg, AMD64Address addr, int additionalInstructionSize) {
-        assert !reg.equals(Register.None);
-        emitOperandHelper(encode(reg), addr, false, additionalInstructionSize);
-    }
-
-    /**
-     * Emits the ModR/M byte and optionally the SIB byte for one register and one memory operand.
-     *
-     * @param force4Byte use 4 byte encoding for displacements that would normally fit in a byte
-     */
-    protected void emitOperandHelper(Register reg, AMD64Address addr, boolean force4Byte, int additionalInstructionSize) {
-        assert !reg.equals(Register.None);
-        emitOperandHelper(encode(reg), addr, force4Byte, additionalInstructionSize);
-    }
-
-    protected void emitOperandHelper(int reg, AMD64Address addr, int additionalInstructionSize) {
-        emitOperandHelper(reg, addr, false, additionalInstructionSize);
-    }
-
-    /**
-     * Emits the ModR/M byte and optionally the SIB byte for one memory operand and an opcode
-     * extension in the R field.
-     *
-     * @param force4Byte use 4 byte encoding for displacements that would normally fit in a byte
-     * @param additionalInstructionSize the number of bytes that will be emitted after the operand,
-     *            so that the start position of the next instruction can be computed even though
-     *            this instruction has not been completely emitted yet.
-     */
-    protected void emitOperandHelper(int reg, AMD64Address addr, boolean force4Byte, int additionalInstructionSize) {
-        assert (reg & 0x07) == reg;
-        int regenc = reg << 3;
-
-        Register base = addr.getBase();
-        Register index = addr.getIndex();
-
-        AMD64Address.Scale scale = addr.getScale();
-        int disp = addr.getDisplacement();
-
-        if (base.equals(AMD64.rip)) { // also matches addresses returned by getPlaceholder()
-            // [00 000 101] disp32
-            assert index.equals(Register.None) : "cannot use RIP relative addressing with index register";
-            emitByte(0x05 | regenc);
-            if (codePatchingAnnotationConsumer != null && addr.instructionStartPosition >= 0) {
-                codePatchingAnnotationConsumer.accept(new AddressDisplacementAnnotation(addr.instructionStartPosition, position(), 4, position() + 4 + additionalInstructionSize));
-            }
-            emitInt(disp);
-        } else if (base.isValid()) {
-            int baseenc = base.isValid() ? encode(base) : 0;
-            if (index.isValid()) {
-                int indexenc = encode(index) << 3;
-                // [base + indexscale + disp]
-                if (disp == 0 && !base.equals(rbp) && !base.equals(r13)) {
-                    // [base + indexscale]
-                    // [00 reg 100][ss index base]
-                    assert !index.equals(rsp) : "illegal addressing mode";
-                    emitByte(0x04 | regenc);
-                    emitByte(scale.log2 << 6 | indexenc | baseenc);
-                } else if (isByte(disp) && !force4Byte) {
-                    // [base + indexscale + imm8]
-                    // [01 reg 100][ss index base] imm8
-                    assert !index.equals(rsp) : "illegal addressing mode";
-                    emitByte(0x44 | regenc);
-                    emitByte(scale.log2 << 6 | indexenc | baseenc);
-                    emitByte(disp & 0xFF);
-                } else {
-                    // [base + indexscale + disp32]
-                    // [10 reg 100][ss index base] disp32
-                    assert !index.equals(rsp) : "illegal addressing mode";
-                    emitByte(0x84 | regenc);
-                    emitByte(scale.log2 << 6 | indexenc | baseenc);
-                    emitInt(disp);
-                }
-            } else if (base.equals(rsp) || base.equals(r12)) {
-                // [rsp + disp]
-                if (disp == 0) {
-                    // [rsp]
-                    // [00 reg 100][00 100 100]
-                    emitByte(0x04 | regenc);
-                    emitByte(0x24);
-                } else if (isByte(disp) && !force4Byte) {
-                    // [rsp + imm8]
-                    // [01 reg 100][00 100 100] disp8
-                    emitByte(0x44 | regenc);
-                    emitByte(0x24);
-                    emitByte(disp & 0xFF);
-                } else {
-                    // [rsp + imm32]
-                    // [10 reg 100][00 100 100] disp32
-                    emitByte(0x84 | regenc);
-                    emitByte(0x24);
-                    emitInt(disp);
-                }
-            } else {
-                // [base + disp]
-                assert !base.equals(rsp) && !base.equals(r12) : "illegal addressing mode";
-                if (disp == 0 && !base.equals(rbp) && !base.equals(r13)) {
-                    // [base]
-                    // [00 reg base]
-                    emitByte(0x00 | regenc | baseenc);
-                } else if (isByte(disp) && !force4Byte) {
-                    // [base + disp8]
-                    // [01 reg base] disp8
-                    emitByte(0x40 | regenc | baseenc);
-                    emitByte(disp & 0xFF);
-                } else {
-                    // [base + disp32]
-                    // [10 reg base] disp32
-                    emitByte(0x80 | regenc | baseenc);
-                    emitInt(disp);
-                }
-            }
-        } else {
-            if (index.isValid()) {
-                int indexenc = encode(index) << 3;
-                // [indexscale + disp]
-                // [00 reg 100][ss index 101] disp32
-                assert !index.equals(rsp) : "illegal addressing mode";
-                emitByte(0x04 | regenc);
-                emitByte(scale.log2 << 6 | indexenc | 0x05);
-                emitInt(disp);
-            } else {
-                // [disp] ABSOLUTE
-                // [00 reg 100][00 100 101] disp32
-                emitByte(0x04 | regenc);
-                emitByte(0x25);
-                emitInt(disp);
-            }
-        }
-        setCurAttributes(null);
-    }
+    protected static final int P_0F = 0x0F;
+    protected static final int P_0F38 = 0x380F;
+    protected static final int P_0F3A = 0x3A0F;
 
     /**
      * Base class for AMD64 opcodes.
      */
     public static class AMD64Op {
 
-        protected static final int P_0F = 0x0F;
-        protected static final int P_0F38 = 0x380F;
-        protected static final int P_0F3A = 0x3A0F;
-
         private final String opcode;
 
         protected final int prefix1;
@@ -705,8 +270,8 @@
             if (prefix1 != 0) {
                 asm.emitByte(prefix1);
             }
-            if (size.sizePrefix != 0) {
-                asm.emitByte(size.sizePrefix);
+            if (size.getSizePrefix() != 0) {
+                asm.emitByte(size.getSizePrefix());
             }
             int rexPrefix = 0x40 | rxb;
             if (size == QWORD) {
@@ -729,6 +294,32 @@
             return true;
         }
 
+        public OperandSize[] getAllowedSizes() {
+            return assertion.allowedSizes;
+        }
+
+        protected final boolean isSSEInstruction() {
+            if (feature == null) {
+                return false;
+            }
+            switch (feature) {
+                case SSE:
+                case SSE2:
+                case SSE3:
+                case SSSE3:
+                case SSE4A:
+                case SSE4_1:
+                case SSE4_2:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        public final OpAssertion getAssertion() {
+            return assertion;
+        }
+
         @Override
         public String toString() {
             return opcode;
@@ -743,7 +334,11 @@
         private final boolean immIsByte;
 
         protected AMD64ImmOp(String opcode, boolean immIsByte, int prefix, int op, OpAssertion assertion) {
-            super(opcode, 0, prefix, op, assertion, null);
+            this(opcode, immIsByte, prefix, op, assertion, null);
+        }
+
+        protected AMD64ImmOp(String opcode, boolean immIsByte, int prefix, int op, OpAssertion assertion, CPUFeature feature) {
+            super(opcode, 0, prefix, op, assertion, feature);
             this.immIsByte = immIsByte;
         }
 
@@ -760,7 +355,7 @@
             if (immIsByte) {
                 return 1;
             } else {
-                return size.bytes;
+                return size.getBytes();
             }
         }
     }
@@ -782,22 +377,6 @@
     }
 
     /**
-     * Opcode with operand order of either RM or MR for 3 address forms.
-     */
-    public abstract static class AMD64RRROp extends AMD64Op {
-
-        protected AMD64RRROp(String opcode, int prefix1, int prefix2, int op, OpAssertion assertion, CPUFeature feature) {
-            super(opcode, prefix1, prefix2, op, assertion, feature);
-        }
-
-        protected AMD64RRROp(String opcode, int prefix1, int prefix2, int op, boolean dstIsByte, boolean srcIsByte, OpAssertion assertion, CPUFeature feature) {
-            super(opcode, prefix1, prefix2, op, dstIsByte, srcIsByte, assertion, feature);
-        }
-
-        public abstract void emit(AMD64Assembler asm, OperandSize size, Register dst, Register nds, Register src);
-    }
-
-    /**
      * Opcode with operand order of RM.
      */
     public static class AMD64RMOp extends AMD64RROp {
@@ -805,9 +384,12 @@
         public static final AMD64RMOp IMUL   = new AMD64RMOp("IMUL",         P_0F, 0xAF, OpAssertion.ByteOrLargerAssertion);
         public static final AMD64RMOp BSF    = new AMD64RMOp("BSF",          P_0F, 0xBC);
         public static final AMD64RMOp BSR    = new AMD64RMOp("BSR",          P_0F, 0xBD);
-        public static final AMD64RMOp POPCNT = new AMD64RMOp("POPCNT", 0xF3, P_0F, 0xB8, CPUFeature.POPCNT);
-        public static final AMD64RMOp TZCNT  = new AMD64RMOp("TZCNT",  0xF3, P_0F, 0xBC, CPUFeature.BMI1);
-        public static final AMD64RMOp LZCNT  = new AMD64RMOp("LZCNT",  0xF3, P_0F, 0xBD, CPUFeature.LZCNT);
+        // POPCNT, TZCNT, and LZCNT support word operation. However, the legacy size prefix should
+        // be emitted before the mandatory prefix 0xF3. Since we are not emitting bit count for
+        // 16-bit operands, here we simply use DwordOrLargerAssertion.
+        public static final AMD64RMOp POPCNT = new AMD64RMOp("POPCNT", 0xF3, P_0F, 0xB8, OpAssertion.DwordOrLargerAssertion, CPUFeature.POPCNT);
+        public static final AMD64RMOp TZCNT  = new AMD64RMOp("TZCNT",  0xF3, P_0F, 0xBC, OpAssertion.DwordOrLargerAssertion, CPUFeature.BMI1);
+        public static final AMD64RMOp LZCNT  = new AMD64RMOp("LZCNT",  0xF3, P_0F, 0xBD, OpAssertion.DwordOrLargerAssertion, CPUFeature.LZCNT);
         public static final AMD64RMOp MOVZXB = new AMD64RMOp("MOVZXB",       P_0F, 0xB6, false, true, OpAssertion.WordOrLargerAssertion);
         public static final AMD64RMOp MOVZX  = new AMD64RMOp("MOVZX",        P_0F, 0xB7, OpAssertion.DwordOrLargerAssertion);
         public static final AMD64RMOp MOVSXB = new AMD64RMOp("MOVSXB",       P_0F, 0xBE, false, true, OpAssertion.WordOrLargerAssertion);
@@ -863,80 +445,35 @@
         @Override
         public final void emit(AMD64Assembler asm, OperandSize size, Register dst, Register src) {
             assert verify(asm, size, dst, src);
-            boolean isSimd = false;
-            boolean noNds = false;
-
-            switch (op) {
-                case 0x2A:
-                case 0x2C:
-                case 0x2E:
-                case 0x5A:
-                case 0x6E:
-                    isSimd = true;
-                    noNds = true;
-                    break;
-                case 0x10:
-                case 0x51:
-                case 0x54:
-                case 0x55:
-                case 0x56:
-                case 0x57:
-                case 0x58:
-                case 0x59:
-                case 0x5C:
-                case 0x5D:
-                case 0x5E:
-                case 0x5F:
-                    isSimd = true;
-                    break;
-            }
-
-            int opc = 0;
-            if (isSimd) {
-                switch (prefix2) {
-                    case P_0F:
-                        opc = VexOpcode.VEX_OPCODE_0F;
+            if (isSSEInstruction()) {
+                Register nds = Register.None;
+                switch (op) {
+                    case 0x10:
+                    case 0x51:
+                        if ((size == SS) || (size == SD)) {
+                            nds = dst;
+                        }
                         break;
-                    case P_0F38:
-                        opc = VexOpcode.VEX_OPCODE_0F_38;
-                        break;
-                    case P_0F3A:
-                        opc = VexOpcode.VEX_OPCODE_0F_3A;
+                    case 0x2A:
+                    case 0x54:
+                    case 0x55:
+                    case 0x56:
+                    case 0x57:
+                    case 0x58:
+                    case 0x59:
+                    case 0x5A:
+                    case 0x5C:
+                    case 0x5D:
+                    case 0x5E:
+                    case 0x5F:
+                        nds = dst;
                         break;
                     default:
-                        opc = VexOpcode.VEX_OPCODE_NONE;
-                        isSimd = false;
                         break;
                 }
-            }
-
-            if (isSimd) {
-                int pre;
-                boolean rexVexW = (size == QWORD) ? true : false;
-                AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-                int curPrefix = size.sizePrefix | prefix1;
-                switch (curPrefix) {
-                    case 0x66:
-                        pre = VexSimdPrefix.VEX_SIMD_66;
-                        break;
-                    case 0xF2:
-                        pre = VexSimdPrefix.VEX_SIMD_F2;
-                        break;
-                    case 0xF3:
-                        pre = VexSimdPrefix.VEX_SIMD_F3;
-                        break;
-                    default:
-                        pre = VexSimdPrefix.VEX_SIMD_NONE;
-                        break;
-                }
-                int encode;
-                if (noNds) {
-                    encode = asm.simdPrefixAndEncode(dst, Register.None, src, pre, opc, attributes);
-                } else {
-                    encode = asm.simdPrefixAndEncode(dst, dst, src, pre, opc, attributes);
-                }
+                asm.simdPrefix(dst, nds, src, size, prefix1, prefix2, size == QWORD);
                 asm.emitByte(op);
-                asm.emitByte(0xC0 | encode);
+                asm.emitModRM(dst, src);
             } else {
                 emitOpcode(asm, size, getRXB(dst, src), dst.encoding, src.encoding);
                 asm.emitModRM(dst, src);
@@ -945,75 +482,32 @@
 
         public final void emit(AMD64Assembler asm, OperandSize size, Register dst, AMD64Address src) {
             assert verify(asm, size, dst, null);
-            boolean isSimd = false;
-            boolean noNds = false;
-
-            switch (op) {
-                case 0x10:
-                case 0x2A:
-                case 0x2C:
-                case 0x2E:
-                case 0x6E:
-                    isSimd = true;
-                    noNds = true;
-                    break;
-                case 0x51:
-                case 0x54:
-                case 0x55:
-                case 0x56:
-                case 0x57:
-                case 0x58:
-                case 0x59:
-                case 0x5C:
-                case 0x5D:
-                case 0x5E:
-                case 0x5F:
-                    isSimd = true;
-                    break;
-            }
-
-            int opc = 0;
-            if (isSimd) {
-                switch (prefix2) {
-                    case P_0F:
-                        opc = VexOpcode.VEX_OPCODE_0F;
+            if (isSSEInstruction()) {
+                Register nds = Register.None;
+                switch (op) {
+                    case 0x51:
+                        if ((size == SS) || (size == SD)) {
+                            nds = dst;
+                        }
                         break;
-                    case P_0F38:
-                        opc = VexOpcode.VEX_OPCODE_0F_38;
-                        break;
-                    case P_0F3A:
-                        opc = VexOpcode.VEX_OPCODE_0F_3A;
+                    case 0x2A:
+                    case 0x54:
+                    case 0x55:
+                    case 0x56:
+                    case 0x57:
+                    case 0x58:
+                    case 0x59:
+                    case 0x5A:
+                    case 0x5C:
+                    case 0x5D:
+                    case 0x5E:
+                    case 0x5F:
+                        nds = dst;
                         break;
                     default:
-                        isSimd = false;
                         break;
                 }
-            }
-
-            if (isSimd) {
-                int pre;
-                boolean rexVexW = (size == QWORD) ? true : false;
-                AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-                int curPrefix = size.sizePrefix | prefix1;
-                switch (curPrefix) {
-                    case 0x66:
-                        pre = VexSimdPrefix.VEX_SIMD_66;
-                        break;
-                    case 0xF2:
-                        pre = VexSimdPrefix.VEX_SIMD_F2;
-                        break;
-                    case 0xF3:
-                        pre = VexSimdPrefix.VEX_SIMD_F3;
-                        break;
-                    default:
-                        pre = VexSimdPrefix.VEX_SIMD_NONE;
-                        break;
-                }
-                if (noNds) {
-                    asm.simdPrefix(dst, Register.None, src, pre, opc, attributes);
-                } else {
-                    asm.simdPrefix(dst, dst, src, pre, opc, attributes);
-                }
+                asm.simdPrefix(dst, nds, src, size, prefix1, prefix2, size == QWORD);
                 asm.emitByte(op);
                 asm.emitOperandHelper(dst, src, 0);
             } else {
@@ -1024,123 +518,6 @@
     }
 
     /**
-     * Opcode with operand order of RM.
-     */
-    public static class AMD64RRMOp extends AMD64RRROp {
-        protected AMD64RRMOp(String opcode, int op) {
-            this(opcode, 0, op);
-        }
-
-        protected AMD64RRMOp(String opcode, int op, OpAssertion assertion) {
-            this(opcode, 0, op, assertion);
-        }
-
-        protected AMD64RRMOp(String opcode, int prefix, int op) {
-            this(opcode, 0, prefix, op, null);
-        }
-
-        protected AMD64RRMOp(String opcode, int prefix, int op, OpAssertion assertion) {
-            this(opcode, 0, prefix, op, assertion, null);
-        }
-
-        protected AMD64RRMOp(String opcode, int prefix, int op, OpAssertion assertion, CPUFeature feature) {
-            this(opcode, 0, prefix, op, assertion, feature);
-        }
-
-        protected AMD64RRMOp(String opcode, int prefix, int op, boolean dstIsByte, boolean srcIsByte, OpAssertion assertion) {
-            super(opcode, 0, prefix, op, dstIsByte, srcIsByte, assertion, null);
-        }
-
-        protected AMD64RRMOp(String opcode, int prefix1, int prefix2, int op, CPUFeature feature) {
-            this(opcode, prefix1, prefix2, op, OpAssertion.WordOrLargerAssertion, feature);
-        }
-
-        protected AMD64RRMOp(String opcode, int prefix1, int prefix2, int op, OpAssertion assertion, CPUFeature feature) {
-            super(opcode, prefix1, prefix2, op, assertion, feature);
-        }
-
-        @Override
-        public final void emit(AMD64Assembler asm, OperandSize size, Register dst, Register nds, Register src) {
-            assert verify(asm, size, dst, src);
-            int pre;
-            int opc;
-            boolean rexVexW = (size == QWORD) ? true : false;
-            AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-            int curPrefix = size.sizePrefix | prefix1;
-            switch (curPrefix) {
-                case 0x66:
-                    pre = VexSimdPrefix.VEX_SIMD_66;
-                    break;
-                case 0xF2:
-                    pre = VexSimdPrefix.VEX_SIMD_F2;
-                    break;
-                case 0xF3:
-                    pre = VexSimdPrefix.VEX_SIMD_F3;
-                    break;
-                default:
-                    pre = VexSimdPrefix.VEX_SIMD_NONE;
-                    break;
-            }
-            switch (prefix2) {
-                case P_0F:
-                    opc = VexOpcode.VEX_OPCODE_0F;
-                    break;
-                case P_0F38:
-                    opc = VexOpcode.VEX_OPCODE_0F_38;
-                    break;
-                case P_0F3A:
-                    opc = VexOpcode.VEX_OPCODE_0F_3A;
-                    break;
-                default:
-                    throw GraalError.shouldNotReachHere("invalid VEX instruction prefix");
-            }
-            int encode;
-            encode = asm.simdPrefixAndEncode(dst, nds, src, pre, opc, attributes);
-            asm.emitByte(op);
-            asm.emitByte(0xC0 | encode);
-        }
-
-        public final void emit(AMD64Assembler asm, OperandSize size, Register dst, Register nds, AMD64Address src) {
-            assert verify(asm, size, dst, null);
-            int pre;
-            int opc;
-            boolean rexVexW = (size == QWORD) ? true : false;
-            AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-            int curPrefix = size.sizePrefix | prefix1;
-            switch (curPrefix) {
-                case 0x66:
-                    pre = VexSimdPrefix.VEX_SIMD_66;
-                    break;
-                case 0xF2:
-                    pre = VexSimdPrefix.VEX_SIMD_F2;
-                    break;
-                case 0xF3:
-                    pre = VexSimdPrefix.VEX_SIMD_F3;
-                    break;
-                default:
-                    pre = VexSimdPrefix.VEX_SIMD_NONE;
-                    break;
-            }
-            switch (prefix2) {
-                case P_0F:
-                    opc = VexOpcode.VEX_OPCODE_0F;
-                    break;
-                case P_0F38:
-                    opc = VexOpcode.VEX_OPCODE_0F_38;
-                    break;
-                case P_0F3A:
-                    opc = VexOpcode.VEX_OPCODE_0F_3A;
-                    break;
-                default:
-                    throw GraalError.shouldNotReachHere("invalid VEX instruction prefix");
-            }
-            asm.simdPrefix(dst, nds, src, pre, opc, attributes);
-            asm.emitByte(op);
-            asm.emitOperandHelper(dst, src, 0);
-        }
-    }
-
-    /**
      * Opcode with operand order of MR.
      */
     public static class AMD64MROp extends AMD64RROp {
@@ -1185,64 +562,20 @@
         @Override
         public final void emit(AMD64Assembler asm, OperandSize size, Register dst, Register src) {
             assert verify(asm, size, src, dst);
-            boolean isSimd = false;
-            boolean noNds = false;
-
-            switch (op) {
-                case 0x7E:
-                    isSimd = true;
-                    noNds = true;
-                    break;
-                case 0x11:
-                    isSimd = true;
-                    break;
-            }
-
-            int opc = 0;
-            if (isSimd) {
-                switch (prefix2) {
-                    case P_0F:
-                        opc = VexOpcode.VEX_OPCODE_0F;
-                        break;
-                    case P_0F38:
-                        opc = VexOpcode.VEX_OPCODE_0F_38;
-                        break;
-                    case P_0F3A:
-                        opc = VexOpcode.VEX_OPCODE_0F_3A;
+            if (isSSEInstruction()) {
+                Register nds = Register.None;
+                switch (op) {
+                    case 0x11:
+                        if ((size == SS) || (size == SD)) {
+                            nds = src;
+                        }
                         break;
                     default:
-                        isSimd = false;
                         break;
                 }
-            }
-
-            if (isSimd) {
-                int pre;
-                boolean rexVexW = (size == QWORD) ? true : false;
-                AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-                int curPrefix = size.sizePrefix | prefix1;
-                switch (curPrefix) {
-                    case 0x66:
-                        pre = VexSimdPrefix.VEX_SIMD_66;
-                        break;
-                    case 0xF2:
-                        pre = VexSimdPrefix.VEX_SIMD_F2;
-                        break;
-                    case 0xF3:
-                        pre = VexSimdPrefix.VEX_SIMD_F3;
-                        break;
-                    default:
-                        pre = VexSimdPrefix.VEX_SIMD_NONE;
-                        break;
-                }
-                int encode;
-                if (noNds) {
-                    encode = asm.simdPrefixAndEncode(src, Register.None, dst, pre, opc, attributes);
-                } else {
-                    encode = asm.simdPrefixAndEncode(src, src, dst, pre, opc, attributes);
-                }
+                asm.simdPrefix(src, nds, dst, size, prefix1, prefix2, size == QWORD);
                 asm.emitByte(op);
-                asm.emitByte(0xC0 | encode);
+                asm.emitModRM(src, dst);
             } else {
                 emitOpcode(asm, size, getRXB(src, dst), src.encoding, dst.encoding);
                 asm.emitModRM(src, dst);
@@ -1250,60 +583,14 @@
         }
 
         public final void emit(AMD64Assembler asm, OperandSize size, AMD64Address dst, Register src) {
-            assert verify(asm, size, null, src);
-            boolean isSimd = false;
-
-            switch (op) {
-                case 0x7E:
-                case 0x11:
-                    isSimd = true;
-                    break;
-            }
-
-            int opc = 0;
-            if (isSimd) {
-                switch (prefix2) {
-                    case P_0F:
-                        opc = VexOpcode.VEX_OPCODE_0F;
-                        break;
-                    case P_0F38:
-                        opc = VexOpcode.VEX_OPCODE_0F_38;
-                        break;
-                    case P_0F3A:
-                        opc = VexOpcode.VEX_OPCODE_0F_3A;
-                        break;
-                    default:
-                        isSimd = false;
-                        break;
-                }
-            }
-
-            if (isSimd) {
-                int pre;
-                boolean rexVexW = (size == QWORD) ? true : false;
-                AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-                int curPrefix = size.sizePrefix | prefix1;
-                switch (curPrefix) {
-                    case 0x66:
-                        pre = VexSimdPrefix.VEX_SIMD_66;
-                        break;
-                    case 0xF2:
-                        pre = VexSimdPrefix.VEX_SIMD_F2;
-                        break;
-                    case 0xF3:
-                        pre = VexSimdPrefix.VEX_SIMD_F3;
-                        break;
-                    default:
-                        pre = VexSimdPrefix.VEX_SIMD_NONE;
-                        break;
-                }
-                asm.simdPrefix(src, Register.None, dst, pre, opc, attributes);
+            assert verify(asm, size, src, null);
+            if (isSSEInstruction()) {
+                asm.simdPrefix(src, Register.None, dst, size, prefix1, prefix2, size == QWORD);
                 asm.emitByte(op);
-                asm.emitOperandHelper(src, dst, 0);
             } else {
                 emitOpcode(asm, size, getRXB(src, dst), src.encoding, 0);
-                asm.emitOperandHelper(src, dst, 0);
             }
+            asm.emitOperandHelper(src, dst, 0);
         }
     }
 
@@ -1382,17 +669,37 @@
         }
 
         public final void emit(AMD64Assembler asm, OperandSize size, Register dst, int imm) {
+            emit(asm, size, dst, imm, false);
+        }
+
+        public final void emit(AMD64Assembler asm, OperandSize size, Register dst, int imm, boolean annotateImm) {
             assert verify(asm, size, dst, null);
+            int insnPos = asm.position();
             emitOpcode(asm, size, getRXB(null, dst), 0, dst.encoding);
             asm.emitModRM(ext, dst);
+            int immPos = asm.position();
             emitImmediate(asm, size, imm);
+            int nextInsnPos = asm.position();
+            if (annotateImm && asm.codePatchingAnnotationConsumer != null) {
+                asm.codePatchingAnnotationConsumer.accept(new ImmediateOperandAnnotation(insnPos, immPos, nextInsnPos - immPos, nextInsnPos));
+            }
         }
 
         public final void emit(AMD64Assembler asm, OperandSize size, AMD64Address dst, int imm) {
+            emit(asm, size, dst, imm, false);
+        }
+
+        public final void emit(AMD64Assembler asm, OperandSize size, AMD64Address dst, int imm, boolean annotateImm) {
             assert verify(asm, size, null, null);
+            int insnPos = asm.position();
             emitOpcode(asm, size, getRXB(null, dst), 0, 0);
             asm.emitOperandHelper(ext, dst, immediateSize(size));
+            int immPos = asm.position();
             emitImmediate(asm, size, imm);
+            int nextInsnPos = asm.position();
+            if (annotateImm && asm.codePatchingAnnotationConsumer != null) {
+                asm.codePatchingAnnotationConsumer.accept(new ImmediateOperandAnnotation(insnPos, immPos, nextInsnPos - immPos, nextInsnPos));
+            }
         }
     }
 
@@ -1406,153 +713,66 @@
         // @formatter:off
         public static final AMD64RMIOp IMUL    = new AMD64RMIOp("IMUL", false, 0x69);
         public static final AMD64RMIOp IMUL_SX = new AMD64RMIOp("IMUL", true,  0x6B);
-        public static final AMD64RMIOp ROUNDSS = new AMD64RMIOp("ROUNDSS", true, P_0F3A, 0x0A, OpAssertion.PackedDoubleAssertion);
-        public static final AMD64RMIOp ROUNDSD = new AMD64RMIOp("ROUNDSD", true, P_0F3A, 0x0B, OpAssertion.PackedDoubleAssertion);
+        public static final AMD64RMIOp ROUNDSS = new AMD64RMIOp("ROUNDSS", true, P_0F3A, 0x0A, OpAssertion.PackedDoubleAssertion, CPUFeature.SSE4_1);
+        public static final AMD64RMIOp ROUNDSD = new AMD64RMIOp("ROUNDSD", true, P_0F3A, 0x0B, OpAssertion.PackedDoubleAssertion, CPUFeature.SSE4_1);
         // @formatter:on
 
         protected AMD64RMIOp(String opcode, boolean immIsByte, int op) {
-            this(opcode, immIsByte, 0, op, OpAssertion.WordOrLargerAssertion);
+            this(opcode, immIsByte, 0, op, OpAssertion.WordOrLargerAssertion, null);
         }
 
-        protected AMD64RMIOp(String opcode, boolean immIsByte, int prefix, int op, OpAssertion assertion) {
-            super(opcode, immIsByte, prefix, op, assertion);
+        protected AMD64RMIOp(String opcode, boolean immIsByte, int prefix, int op, OpAssertion assertion, CPUFeature feature) {
+            super(opcode, immIsByte, prefix, op, assertion, feature);
         }
 
         public final void emit(AMD64Assembler asm, OperandSize size, Register dst, Register src, int imm) {
             assert verify(asm, size, dst, src);
-            boolean isSimd = false;
-            boolean noNds = false;
-
-            switch (op) {
-                case 0x0A:
-                case 0x0B:
-                    isSimd = true;
-                    noNds = true;
-                    break;
-            }
-
-            int opc = 0;
-            if (isSimd) {
-                switch (prefix2) {
-                    case P_0F:
-                        opc = VexOpcode.VEX_OPCODE_0F;
-                        break;
-                    case P_0F38:
-                        opc = VexOpcode.VEX_OPCODE_0F_38;
-                        break;
-                    case P_0F3A:
-                        opc = VexOpcode.VEX_OPCODE_0F_3A;
+            if (isSSEInstruction()) {
+                Register nds = Register.None;
+                switch (op) {
+                    case 0x0A:
+                    case 0x0B:
+                        nds = dst;
                         break;
                     default:
-                        isSimd = false;
                         break;
                 }
-            }
-
-            if (isSimd) {
-                int pre;
-                AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-                int curPrefix = size.sizePrefix | prefix1;
-                switch (curPrefix) {
-                    case 0x66:
-                        pre = VexSimdPrefix.VEX_SIMD_66;
-                        break;
-                    case 0xF2:
-                        pre = VexSimdPrefix.VEX_SIMD_F2;
-                        break;
-                    case 0xF3:
-                        pre = VexSimdPrefix.VEX_SIMD_F3;
-                        break;
-                    default:
-                        pre = VexSimdPrefix.VEX_SIMD_NONE;
-                        break;
-                }
-                int encode;
-                if (noNds) {
-                    encode = asm.simdPrefixAndEncode(dst, Register.None, src, pre, opc, attributes);
-                } else {
-                    encode = asm.simdPrefixAndEncode(dst, dst, src, pre, opc, attributes);
-                }
+                asm.simdPrefix(dst, nds, src, size, prefix1, prefix2, false);
                 asm.emitByte(op);
-                asm.emitByte(0xC0 | encode);
-                emitImmediate(asm, size, imm);
+                asm.emitModRM(dst, src);
             } else {
                 emitOpcode(asm, size, getRXB(dst, src), dst.encoding, src.encoding);
                 asm.emitModRM(dst, src);
-                emitImmediate(asm, size, imm);
             }
+            emitImmediate(asm, size, imm);
         }
 
         public final void emit(AMD64Assembler asm, OperandSize size, Register dst, AMD64Address src, int imm) {
             assert verify(asm, size, dst, null);
-
-            boolean isSimd = false;
-            boolean noNds = false;
-
-            switch (op) {
-                case 0x0A:
-                case 0x0B:
-                    isSimd = true;
-                    noNds = true;
-                    break;
-            }
-
-            int opc = 0;
-            if (isSimd) {
-                switch (prefix2) {
-                    case P_0F:
-                        opc = VexOpcode.VEX_OPCODE_0F;
-                        break;
-                    case P_0F38:
-                        opc = VexOpcode.VEX_OPCODE_0F_38;
-                        break;
-                    case P_0F3A:
-                        opc = VexOpcode.VEX_OPCODE_0F_3A;
+            if (isSSEInstruction()) {
+                Register nds = Register.None;
+                switch (op) {
+                    case 0x0A:
+                    case 0x0B:
+                        nds = dst;
                         break;
                     default:
-                        isSimd = false;
                         break;
                 }
-            }
-
-            if (isSimd) {
-                int pre;
-                AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, asm.target);
-                int curPrefix = size.sizePrefix | prefix1;
-                switch (curPrefix) {
-                    case 0x66:
-                        pre = VexSimdPrefix.VEX_SIMD_66;
-                        break;
-                    case 0xF2:
-                        pre = VexSimdPrefix.VEX_SIMD_F2;
-                        break;
-                    case 0xF3:
-                        pre = VexSimdPrefix.VEX_SIMD_F3;
-                        break;
-                    default:
-                        pre = VexSimdPrefix.VEX_SIMD_NONE;
-                        break;
-                }
-                if (noNds) {
-                    asm.simdPrefix(dst, Register.None, src, pre, opc, attributes);
-                } else {
-                    asm.simdPrefix(dst, dst, src, pre, opc, attributes);
-                }
+                asm.simdPrefix(dst, nds, src, size, prefix1, prefix2, false);
                 asm.emitByte(op);
-                asm.emitOperandHelper(dst, src, immediateSize(size));
-                emitImmediate(asm, size, imm);
             } else {
                 emitOpcode(asm, size, getRXB(dst, src), dst.encoding, 0);
-                asm.emitOperandHelper(dst, src, immediateSize(size));
-                emitImmediate(asm, size, imm);
             }
+            asm.emitOperandHelper(dst, src, immediateSize(size));
+            emitImmediate(asm, size, imm);
         }
     }
 
     public static class SSEOp extends AMD64RMOp {
         // @formatter:off
         public static final SSEOp CVTSI2SS  = new SSEOp("CVTSI2SS",  0xF3, P_0F, 0x2A, OpAssertion.IntToFloatAssertion);
-        public static final SSEOp CVTSI2SD  = new SSEOp("CVTSI2SS",  0xF2, P_0F, 0x2A, OpAssertion.IntToFloatAssertion);
+        public static final SSEOp CVTSI2SD  = new SSEOp("CVTSI2SD",  0xF2, P_0F, 0x2A, OpAssertion.IntToFloatAssertion);
         public static final SSEOp CVTTSS2SI = new SSEOp("CVTTSS2SI", 0xF3, P_0F, 0x2C, OpAssertion.FloatToIntAssertion);
         public static final SSEOp CVTTSD2SI = new SSEOp("CVTTSD2SI", 0xF2, P_0F, 0x2C, OpAssertion.FloatToIntAssertion);
         public static final SSEOp UCOMIS    = new SSEOp("UCOMIS",          P_0F, 0x2E, OpAssertion.PackedFloatAssertion);
@@ -1584,33 +804,6 @@
         }
     }
 
-    public static class AVXOp extends AMD64RRMOp {
-        // @formatter:off
-        public static final AVXOp AND       = new AVXOp("AND",             P_0F, 0x54, OpAssertion.PackedFloatAssertion);
-        public static final AVXOp ANDN      = new AVXOp("ANDN",            P_0F, 0x55, OpAssertion.PackedFloatAssertion);
-        public static final AVXOp OR        = new AVXOp("OR",              P_0F, 0x56, OpAssertion.PackedFloatAssertion);
-        public static final AVXOp XOR       = new AVXOp("XOR",             P_0F, 0x57, OpAssertion.PackedFloatAssertion);
-        public static final AVXOp ADD       = new AVXOp("ADD",             P_0F, 0x58);
-        public static final AVXOp MUL       = new AVXOp("MUL",             P_0F, 0x59);
-        public static final AVXOp SUB       = new AVXOp("SUB",             P_0F, 0x5C);
-        public static final AVXOp MIN       = new AVXOp("MIN",             P_0F, 0x5D);
-        public static final AVXOp DIV       = new AVXOp("DIV",             P_0F, 0x5E);
-        public static final AVXOp MAX       = new AVXOp("MAX",             P_0F, 0x5F);
-        // @formatter:on
-
-        protected AVXOp(String opcode, int prefix, int op) {
-            this(opcode, prefix, op, OpAssertion.FloatAssertion);
-        }
-
-        protected AVXOp(String opcode, int prefix, int op, OpAssertion assertion) {
-            this(opcode, 0, prefix, op, assertion);
-        }
-
-        protected AVXOp(String opcode, int mandatoryPrefix, int prefix, int op, OpAssertion assertion) {
-            super(opcode, mandatoryPrefix, prefix, op, assertion, CPUFeature.AVX);
-        }
-    }
-
     /**
      * Arithmetic operation with operand order of RM, MR or MI.
      */
@@ -1700,6 +893,661 @@
         }
     }
 
+    private enum AVXOpAssertion {
+        AVX1(CPUFeature.AVX, CPUFeature.AVX),
+        AVX1_2(CPUFeature.AVX, CPUFeature.AVX2),
+        AVX2(CPUFeature.AVX2, CPUFeature.AVX2),
+        AVX1_128ONLY(CPUFeature.AVX, null),
+        AVX1_256ONLY(null, CPUFeature.AVX),
+        AVX2_256ONLY(null, CPUFeature.AVX2),
+        XMM_CPU(CPUFeature.AVX, null, XMM, null, CPU, null),
+        XMM_XMM_CPU(CPUFeature.AVX, null, XMM, XMM, CPU, null),
+        CPU_XMM(CPUFeature.AVX, null, CPU, null, XMM, null),
+        AVX1_2_CPU_XMM(CPUFeature.AVX, CPUFeature.AVX2, CPU, null, XMM, null);
+
+        private final CPUFeature avx128feature;
+        private final CPUFeature avx256feature;
+
+        private final RegisterCategory rCategory;
+        private final RegisterCategory vCategory;
+        private final RegisterCategory mCategory;
+        private final RegisterCategory imm8Category;
+
+        AVXOpAssertion(CPUFeature avx128feature, CPUFeature avx256feature) {
+            this(avx128feature, avx256feature, XMM, XMM, XMM, XMM);
+        }
+
+        AVXOpAssertion(CPUFeature avx128feature, CPUFeature avx256feature, RegisterCategory rCategory, RegisterCategory vCategory, RegisterCategory mCategory, RegisterCategory imm8Category) {
+            this.avx128feature = avx128feature;
+            this.avx256feature = avx256feature;
+            this.rCategory = rCategory;
+            this.vCategory = vCategory;
+            this.mCategory = mCategory;
+            this.imm8Category = imm8Category;
+        }
+
+        public boolean check(AMD64 arch, AVXSize size, Register r, Register v, Register m) {
+            return check(arch, size, r, v, m, null);
+        }
+
+        public boolean check(AMD64 arch, AVXSize size, Register r, Register v, Register m, Register imm8) {
+            switch (size) {
+                case XMM:
+                    assert avx128feature != null && arch.getFeatures().contains(avx128feature) : "emitting illegal 128 bit instruction";
+                    break;
+                case YMM:
+                    assert avx256feature != null && arch.getFeatures().contains(avx256feature) : "emitting illegal 256 bit instruction";
+                    break;
+            }
+            if (r != null) {
+                assert r.getRegisterCategory().equals(rCategory);
+            }
+            if (v != null) {
+                assert v.getRegisterCategory().equals(vCategory);
+            }
+            if (m != null) {
+                assert m.getRegisterCategory().equals(mCategory);
+            }
+            if (imm8 != null) {
+                assert imm8.getRegisterCategory().equals(imm8Category);
+            }
+            return true;
+        }
+
+        public boolean supports(EnumSet<CPUFeature> features, AVXSize avxSize) {
+            switch (avxSize) {
+                case XMM:
+                    return avx128feature != null && features.contains(avx128feature);
+                case YMM:
+                    return avx256feature != null && features.contains(avx256feature);
+                default:
+                    throw GraalError.shouldNotReachHere();
+            }
+        }
+    }
+
+    /**
+     * Base class for VEX-encoded instructions.
+     */
+    public static class VexOp {
+        protected final int pp;
+        protected final int mmmmm;
+        protected final int w;
+        protected final int op;
+
+        private final String opcode;
+        protected final AVXOpAssertion assertion;
+
+        protected VexOp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            this.pp = pp;
+            this.mmmmm = mmmmm;
+            this.w = w;
+            this.op = op;
+            this.opcode = opcode;
+            this.assertion = assertion;
+        }
+
+        public boolean isSupported(AMD64Assembler vasm, AMD64Kind kind) {
+            return assertion.supports(((AMD64) vasm.target.arch).getFeatures(), AVXKind.getRegisterSize(kind));
+        }
+
+        public final boolean isSupported(AMD64Assembler vasm, AVXSize size) {
+            return assertion.supports(((AMD64) vasm.target.arch).getFeatures(), size);
+        }
+
+        @Override
+        public String toString() {
+            return opcode;
+        }
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of RM, but the M operand must be a register.
+     */
+    public static class VexRROp extends VexOp {
+        // @formatter:off
+        public static final VexRROp VMASKMOVDQU = new VexRROp("VMASKMOVDQU", P_66, M_0F, WIG, 0xF7, AVXOpAssertion.AVX1_128ONLY);
+        // @formatter:on
+
+        protected VexRROp(String opcode, int pp, int mmmmm, int w, int op) {
+            this(opcode, pp, mmmmm, w, op, AVXOpAssertion.AVX1);
+        }
+
+        protected VexRROp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, null, src);
+            assert op != 0x1A || op != 0x5A;
+            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(dst, src);
+        }
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of RM.
+     */
+    public static class VexRMOp extends VexRROp {
+        // @formatter:off
+        public static final VexRMOp VCVTTSS2SI      = new VexRMOp("VCVTTSS2SI",      P_F3, M_0F,   W0,  0x2C, AVXOpAssertion.CPU_XMM);
+        public static final VexRMOp VCVTTSS2SQ      = new VexRMOp("VCVTTSS2SQ",      P_F3, M_0F,   W1,  0x2C, AVXOpAssertion.CPU_XMM);
+        public static final VexRMOp VCVTTSD2SI      = new VexRMOp("VCVTTSD2SI",      P_F2, M_0F,   W0,  0x2C, AVXOpAssertion.CPU_XMM);
+        public static final VexRMOp VCVTTSD2SQ      = new VexRMOp("VCVTTSD2SQ",      P_F2, M_0F,   W1,  0x2C, AVXOpAssertion.CPU_XMM);
+        public static final VexRMOp VCVTPS2PD       = new VexRMOp("VCVTPS2PD",       P_,   M_0F,   WIG, 0x5A);
+        public static final VexRMOp VCVTPD2PS       = new VexRMOp("VCVTPD2PS",       P_66, M_0F,   WIG, 0x5A);
+        public static final VexRMOp VCVTDQ2PS       = new VexRMOp("VCVTDQ2PS",       P_,   M_0F,   WIG, 0x5B);
+        public static final VexRMOp VCVTTPS2DQ      = new VexRMOp("VCVTTPS2DQ",      P_F3, M_0F,   WIG, 0x5B);
+        public static final VexRMOp VCVTTPD2DQ      = new VexRMOp("VCVTTPD2DQ",      P_66, M_0F,   WIG, 0xE6);
+        public static final VexRMOp VCVTDQ2PD       = new VexRMOp("VCVTDQ2PD",       P_F3, M_0F,   WIG, 0xE6);
+        public static final VexRMOp VBROADCASTSS    = new VexRMOp("VBROADCASTSS",    P_66, M_0F38, W0,  0x18);
+        public static final VexRMOp VBROADCASTSD    = new VexRMOp("VBROADCASTSD",    P_66, M_0F38, W0,  0x19, AVXOpAssertion.AVX1_256ONLY);
+        public static final VexRMOp VBROADCASTF128  = new VexRMOp("VBROADCASTF128",  P_66, M_0F38, W0,  0x1A, AVXOpAssertion.AVX1_256ONLY);
+        public static final VexRMOp VPBROADCASTI128 = new VexRMOp("VPBROADCASTI128", P_66, M_0F38, W0,  0x5A, AVXOpAssertion.AVX2_256ONLY);
+        public static final VexRMOp VPBROADCASTB    = new VexRMOp("VPBROADCASTB",    P_66, M_0F38, W0,  0x78, AVXOpAssertion.AVX2);
+        public static final VexRMOp VPBROADCASTW    = new VexRMOp("VPBROADCASTW",    P_66, M_0F38, W0,  0x79, AVXOpAssertion.AVX2);
+        public static final VexRMOp VPBROADCASTD    = new VexRMOp("VPBROADCASTD",    P_66, M_0F38, W0,  0x58, AVXOpAssertion.AVX2);
+        public static final VexRMOp VPBROADCASTQ    = new VexRMOp("VPBROADCASTQ",    P_66, M_0F38, W0,  0x59, AVXOpAssertion.AVX2);
+        public static final VexRMOp VPMOVMSKB       = new VexRMOp("VPMOVMSKB",       P_66, M_0F,   WIG, 0xD7, AVXOpAssertion.AVX1_2_CPU_XMM);
+        public static final VexRMOp VPMOVSXBW       = new VexRMOp("VPMOVSXBW",       P_66, M_0F38, WIG, 0x20);
+        public static final VexRMOp VPMOVSXBD       = new VexRMOp("VPMOVSXBD",       P_66, M_0F38, WIG, 0x21);
+        public static final VexRMOp VPMOVSXBQ       = new VexRMOp("VPMOVSXBQ",       P_66, M_0F38, WIG, 0x22);
+        public static final VexRMOp VPMOVSXWD       = new VexRMOp("VPMOVSXWD",       P_66, M_0F38, WIG, 0x23);
+        public static final VexRMOp VPMOVSXWQ       = new VexRMOp("VPMOVSXWQ",       P_66, M_0F38, WIG, 0x24);
+        public static final VexRMOp VPMOVSXDQ       = new VexRMOp("VPMOVSXDQ",       P_66, M_0F38, WIG, 0x25);
+        public static final VexRMOp VPMOVZXBW       = new VexRMOp("VPMOVZXBW",       P_66, M_0F38, WIG, 0x30);
+        public static final VexRMOp VPMOVZXBD       = new VexRMOp("VPMOVZXBD",       P_66, M_0F38, WIG, 0x31);
+        public static final VexRMOp VPMOVZXBQ       = new VexRMOp("VPMOVZXBQ",       P_66, M_0F38, WIG, 0x32);
+        public static final VexRMOp VPMOVZXWD       = new VexRMOp("VPMOVZXWD",       P_66, M_0F38, WIG, 0x33);
+        public static final VexRMOp VPMOVZXWQ       = new VexRMOp("VPMOVZXWQ",       P_66, M_0F38, WIG, 0x34);
+        public static final VexRMOp VPMOVZXDQ       = new VexRMOp("VPMOVZXDQ",       P_66, M_0F38, WIG, 0x35);
+        public static final VexRMOp VPTEST          = new VexRMOp("VPTEST",          P_66, M_0F38, WIG, 0x17);
+        public static final VexRMOp VSQRTPD         = new VexRMOp("VSQRTPD",         P_66, M_0F,   WIG, 0x51);
+        public static final VexRMOp VSQRTPS         = new VexRMOp("VSQRTPS",         P_,   M_0F,   WIG, 0x51);
+        public static final VexRMOp VSQRTSD         = new VexRMOp("VSQRTSD",         P_F2, M_0F,   WIG, 0x51);
+        public static final VexRMOp VSQRTSS         = new VexRMOp("VSQRTSS",         P_F3, M_0F,   WIG, 0x51);
+        public static final VexRMOp VUCOMISS        = new VexRMOp("VUCOMISS",        P_,   M_0F,   WIG, 0x2E);
+        public static final VexRMOp VUCOMISD        = new VexRMOp("VUCOMISD",        P_66, M_0F,   WIG, 0x2E);
+        // @formatter:on
+
+        protected VexRMOp(String opcode, int pp, int mmmmm, int w, int op) {
+            this(opcode, pp, mmmmm, w, op, AVXOpAssertion.AVX1);
+        }
+
+        protected VexRMOp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, AMD64Address src) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, null, null);
+            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src, 0);
+        }
+    }
+
+    /**
+     * VEX-encoded move instructions.
+     * <p>
+     * These instructions have two opcodes: op is the forward move instruction with an operand order
+     * of RM, and opReverse is the reverse move instruction with an operand order of MR.
+     */
+    public static final class VexMoveOp extends VexRMOp {
+        // @formatter:off
+        public static final VexMoveOp VMOVDQA = new VexMoveOp("VMOVDQA", P_66, M_0F, WIG, 0x6F, 0x7F);
+        public static final VexMoveOp VMOVDQU = new VexMoveOp("VMOVDQU", P_F3, M_0F, WIG, 0x6F, 0x7F);
+        public static final VexMoveOp VMOVAPS = new VexMoveOp("VMOVAPS", P_,   M_0F, WIG, 0x28, 0x29);
+        public static final VexMoveOp VMOVAPD = new VexMoveOp("VMOVAPD", P_66, M_0F, WIG, 0x28, 0x29);
+        public static final VexMoveOp VMOVUPS = new VexMoveOp("VMOVUPS", P_,   M_0F, WIG, 0x10, 0x11);
+        public static final VexMoveOp VMOVUPD = new VexMoveOp("VMOVUPD", P_66, M_0F, WIG, 0x10, 0x11);
+        public static final VexMoveOp VMOVSS  = new VexMoveOp("VMOVSS",  P_F3, M_0F, WIG, 0x10, 0x11);
+        public static final VexMoveOp VMOVSD  = new VexMoveOp("VMOVSD",  P_F2, M_0F, WIG, 0x10, 0x11);
+        public static final VexMoveOp VMOVD   = new VexMoveOp("VMOVD",   P_66, M_0F, W0,  0x6E, 0x7E, AVXOpAssertion.XMM_CPU);
+        public static final VexMoveOp VMOVQ   = new VexMoveOp("VMOVQ",   P_66, M_0F, W1,  0x6E, 0x7E, AVXOpAssertion.XMM_CPU);
+        // @formatter:on
+
+        private final int opReverse;
+
+        private VexMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse) {
+            this(opcode, pp, mmmmm, w, op, opReverse, AVXOpAssertion.AVX1);
+        }
+
+        private VexMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+            this.opReverse = opReverse;
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, AMD64Address dst, Register src) {
+            assert assertion.check((AMD64) asm.target.arch, size, src, null, null);
+            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w);
+            asm.emitByte(opReverse);
+            asm.emitOperandHelper(src, dst, 0);
+        }
+
+        public void emitReverse(AMD64Assembler asm, AVXSize size, Register dst, Register src) {
+            assert assertion.check((AMD64) asm.target.arch, size, src, null, dst);
+            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w);
+            asm.emitByte(opReverse);
+            asm.emitModRM(src, dst);
+        }
+    }
+
+    public interface VexRRIOp {
+        void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8);
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of RMI.
+     */
+    public static final class VexRMIOp extends VexOp implements VexRRIOp {
+        // @formatter:off
+        public static final VexRMIOp VPERMQ   = new VexRMIOp("VPERMQ",   P_66, M_0F3A, W1,  0x00, AVXOpAssertion.AVX2_256ONLY);
+        public static final VexRMIOp VPSHUFLW = new VexRMIOp("VPSHUFLW", P_F2, M_0F,   WIG, 0x70, AVXOpAssertion.AVX1_2);
+        public static final VexRMIOp VPSHUFHW = new VexRMIOp("VPSHUFHW", P_F3, M_0F,   WIG, 0x70, AVXOpAssertion.AVX1_2);
+        public static final VexRMIOp VPSHUFD  = new VexRMIOp("VPSHUFD",  P_66, M_0F,   WIG, 0x70, AVXOpAssertion.AVX1_2);
+        // @formatter:on
+
+        private VexRMIOp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        @Override
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, null, src);
+            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(dst, src);
+            asm.emitByte(imm8);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, AMD64Address src, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, null, null);
+            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src, 1);
+            asm.emitByte(imm8);
+        }
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of MRI.
+     */
+    public static final class VexMRIOp extends VexOp implements VexRRIOp {
+        // @formatter:off
+        public static final VexMRIOp VEXTRACTF128 = new VexMRIOp("VEXTRACTF128", P_66, M_0F3A, W0, 0x19, AVXOpAssertion.AVX1_256ONLY);
+        public static final VexMRIOp VEXTRACTI128 = new VexMRIOp("VEXTRACTI128", P_66, M_0F3A, W0, 0x39, AVXOpAssertion.AVX2_256ONLY);
+        public static final VexMRIOp VPEXTRB      = new VexMRIOp("VPEXTRB",      P_66, M_0F3A, W0, 0x14, AVXOpAssertion.XMM_CPU);
+        public static final VexMRIOp VPEXTRW      = new VexMRIOp("VPEXTRW",      P_66, M_0F3A, W0, 0x15, AVXOpAssertion.XMM_CPU);
+        public static final VexMRIOp VPEXTRD      = new VexMRIOp("VPEXTRD",      P_66, M_0F3A, W0, 0x16, AVXOpAssertion.XMM_CPU);
+        public static final VexMRIOp VPEXTRQ      = new VexMRIOp("VPEXTRQ",      P_66, M_0F3A, W1, 0x16, AVXOpAssertion.XMM_CPU);
+        // @formatter:on
+
+        private VexMRIOp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        @Override
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, src, null, dst);
+            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(src, dst);
+            asm.emitByte(imm8);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, AMD64Address dst, Register src, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, src, null, null);
+            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(src, dst, 1);
+            asm.emitByte(imm8);
+        }
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of RVMR.
+     */
+    public static class VexRVMROp extends VexOp {
+        // @formatter:off
+        public static final VexRVMROp VPBLENDVB  = new VexRVMROp("VPBLENDVB",  P_66, M_0F3A, W0, 0x4C, AVXOpAssertion.AVX1_2);
+        public static final VexRVMROp VPBLENDVPS = new VexRVMROp("VPBLENDVPS", P_66, M_0F3A, W0, 0x4A, AVXOpAssertion.AVX1);
+        public static final VexRVMROp VPBLENDVPD = new VexRVMROp("VPBLENDVPD", P_66, M_0F3A, W0, 0x4B, AVXOpAssertion.AVX1);
+        // @formatter:on
+
+        protected VexRVMROp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register mask, Register src1, Register src2) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, mask, src1, src2);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(dst, src2);
+            asm.emitByte(mask.encoding() << 4);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register mask, Register src1, AMD64Address src2) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, mask, src1, null);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src2, 0);
+            asm.emitByte(mask.encoding() << 4);
+        }
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of RVM.
+     */
+    public static class VexRVMOp extends VexOp {
+        // @formatter:off
+        public static final VexRVMOp VANDPS    = new VexRVMOp("VANDPS",    P_,   M_0F,   WIG, 0x54);
+        public static final VexRVMOp VANDPD    = new VexRVMOp("VANDPD",    P_66, M_0F,   WIG, 0x54);
+        public static final VexRVMOp VANDNPS   = new VexRVMOp("VANDNPS",   P_,   M_0F,   WIG, 0x55);
+        public static final VexRVMOp VANDNPD   = new VexRVMOp("VANDNPD",   P_66, M_0F,   WIG, 0x55);
+        public static final VexRVMOp VORPS     = new VexRVMOp("VORPS",     P_,   M_0F,   WIG, 0x56);
+        public static final VexRVMOp VORPD     = new VexRVMOp("VORPD",     P_66, M_0F,   WIG, 0x56);
+        public static final VexRVMOp VXORPS    = new VexRVMOp("VXORPS",    P_,   M_0F,   WIG, 0x57);
+        public static final VexRVMOp VXORPD    = new VexRVMOp("VXORPD",    P_66, M_0F,   WIG, 0x57);
+        public static final VexRVMOp VADDPS    = new VexRVMOp("VADDPS",    P_,   M_0F,   WIG, 0x58);
+        public static final VexRVMOp VADDPD    = new VexRVMOp("VADDPD",    P_66, M_0F,   WIG, 0x58);
+        public static final VexRVMOp VADDSS    = new VexRVMOp("VADDSS",    P_F3, M_0F,   WIG, 0x58);
+        public static final VexRVMOp VADDSD    = new VexRVMOp("VADDSD",    P_F2, M_0F,   WIG, 0x58);
+        public static final VexRVMOp VMULPS    = new VexRVMOp("VMULPS",    P_,   M_0F,   WIG, 0x59);
+        public static final VexRVMOp VMULPD    = new VexRVMOp("VMULPD",    P_66, M_0F,   WIG, 0x59);
+        public static final VexRVMOp VMULSS    = new VexRVMOp("VMULSS",    P_F3, M_0F,   WIG, 0x59);
+        public static final VexRVMOp VMULSD    = new VexRVMOp("VMULSD",    P_F2, M_0F,   WIG, 0x59);
+        public static final VexRVMOp VSUBPS    = new VexRVMOp("VSUBPS",    P_,   M_0F,   WIG, 0x5C);
+        public static final VexRVMOp VSUBPD    = new VexRVMOp("VSUBPD",    P_66, M_0F,   WIG, 0x5C);
+        public static final VexRVMOp VSUBSS    = new VexRVMOp("VSUBSS",    P_F3, M_0F,   WIG, 0x5C);
+        public static final VexRVMOp VSUBSD    = new VexRVMOp("VSUBSD",    P_F2, M_0F,   WIG, 0x5C);
+        public static final VexRVMOp VMINPS    = new VexRVMOp("VMINPS",    P_,   M_0F,   WIG, 0x5D);
+        public static final VexRVMOp VMINPD    = new VexRVMOp("VMINPD",    P_66, M_0F,   WIG, 0x5D);
+        public static final VexRVMOp VMINSS    = new VexRVMOp("VMINSS",    P_F3, M_0F,   WIG, 0x5D);
+        public static final VexRVMOp VMINSD    = new VexRVMOp("VMINSD",    P_F2, M_0F,   WIG, 0x5D);
+        public static final VexRVMOp VDIVPS    = new VexRVMOp("VDIVPS",    P_,   M_0F,   WIG, 0x5E);
+        public static final VexRVMOp VDIVPD    = new VexRVMOp("VDIVPD",    P_66, M_0F,   WIG, 0x5E);
+        public static final VexRVMOp VDIVSS    = new VexRVMOp("VDIVPS",    P_F3, M_0F,   WIG, 0x5E);
+        public static final VexRVMOp VDIVSD    = new VexRVMOp("VDIVPD",    P_F2, M_0F,   WIG, 0x5E);
+        public static final VexRVMOp VMAXPS    = new VexRVMOp("VMAXPS",    P_,   M_0F,   WIG, 0x5F);
+        public static final VexRVMOp VMAXPD    = new VexRVMOp("VMAXPD",    P_66, M_0F,   WIG, 0x5F);
+        public static final VexRVMOp VMAXSS    = new VexRVMOp("VMAXSS",    P_F3, M_0F,   WIG, 0x5F);
+        public static final VexRVMOp VMAXSD    = new VexRVMOp("VMAXSD",    P_F2, M_0F,   WIG, 0x5F);
+        public static final VexRVMOp VADDSUBPS = new VexRVMOp("VADDSUBPS", P_F2, M_0F,   WIG, 0xD0);
+        public static final VexRVMOp VADDSUBPD = new VexRVMOp("VADDSUBPD", P_66, M_0F,   WIG, 0xD0);
+        public static final VexRVMOp VPAND     = new VexRVMOp("VPAND",     P_66, M_0F,   WIG, 0xDB, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPOR      = new VexRVMOp("VPOR",      P_66, M_0F,   WIG, 0xEB, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPXOR     = new VexRVMOp("VPXOR",     P_66, M_0F,   WIG, 0xEF, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPADDB    = new VexRVMOp("VPADDB",    P_66, M_0F,   WIG, 0xFC, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPADDW    = new VexRVMOp("VPADDW",    P_66, M_0F,   WIG, 0xFD, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPADDD    = new VexRVMOp("VPADDD",    P_66, M_0F,   WIG, 0xFE, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPADDQ    = new VexRVMOp("VPADDQ",    P_66, M_0F,   WIG, 0xD4, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPMULHUW  = new VexRVMOp("VPMULHUW",  P_66, M_0F,   WIG, 0xE4, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPMULHW   = new VexRVMOp("VPMULHW",   P_66, M_0F,   WIG, 0xE5, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPMULLW   = new VexRVMOp("VPMULLW",   P_66, M_0F,   WIG, 0xD5, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPMULLD   = new VexRVMOp("VPMULLD",   P_66, M_0F38, WIG, 0x40, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPSUBB    = new VexRVMOp("VPSUBB",    P_66, M_0F,   WIG, 0xF8, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPSUBW    = new VexRVMOp("VPSUBW",    P_66, M_0F,   WIG, 0xF9, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPSUBD    = new VexRVMOp("VPSUBD",    P_66, M_0F,   WIG, 0xFA, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPSUBQ    = new VexRVMOp("VPSUBQ",    P_66, M_0F,   WIG, 0xFB, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPSHUFB   = new VexRVMOp("VPSHUFB",   P_66, M_0F38, WIG, 0x00, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VCVTSD2SS = new VexRVMOp("VCVTSD2SS", P_F2, M_0F,   WIG, 0x5A);
+        public static final VexRVMOp VCVTSS2SD = new VexRVMOp("VCVTSS2SD", P_F3, M_0F,   WIG, 0x5A);
+        public static final VexRVMOp VCVTSI2SD = new VexRVMOp("VCVTSI2SD", P_F2, M_0F,   W0,  0x2A, AVXOpAssertion.XMM_XMM_CPU);
+        public static final VexRVMOp VCVTSQ2SD = new VexRVMOp("VCVTSQ2SD", P_F2, M_0F,   W1,  0x2A, AVXOpAssertion.XMM_XMM_CPU);
+        public static final VexRVMOp VCVTSI2SS = new VexRVMOp("VCVTSI2SS", P_F3, M_0F,   W0,  0x2A, AVXOpAssertion.XMM_XMM_CPU);
+        public static final VexRVMOp VCVTSQ2SS = new VexRVMOp("VCVTSQ2SS", P_F3, M_0F,   W1,  0x2A, AVXOpAssertion.XMM_XMM_CPU);
+        public static final VexRVMOp VPCMPEQB  = new VexRVMOp("VPCMPEQB",  P_66, M_0F,   WIG, 0x74, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPEQW  = new VexRVMOp("VPCMPEQW",  P_66, M_0F,   WIG, 0x75, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPEQD  = new VexRVMOp("VPCMPEQD",  P_66, M_0F,   WIG, 0x76, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPEQQ  = new VexRVMOp("VPCMPEQQ",  P_66, M_0F38, WIG, 0x29, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPGTB  = new VexRVMOp("VPCMPGTB",  P_66, M_0F,   WIG, 0x64, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPGTW  = new VexRVMOp("VPCMPGTW",  P_66, M_0F,   WIG, 0x65, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPGTD  = new VexRVMOp("VPCMPGTD",  P_66, M_0F,   WIG, 0x66, AVXOpAssertion.AVX1_2);
+        public static final VexRVMOp VPCMPGTQ  = new VexRVMOp("VPCMPGTQ",  P_66, M_0F38, WIG, 0x37, AVXOpAssertion.AVX1_2);
+        // @formatter:on
+
+        private VexRVMOp(String opcode, int pp, int mmmmm, int w, int op) {
+            this(opcode, pp, mmmmm, w, op, AVXOpAssertion.AVX1);
+        }
+
+        protected VexRVMOp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, src1, src2);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(dst, src2);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, src1, null);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src2, 0);
+        }
+    }
+
+    /**
+     * VEX-encoded shift instructions with an operand order of either RVM or VMI.
+     */
+    public static final class VexShiftOp extends VexRVMOp implements VexRRIOp {
+        // @formatter:off
+        public static final VexShiftOp VPSRLW = new VexShiftOp("VPSRLW", P_66, M_0F, WIG, 0xD1, 0x71, 2);
+        public static final VexShiftOp VPSRLD = new VexShiftOp("VPSRLD", P_66, M_0F, WIG, 0xD2, 0x72, 2);
+        public static final VexShiftOp VPSRLQ = new VexShiftOp("VPSRLQ", P_66, M_0F, WIG, 0xD3, 0x73, 2);
+        public static final VexShiftOp VPSRAW = new VexShiftOp("VPSRAW", P_66, M_0F, WIG, 0xE1, 0x71, 4);
+        public static final VexShiftOp VPSRAD = new VexShiftOp("VPSRAD", P_66, M_0F, WIG, 0xE2, 0x72, 4);
+        public static final VexShiftOp VPSLLW = new VexShiftOp("VPSLLW", P_66, M_0F, WIG, 0xF1, 0x71, 6);
+        public static final VexShiftOp VPSLLD = new VexShiftOp("VPSLLD", P_66, M_0F, WIG, 0xF2, 0x72, 6);
+        public static final VexShiftOp VPSLLQ = new VexShiftOp("VPSLLQ", P_66, M_0F, WIG, 0xF3, 0x73, 6);
+        // @formatter:on
+
+        private final int immOp;
+        private final int r;
+
+        private VexShiftOp(String opcode, int pp, int mmmmm, int w, int op, int immOp, int r) {
+            super(opcode, pp, mmmmm, w, op, AVXOpAssertion.AVX1_2);
+            this.immOp = immOp;
+            this.r = r;
+        }
+
+        @Override
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, null, dst, src);
+            asm.vexPrefix(null, dst, src, size, pp, mmmmm, w);
+            asm.emitByte(immOp);
+            asm.emitModRM(r, src);
+            asm.emitByte(imm8);
+        }
+    }
+
+    public static final class VexMaskMoveOp extends VexOp {
+        // @formatter:off
+        public static final VexMaskMoveOp VMASKMOVPS = new VexMaskMoveOp("VMASKMOVPS", P_66, M_0F38, W0, 0x2C, 0x2E);
+        public static final VexMaskMoveOp VMASKMOVPD = new VexMaskMoveOp("VMASKMOVPD", P_66, M_0F38, W0, 0x2D, 0x2F);
+        public static final VexMaskMoveOp VPMASKMOVD = new VexMaskMoveOp("VPMASKMOVD", P_66, M_0F38, W0, 0x8C, 0x8E, AVXOpAssertion.AVX2);
+        public static final VexMaskMoveOp VPMASKMOVQ = new VexMaskMoveOp("VPMASKMOVQ", P_66, M_0F38, W1, 0x8C, 0x8E, AVXOpAssertion.AVX2);
+        // @formatter:on
+
+        private final int opReverse;
+
+        private VexMaskMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse) {
+            this(opcode, pp, mmmmm, w, op, opReverse, AVXOpAssertion.AVX1);
+        }
+
+        private VexMaskMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+            this.opReverse = opReverse;
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register mask, AMD64Address src) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, mask, null);
+            asm.vexPrefix(dst, mask, src, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src, 0);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, AMD64Address dst, Register mask, Register src) {
+            assert assertion.check((AMD64) asm.target.arch, size, src, mask, null);
+            asm.vexPrefix(src, mask, dst, size, pp, mmmmm, w);
+            asm.emitByte(opReverse);
+            asm.emitOperandHelper(src, dst, 0);
+        }
+    }
+
+    /**
+     * VEX-encoded instructions with an operand order of RVMI.
+     */
+    public static final class VexRVMIOp extends VexOp {
+        // @formatter:off
+        public static final VexRVMIOp VSHUFPS     = new VexRVMIOp("VSHUFPS",     P_,   M_0F,   WIG, 0xC6);
+        public static final VexRVMIOp VSHUFPD     = new VexRVMIOp("VSHUFPD",     P_66, M_0F,   WIG, 0xC6);
+        public static final VexRVMIOp VINSERTF128 = new VexRVMIOp("VINSERTF128", P_66, M_0F3A, W0,  0x18, AVXOpAssertion.AVX1_256ONLY);
+        public static final VexRVMIOp VINSERTI128 = new VexRVMIOp("VINSERTI128", P_66, M_0F3A, W0,  0x38, AVXOpAssertion.AVX2_256ONLY);
+        // @formatter:on
+
+        private VexRVMIOp(String opcode, int pp, int mmmmm, int w, int op) {
+            this(opcode, pp, mmmmm, w, op, AVXOpAssertion.AVX1);
+        }
+
+        private VexRVMIOp(String opcode, int pp, int mmmmm, int w, int op, AVXOpAssertion assertion) {
+            super(opcode, pp, mmmmm, w, op, assertion);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, src1, src2);
+            assert (imm8 & 0xFF) == imm8;
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(dst, src2);
+            asm.emitByte(imm8);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2, int imm8) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, src1, null);
+            assert (imm8 & 0xFF) == imm8;
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src2, 1);
+            asm.emitByte(imm8);
+        }
+    }
+
+    /**
+     * VEX-encoded comparison operation with an operand order of RVMI. The immediate operand is a
+     * comparison operator.
+     */
+    public static final class VexFloatCompareOp extends VexOp {
+        // @formatter:off
+        public static final VexFloatCompareOp VCMPPS = new VexFloatCompareOp("VCMPPS", P_,   M_0F, WIG, 0xC2);
+        public static final VexFloatCompareOp VCMPPD = new VexFloatCompareOp("VCMPPD", P_66, M_0F, WIG, 0xC2);
+        public static final VexFloatCompareOp VCMPSS = new VexFloatCompareOp("VCMPSS", P_F2, M_0F, WIG, 0xC2);
+        public static final VexFloatCompareOp VCMPSD = new VexFloatCompareOp("VCMPSD", P_F2, M_0F, WIG, 0xC2);
+        // @formatter:on
+
+        public enum Predicate {
+            EQ_OQ(0x00),
+            LT_OS(0x01),
+            LE_OS(0x02),
+            UNORD_Q(0x03),
+            NEQ_UQ(0x04),
+            NLT_US(0x05),
+            NLE_US(0x06),
+            ORD_Q(0x07),
+            EQ_UQ(0x08),
+            NGE_US(0x09),
+            NGT_US(0x0a),
+            FALSE_OQ(0x0b),
+            NEQ_OQ(0x0c),
+            GE_OS(0x0d),
+            GT_OS(0x0e),
+            TRUE_UQ(0x0f),
+            EQ_OS(0x10),
+            LT_OQ(0x11),
+            LE_OQ(0x12),
+            UNORD_S(0x13),
+            NEQ_US(0x14),
+            NLT_UQ(0x15),
+            NLE_UQ(0x16),
+            ORD_S(0x17),
+            EQ_US(0x18),
+            NGE_UQ(0x19),
+            NGT_UQ(0x1a),
+            FALSE_OS(0x1b),
+            NEQ_OS(0x1c),
+            GE_OQ(0x1d),
+            GT_OQ(0x1e),
+            TRUE_US(0x1f);
+
+            private int imm8;
+
+            Predicate(int imm8) {
+                this.imm8 = imm8;
+            }
+
+            public static Predicate getPredicate(Condition condition, boolean unorderedIsTrue) {
+                if (unorderedIsTrue) {
+                    switch (condition) {
+                        case EQ:
+                            return EQ_UQ;
+                        case NE:
+                            return NEQ_UQ;
+                        case LT:
+                            return NGE_UQ;
+                        case LE:
+                            return NGT_UQ;
+                        case GT:
+                            return NLE_UQ;
+                        case GE:
+                            return NLT_UQ;
+                        default:
+                            throw GraalError.shouldNotReachHere();
+                    }
+                } else {
+                    switch (condition) {
+                        case EQ:
+                            return EQ_OQ;
+                        case NE:
+                            return NEQ_OQ;
+                        case LT:
+                            return LT_OQ;
+                        case LE:
+                            return LE_OQ;
+                        case GT:
+                            return GT_OQ;
+                        case GE:
+                            return GE_OQ;
+                        default:
+                            throw GraalError.shouldNotReachHere();
+                    }
+                }
+            }
+        }
+
+        private VexFloatCompareOp(String opcode, int pp, int mmmmm, int w, int op) {
+            super(opcode, pp, mmmmm, w, op, AVXOpAssertion.AVX1);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2, Predicate p) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, src1, src2);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitModRM(dst, src2);
+            asm.emitByte(p.imm8);
+        }
+
+        public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2, Predicate p) {
+            assert assertion.check((AMD64) asm.target.arch, size, dst, src1, null);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w);
+            asm.emitByte(op);
+            asm.emitOperandHelper(dst, src2, 1);
+            asm.emitByte(p.imm8);
+        }
+    }
+
     public final void addl(AMD64Address dst, int imm32) {
         ADD.getMIOpcode(DWORD, isByte(imm32)).emit(this, DWORD, dst, imm32);
     }
@@ -1713,35 +1561,19 @@
     }
 
     public final void addpd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x58);
-        emitByte(0xC0 | encode);
+        SSEOp.ADD.emit(this, PD, dst, src);
     }
 
     public final void addpd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x58);
-        emitOperandHelper(dst, src, 0);
+        SSEOp.ADD.emit(this, PD, dst, src);
     }
 
     public final void addsd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x58);
-        emitByte(0xC0 | encode);
+        SSEOp.ADD.emit(this, SD, dst, src);
     }
 
     public final void addsd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x58);
-        emitOperandHelper(dst, src, 0);
+        SSEOp.ADD.emit(this, SD, dst, src);
     }
 
     private void addrNop4() {
@@ -1787,39 +1619,31 @@
     }
 
     public final void andpd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x54);
-        emitByte(0xC0 | encode);
+        SSEOp.AND.emit(this, PD, dst, src);
     }
 
     public final void andpd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x54);
-        emitOperandHelper(dst, src, 0);
+        SSEOp.AND.emit(this, PD, dst, src);
     }
 
     public final void bsfq(Register dst, Register src) {
-        int encode = prefixqAndEncode(dst.encoding(), src.encoding());
+        prefixq(dst, src);
         emitByte(0x0F);
         emitByte(0xBC);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void bsrl(Register dst, Register src) {
-        int encode = prefixAndEncode(dst.encoding(), src.encoding());
+        prefix(dst, src);
         emitByte(0x0F);
         emitByte(0xBD);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void bswapl(Register reg) {
-        int encode = prefixAndEncode(reg.encoding);
+        prefix(reg);
         emitByte(0x0F);
-        emitByte(0xC8 | encode);
+        emitModRM(1, reg);
     }
 
     public final void cdql() {
@@ -1827,10 +1651,10 @@
     }
 
     public final void cmovl(ConditionFlag cc, Register dst, Register src) {
-        int encode = prefixAndEncode(dst.encoding, src.encoding);
+        prefix(dst, src);
         emitByte(0x0F);
         emitByte(0x40 | cc.getValue());
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void cmovl(ConditionFlag cc, Register dst, AMD64Address src) {
@@ -1894,53 +1718,21 @@
     }
 
     public final void cvtsi2sdl(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.CPU);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x2A);
-        emitByte(0xC0 | encode);
+        SSEOp.CVTSI2SD.emit(this, DWORD, dst, src);
     }
 
     public final void cvttsd2sil(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.CPU) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x2C);
-        emitByte(0xC0 | encode);
+        SSEOp.CVTTSD2SI.emit(this, DWORD, dst, src);
     }
 
-    protected final void decl(AMD64Address dst) {
+    public final void decl(AMD64Address dst) {
         prefix(dst);
         emitByte(0xFF);
         emitOperandHelper(1, dst, 0);
     }
 
     public final void divsd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x5E);
-        emitByte(0xC0 | encode);
-    }
-
-    public final void evmovdquq(Register dst, AMD64Address src, int vectorLen) {
-        assert supports(CPUFeature.AVX512F);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(vectorLen, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true, target);
-        attributes.setAddressAttributes(/* tuple_type */ EvexTupleType.EVEX_FVM, /* input_size_in_bits */ EvexInputSizeInBits.EVEX_NObit);
-        attributes.setIsEvexInstruction();
-        vexPrefix(src, Register.None, dst, VexSimdPrefix.VEX_SIMD_F3, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x6F);
-        emitOperandHelper(dst, src, 0);
-    }
-
-    public final void evpcmpeqb(Register kdst, Register nds, AMD64Address src, int vectorLen) {
-        assert supports(CPUFeature.AVX512BW);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(vectorLen, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false, target);
-        attributes.setIsEvexInstruction();
-        attributes.setAddressAttributes(/* tuple_type */ EvexTupleType.EVEX_FVM, /* input_size_in_bits */ EvexInputSizeInBits.EVEX_NObit);
-        vexPrefix(src, nds, kdst, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x74);
-        emitOperandHelper(kdst, src, 0);
+        SSEOp.DIV.emit(this, SD, dst, src);
     }
 
     public final void hlt() {
@@ -1955,7 +1747,7 @@
         }
     }
 
-    protected final void incl(AMD64Address dst) {
+    public final void incl(AMD64Address dst) {
         prefix(dst);
         emitByte(0xFF);
         emitOperandHelper(0, dst, 0);
@@ -2041,15 +1833,15 @@
     }
 
     public final void jmp(Register entry) {
-        int encode = prefixAndEncode(entry.encoding);
+        prefix(entry);
         emitByte(0xFF);
-        emitByte(0xE0 | encode);
+        emitModRM(4, entry);
     }
 
     public final void jmp(AMD64Address adr) {
         prefix(adr);
         emitByte(0xFF);
-        emitOperandHelper(rsp, adr, 0);
+        emitOperandHelper(AMD64.rsp, adr, 0);
     }
 
     public final void jmpb(Label l) {
@@ -2068,32 +1860,6 @@
         }
     }
 
-    // This instruction produces ZF or CF flags
-    public final void kortestql(Register src1, Register src2) {
-        assert supports(CPUFeature.AVX512BW);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false, target);
-        int encode = vexPrefixAndEncode(src1, Register.None, src2, VexSimdPrefix.VEX_SIMD_NONE, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x98);
-        emitByte(0xC0 | encode);
-    }
-
-    public final void kmovql(Register dst, Register src) {
-        assert supports(CPUFeature.AVX512BW);
-        if (src.getRegisterCategory().equals(AMD64.MASK)) {
-            // kmovql(KRegister dst, KRegister src)
-            AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false, target);
-            int encode = vexPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_NONE, VexOpcode.VEX_OPCODE_0F, attributes);
-            emitByte(0x90);
-            emitByte(0xC0 | encode);
-        } else {
-            // kmovql(KRegister dst, Register src)
-            AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false, target);
-            int encode = vexPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-            emitByte(0x92);
-            emitByte(0xC0 | encode);
-        }
-    }
-
     public final void lead(Register dst, AMD64Address src) {
         prefix(src, dst);
         emitByte(0x8D);
@@ -2115,19 +1881,17 @@
     }
 
     public final void movapd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PD, P_0F, false);
         emitByte(0x28);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movaps(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_NONE, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PS, P_0F, false);
         emitByte(0x28);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movb(AMD64Address dst, int imm8) {
@@ -2138,22 +1902,32 @@
     }
 
     public final void movb(AMD64Address dst, Register src) {
-        assert src.getRegisterCategory().equals(AMD64.CPU) : "must have byte register";
+        assert src.getRegisterCategory().equals(CPU) : "must have byte register";
         prefixb(dst, src);
         emitByte(0x88);
         emitOperandHelper(src, dst, 0);
     }
 
     public final void movl(Register dst, int imm32) {
-        int encode = prefixAndEncode(dst.encoding);
-        emitByte(0xB8 | encode);
+        movl(dst, imm32, false);
+    }
+
+    public final void movl(Register dst, int imm32, boolean annotateImm) {
+        int insnPos = position();
+        prefix(dst);
+        emitByte(0xB8 + encode(dst));
+        int immPos = position();
         emitInt(imm32);
+        int nextInsnPos = position();
+        if (annotateImm && codePatchingAnnotationConsumer != null) {
+            codePatchingAnnotationConsumer.accept(new ImmediateOperandAnnotation(insnPos, immPos, nextInsnPos - immPos, nextInsnPos));
+        }
     }
 
     public final void movl(Register dst, Register src) {
-        int encode = prefixAndEncode(dst.encoding, src.encoding);
+        prefix(dst, src);
         emitByte(0x8B);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movl(Register dst, AMD64Address src) {
@@ -2191,19 +1965,17 @@
      * {@link AMD64MacroAssembler#movflt(Register, Register)}.
      */
     public final void movlpd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0x12);
         emitOperandHelper(dst, src, 0);
     }
 
     public final void movlhps(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, src, src, VexSimdPrefix.VEX_SIMD_NONE, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, src, src, PS, P_0F, false);
         emitByte(0x16);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movq(Register dst, AMD64Address src) {
@@ -2211,9 +1983,8 @@
     }
 
     public final void movq(Register dst, AMD64Address src, boolean wide) {
-        if (dst.getRegisterCategory().equals(AMD64.XMM)) {
-            AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ wide, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-            simdPrefix(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_F3, VexOpcode.VEX_OPCODE_0F, attributes);
+        if (dst.getRegisterCategory().equals(XMM)) {
+            simdPrefix(dst, Register.None, src, SS, P_0F, false);
             emitByte(0x7E);
             emitOperandHelper(dst, src, wide, 0);
         } else {
@@ -2225,15 +1996,14 @@
     }
 
     public final void movq(Register dst, Register src) {
-        int encode = prefixqAndEncode(dst.encoding, src.encoding);
+        prefixq(dst, src);
         emitByte(0x8B);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movq(AMD64Address dst, Register src) {
-        if (src.getRegisterCategory().equals(AMD64.XMM)) {
-            AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ true, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-            simdPrefix(src, Register.None, dst, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        if (src.getRegisterCategory().equals(XMM)) {
+            simdPrefix(src, Register.None, dst, PD, P_0F, true);
             emitByte(0xD6);
             emitOperandHelper(src, dst, 0);
         } else {
@@ -2252,10 +2022,10 @@
     }
 
     public final void movsbl(Register dst, Register src) {
-        int encode = prefixAndEncode(dst.encoding, false, src.encoding, true);
+        prefix(dst, false, src, true);
         emitByte(0x0F);
         emitByte(0xBE);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movsbq(Register dst, AMD64Address src) {
@@ -2266,98 +2036,54 @@
     }
 
     public final void movsbq(Register dst, Register src) {
-        int encode = prefixqAndEncode(dst.encoding, src.encoding);
+        prefixq(dst, src);
         emitByte(0x0F);
         emitByte(0xBE);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void movsd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x10);
-        emitByte(0xC0 | encode);
+        AMD64RMOp.MOVSD.emit(this, SD, dst, src);
     }
 
     public final void movsd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x10);
-        emitOperandHelper(dst, src, 0);
+        AMD64RMOp.MOVSD.emit(this, SD, dst, src);
     }
 
     public final void movsd(AMD64Address dst, Register src) {
-        assert src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(src, Register.None, dst, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x11);
-        emitOperandHelper(src, dst, 0);
+        AMD64MROp.MOVSD.emit(this, SD, dst, src);
     }
 
     public final void movss(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F3, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x10);
-        emitByte(0xC0 | encode);
+        AMD64RMOp.MOVSS.emit(this, SS, dst, src);
     }
 
     public final void movss(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_F3, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x10);
-        emitOperandHelper(dst, src, 0);
+        AMD64RMOp.MOVSS.emit(this, SS, dst, src);
     }
 
     public final void movss(AMD64Address dst, Register src) {
-        assert src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(src, Register.None, dst, VexSimdPrefix.VEX_SIMD_F3, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x11);
-        emitOperandHelper(src, dst, 0);
+        AMD64MROp.MOVSS.emit(this, SS, dst, src);
     }
 
     public final void mulpd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x59);
-        emitByte(0xC0 | encode);
+        SSEOp.MUL.emit(this, PD, dst, src);
     }
 
     public final void mulpd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x59);
-        emitOperandHelper(dst, src, 0);
+        SSEOp.MUL.emit(this, PD, dst, src);
     }
 
     public final void mulsd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x59);
-        emitByte(0xC0 | encode);
+        SSEOp.MUL.emit(this, SD, dst, src);
     }
 
     public final void mulsd(Register dst, AMD64Address src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, dst, src, VexSimdPrefix.VEX_SIMD_F2, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x59);
-        emitOperandHelper(dst, src, 0);
+        SSEOp.MUL.emit(this, SD, dst, src);
     }
 
     public final void mulss(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_F3, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0x59);
-        emitByte(0xC0 | encode);
+        SSEOp.MUL.emit(this, SS, dst, src);
     }
 
     public final void movswl(Register dst, AMD64Address src) {
@@ -2390,11 +2116,11 @@
     }
 
     public final void movzbl(Register dst, Register src) {
-        AMD64RMOp.MOVZXB.emit(this, OperandSize.DWORD, dst, src);
+        AMD64RMOp.MOVZXB.emit(this, DWORD, dst, src);
     }
 
     public final void movzbq(Register dst, Register src) {
-        AMD64RMOp.MOVZXB.emit(this, OperandSize.QWORD, dst, src);
+        AMD64RMOp.MOVZXB.emit(this, QWORD, dst, src);
     }
 
     public final void movzwl(Register dst, AMD64Address src) {
@@ -2639,8 +2365,8 @@
     }
 
     public final void pop(Register dst) {
-        int encode = prefixAndEncode(dst.encoding);
-        emitByte(0x58 | encode);
+        prefix(dst);
+        emitByte(0x58 + encode(dst));
     }
 
     public void popfq() {
@@ -2649,26 +2375,32 @@
 
     public final void ptest(Register dst, Register src) {
         assert supports(CPUFeature.SSE4_1);
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F_38, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PD, P_0F38, false);
         emitByte(0x17);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
-    public final void vptest(Register dst, Register src) {
-        assert supports(CPUFeature.AVX);
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_256bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = vexPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F_38, attributes);
-        emitByte(0x17);
-        emitByte(0xC0 | encode);
+    public final void pcmpeqb(Register dst, Register src) {
+        assert supports(CPUFeature.SSE2);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
+        emitByte(0x74);
+        emitModRM(dst, src);
+    }
+
+    public final void pcmpeqw(Register dst, Register src) {
+        assert supports(CPUFeature.SSE2);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
+        emitByte(0x75);
+        emitModRM(dst, src);
     }
 
     public final void pcmpestri(Register dst, AMD64Address src, int imm8) {
         assert supports(CPUFeature.SSE4_2);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        simdPrefix(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F_3A, attributes);
+        assert dst.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PD, P_0F3A, false);
         emitByte(0x61);
         emitOperandHelper(dst, src, 0);
         emitByte(imm8);
@@ -2676,36 +2408,33 @@
 
     public final void pcmpestri(Register dst, Register src, int imm8) {
         assert supports(CPUFeature.SSE4_2);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F_3A, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PD, P_0F3A, false);
         emitByte(0x61);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
         emitByte(imm8);
     }
 
+    public final void pmovmskb(Register dst, Register src) {
+        assert supports(CPUFeature.SSE2);
+        assert dst.getRegisterCategory().equals(CPU) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PD, P_0F, false);
+        emitByte(0xD7);
+        emitModRM(dst, src);
+    }
+
     public final void pmovzxbw(Register dst, AMD64Address src) {
         assert supports(CPUFeature.SSE4_2);
+        assert dst.getRegisterCategory().equals(XMM);
         // XXX legacy_mode should be: _legacy_mode_bw
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false, target);
-        attributes.setAddressAttributes(/* tuple_type */ EvexTupleType.EVEX_HVM, /* input_size_in_bits */ EvexInputSizeInBits.EVEX_NObit);
-        simdPrefix(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F_38, attributes);
+        simdPrefix(dst, Register.None, src, PD, P_0F38, false);
         emitByte(0x30);
         emitOperandHelper(dst, src, 0);
     }
 
-    public final void vpmovzxbw(Register dst, AMD64Address src, int vectorLen) {
-        assert supports(CPUFeature.AVX);
-        // XXX legacy_mode should be: _legacy_mode_bw
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(vectorLen, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false, target);
-        attributes.setAddressAttributes(/* tuple_type */ EvexTupleType.EVEX_HVM, /* input_size_in_bits */ EvexInputSizeInBits.EVEX_NObit);
-        vexPrefix(src, Register.None, dst, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F_38, attributes);
-        emitByte(0x30);
-        emitOperandHelper(dst, src, 0);
-    }
-
     public final void push(Register src) {
-        int encode = prefixAndEncode(src.encoding);
-        emitByte(0x50 | encode);
+        prefix(src);
+        emitByte(0x50 + encode(src));
     }
 
     public void pushfq() {
@@ -2713,178 +2442,161 @@
     }
 
     public final void paddd(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0xFE);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void paddq(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0xD4);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void pextrw(Register dst, Register src, int imm8) {
-        assert dst.getRegisterCategory().equals(AMD64.CPU) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, Register.None, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(CPU) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, Register.None, src, PD, P_0F, false);
         emitByte(0xC5);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
         emitByte(imm8);
     }
 
     public final void pinsrw(Register dst, Register src, int imm8) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.CPU);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(CPU);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0xC4);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
         emitByte(imm8);
     }
 
     public final void por(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0xEB);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void pand(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0xDB);
-        emitByte(0xC0 | encode);
+        emitModRM(dst, src);
     }
 
     public final void pxor(Register dst, Register src) {
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = simdPrefixAndEncode(dst, dst, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
+        assert dst.getRegisterCategory().equals(XMM) && src.getRegisterCategory().equals(XMM);
+        simdPrefix(dst, dst, src, PD, P_0F, false);
         emitByte(0xEF);
-        emitByte(0xC0 | encode);
-    }
-
-    public final void vpxor(Register dst, Register nds, Register src) {
-        assert supports(CPUFeature.AVX);
-        assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_256bit, /* rexVexW */ false, /* legacyMode */ false, /* noMaskReg */ false, /* usesVl */ false, target);
-        int encode = vexPrefixAndEncode(dst, nds, src, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0xEF);
-        emitByte(0xC0 | encode);
-    }
-
-    public final void vpxor(Register dst, Register nds, AMD64Address src) {
-        assert supports(CPUFeature.AVX);
-        AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true, target);
-        attributes.setAddressAttributes(/* tuple_type */ EvexTupleType.EVEX_FV, /* input_size_in_bits */ EvexInputSizeInBits.EVEX_32bit);
-        vexPrefix(src, nds, dst, VexSimdPrefix.VEX_SIMD_66, VexOpcode.VEX_OPCODE_0F, attributes);
-        emitByte(0xEF);
-        emitOperandHelper(dst, src, 0);
+        emitModRM(dst, src);