8161258: Simplify including platform files.
authorgoetz
Wed, 13 Jul 2016 12:23:05 +0200
changeset 40010 e32d5e545789
parent 40009 626aa0715fe4
child 40011 e93911497588
8161258: Simplify including platform files. Summary: Include patform files with macros cpu_header() etc. Do various cleanups of macro usages. Remove _64/_32 from adlc generated files and platform .hpp files. Merge stubRoutines_x86*.hpp. Remove empty mutex_<os>* files. Reviewed-by: dholmes, coleenp, kbarrett
hotspot/make/gensrc/GensrcAdlc.gmk
hotspot/make/lib/CompileJvm.gmk
hotspot/src/cpu/aarch64/vm/bytes_aarch64.hpp
hotspot/src/cpu/aarch64/vm/copy_aarch64.hpp
hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
hotspot/src/cpu/ppc/vm/bytes_ppc.hpp
hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
hotspot/src/cpu/ppc/vm/interp_masm_ppc.hpp
hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
hotspot/src/cpu/ppc/vm/ppc_64.ad
hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp
hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp
hotspot/src/cpu/ppc/vm/templateTable_ppc.hpp
hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp
hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
hotspot/src/cpu/x86/vm/bytes_x86.hpp
hotspot/src/cpu/x86/vm/copy_x86.hpp
hotspot/src/cpu/x86/vm/macroAssembler_x86.inline.hpp
hotspot/src/cpu/x86/vm/register_definitions_x86.cpp
hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp
hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp
hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
hotspot/src/cpu/zero/vm/bytes_zero.hpp
hotspot/src/cpu/zero/vm/macroAssembler_zero.hpp
hotspot/src/cpu/zero/vm/macroAssembler_zero.inline.hpp
hotspot/src/os/aix/vm/mutex_aix.inline.hpp
hotspot/src/os/aix/vm/os_aix.cpp
hotspot/src/os/bsd/vm/mutex_bsd.cpp
hotspot/src/os/bsd/vm/mutex_bsd.inline.hpp
hotspot/src/os/bsd/vm/os_bsd.cpp
hotspot/src/os/linux/vm/mutex_linux.cpp
hotspot/src/os/linux/vm/mutex_linux.inline.hpp
hotspot/src/os/linux/vm/os_linux.cpp
hotspot/src/os/posix/vm/os_posix.cpp
hotspot/src/os/posix/vm/vmError_posix.cpp
hotspot/src/os/solaris/vm/mutex_solaris.cpp
hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp
hotspot/src/os/solaris/vm/os_solaris.cpp
hotspot/src/os/windows/vm/mutex_windows.cpp
hotspot/src/os/windows/vm/mutex_windows.inline.hpp
hotspot/src/os/windows/vm/os_windows.cpp
hotspot/src/os_cpu/aix_ppc/vm/bytes_aix_ppc.inline.hpp
hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
hotspot/src/share/vm/asm/assembler.hpp
hotspot/src/share/vm/asm/assembler.inline.hpp
hotspot/src/share/vm/asm/codeBuffer.hpp
hotspot/src/share/vm/asm/macroAssembler.hpp
hotspot/src/share/vm/asm/macroAssembler.inline.hpp
hotspot/src/share/vm/asm/register.hpp
hotspot/src/share/vm/c1/c1_Defs.hpp
hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
hotspot/src/share/vm/c1/c1_FrameMap.hpp
hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
hotspot/src/share/vm/c1/c1_LinearScan.hpp
hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
hotspot/src/share/vm/c1/c1_globals.hpp
hotspot/src/share/vm/code/nativeInst.hpp
hotspot/src/share/vm/code/nmethod.cpp
hotspot/src/share/vm/code/relocInfo.hpp
hotspot/src/share/vm/code/vmreg.hpp
hotspot/src/share/vm/code/vmreg.inline.hpp
hotspot/src/share/vm/compiler/disassembler.cpp
hotspot/src/share/vm/compiler/disassembler.hpp
hotspot/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp
hotspot/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp
hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
hotspot/src/share/vm/interpreter/cppInterpreter.hpp
hotspot/src/share/vm/interpreter/interp_masm.hpp
hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp
hotspot/src/share/vm/interpreter/templateTable.hpp
hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp
hotspot/src/share/vm/jvmci/jvmciRuntime.cpp
hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
hotspot/src/share/vm/opto/ad.hpp
hotspot/src/share/vm/opto/c2_globals.hpp
hotspot/src/share/vm/opto/library_call.cpp
hotspot/src/share/vm/opto/optoreg.hpp
hotspot/src/share/vm/prims/jni_md.h
hotspot/src/share/vm/prims/jvm.cpp
hotspot/src/share/vm/prims/jvm.h
hotspot/src/share/vm/prims/methodHandles.hpp
hotspot/src/share/vm/runtime/atomic.inline.hpp
hotspot/src/share/vm/runtime/frame.hpp
hotspot/src/share/vm/runtime/frame.inline.hpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/icache.hpp
hotspot/src/share/vm/runtime/interfaceSupport.hpp
hotspot/src/share/vm/runtime/javaCalls.hpp
hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
hotspot/src/share/vm/runtime/mutex.cpp
hotspot/src/share/vm/runtime/orderAccess.inline.hpp
hotspot/src/share/vm/runtime/os.cpp
hotspot/src/share/vm/runtime/os.hpp
hotspot/src/share/vm/runtime/os.inline.hpp
hotspot/src/share/vm/runtime/osThread.hpp
hotspot/src/share/vm/runtime/prefetch.inline.hpp
hotspot/src/share/vm/runtime/registerMap.hpp
hotspot/src/share/vm/runtime/semaphore.hpp
hotspot/src/share/vm/runtime/stubRoutines.hpp
hotspot/src/share/vm/runtime/thread.hpp
hotspot/src/share/vm/runtime/vmStructs.cpp
hotspot/src/share/vm/runtime/vm_version.hpp
hotspot/src/share/vm/shark/sharkRuntime.cpp
hotspot/src/share/vm/shark/shark_globals.hpp
hotspot/src/share/vm/utilities/bytes.hpp
hotspot/src/share/vm/utilities/copy.hpp
hotspot/src/share/vm/utilities/globalDefinitions.hpp
hotspot/src/share/vm/utilities/macros.hpp
--- a/hotspot/make/gensrc/GensrcAdlc.gmk	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/make/gensrc/GensrcAdlc.gmk	Wed Jul 13 12:23:05 2016 +0200
@@ -156,10 +156,10 @@
 	$(call MakeDir, $(@D))
 	$(call ExecuteWithLog, $(ADLC_SUPPORT_DIR)/adlc_run, \
 	    $(FIXPATH) $(ADLC_TOOL) $(ADLCFLAGS) $(SINGLE_AD_SRCFILE) \
-	        -c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU).cpp \
-	        -h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU).hpp \
-	        -a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU).cpp \
-	        -v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU).hpp)
+	        -c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
+	        -h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
+	        -a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
+	        -v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp)
 	$(TOUCH) $@
 
   ##############################################################################
@@ -167,17 +167,17 @@
   # and postprocess them by fixing dummy #line directives.
 
   ADLC_GENERATED_FILES := $(addprefix $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/, \
-      ad_$(HOTSPOT_TARGET_CPU).cpp \
-      ad_$(HOTSPOT_TARGET_CPU).hpp \
-      ad_$(HOTSPOT_TARGET_CPU)_clone.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_expand.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_format.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_gen.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_misc.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_peephole.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_pipeline.cpp \
-      adGlobals_$(HOTSPOT_TARGET_CPU).hpp \
-      dfa_$(HOTSPOT_TARGET_CPU).cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_clone.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_expand.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_format.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_gen.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_misc.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_peephole.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_pipeline.cpp \
+      adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
+      dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
   )
 
   $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/%: $(ADLC_RUN_MARKER)
--- a/hotspot/make/lib/CompileJvm.gmk	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/make/lib/CompileJvm.gmk	Wed Jul 13 12:23:05 2016 +0200
@@ -60,12 +60,15 @@
     -I$(HOTSPOT_TOPDIR)/src/share/vm/prims \
     #
 
+# INCLUDE_SUFFIX_* is only meant for including the proper
+# platform files. Don't use it to guard code. Use the value of
+# HOTSPOT_TARGET_CPU_DEFINE etc. instead.
+# Remaining TARGET_ARCH_* is needed to distinguish closed and open
+# 64-bit ARM ports (also called AARCH64).
 JVM_CFLAGS_TARGET_DEFINES += \
-    -DTARGET_OS_FAMILY_$(HOTSPOT_TARGET_OS) \
-    -DTARGET_ARCH_MODEL_$(HOTSPOT_TARGET_CPU) \
     -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
-    -DTARGET_OS_ARCH_MODEL_$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU) \
-    -DTARGET_OS_ARCH_$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \
+    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
+    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
     -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
     -D$(HOTSPOT_TARGET_CPU_DEFINE) \
     -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
--- a/hotspot/src/cpu/aarch64/vm/bytes_aarch64.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/aarch64/vm/bytes_aarch64.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -67,9 +67,6 @@
 
 
 // The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base]
-
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "bytes_linux_aarch64.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // CPU_AARCH64_VM_BYTES_AARCH64_HPP
--- a/hotspot/src/cpu/aarch64/vm/copy_aarch64.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/aarch64/vm/copy_aarch64.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,9 +29,7 @@
 // Inline functions for memory copy and fill.
 
 // Contains inline asm implementations
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "copy_linux_aarch64.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(copy)
 
 
 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,10 +29,10 @@
 #include "memory/resourceArea.hpp"
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
+#include "utilities/macros.hpp"
 #include "vm_version_aarch64.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
+
+#include OS_HEADER_INLINE(os)
 
 #ifndef BUILTIN_SIM
 #include <sys/auxv.h>
--- a/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2013 SAP SE. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -274,8 +274,6 @@
 #endif // VM_LITTLE_ENDIAN
 };
 
-#if defined(TARGET_OS_ARCH_linux_ppc)
-#include "bytes_linux_ppc.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // CPU_PPC_VM_BYTES_PPC_HPP
--- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -47,7 +47,7 @@
 // The expected size in bytes of a cache line, used to pad data structures.
 #define DEFAULT_CACHE_LINE_SIZE 128
 
-#if defined(COMPILER2) && (defined(AIX) || defined(linux))
+#if defined(COMPILER2) && (defined(AIX) || defined(LINUX))
 // Include Transactional Memory lock eliding optimization
 #define INCLUDE_RTM_OPT 1
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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.
+ *
+ */
+
+#ifndef CPU_PPC_VM_INTERP_MASM_PPC_HPP
+#define CPU_PPC_VM_INTERP_MASM_PPC_HPP
+
+#include "asm/macroAssembler.hpp"
+#include "interpreter/invocationCounter.hpp"
+
+// This file specializes the assembler with interpreter-specific macros.
+
+
+class InterpreterMacroAssembler: public MacroAssembler {
+
+ public:
+  InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
+
+  void null_check_throw(Register a, int offset, Register temp_reg);
+
+  void jump_to_entry(address entry, Register Rscratch);
+
+  // Handy address generation macros.
+#define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread
+#define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method
+
+  virtual void check_and_handle_popframe(Register java_thread);
+  virtual void check_and_handle_earlyret(Register java_thread);
+
+  // Base routine for all dispatches.
+  void dispatch_base(TosState state, address* table);
+
+  void load_earlyret_value(TosState state, Register Rscratch1);
+
+  static const Address l_tmp;
+  static const Address d_tmp;
+
+  // dispatch routines
+  void dispatch_next(TosState state, int step = 0);
+  void dispatch_via (TosState state, address* table);
+  void load_dispatch_table(Register dst, address* table);
+  void dispatch_Lbyte_code(TosState state, Register bytecode, address* table, bool verify = false);
+
+  // Called by shared interpreter generator.
+  void dispatch_prolog(TosState state, int step = 0);
+  void dispatch_epilog(TosState state, int step = 0);
+
+  // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls.
+  void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1);
+  void super_call_VM(Register thread_cache, Register oop_result, Register last_java_sp,
+                     address entry_point, Register arg_1, Register arg_2, bool check_exception = true);
+
+  // Generate a subtype check: branch to ok_is_subtype if sub_klass is
+  // a subtype of super_klass.  Blows registers tmp1, tmp2 and tmp3.
+  void gen_subtype_check(Register sub_klass, Register super_klass,
+                         Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype);
+
+  // Load object from cpool->resolved_references(index).
+  void load_resolved_reference_at_index(Register result, Register index, Label *is_null = NULL);
+
+  void load_receiver(Register Rparam_count, Register Rrecv_dst);
+
+  // helpers for expression stack
+  void pop_i(     Register r = R17_tos);
+  void pop_ptr(   Register r = R17_tos);
+  void pop_l(     Register r = R17_tos);
+  void pop_f(FloatRegister f = F15_ftos);
+  void pop_d(FloatRegister f = F15_ftos );
+
+  void push_i(     Register r = R17_tos);
+  void push_ptr(   Register r = R17_tos);
+  void push_l(     Register r = R17_tos);
+  void push_f(FloatRegister f = F15_ftos );
+  void push_d(FloatRegister f = F15_ftos);
+
+  void push_2ptrs(Register first, Register second);
+
+  void push_l_pop_d(Register l = R17_tos, FloatRegister d = F15_ftos);
+  void push_d_pop_l(FloatRegister d = F15_ftos, Register l = R17_tos);
+
+  void pop (TosState state);           // transition vtos -> state
+  void push(TosState state);           // transition state -> vtos
+  void empty_expression_stack();       // Resets both Lesp and SP.
+
+ public:
+  // Load values from bytecode stream:
+
+  enum signedOrNot { Signed, Unsigned };
+  enum setCCOrNot  { set_CC, dont_set_CC };
+
+  void get_2_byte_integer_at_bcp(int         bcp_offset,
+                                 Register    Rdst,
+                                 signedOrNot is_signed);
+
+  void get_4_byte_integer_at_bcp(int         bcp_offset,
+                                 Register    Rdst,
+                                 signedOrNot is_signed = Unsigned);
+
+  void get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size);
+
+  void get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size = sizeof(u2));
+
+  void get_u4(Register Rdst, Register Rsrc, int offset, signedOrNot is_signed);
+
+  // common code
+
+  void field_offset_at(int n, Register tmp, Register dest, Register base);
+  int  field_offset_at(Register object, address bcp, int offset);
+  void fast_iaaccess(int n, address bcp);
+  void fast_iaputfield(address bcp, bool do_store_check);
+
+  void index_check(Register array, Register index, int index_shift, Register tmp, Register res);
+  void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
+
+  void get_const(Register Rdst);
+  void get_constant_pool(Register Rdst);
+  void get_constant_pool_cache(Register Rdst);
+  void get_cpool_and_tags(Register Rcpool, Register Rtags);
+  void is_a(Label& L);
+
+  void narrow(Register result);
+
+  // Java Call Helpers
+  void call_from_interpreter(Register Rtarget_method, Register Rret_addr, Register Rscratch1, Register Rscratch2);
+
+  // --------------------------------------------------
+
+  void unlock_if_synchronized_method(TosState state, bool throw_monitor_exception = true,
+                                     bool install_monitor_exception = true);
+
+  // Removes the current activation (incl. unlocking of monitors).
+  // Additionally this code is used for earlyReturn in which case we
+  // want to skip throwing an exception and installing an exception.
+  void remove_activation(TosState state,
+                         bool throw_monitor_exception = true,
+                         bool install_monitor_exception = true);
+  void merge_frames(Register Rtop_frame_sp, Register return_pc, Register Rscratch1, Register Rscratch2); // merge top frames
+
+  void add_monitor_to_stack(bool stack_is_empty, Register Rtemp1, Register Rtemp2);
+
+  // Local variable access helpers
+  void load_local_int(Register Rdst_value, Register Rdst_address, Register Rindex);
+  void load_local_long(Register Rdst_value, Register Rdst_address, Register Rindex);
+  void load_local_ptr(Register Rdst_value, Register Rdst_address, Register Rindex);
+  void load_local_float(FloatRegister Rdst_value, Register Rdst_address, Register Rindex);
+  void load_local_double(FloatRegister Rdst_value, Register Rdst_address, Register Rindex);
+  void store_local_int(Register Rvalue, Register Rindex);
+  void store_local_long(Register Rvalue, Register Rindex);
+  void store_local_ptr(Register Rvalue, Register Rindex);
+  void store_local_float(FloatRegister Rvalue, Register Rindex);
+  void store_local_double(FloatRegister Rvalue, Register Rindex);
+
+  // Call VM for std frames
+  // Special call VM versions that check for exceptions and forward exception
+  // via short cut (not via expensive forward exception stub).
+  void check_and_forward_exception(Register Rscratch1, Register Rscratch2);
+  void call_VM(Register oop_result, address entry_point, bool check_exceptions = true);
+  void call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions = true);
+  void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions = true);
+  void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true);
+  // Should not be used:
+  void call_VM(Register oop_result, Register last_java_sp, address entry_point, bool check_exceptions = true) {ShouldNotReachHere();}
+  void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, bool check_exceptions = true) {ShouldNotReachHere();}
+  void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, bool check_exceptions = true) {ShouldNotReachHere();}
+  void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true) {ShouldNotReachHere();}
+
+  Address first_local_in_stack();
+
+  enum LoadOrStore { load, store };
+  void static_iload_or_store(int which_local, LoadOrStore direction, Register Rtmp);
+  void static_aload_or_store(int which_local, LoadOrStore direction, Register Rtmp);
+  void static_dload_or_store(int which_local, LoadOrStore direction);
+
+  void save_interpreter_state(Register scratch);
+  void restore_interpreter_state(Register scratch, bool bcp_and_mdx_only = false);
+
+  void increment_backedge_counter(const Register Rcounters, Register Rtmp, Register Rtmp2, Register Rscratch);
+  void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register target_bcp, Register disp, Register Rtmp);
+
+  void record_static_call_in_profile(Register Rentry, Register Rtmp);
+  void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
+
+  void get_method_counters(Register method, Register Rcounters, Label& skip);
+  void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0);
+
+  // Object locking
+  void lock_object  (Register lock_reg, Register obj_reg);
+  void unlock_object(Register lock_reg, bool check_for_exceptions = true);
+
+  // Interpreter profiling operations
+  void set_method_data_pointer_for_bcp();
+  void test_method_data_pointer(Label& zero_continue);
+  void verify_method_data_pointer();
+  void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rscratch, Label &profile_continue);
+
+  void set_mdp_data_at(int constant, Register value);
+
+  void increment_mdp_data_at(int constant, Register counter_addr, Register Rbumped_count, bool decrement = false);
+
+  void increment_mdp_data_at(Register counter_addr, Register Rbumped_count, bool decrement = false);
+  void increment_mdp_data_at(Register reg, int constant, Register scratch, Register Rbumped_count, bool decrement = false);
+
+  void set_mdp_flag_at(int flag_constant, Register scratch);
+  void test_mdp_data_at(int offset, Register value, Label& not_equal_continue, Register test_out);
+
+  void update_mdp_by_offset(int offset_of_disp, Register scratch);
+  void update_mdp_by_offset(Register reg, int offset_of_disp,
+                            Register scratch);
+  void update_mdp_by_constant(int constant);
+  void update_mdp_for_ret(TosState state, Register return_bci);
+
+  void profile_taken_branch(Register scratch, Register bumped_count);
+  void profile_not_taken_branch(Register scratch1, Register scratch2);
+  void profile_call(Register scratch1, Register scratch2);
+  void profile_final_call(Register scratch1, Register scratch2);
+  void profile_virtual_call(Register Rreceiver, Register Rscratch1, Register Rscratch2,  bool receiver_can_be_null);
+  void profile_typecheck(Register Rklass, Register Rscratch1, Register Rscratch2);
+  void profile_typecheck_failed(Register Rscratch1, Register Rscratch2);
+  void profile_ret(TosState state, Register return_bci, Register scratch1, Register scratch2);
+  void profile_switch_default(Register scratch1, Register scratch2);
+  void profile_switch_case(Register index, Register scratch1,Register scratch2, Register scratch3);
+  void profile_null_seen(Register Rscratch1, Register Rscratch2);
+  void record_klass_in_profile(Register receiver, Register scratch1, Register scratch2, bool is_virtual_call);
+  void record_klass_in_profile_helper(Register receiver, Register scratch1, Register scratch2, int start_row, Label& done, bool is_virtual_call);
+
+  // Argument and return type profiling.
+  void profile_obj_type(Register obj, Register mdo_addr_base, RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2);
+  void profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual);
+  void profile_return_type(Register ret, Register tmp1, Register tmp2);
+  void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
+
+  // Debugging
+  void verify_oop(Register reg, TosState state = atos);    // only if +VerifyOops && state == atos
+  void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
+  void verify_FPU(int stack_depth, TosState state = ftos);
+
+  typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
+
+  // Support for jvmdi/jvmpi.
+  void notify_method_entry();
+  void notify_method_exit(bool is_native_method, TosState state,
+                          NotifyMethodExitMode mode, bool check_exceptions);
+};
+
+#endif // CPU_PPC_VM_INTERP_MASM_PPC_HPP
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,7 +26,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
-#include "interp_masm_ppc_64.hpp"
+#include "interp_masm_ppc.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. 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.
- *
- */
-
-#ifndef CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
-#define CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
-
-#include "asm/macroAssembler.hpp"
-#include "interpreter/invocationCounter.hpp"
-
-// This file specializes the assembler with interpreter-specific macros.
-
-
-class InterpreterMacroAssembler: public MacroAssembler {
-
- public:
-  InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
-
-  void null_check_throw(Register a, int offset, Register temp_reg);
-
-  void jump_to_entry(address entry, Register Rscratch);
-
-  // Handy address generation macros.
-#define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread
-#define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method
-
-  virtual void check_and_handle_popframe(Register java_thread);
-  virtual void check_and_handle_earlyret(Register java_thread);
-
-  // Base routine for all dispatches.
-  void dispatch_base(TosState state, address* table);
-
-  void load_earlyret_value(TosState state, Register Rscratch1);
-
-  static const Address l_tmp;
-  static const Address d_tmp;
-
-  // dispatch routines
-  void dispatch_next(TosState state, int step = 0);
-  void dispatch_via (TosState state, address* table);
-  void load_dispatch_table(Register dst, address* table);
-  void dispatch_Lbyte_code(TosState state, Register bytecode, address* table, bool verify = false);
-
-  // Called by shared interpreter generator.
-  void dispatch_prolog(TosState state, int step = 0);
-  void dispatch_epilog(TosState state, int step = 0);
-
-  // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls.
-  void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1);
-  void super_call_VM(Register thread_cache, Register oop_result, Register last_java_sp,
-                     address entry_point, Register arg_1, Register arg_2, bool check_exception = true);
-
-  // Generate a subtype check: branch to ok_is_subtype if sub_klass is
-  // a subtype of super_klass.  Blows registers tmp1, tmp2 and tmp3.
-  void gen_subtype_check(Register sub_klass, Register super_klass,
-                         Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype);
-
-  // Load object from cpool->resolved_references(index).
-  void load_resolved_reference_at_index(Register result, Register index, Label *is_null = NULL);
-
-  void load_receiver(Register Rparam_count, Register Rrecv_dst);
-
-  // helpers for expression stack
-  void pop_i(     Register r = R17_tos);
-  void pop_ptr(   Register r = R17_tos);
-  void pop_l(     Register r = R17_tos);
-  void pop_f(FloatRegister f = F15_ftos);
-  void pop_d(FloatRegister f = F15_ftos );
-
-  void push_i(     Register r = R17_tos);
-  void push_ptr(   Register r = R17_tos);
-  void push_l(     Register r = R17_tos);
-  void push_f(FloatRegister f = F15_ftos );
-  void push_d(FloatRegister f = F15_ftos);
-
-  void push_2ptrs(Register first, Register second);
-
-  void push_l_pop_d(Register l = R17_tos, FloatRegister d = F15_ftos);
-  void push_d_pop_l(FloatRegister d = F15_ftos, Register l = R17_tos);
-
-  void pop (TosState state);           // transition vtos -> state
-  void push(TosState state);           // transition state -> vtos
-  void empty_expression_stack();       // Resets both Lesp and SP.
-
- public:
-  // Load values from bytecode stream:
-
-  enum signedOrNot { Signed, Unsigned };
-  enum setCCOrNot  { set_CC, dont_set_CC };
-
-  void get_2_byte_integer_at_bcp(int         bcp_offset,
-                                 Register    Rdst,
-                                 signedOrNot is_signed);
-
-  void get_4_byte_integer_at_bcp(int         bcp_offset,
-                                 Register    Rdst,
-                                 signedOrNot is_signed = Unsigned);
-
-  void get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size);
-
-  void get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size = sizeof(u2));
-
-  void get_u4(Register Rdst, Register Rsrc, int offset, signedOrNot is_signed);
-
-  // common code
-
-  void field_offset_at(int n, Register tmp, Register dest, Register base);
-  int  field_offset_at(Register object, address bcp, int offset);
-  void fast_iaaccess(int n, address bcp);
-  void fast_iaputfield(address bcp, bool do_store_check);
-
-  void index_check(Register array, Register index, int index_shift, Register tmp, Register res);
-  void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
-
-  void get_const(Register Rdst);
-  void get_constant_pool(Register Rdst);
-  void get_constant_pool_cache(Register Rdst);
-  void get_cpool_and_tags(Register Rcpool, Register Rtags);
-  void is_a(Label& L);
-
-  void narrow(Register result);
-
-  // Java Call Helpers
-  void call_from_interpreter(Register Rtarget_method, Register Rret_addr, Register Rscratch1, Register Rscratch2);
-
-  // --------------------------------------------------
-
-  void unlock_if_synchronized_method(TosState state, bool throw_monitor_exception = true,
-                                     bool install_monitor_exception = true);
-
-  // Removes the current activation (incl. unlocking of monitors).
-  // Additionally this code is used for earlyReturn in which case we
-  // want to skip throwing an exception and installing an exception.
-  void remove_activation(TosState state,
-                         bool throw_monitor_exception = true,
-                         bool install_monitor_exception = true);
-  void merge_frames(Register Rtop_frame_sp, Register return_pc, Register Rscratch1, Register Rscratch2); // merge top frames
-
-  void add_monitor_to_stack(bool stack_is_empty, Register Rtemp1, Register Rtemp2);
-
-  // Local variable access helpers
-  void load_local_int(Register Rdst_value, Register Rdst_address, Register Rindex);
-  void load_local_long(Register Rdst_value, Register Rdst_address, Register Rindex);
-  void load_local_ptr(Register Rdst_value, Register Rdst_address, Register Rindex);
-  void load_local_float(FloatRegister Rdst_value, Register Rdst_address, Register Rindex);
-  void load_local_double(FloatRegister Rdst_value, Register Rdst_address, Register Rindex);
-  void store_local_int(Register Rvalue, Register Rindex);
-  void store_local_long(Register Rvalue, Register Rindex);
-  void store_local_ptr(Register Rvalue, Register Rindex);
-  void store_local_float(FloatRegister Rvalue, Register Rindex);
-  void store_local_double(FloatRegister Rvalue, Register Rindex);
-
-  // Call VM for std frames
-  // Special call VM versions that check for exceptions and forward exception
-  // via short cut (not via expensive forward exception stub).
-  void check_and_forward_exception(Register Rscratch1, Register Rscratch2);
-  void call_VM(Register oop_result, address entry_point, bool check_exceptions = true);
-  void call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions = true);
-  void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions = true);
-  void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true);
-  // Should not be used:
-  void call_VM(Register oop_result, Register last_java_sp, address entry_point, bool check_exceptions = true) {ShouldNotReachHere();}
-  void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, bool check_exceptions = true) {ShouldNotReachHere();}
-  void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, bool check_exceptions = true) {ShouldNotReachHere();}
-  void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true) {ShouldNotReachHere();}
-
-  Address first_local_in_stack();
-
-  enum LoadOrStore { load, store };
-  void static_iload_or_store(int which_local, LoadOrStore direction, Register Rtmp);
-  void static_aload_or_store(int which_local, LoadOrStore direction, Register Rtmp);
-  void static_dload_or_store(int which_local, LoadOrStore direction);
-
-  void save_interpreter_state(Register scratch);
-  void restore_interpreter_state(Register scratch, bool bcp_and_mdx_only = false);
-
-  void increment_backedge_counter(const Register Rcounters, Register Rtmp, Register Rtmp2, Register Rscratch);
-  void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register target_bcp, Register disp, Register Rtmp);
-
-  void record_static_call_in_profile(Register Rentry, Register Rtmp);
-  void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
-
-  void get_method_counters(Register method, Register Rcounters, Label& skip);
-  void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0);
-
-  // Object locking
-  void lock_object  (Register lock_reg, Register obj_reg);
-  void unlock_object(Register lock_reg, bool check_for_exceptions = true);
-
-  // Interpreter profiling operations
-  void set_method_data_pointer_for_bcp();
-  void test_method_data_pointer(Label& zero_continue);
-  void verify_method_data_pointer();
-  void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rscratch, Label &profile_continue);
-
-  void set_mdp_data_at(int constant, Register value);
-
-  void increment_mdp_data_at(int constant, Register counter_addr, Register Rbumped_count, bool decrement = false);
-
-  void increment_mdp_data_at(Register counter_addr, Register Rbumped_count, bool decrement = false);
-  void increment_mdp_data_at(Register reg, int constant, Register scratch, Register Rbumped_count, bool decrement = false);
-
-  void set_mdp_flag_at(int flag_constant, Register scratch);
-  void test_mdp_data_at(int offset, Register value, Label& not_equal_continue, Register test_out);
-
-  void update_mdp_by_offset(int offset_of_disp, Register scratch);
-  void update_mdp_by_offset(Register reg, int offset_of_disp,
-                            Register scratch);
-  void update_mdp_by_constant(int constant);
-  void update_mdp_for_ret(TosState state, Register return_bci);
-
-  void profile_taken_branch(Register scratch, Register bumped_count);
-  void profile_not_taken_branch(Register scratch1, Register scratch2);
-  void profile_call(Register scratch1, Register scratch2);
-  void profile_final_call(Register scratch1, Register scratch2);
-  void profile_virtual_call(Register Rreceiver, Register Rscratch1, Register Rscratch2,  bool receiver_can_be_null);
-  void profile_typecheck(Register Rklass, Register Rscratch1, Register Rscratch2);
-  void profile_typecheck_failed(Register Rscratch1, Register Rscratch2);
-  void profile_ret(TosState state, Register return_bci, Register scratch1, Register scratch2);
-  void profile_switch_default(Register scratch1, Register scratch2);
-  void profile_switch_case(Register index, Register scratch1,Register scratch2, Register scratch3);
-  void profile_null_seen(Register Rscratch1, Register Rscratch2);
-  void record_klass_in_profile(Register receiver, Register scratch1, Register scratch2, bool is_virtual_call);
-  void record_klass_in_profile_helper(Register receiver, Register scratch1, Register scratch2, int start_row, Label& done, bool is_virtual_call);
-
-  // Argument and return type profiling.
-  void profile_obj_type(Register obj, Register mdo_addr_base, RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2);
-  void profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual);
-  void profile_return_type(Register ret, Register tmp1, Register tmp2);
-  void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
-
-  // Debugging
-  void verify_oop(Register reg, TosState state = atos);    // only if +VerifyOops && state == atos
-  void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
-  void verify_FPU(int stack_depth, TosState state = ftos);
-
-  typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
-
-  // Support for jvmdi/jvmpi.
-  void notify_method_entry();
-  void notify_method_exit(bool is_native_method, TosState state,
-                          NotifyMethodExitMode mode, bool check_exceptions);
-};
-
-#endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
--- a/hotspot/src/cpu/ppc/vm/ppc_64.ad	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-//
-// Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-// Copyright (c) 2012, 2013 SAP SE. 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.
-//
-//
--- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -40,7 +40,7 @@
 #include "c1/c1_Runtime1.hpp"
 #endif
 #ifdef COMPILER2
-#include "adfiles/ad_ppc_64.hpp"
+#include "opto/ad.hpp"
 #include "opto/runtime.hpp"
 #endif
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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.
+ *
+ */
+
+#ifndef CPU_PPC_VM_STUBROUTINES_PPC_HPP
+#define CPU_PPC_VM_STUBROUTINES_PPC_HPP
+
+// This file holds the platform specific parts of the StubRoutines
+// definition. See stubRoutines.hpp for a description on how to
+// extend it.
+
+static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
+
+enum platform_dependent_constants {
+  code_size1 = 20000,          // simply increase if too small (assembler will crash if too small)
+  code_size2 = 20000           // simply increase if too small (assembler will crash if too small)
+};
+
+// CRC32 Intrinsics.
+#define CRC32_COLUMN_SIZE 256
+#define CRC32_BYFOUR
+#ifdef  CRC32_BYFOUR
+  #define CRC32_TABLES 8
+#else
+  #define CRC32_TABLES 1
+#endif
+
+class ppc64 {
+ friend class StubGenerator;
+
+ private:
+
+  // CRC32 Intrinsics.
+  static juint _crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
+
+ public:
+
+  // CRC32 Intrinsics.
+  static void generate_load_crc_table_addr(MacroAssembler* masm, Register table);
+
+};
+
+#endif // CPU_PPC_VM_STUBROUTINES_PPC_HPP
--- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. 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.
- *
- */
-
-#ifndef CPU_PPC_VM_STUBROUTINES_PPC_64_HPP
-#define CPU_PPC_VM_STUBROUTINES_PPC_64_HPP
-
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
-
-static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
-
-enum platform_dependent_constants {
-  code_size1 = 20000,          // simply increase if too small (assembler will crash if too small)
-  code_size2 = 20000           // simply increase if too small (assembler will crash if too small)
-};
-
-// CRC32 Intrinsics.
-#define CRC32_COLUMN_SIZE 256
-#define CRC32_BYFOUR
-#ifdef  CRC32_BYFOUR
-  #define CRC32_TABLES 8
-#else
-  #define CRC32_TABLES 1
-#endif
-
-class ppc64 {
- friend class StubGenerator;
-
- private:
-
-  // CRC32 Intrinsics.
-  static juint _crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
-
- public:
-
-  // CRC32 Intrinsics.
-  static void generate_load_crc_table_addr(MacroAssembler* masm, Register table);
-
-};
-
-#endif // CPU_PPC_VM_STUBROUTINES_PPC_64_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016 SAP SE. 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.
+ *
+ */
+
+#ifndef CPU_PPC_VM_TEMPLATETABLE_PPC_HPP
+#define CPU_PPC_VM_TEMPLATETABLE_PPC_HPP
+
+  static void prepare_invoke(int byte_no, Register Rmethod, Register Rret_addr, Register Rindex, Register Rrecv, Register Rflags, Register Rscratch);
+  static void invokevfinal_helper(Register Rmethod, Register Rflags, Register Rscratch1, Register Rscratch2);
+  static void generate_vtable_call(Register Rrecv_klass, Register Rindex, Register Rret, Register Rtemp);
+  static void invokeinterface_object_method(Register Rrecv_klass, Register Rret, Register Rflags, Register Rindex, Register Rtemp, Register Rtemp2);
+
+  // Branch_conditional which takes TemplateTable::Condition.
+  static void branch_conditional(ConditionRegister crx, TemplateTable::Condition cc, Label& L, bool invert = false);
+  static void if_cmp_common(Register Rfirst, Register Rsecond, Register Rscratch1, Register Rscratch2, Condition cc, bool is_jint, bool cmp0);
+
+#endif // CPU_PPC_VM_TEMPLATETABLE_PPC_HPP
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, 2014 SAP SE. 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.
- *
- */
-
-#ifndef CPU_PPC_VM_TEMPLATETABLE_PPC_64_HPP
-#define CPU_PPC_VM_TEMPLATETABLE_PPC_64_HPP
-
-  static void prepare_invoke(int byte_no, Register Rmethod, Register Rret_addr, Register Rindex, Register Rrecv, Register Rflags, Register Rscratch);
-  static void invokevfinal_helper(Register Rmethod, Register Rflags, Register Rscratch1, Register Rscratch2);
-  static void generate_vtable_call(Register Rrecv_klass, Register Rindex, Register Rret, Register Rtemp);
-  static void invokeinterface_object_method(Register Rrecv_klass, Register Rret, Register Rflags, Register Rindex, Register Rtemp, Register Rtemp2);
-
-  // Branch_conditional which takes TemplateTable::Condition.
-  static void branch_conditional(ConditionRegister crx, TemplateTable::Condition cc, Label& L, bool invert = false);
-  static void if_cmp_common(Register Rfirst, Register Rsecond, Register Rscratch1, Register Rscratch2, Condition cc, bool is_jint, bool cmp0);
-
-#endif // CPU_PPC_VM_TEMPLATETABLE_PPC_64_HPP
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -278,7 +278,7 @@
       os_too_old = false;
     }
 #endif
-#ifdef linux
+#ifdef LINUX
     // At least Linux kernel 4.2, as the problematic behavior of syscalls
     // being called in the middle of a transaction has been addressed.
     // Please, refer to commit b4b56f9ecab40f3b4ef53e130c9f6663be491894
--- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -26,7 +26,7 @@
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
 #include "code/vtableStubs.hpp"
-#include "interp_masm_ppc_64.hpp"
+#include "interp_masm_ppc.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klassVtable.hpp"
--- a/hotspot/src/cpu/x86/vm/bytes_x86.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/bytes_x86.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -26,6 +26,7 @@
 #define CPU_X86_VM_BYTES_X86_HPP
 
 #include "memory/allocation.hpp"
+#include "utilities/macros.hpp"
 
 class Bytes: AllStatic {
  private:
@@ -70,20 +71,7 @@
   static inline u8   swap_u8(u8 x);
 };
 
-
 // The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base]
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "bytes_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "bytes_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "bytes_windows_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "bytes_bsd_x86.inline.hpp"
-#endif
-
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // CPU_X86_VM_BYTES_X86_HPP
--- a/hotspot/src/cpu/x86/vm/copy_x86.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/copy_x86.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -28,19 +28,7 @@
 // Inline functions for memory copy and fill.
 
 // Contains inline asm implementations
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "copy_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "copy_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "copy_windows_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "copy_bsd_x86.inline.hpp"
-#endif
-
+#include OS_CPU_HEADER_INLINE(copy)
 
 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
 #ifdef AMD64
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, 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.
+ *
+ */
+
+#ifndef CPU_X86_VM_MACROASSEMBLER_X86_INLINE_HPP
+#define CPU_X86_VM_MACROASSEMBLER_X86_INLINE_HPP
+
+// Still empty.
+
+#endif // CPU_X86_VM_MACROASSEMBLER_X86_INLINE_HPP
--- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,9 +26,7 @@
 #include "asm/assembler.hpp"
 #include "asm/register.hpp"
 #include "register_x86.hpp"
-#ifdef TARGET_ARCH_x86
-# include "interp_masm_x86.hpp"
-#endif
+#include "interp_masm_x86.hpp"
 
 REGISTER_DEFINITION(Register, noreg);
 REGISTER_DEFINITION(Register, rax);
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
@@ -29,6 +29,83 @@
 // definition. See stubRoutines.hpp for a description on how to
 // extend it.
 
+static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
+
+enum platform_dependent_constants {
+  code_size1 = 20000 LP64_ONLY(+10000),         // simply increase if too small (assembler will crash if too small)
+  code_size2 = 33800 LP64_ONLY(+1200)           // simply increase if too small (assembler will crash if too small)
+};
+
+class x86 {
+ friend class StubGenerator;
+ friend class VMStructs;
+
+#ifdef _LP64
+ private:
+  static address _get_previous_fp_entry;
+  static address _get_previous_sp_entry;
+
+  static address _f2i_fixup;
+  static address _f2l_fixup;
+  static address _d2i_fixup;
+  static address _d2l_fixup;
+
+  static address _float_sign_mask;
+  static address _float_sign_flip;
+  static address _double_sign_mask;
+  static address _double_sign_flip;
+
+ public:
+
+  static address get_previous_fp_entry() {
+    return _get_previous_fp_entry;
+  }
+
+  static address get_previous_sp_entry() {
+    return _get_previous_sp_entry;
+  }
+
+  static address f2i_fixup() {
+    return _f2i_fixup;
+  }
+
+  static address f2l_fixup() {
+    return _f2l_fixup;
+  }
+
+  static address d2i_fixup() {
+    return _d2i_fixup;
+  }
+
+  static address d2l_fixup() {
+    return _d2l_fixup;
+  }
+
+  static address float_sign_mask() {
+    return _float_sign_mask;
+  }
+
+  static address float_sign_flip() {
+    return _float_sign_flip;
+  }
+
+  static address double_sign_mask() {
+    return _double_sign_mask;
+  }
+
+  static address double_sign_flip() {
+    return _double_sign_flip;
+  }
+#else // !LP64
+
+ private:
+  static address _verify_fpu_cntrl_wrd_entry;
+
+ public:
+  static address verify_fpu_cntrl_wrd_entry() { return _verify_fpu_cntrl_wrd_entry; }
+
+#endif // !LP64
+
  private:
   static address _verify_mxcsr_entry;
   // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers
@@ -138,4 +215,6 @@
   static address _Pi4x4_addr()      { return _Pi4x4_adr; }
   static address _ones_addr()      { return _ones_adr; }
 
-#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP
+};
+
+#endif // CPU_X86_VM_STUBROUTINES_X86_HPP
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, 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.
- *
- */
-
-#ifndef CPU_X86_VM_STUBROUTINES_X86_32_HPP
-#define CPU_X86_VM_STUBROUTINES_X86_32_HPP
-
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
-
-enum platform_dependent_constants {
-  code_size1 =  20000,           // simply increase if too small (assembler will crash if too small)
-  code_size2 = 33800            // simply increase if too small (assembler will crash if too small)
-};
-
-class x86 {
- friend class StubGenerator;
- friend class VMStructs;
-
- private:
-  static address _verify_fpu_cntrl_wrd_entry;
-
- public:
-  static address verify_fpu_cntrl_wrd_entry()                { return _verify_fpu_cntrl_wrd_entry; }
-
-# include "stubRoutines_x86.hpp"
-
-};
-
-  static bool    returns_to_call_stub(address return_pc)     { return return_pc == _call_stub_return_address; }
-
-#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, 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.
- *
- */
-
-#ifndef CPU_X86_VM_STUBROUTINES_X86_64_HPP
-#define CPU_X86_VM_STUBROUTINES_X86_64_HPP
-
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
-
-static bool    returns_to_call_stub(address return_pc)   { return return_pc == _call_stub_return_address; }
-
-enum platform_dependent_constants {
-  code_size1 = 30000,          // simply increase if too small (assembler will crash if too small)
-  code_size2 = 35000           // simply increase if too small (assembler will crash if too small)
-};
-
-class x86 {
- friend class StubGenerator;
-
- private:
-  static address _get_previous_fp_entry;
-  static address _get_previous_sp_entry;
-
-  static address _f2i_fixup;
-  static address _f2l_fixup;
-  static address _d2i_fixup;
-  static address _d2l_fixup;
-
-  static address _float_sign_mask;
-  static address _float_sign_flip;
-  static address _double_sign_mask;
-  static address _double_sign_flip;
-
- public:
-
-  static address get_previous_fp_entry()
-  {
-    return _get_previous_fp_entry;
-  }
-
-  static address get_previous_sp_entry()
-  {
-    return _get_previous_sp_entry;
-  }
-
-  static address f2i_fixup()
-  {
-    return _f2i_fixup;
-  }
-
-  static address f2l_fixup()
-  {
-    return _f2l_fixup;
-  }
-
-  static address d2i_fixup()
-  {
-    return _d2i_fixup;
-  }
-
-  static address d2l_fixup()
-  {
-    return _d2l_fixup;
-  }
-
-  static address float_sign_mask()
-  {
-    return _float_sign_mask;
-  }
-
-  static address float_sign_flip()
-  {
-    return _float_sign_flip;
-  }
-
-  static address double_sign_mask()
-  {
-    return _double_sign_mask;
-  }
-
-  static address double_sign_flip()
-  {
-    return _double_sign_flip;
-  }
-
-# include "stubRoutines_x86.hpp"
-
-};
-
-#endif // CPU_X86_VM_STUBROUTINES_X86_64_HPP
--- a/hotspot/src/cpu/zero/vm/bytes_zero.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/cpu/zero/vm/bytes_zero.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -165,12 +165,8 @@
 #ifdef VM_LITTLE_ENDIAN
 // The following header contains the implementations of swap_u2,
 // swap_u4, and swap_u8
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "bytes_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "bytes_bsd_zero.inline.hpp"
-#endif
+
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // VM_LITTLE_ENDIAN
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/cpu/zero/vm/macroAssembler_zero.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, 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.
+ *
+ */
+
+#ifndef CPU_ZERO_VM_MACROASSEMBLER_ZERO_HPP
+#define CPU_ZERO_VM_MACROASSEMBLER_ZERO_HPP
+
+// Needed for includes in shared files.
+
+#endif // CPU_ZERO_VM_MACROASSEMBLER_ZERO_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/cpu/zero/vm/macroAssembler_zero.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, 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.
+ *
+ */
+
+#ifndef CPU_ZERO_VM_MACROASSEMBLER_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_MACROASSEMBLER_ZERO_INLINE_HPP
+
+// Needed for includes in shared files.
+
+#endif // CPU_ZERO_VM_MACROASSEMBLER_ZERO_INLINE_HPP
--- a/hotspot/src/os/aix/vm/mutex_aix.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 SAP SE. 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.
- *
- */
-
-#ifndef OS_AIX_VM_MUTEX_AIX_INLINE_HPP
-#define OS_AIX_VM_MUTEX_AIX_INLINE_HPP
-
-#include "os_aix.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-#endif // OS_AIX_VM_MUTEX_AIX_INLINE_HPP
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -44,7 +44,6 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
 #include "misc_aix.hpp"
-#include "mutex_aix.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_aix.inline.hpp"
 #include "os_share_aix.hpp"
--- a/hotspot/src/os/bsd/vm/mutex_bsd.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_bsd.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// put OS-includes here
-# include <signal.h>
--- a/hotspot/src/os/bsd/vm/mutex_bsd.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 1999, 2010, 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.
- *
- */
-
-#ifndef OS_BSD_VM_MUTEX_BSD_INLINE_HPP
-#define OS_BSD_VM_MUTEX_BSD_INLINE_HPP
-
-#include "os_bsd.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-
-// Reconciliation History
-// mutex_solaris.inline.hpp     1.5 99/06/22 16:38:49
-// End
-
-#endif // OS_BSD_VM_MUTEX_BSD_INLINE_HPP
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -35,7 +35,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_bsd.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_bsd.inline.hpp"
 #include "os_share_bsd.hpp"
--- a/hotspot/src/os/linux/vm/mutex_linux.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_linux.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// put OS-includes here
-# include <signal.h>
--- a/hotspot/src/os/linux/vm/mutex_linux.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 1999, 2010, 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.
- *
- */
-
-#ifndef OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
-#define OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
-
-#include "os_linux.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-
-// Reconciliation History
-// mutex_solaris.inline.hpp     1.5 99/06/22 16:38:49
-// End
-
-#endif // OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -35,7 +35,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_linux.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_linux.inline.hpp"
 #include "os_share_linux.hpp"
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -28,6 +28,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/os.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
 
 #include <signal.h>
@@ -214,7 +215,7 @@
   else st->print("%luk", rlim.rlim_cur >> 10);
 
   // Isn't there on solaris
-#if !defined(TARGET_OS_FAMILY_solaris) && !defined(TARGET_OS_FAMILY_aix)
+#if !defined(SOLARIS) && !defined(AIX)
   st->print(", NPROC ");
   getrlimit(RLIMIT_NPROC, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
@@ -1062,28 +1063,28 @@
 }
 
 address os::Posix::ucontext_get_pc(const ucontext_t* ctx) {
-#ifdef TARGET_OS_FAMILY_linux
+#if defined(AIX)
+   return Aix::ucontext_get_pc(ctx);
+#elif defined(BSD)
+   return Bsd::ucontext_get_pc(ctx);
+#elif defined(LINUX)
    return Linux::ucontext_get_pc(ctx);
-#elif defined(TARGET_OS_FAMILY_solaris)
+#elif defined(SOLARIS)
    return Solaris::ucontext_get_pc(ctx);
-#elif defined(TARGET_OS_FAMILY_aix)
-   return Aix::ucontext_get_pc(ctx);
-#elif defined(TARGET_OS_FAMILY_bsd)
-   return Bsd::ucontext_get_pc(ctx);
 #else
    VMError::report_and_die("unimplemented ucontext_get_pc");
 #endif
 }
 
 void os::Posix::ucontext_set_pc(ucontext_t* ctx, address pc) {
-#ifdef TARGET_OS_FAMILY_linux
+#if defined(AIX)
+   Aix::ucontext_set_pc(ctx, pc);
+#elif defined(BSD)
+   Bsd::ucontext_set_pc(ctx, pc);
+#elif defined(LINUX)
    Linux::ucontext_set_pc(ctx, pc);
-#elif defined(TARGET_OS_FAMILY_solaris)
+#elif defined(SOLARIS)
    Solaris::ucontext_set_pc(ctx, pc);
-#elif defined(TARGET_OS_FAMILY_aix)
-   Aix::ucontext_set_pc(ctx, pc);
-#elif defined(TARGET_OS_FAMILY_bsd)
-   Bsd::ucontext_set_pc(ctx, pc);
 #else
    VMError::report_and_die("unimplemented ucontext_get_pc");
 #endif
--- a/hotspot/src/os/posix/vm/vmError_posix.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/posix/vm/vmError_posix.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -33,17 +33,17 @@
 #include <sys/wait.h>
 #include <signal.h>
 
-#ifdef TARGET_OS_FAMILY_linux
+#ifdef LINUX
 #include <sys/syscall.h>
 #include <unistd.h>
 #endif
-#ifdef TARGET_OS_FAMILY_solaris
+#ifdef SOLARIS
 #include <thread.h>
 #endif
-#ifdef TARGET_OS_FAMILY_aix
+#ifdef AIX
 #include <unistd.h>
 #endif
-#ifdef TARGET_OS_FAMILY_bsd
+#ifdef BSD
 #include <sys/syscall.h>
 #include <unistd.h>
 #endif
--- a/hotspot/src/os/solaris/vm/mutex_solaris.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2007, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_solaris.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// Solaris-specific include, therefore not in includeDB_*
-# include "os_share_solaris.hpp"
-
-// put OS-includes here
-# include <signal.h>
--- a/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, 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.
- *
- */
-
-#ifndef OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
-#define OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
-
-#include "os_solaris.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-#endif // OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -35,7 +35,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_solaris.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_solaris.hpp"
 #include "os_solaris.inline.hpp"
--- a/hotspot/src/os/windows/vm/mutex_windows.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_windows.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// put OS-includes here
-# include <windows.h>
--- a/hotspot/src/os/windows/vm/mutex_windows.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, 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.
- *
- */
-
-#ifndef OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
-#define OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
-
-#include "os_windows.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-#endif // OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -38,7 +38,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_windows.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_windows.hpp"
 #include "os_windows.inline.hpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/os_cpu/aix_ppc/vm/bytes_aix_ppc.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016, 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.
+ *
+ */
+
+#ifndef OS_CPU_AIX_PPC_VM_BYTES_AIX_PPC_INLINE_HPP
+#define OS_CPU_AIX_PPC_VM_BYTES_AIX_PPC_INLINE_HPP
+
+#if defined(VM_LITTLE_ENDIAN)
+// Aix is not little endian.
+#endif // VM_LITTLE_ENDIAN
+
+#endif // OS_CPU_AIX_PPC_VM_BYTES_AIX_PPC_INLINE_HPP
--- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -34,7 +34,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_aix.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_aix.inline.hpp"
 #include "nativeInst_ppc.hpp"
 #include "os_share_aix.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_bsd.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_bsd.inline.hpp"
 #include "os_share_bsd.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -38,7 +38,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_bsd.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_bsd.inline.hpp"
 #include "nativeInst_zero.hpp"
 #include "os_share_bsd.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -35,7 +35,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
--- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -34,7 +34,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "nativeInst_ppc.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "nativeInst_sparc.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "nativeInst_zero.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -34,7 +34,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_solaris.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_solaris.inline.hpp"
 #include "nativeInst_sparc.hpp"
 #include "os_share_solaris.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_solaris.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_solaris.inline.hpp"
 #include "os_share_solaris.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -34,7 +34,6 @@
 #include "jvm_windows.h"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
-#include "mutex_windows.inline.hpp"
 #include "nativeInst_x86.hpp"
 #include "os_share_windows.hpp"
 #include "prims/jniFastGetField.hpp"
--- a/hotspot/src/share/vm/asm/assembler.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/asm/assembler.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -33,6 +33,7 @@
 #include "runtime/vm_version.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/growableArray.hpp"
+#include "utilities/macros.hpp"
 
 // This file contains platform-independent assembler declarations.
 
@@ -417,24 +418,6 @@
 
 };
 
-#ifdef TARGET_ARCH_x86
-# include "assembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "assembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "assembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "assembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "assembler_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(assembler)
 
 #endif // SHARE_VM_ASM_ASSEMBLER_HPP
--- a/hotspot/src/share/vm/asm/assembler.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/asm/assembler.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -27,23 +27,6 @@
 
 #include "asm/assembler.hpp"
 
-#ifdef TARGET_ARCH_x86
-# include "assembler_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "assembler_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "assembler_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "assembler_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "assembler_aarch64.inline.hpp"
-#endif
+#include CPU_HEADER_INLINE(assembler)
 
 #endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP
--- a/hotspot/src/share/vm/asm/codeBuffer.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/asm/codeBuffer.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -28,6 +28,7 @@
 #include "code/oopRecorder.hpp"
 #include "code/relocInfo.hpp"
 #include "utilities/debug.hpp"
+#include "utilities/macros.hpp"
 
 class CodeStrings;
 class PhaseCFG;
@@ -633,24 +634,7 @@
 
 
   // The following header contains architecture-specific implementations
-#ifdef TARGET_ARCH_x86
-# include "codeBuffer_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "codeBuffer_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "codeBuffer_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "codeBuffer_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "codeBuffer_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "codeBuffer_aarch64.hpp"
-#endif
+#include CPU_HEADER(codeBuffer)
 
 };
 
--- a/hotspot/src/share/vm/asm/macroAssembler.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/asm/macroAssembler.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -26,24 +26,8 @@
 #define SHARE_VM_ASM_MACROASSEMBLER_HPP
 
 #include "asm/assembler.hpp"
+#include "utilities/macros.hpp"
 
-#ifdef TARGET_ARCH_x86
-# include "macroAssembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "macroAssembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "macroAssembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "macroAssembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "macroAssembler_aarch64.hpp"
-#endif
+#include CPU_HEADER(macroAssembler)
 
 #endif // SHARE_VM_ASM_MACROASSEMBLER_HPP
--- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -26,24 +26,6 @@
 #define SHARE_VM_ASM_MACROASSEMBLER_INLINE_HPP
 
 #include "asm/macroAssembler.hpp"
-
-#ifdef TARGET_ARCH_x86
-// no macroAssembler_x86.inline.hpp
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "macroAssembler_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "macroAssembler_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "macroAssembler_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "macroAssembler_aarch64.inline.hpp"
-#endif
+#include CPU_HEADER_INLINE(macroAssembler)
 
 #endif // SHARE_VM_ASM_MACROASSEMBLER_INLINE_HPP
--- a/hotspot/src/share/vm/asm/register.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/asm/register.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -27,6 +27,7 @@
 
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 // Use AbstractRegister as shortcut
 class AbstractRegisterImpl;
@@ -94,25 +95,7 @@
 #define REGISTER_DEFINITION(type, name) \
 const type name = ((type)name##_##type##EnumValue)
 
-#ifdef TARGET_ARCH_x86
-# include "register_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "register_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "register_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "register_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "register_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "register_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(register)
 
 // Debugging support
 
--- a/hotspot/src/share/vm/c1/c1_Defs.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_Defs.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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,8 +25,9 @@
 #ifndef SHARE_VM_C1_C1_DEFS_HPP
 #define SHARE_VM_C1_C1_DEFS_HPP
 
+#include "asm/register.hpp"
 #include "utilities/globalDefinitions.hpp"
-#include "asm/register.hpp"
+#include "utilities/macros.hpp"
 
 // set frame size and return address offset to these values in blobs
 // (if the compiled frame uses ebp as link pointer on IA; otherwise,
@@ -35,23 +36,7 @@
   no_frame_size            = -1
 };
 
-
-#ifdef TARGET_ARCH_x86
-# include "c1_Defs_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_Defs_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_Defs_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_Defs_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_Defs_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_Defs)
 
 // native word offsets from memory address
 enum {
--- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -27,26 +27,12 @@
 
 #include "c1/c1_FrameMap.hpp"
 #include "memory/allocation.hpp"
+#include "utilities/macros.hpp"
 
 // Provides location for forward declaration of this class, which is
 // only implemented on Intel
 class FpuStackSim;
 
-#ifdef TARGET_ARCH_x86
-# include "c1_FpuStackSim_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_FpuStackSim_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_FpuStackSim_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_FpuStackSim_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_FpuStackSim_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_FpuStackSim)
 
 #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP
--- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -33,6 +33,7 @@
 #include "runtime/frame.hpp"
 #include "runtime/synchronizer.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 class ciMethod;
 class CallingConvention;
@@ -80,22 +81,7 @@
     spill_slot_size_in_bytes = 4
   };
 
-#ifdef TARGET_ARCH_x86
-# include "c1_FrameMap_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_FrameMap_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_FrameMap_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_FrameMap_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_FrameMap_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_FrameMap)
 
   friend class LIR_OprDesc;
 
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -28,6 +28,7 @@
 #include "c1/c1_CodeStubs.hpp"
 #include "ci/ciMethodData.hpp"
 #include "oops/methodData.hpp"
+#include "utilities/macros.hpp"
 
 class Compilation;
 class ScopeValue;
@@ -257,21 +258,7 @@
 
   void atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp);
 
-#ifdef TARGET_ARCH_x86
-# include "c1_LIRAssembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_LIRAssembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_LIRAssembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_LIRAssembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_LIRAssembler_aarch64.hpp"
-#endif
+#include CPU_HEADER(c1_LIRAssembler)
 
 };
 
--- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -31,6 +31,7 @@
 #include "c1/c1_Instruction.hpp"
 #include "c1/c1_LIR.hpp"
 #include "c1/c1_LIRGenerator.hpp"
+#include "utilities/macros.hpp"
 
 class DebugInfoCache;
 class FpuStackAllocator;
@@ -959,23 +960,7 @@
 
 #endif // ifndef PRODUCT
 
-
 // Pick up platform-dependent implementation details
-#ifdef TARGET_ARCH_x86
-# include "c1_LinearScan_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_LinearScan_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_LinearScan_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_LinearScan_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_LinearScan_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_LinearScan)
 
 #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP
--- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -27,6 +27,7 @@
 
 #include "asm/macroAssembler.hpp"
 #include "asm/macroAssembler.inline.hpp"
+#include "utilities/macros.hpp"
 
 class CodeEmitInfo;
 
@@ -47,21 +48,7 @@
   void verify_stack_oop(int offset) PRODUCT_RETURN;
   void verify_not_null_oop(Register r)  PRODUCT_RETURN;
 
-#ifdef TARGET_ARCH_x86
-# include "c1_MacroAssembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_MacroAssembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_MacroAssembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_MacroAssembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_MacroAssembler_aarch64.hpp"
-#endif
+#include CPU_HEADER(c1_MacroAssembler)
 
 };
 
--- a/hotspot/src/share/vm/c1/c1_globals.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/c1/c1_globals.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,36 +26,10 @@
 #define SHARE_VM_C1_C1_GLOBALS_HPP
 
 #include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_x86
-# include "c1_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c1_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c1_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c1_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c1_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c1_globals_bsd.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(c1_globals)
+#include OS_HEADER(c1_globals)
 
 //
 // Defines all global flags used by the client compiler.
--- a/hotspot/src/share/vm/code/nativeInst.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/code/nativeInst.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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,23 +25,8 @@
 #ifndef SHARE_VM_CODE_NATIVEINST_HPP
 #define SHARE_VM_CODE_NATIVEINST_HPP
 
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "nativeInst_aarch64.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(nativeInst)
 
 #endif // SHARE_VM_CODE_NATIVEINST_HPP
--- a/hotspot/src/share/vm/code/nmethod.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -51,21 +51,6 @@
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
 #include "logging/log.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 #ifdef SHARK
 #include "shark/sharkCompiler.hpp"
 #endif
--- a/hotspot/src/share/vm/code/relocInfo.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/code/relocInfo.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/os.hpp"
+#include "utilities/macros.hpp"
 
 class nmethod;
 class CompiledMethod;
@@ -423,24 +424,7 @@
   static void remove_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type);
 
   // Machine dependent stuff
-#ifdef TARGET_ARCH_x86
-# include "relocInfo_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "relocInfo_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "relocInfo_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "relocInfo_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "relocInfo_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "relocInfo_aarch64.hpp"
-#endif
+#include CPU_HEADER(relocInfo)
 
  protected:
   // Derived constant, based on format_width which is PD:
--- a/hotspot/src/share/vm/code/vmreg.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/code/vmreg.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, 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
@@ -28,6 +28,7 @@
 #include "asm/register.hpp"
 #include "memory/allocation.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/ostream.hpp"
 #ifdef COMPILER2
 #include "opto/adlcVMDeps.hpp"
@@ -139,25 +140,7 @@
 
   static void set_regName();
 
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "vmreg_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(vmreg)
 
 };
 
--- a/hotspot/src/share/vm/code/vmreg.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/code/vmreg.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -27,23 +27,6 @@
 
 #include "asm/register.hpp"
 #include "code/vmreg.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "vmreg_aarch64.inline.hpp"
-#endif
+#include CPU_HEADER_INLINE(vmreg)
 
 #endif // SHARE_VM_CODE_VMREG_INLINE_HPP
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -35,24 +35,7 @@
 #include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
-#ifdef TARGET_ARCH_x86
-# include "depChecker_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "depChecker_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "depChecker_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "depChecker_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "depChecker_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "depChecker_aarch64.hpp"
-#endif
+#include CPU_HEADER(depChecker)
 #ifdef SHARK
 #include "shark/sharkEntry.hpp"
 #endif
--- a/hotspot/src/share/vm/compiler/disassembler.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/compiler/disassembler.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, 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
@@ -27,6 +27,7 @@
 
 #include "asm/codeBuffer.hpp"
 #include "runtime/globals.hpp"
+#include "utilities/macros.hpp"
 
 class decode_env;
 
@@ -63,25 +64,7 @@
   static bool load_library();
 
   // Machine dependent stuff
-#ifdef TARGET_ARCH_x86
-# include "disassembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "disassembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "disassembler_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "disassembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "disassembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "disassembler_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(disassembler)
 
  public:
   static bool can_decode() {
--- a/hotspot/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -26,22 +26,8 @@
 #include "gc/g1/g1PageBasedVirtualSpace.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/memTracker.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 #include "utilities/bitMap.inline.hpp"
 
 G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) :
--- a/hotspot/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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,9 +25,10 @@
 #ifndef SRC_SHARE_VM_GC_SHARED_MEMSETWITHCONCURRENTREADERS_HPP
 #define SRC_SHARE_VM_GC_SHARED_MEMSETWITHCONCURRENTREADERS_HPP
 
+#include "utilities/macros.hpp"
+
 #include <stddef.h>
 #include <string.h>
-#include "utilities/macros.hpp"
 
 // Only used by concurrent collectors.
 #if INCLUDE_ALL_GCS
@@ -36,7 +37,7 @@
 // understanding that there may be concurrent readers of that memory.
 void memset_with_concurrent_readers(void* to, int value, size_t size);
 
-#ifdef TARGET_ARCH_sparc
+#ifdef SPARC
 
 // SPARC requires special handling.  See SPARC-specific definition.
 
@@ -51,4 +52,4 @@
 
 #endif // INCLUDE_ALL_GCS
 
-#endif // include guard
+#endif // SRC_SHARE_VM_GC_SHARED_MEMSETWITHCONCURRENTREADERS_HPP
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -32,6 +32,7 @@
 #include "runtime/frame.hpp"
 #include "runtime/globals.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 #ifdef CC_INTERP
 
@@ -572,7 +573,7 @@
 void print();
 #endif // PRODUCT
 
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "bytecodeInterpreter_zero.hpp"
 #else
 #error "Only Zero Bytecode Interpreter is supported"
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -27,6 +27,7 @@
 
 #include "interpreter/bytecodeInterpreter.hpp"
 #include "runtime/stubRoutines.hpp"
+#include "utilities/macros.hpp"
 
 // This file holds platform-independent bodies of inline functions for the C++ based interpreter
 
@@ -42,7 +43,7 @@
 #define VERIFY_OOP(o)
 #endif
 
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "bytecodeInterpreter_zero.inline.hpp"
 #else
 #error "Only Zero Bytecode Interpreter is supported"
--- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -26,6 +26,8 @@
 #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
 
 #include "interpreter/abstractInterpreter.hpp"
+#include "utilities/macros.hpp"
+
 #ifdef CC_INTERP
 
 class InterpreterCodelet;
@@ -60,7 +62,7 @@
                          address   entry_point,
                          address   osr_buf,
                          TRAPS);
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "cppInterpreter_zero.hpp"
 #endif
 
--- a/hotspot/src/share/vm/interpreter/interp_masm.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/interp_masm.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -26,19 +26,8 @@
 #define SHARE_VM_INTERPRETER_INTERP_MASM_HPP
 
 #include "asm/macroAssembler.hpp"
+#include "utilities/macros.hpp"
 
-#if defined INTERP_MASM_MD_HPP
-# include INTERP_MASM_MD_HPP
-#elif defined TARGET_ARCH_x86
-# include "interp_masm_x86.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "interp_masm_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "interp_masm_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "interp_masm_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "interp_masm_aarch64.hpp"
-#endif
+#include CPU_HEADER(interp_masm)
 
 #endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -32,6 +32,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/thread.hpp"
+#include "utilities/macros.hpp"
 
 // The InterpreterRuntime is called by the interpreter for everything
 // that cannot/should not be dealt with in assembly and needs C support.
@@ -167,24 +168,7 @@
   static intptr_t trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2) PRODUCT_RETURN0;
 
   // Platform dependent stuff
-#ifdef TARGET_ARCH_x86
-# include "interpreterRT_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "interpreterRT_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "interpreterRT_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "interpreterRT_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "interpreterRT_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "interpreterRT_aarch64.hpp"
-#endif
+#include CPU_HEADER(interpreterRT)
 
   // optional normalization of fingerprints to reduce the number of adapters
   static uint64_t normalize_fast_native_fingerprint(uint64_t fingerprint);
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -476,7 +476,7 @@
   case Interpreter::java_lang_Double_doubleToRawLongBits:
     native = true;
     break;
-#endif // defined(TARGET_ARCH_x86) && !defined(_LP64)
+#endif // !IA32
   default:
     fatal("unexpected method kind: %d", kind);
     break;
--- a/hotspot/src/share/vm/interpreter/templateTable.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -28,6 +28,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/frame.hpp"
+#include "utilities/macros.hpp"
 
 #ifndef CC_INTERP
 // All the necessary definitions used for (bytecode) template generation. Instead of
@@ -349,17 +350,7 @@
   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 
   // Platform specifics
-#if defined TEMPLATETABLE_MD_HPP
-# include TEMPLATETABLE_MD_HPP
-#elif defined (TARGET_ARCH_MODEL_x86_32) || defined (TARGET_ARCH_MODEL_x86_64)
-# include "templateTable_x86.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "templateTable_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "templateTable_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "templateTable_aarch64.hpp"
-#endif
+#include CPU_HEADER(templateTable)
 
 };
 #endif /* !CC_INTERP */
--- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -22,38 +22,21 @@
  */
 
 #include "precompiled.hpp"
+#include "asm/register.hpp"
+#include "classfile/vmSymbols.hpp"
 #include "code/compiledIC.hpp"
+#include "code/vmreg.inline.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/disassembler.hpp"
-#include "oops/oop.inline.hpp"
-#include "oops/objArrayOop.inline.hpp"
-#include "runtime/javaCalls.hpp"
 #include "jvmci/jvmciEnv.hpp"
 #include "jvmci/jvmciCompiler.hpp"
 #include "jvmci/jvmciCodeInstaller.hpp"
 #include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciRuntime.hpp"
-#include "asm/register.hpp"
-#include "classfile/vmSymbols.hpp"
-#include "code/vmreg.hpp"
-
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-
+#include "oops/oop.inline.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "runtime/javaCalls.hpp"
 
 // frequently used constants
 // Allocate them with new so they are never destroyed (otherwise, a
--- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -44,6 +44,7 @@
 #include "runtime/sharedRuntime.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/defaultStream.hpp"
+#include "utilities/macros.hpp"
 
 #if defined(_MSC_VER)
 #define strtoll _strtoi64
@@ -770,14 +771,14 @@
   }
 
 #ifdef _LP64
-#ifndef TARGET_ARCH_sparc
+#ifndef SPARC
   uintptr_t heap_end = (uintptr_t) Universe::heap()->reserved_region().end();
   uintptr_t allocation_end = heap_end + ((uintptr_t)16) * 1024 * 1024 * 1024;
   guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)");
-#endif // TARGET_ARCH_sparc
+#endif // !SPARC
 #else
   fatal("check TLAB allocation code for address space conflicts");
-#endif
+#endif // _LP64
 
   JVMCIRuntime::initialize_well_known_classes(CHECK);
 
--- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -591,31 +591,31 @@
 #endif // INCLUDE_ALL_GCS
 
 
-#ifdef TARGET_OS_FAMILY_linux
+#ifdef LINUX
 
 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
   declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
 
-#endif // TARGET_OS_FAMILY_linux
+#endif
 
 
-#ifdef TARGET_OS_FAMILY_bsd
+#ifdef BSD
 
 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
   declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
 
-#endif // TARGET_OS_FAMILY_bsd
+#endif
 
-
+// AARCH64 is defined in closed port, too. TARGET_ARCH_aarch64 is not.
 #ifdef TARGET_ARCH_aarch64
 
 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
   volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*)
 
-#endif // TARGET_ARCH_aarch64
+#endif
 
 
-#ifdef TARGET_ARCH_x86
+#ifdef X86
 
 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
   volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*)
@@ -661,10 +661,10 @@
   declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) \
   declare_preprocessor_constant("VM_Version::CPU_SHA", CPU_SHA)
 
-#endif // TARGET_ARCH_x86
+#endif
 
 
-#ifdef TARGET_ARCH_sparc
+#ifdef SPARC
 
 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
   volatile_nonstatic_field(JavaFrameAnchor, _flags, int)
@@ -694,7 +694,7 @@
   declare_constant(VM_Version::sha256_instruction_m)                      \
   declare_constant(VM_Version::sha512_instruction_m)
 
-#endif // TARGET_ARCH_sparc
+#endif
 
 
 /*
--- a/hotspot/src/share/vm/opto/ad.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/opto/ad.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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,20 +25,9 @@
 #ifndef SHARE_VM_OPTO_AD_HPP
 #define SHARE_VM_OPTO_AD_HPP
 
-#if defined AD_MD_HPP
-# include AD_MD_HPP
-#elif defined TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#elif defined TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "adfiles/ad_aarch64.hpp"
-#endif
+
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(adfiles/ad)
 
 #endif // SHARE_VM_OPTO_AD_HPP
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,36 +26,10 @@
 #define SHARE_VM_OPTO_C2_GLOBALS_HPP
 
 #include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_x86
-# include "c2_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c2_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c2_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c2_globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c2_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c2_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c2_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c2_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c2_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c2_globals_bsd.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(c2_globals)
+#include OS_HEADER(c2_globals)
 
 //
 // Defines all globals flags used by the server compiler.
--- a/hotspot/src/share/vm/opto/library_call.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -3304,7 +3304,7 @@
   // drop through to next case
   set_control( _gvn.transform(new IfTrueNode(iff_bit)));
 
-#ifndef TARGET_OS_FAMILY_windows
+#ifndef _WINDOWS
   // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path.
   Node* clr_arg = argument(1);
   Node* cmp_arg = _gvn.transform(new CmpINode(clr_arg, intcon(0)));
@@ -3321,7 +3321,7 @@
 #else
   // To return true on Windows you must read the _interrupted field
   // and check the event state i.e. take the slow path.
-#endif // TARGET_OS_FAMILY_windows
+#endif // _WINDOWS
 
   // (d) Otherwise, go to the slow path.
   slow_region->add_req(control());
--- a/hotspot/src/share/vm/opto/optoreg.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/opto/optoreg.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, 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,23 +25,11 @@
 #ifndef SHARE_VM_OPTO_OPTOREG_HPP
 #define SHARE_VM_OPTO_OPTOREG_HPP
 
+#include "utilities/macros.hpp"
+
 // AdGlobals contains c2 specific register handling code as specified
 // in the .ad files.
-#if defined ADGLOBALS_MD_HPP
-# include ADGLOBALS_MD_HPP
-#elif defined TARGET_ARCH_MODEL_x86_32
-# include "adfiles/adGlobals_x86_32.hpp"
-#elif defined TARGET_ARCH_MODEL_x86_64
-# include "adfiles/adGlobals_x86_64.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "adfiles/adGlobals_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "adfiles/adGlobals_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/adGlobals_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "adfiles/adGlobals_aarch64.hpp"
-#endif
+#include CPU_HEADER(adfiles/adGlobals)
 
 //------------------------------OptoReg----------------------------------------
 // We eventually need Registers for the Real World.  Registers are essentially
--- a/hotspot/src/share/vm/prims/jni_md.h	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/prims/jni_md.h	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -23,26 +23,10 @@
  * questions.
  */
 
+#include "utilities/macros.hpp"
+
 /* Switch to the correct jni_md.h file without reliance on -I options. */
-#ifdef TARGET_ARCH_x86
-# include "jni_x86.h"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jni_sparc.h"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jni_zero.h"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jni_arm.h"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jni_ppc.h"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "jni_aarch64.h"
-#endif
-
+#include CPU_HEADER_H(jni)
 
 /*
   The local copies of JNI header files may be refreshed
--- a/hotspot/src/share/vm/prims/jvm.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -84,21 +84,6 @@
 #include "classfile/sharedClassUtil.hpp"
 #include "classfile/systemDictionaryShared.hpp"
 #endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "jvm_linux.h"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "jvm_solaris.h"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "jvm_windows.h"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "jvm_aix.h"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "jvm_bsd.h"
-#endif
 
 #include <errno.h>
 
--- a/hotspot/src/share/vm/prims/jvm.h	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/prims/jvm.h	Wed Jul 13 12:23:05 2016 +0200
@@ -26,21 +26,9 @@
 #define SHARE_VM_PRIMS_JVM_H
 
 #include "prims/jni.h"
-#ifdef TARGET_OS_FAMILY_linux
-# include "jvm_linux.h"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "jvm_solaris.h"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "jvm_windows.h"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "jvm_aix.h"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "jvm_bsd.h"
-#endif
+#include "utilities/macros.hpp"
+
+#include OS_HEADER_H(jvm)
 
 #ifndef _JAVASOFT_JVM_H_
 #define _JAVASOFT_JVM_H_
--- a/hotspot/src/share/vm/prims/methodHandles.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/prims/methodHandles.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -30,13 +30,13 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/interfaceSupport.hpp"
+#include "utilities/macros.hpp"
 
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "entry_zero.hpp"
 #endif
 
 
-
 class MacroAssembler;
 class Label;
 
@@ -192,25 +192,7 @@
             ref_kind == JVM_REF_invokeInterface);
   }
 
-
-#ifdef TARGET_ARCH_x86
-# include "methodHandles_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "methodHandles_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "methodHandles_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "methodHandles_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "methodHandles_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "methodHandles_aarch64.hpp"
-#endif
+#include CPU_HEADER(methodHandles)
 
   // Tracing
   static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
--- a/hotspot/src/share/vm/runtime/atomic.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/atomic.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -26,52 +26,9 @@
 #define SHARE_VM_RUNTIME_ATOMIC_INLINE_HPP
 
 #include "runtime/atomic.hpp"
-
-// Linux
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "atomic_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "atomic_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "atomic_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "atomic_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "atomic_linux_ppc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "atomic_linux_aarch64.inline.hpp"
-#endif
+#include "utilities/macros.hpp"
 
-// Solaris
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "atomic_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "atomic_solaris_sparc.inline.hpp"
-#endif
-
-// Windows
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "atomic_windows_x86.inline.hpp"
-#endif
-
-// AIX
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "atomic_aix_ppc.inline.hpp"
-#endif
-
-// BSD
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "atomic_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "atomic_bsd_zero.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(atomic)
 
 // size_t casts...
 #if (SIZE_MAX != UINTPTR_MAX)
--- a/hotspot/src/share/vm/runtime/frame.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -29,7 +29,8 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/monitorChunk.hpp"
 #include "runtime/registerMap.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "stack_zero.hpp"
 #endif
 
@@ -415,24 +416,7 @@
 
   int pd_oop_map_offset_adjustment() const;
 
-#ifdef TARGET_ARCH_x86
-# include "frame_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "frame_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "frame_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "frame_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "frame_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "frame_aarch64.hpp"
-#endif
+#include CPU_HEADER(frame)
 
 };
 
--- a/hotspot/src/share/vm/runtime/frame.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/frame.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -31,13 +31,16 @@
 #include "oops/method.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/signature.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "entryFrame_zero.hpp"
 # include "fakeStubFrame_zero.hpp"
 # include "interpreterFrame_zero.hpp"
 # include "sharkFrame_zero.hpp"
 #endif
 
+#include CPU_HEADER_INLINE(frame)
+
 inline bool frame::is_entry_frame() const {
   return StubRoutines::returns_to_call_stub(pc());
 }
@@ -50,26 +53,4 @@
   return is_entry_frame() && entry_frame_is_first();
 }
 
-// here are the platform-dependent bodies:
-
-#ifdef TARGET_ARCH_x86
-# include "frame_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "frame_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "frame_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "frame_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "frame_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "frame_aarch64.inline.hpp"
-#endif
-
-
 #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP
--- a/hotspot/src/share/vm/runtime/globals.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,6 +26,8 @@
 #define SHARE_VM_RUNTIME_GLOBALS_HPP
 
 #include "utilities/debug.hpp"
+#include "utilities/macros.hpp"
+
 #include <float.h> // for DBL_MAX
 
 // use this for flags that are true per default in the tiered build
@@ -38,141 +40,19 @@
 #define falseInTiered true
 #endif
 
-#ifdef TARGET_ARCH_x86
-# include "globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "globals_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "globals_bsd.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "globals_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "globals_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "globals_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "globals_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "globals_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "globals_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "globals_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "globals_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "globals_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "globals_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "globals_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "globals_bsd_zero.hpp"
-#endif
+#include CPU_HEADER(globals)
+#include OS_HEADER(globals)
+#include OS_CPU_HEADER(globals)
 #ifdef COMPILER1
-#ifdef TARGET_ARCH_x86
-# include "c1_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c1_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c1_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c1_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c1_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c1_globals_bsd.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_globals_ppc.hpp"
-#endif
+#include CPU_HEADER(c1_globals)
+#include OS_HEADER(c1_globals)
 #endif
 #ifdef COMPILER2
-#ifdef TARGET_ARCH_x86
-# include "c2_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c2_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c2_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c2_globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c2_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c2_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c2_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c2_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c2_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c2_globals_bsd.hpp"
-#endif
+#include CPU_HEADER(c2_globals)
+#include OS_HEADER(c2_globals)
 #endif
 #ifdef SHARK
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "shark_globals_zero.hpp"
 #endif
 #endif
--- a/hotspot/src/share/vm/runtime/icache.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/icache.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/stubCodeGenerator.hpp"
+#include "utilities/macros.hpp"
 
 // Interface for updating the instruction cache.  Whenever the VM modifies
 // code, part of the processor instruction cache potentially has to be flushed.
@@ -68,26 +69,7 @@
 // Must be included before the definition of ICacheStubGenerator
 // because ICacheStubGenerator uses ICache definitions.
 
-#ifdef TARGET_ARCH_x86
-# include "icache_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "icache_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "icache_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "icache_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "icache_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "icache_aarch64.hpp"
-#endif
-
-
+#include CPU_HEADER(icache)
 
 class ICacheStubGenerator : public StubCodeGenerator {
  public:
--- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -34,6 +34,7 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
 
 // Wrapper for all entry points to the virtual machine.
@@ -90,21 +91,8 @@
 
  public:
   // OS dependent stuff
-#ifdef TARGET_OS_FAMILY_linux
-# include "interfaceSupport_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "interfaceSupport_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "interfaceSupport_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "interfaceSupport_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "interfaceSupport_bsd.hpp"
-#endif
+
+#include OS_HEADER(interfaceSupport)
 
 };
 
--- a/hotspot/src/share/vm/runtime/javaCalls.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/javaCalls.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -31,24 +31,9 @@
 #include "runtime/javaFrameAnchor.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/vmThread.hpp"
-#ifdef TARGET_ARCH_x86
-# include "jniTypes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jniTypes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jniTypes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jniTypes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jniTypes_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "jniTypes_aarch64.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(jniTypes)
 
 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
--- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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,8 +25,9 @@
 #ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
 #define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
 
+#include "runtime/orderAccess.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "utilities/macros.hpp"
 
 //
 // An object for encapsulating the machine/os dependent part of a JavaThread frame state
@@ -77,25 +78,7 @@
   // and no one should look at the other fields.
   void zap(void)                                     { _last_Java_sp = NULL; }
 
-#ifdef TARGET_ARCH_x86
-# include "javaFrameAnchor_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "javaFrameAnchor_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "javaFrameAnchor_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "javaFrameAnchor_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "javaFrameAnchor_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "javaFrameAnchor_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(javaFrameAnchor)
 
 public:
   JavaFrameAnchor()                              { clear(); }
--- a/hotspot/src/share/vm/runtime/mutex.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/mutex.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -30,18 +30,7 @@
 #include "runtime/osThread.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/events.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "mutex_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "mutex_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "mutex_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "mutex_bsd.inline.hpp"
-#endif
+#include "utilities/macros.hpp"
 
 // o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
 //
--- a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014 SAP SE. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016 SAP SE. 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
@@ -28,52 +28,9 @@
 
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
-
-// Linux
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "orderAccess_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "orderAccess_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "orderAccess_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "orderAccess_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "orderAccess_linux_aarch64.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "orderAccess_linux_ppc.inline.hpp"
-#endif
+#include "utilities/macros.hpp"
 
-// Solaris
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "orderAccess_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "orderAccess_solaris_sparc.inline.hpp"
-#endif
-
-// Windows
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "orderAccess_windows_x86.inline.hpp"
-#endif
-
-// AIX
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "orderAccess_aix_ppc.inline.hpp"
-#endif
-
-// BSD
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "orderAccess_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "orderAccess_bsd_zero.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(orderAccess)
 
 #ifdef VM_HAS_GENERALIZED_ORDER_ACCESS
 
--- a/hotspot/src/share/vm/runtime/os.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1742,7 +1742,7 @@
   pd_realign_memory(addr, bytes, alignment_hint);
 }
 
-#ifndef TARGET_OS_FAMILY_windows
+#ifndef _WINDOWS
 /* try to switch state from state "from" to state "to"
  * returns the state set after the method is complete
  */
--- a/hotspot/src/share/vm/runtime/os.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/os.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,29 +26,15 @@
 #define SHARE_VM_RUNTIME_OS_HPP
 
 #include "jvmtifiles/jvmti.h"
+#include "prims/jvm.h"
 #include "runtime/extendedPC.hpp"
 #include "runtime/handles.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "jvm_linux.h"
-# include <setjmp.h>
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "jvm_solaris.h"
+#include "utilities/macros.hpp"
+#ifndef _WINDOWS
 # include <setjmp.h>
 #endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "jvm_windows.h"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "jvm_aix.h"
-# include <setjmp.h>
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "jvm_bsd.h"
-# include <setjmp.h>
-# ifdef __APPLE__
-#  include <mach/mach_time.h>
-# endif
+#ifdef __APPLE__
+# include <mach/mach_time.h>
 #endif
 
 class AgentLibrary;
@@ -816,61 +802,11 @@
   };
 
   // Platform dependent stuff
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.hpp"
-# include "os_posix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.hpp"
-# include "os_posix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.hpp"
+#ifndef _WINDOWS
 # include "os_posix.hpp"
 #endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_posix.hpp"
-# include "os_bsd.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "os_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "os_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "os_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "os_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "os_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "os_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "os_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "os_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "os_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "os_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "os_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "os_bsd_zero.hpp"
-#endif
+#include OS_CPU_HEADER(os)
+#include OS_HEADER(os)
 
 #ifndef OS_NATIVE_THREAD_CREATION_FAILED_MSG
 #define OS_NATIVE_THREAD_CREATION_FAILED_MSG "unable to create native thread: possibly out of memory or process/resource limits reached"
@@ -937,7 +873,7 @@
     bool _done;
   };
 
-#ifndef TARGET_OS_FAMILY_windows
+#ifndef _WINDOWS
   // Suspend/resume support
   // Protocol:
   //
@@ -1008,7 +944,7 @@
       return _state == SR_SUSPENDED;
     }
   };
-#endif
+#endif // !WINDOWS
 
 
  protected:
--- a/hotspot/src/share/vm/runtime/os.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/os.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -27,20 +27,6 @@
 
 #include "runtime/os.hpp"
 
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
+#include OS_HEADER_INLINE(os)
 
 #endif // SHARE_VM_RUNTIME_OS_INLINE_HPP
--- a/hotspot/src/share/vm/runtime/osThread.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/osThread.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -29,6 +29,7 @@
 #include "runtime/handles.hpp"
 #include "runtime/javaFrameAnchor.hpp"
 #include "runtime/objectMonitor.hpp"
+#include "utilities/macros.hpp"
 
 // The OSThread class holds OS-specific thread information.  It is equivalent
 // to the sys_thread_t structure of the classic JVM implementation.
@@ -96,21 +97,7 @@
   static ByteSize interrupted_offset()            { return byte_offset_of(OSThread, _interrupted); }
 
   // Platform dependent stuff
-#ifdef TARGET_OS_FAMILY_linux
-# include "osThread_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "osThread_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "osThread_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "osThread_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "osThread_bsd.hpp"
-#endif
+#include OS_HEADER(osThread)
 
  public:
   static ByteSize thread_id_offset()              { return byte_offset_of(OSThread, _thread_id); }
--- a/hotspot/src/share/vm/runtime/prefetch.inline.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/prefetch.inline.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -26,51 +26,7 @@
 #define SHARE_VM_RUNTIME_PREFETCH_INLINE_HPP
 
 #include "runtime/prefetch.hpp"
-
-// Linux
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "prefetch_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "prefetch_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "prefetch_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "prefetch_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "prefetch_linux_aarch64.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "prefetch_linux_ppc.inline.hpp"
-#endif
-
-// Solaris
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "prefetch_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "prefetch_solaris_sparc.inline.hpp"
-#endif
-
-// Windows
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "prefetch_windows_x86.inline.hpp"
-#endif
-
-// AIX
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "prefetch_aix_ppc.inline.hpp"
-#endif
-
-// BSD
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "prefetch_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "prefetch_bsd_zero.inline.hpp"
-#endif
+#include "utilities/macros.hpp"
+#include OS_CPU_HEADER_INLINE(prefetch)
 
 #endif // SHARE_VM_RUNTIME_PREFETCH_INLINE_HPP
--- a/hotspot/src/share/vm/runtime/registerMap.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/registerMap.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -27,6 +27,7 @@
 
 #include "code/vmreg.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 class JavaThread;
 
@@ -120,24 +121,7 @@
   void print() const;
 
   // the following contains the definition of pd_xxx methods
-#ifdef TARGET_ARCH_x86
-# include "registerMap_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "registerMap_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "registerMap_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "registerMap_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "registerMap_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "registerMap_aarch64.hpp"
-#endif
+#include CPU_HEADER(registerMap)
 
 };
 
--- a/hotspot/src/share/vm/runtime/semaphore.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/semaphore.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -27,11 +27,11 @@
 
 #include "memory/allocation.hpp"
 
-#if defined(TARGET_OS_FAMILY_linux) || defined(TARGET_OS_FAMILY_solaris) || defined(TARGET_OS_FAMILY_aix)
+#if defined(LINUX) || defined(SOLARIS) || defined(AIX)
 # include "semaphore_posix.hpp"
-#elif defined(TARGET_OS_FAMILY_bsd)
+#elif defined(BSD)
 # include "semaphore_bsd.hpp"
-#elif defined(TARGET_OS_FAMILY_windows)
+#elif defined(_WINDOWS)
 # include "semaphore_windows.hpp"
 #else
 # error "No semaphore implementation provided for this OS"
--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -30,6 +30,7 @@
 #include "runtime/frame.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubCodeGenerator.hpp"
+#include "utilities/macros.hpp"
 
 // StubRoutines provides entry points to assembly routines used by
 // compiled code and the run-time system. Platform-specific entry
@@ -83,21 +84,8 @@
 
   // Dependencies
   friend class StubGenerator;
-#if defined STUBROUTINES_MD_HPP
-# include STUBROUTINES_MD_HPP
-#elif defined TARGET_ARCH_MODEL_x86_32
-# include "stubRoutines_x86_32.hpp"
-#elif defined TARGET_ARCH_MODEL_x86_64
-# include "stubRoutines_x86_64.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "stubRoutines_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "stubRoutines_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "stubRoutines_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "stubRoutines_aarch64.hpp"
-#endif
+
+#include CPU_HEADER(stubRoutines)
 
   static jint    _verify_oop_count;
   static address _verify_oop_subroutine_entry;
--- a/hotspot/src/share/vm/runtime/thread.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -50,7 +50,7 @@
 #include "gc/g1/dirtyCardQueue.hpp"
 #include "gc/g1/satbMarkQueue.hpp"
 #endif // INCLUDE_ALL_GCS
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "stack_zero.hpp"
 #endif
 
@@ -1905,43 +1905,7 @@
 #endif // INCLUDE_ALL_GCS
 
   // Machine dependent stuff
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "thread_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "thread_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "thread_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "thread_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "thread_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "thread_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "thread_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "thread_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "thread_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "thread_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "thread_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "thread_bsd_zero.hpp"
-#endif
-
+#include OS_CPU_HEADER(thread)
 
  public:
   void set_blocked_on_compilation(bool value) {
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -107,77 +107,9 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/macros.hpp"
 
-#ifdef TARGET_OS_FAMILY_linux
-# include "vmStructs_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "vmStructs_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "vmStructs_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "vmStructs_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "vmStructs_bsd.hpp"
-#endif
-
-#ifdef TARGET_ARCH_x86
-# include "vmStructs_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmStructs_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmStructs_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmStructs_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmStructs_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "vmStructs_aarch64.hpp"
-#endif
-
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "vmStructs_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "vmStructs_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "vmStructs_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "vmStructs_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "vmStructs_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "vmStructs_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "vmStructs_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "vmStructs_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "vmStructs_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "vmStructs_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "vmStructs_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "vmStructs_bsd_zero.hpp"
-#endif
+#include CPU_HEADER(vmStructs)
+#include OS_HEADER(vmStructs)
+#include OS_CPU_HEADER(vmStructs)
 
 #if INCLUDE_ALL_GCS
 #include "gc/cms/compactibleFreeListSpace.hpp"
--- a/hotspot/src/share/vm/runtime/vm_version.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/runtime/vm_version.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "utilities/ostream.hpp"
+#include "utilities/macros.hpp"
 
 // VM_Version provides information about the VM.
 
@@ -160,20 +161,6 @@
   static bool supports_on_spin_wait() { return false; }
 };
 
-#ifdef TARGET_ARCH_x86
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vm_version_ppc.hpp"
-#endif
+#include CPU_HEADER(vm_version)
 
 #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
--- a/hotspot/src/share/vm/shark/sharkRuntime.cpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/shark/sharkRuntime.cpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -30,7 +30,8 @@
 #include "runtime/thread.hpp"
 #include "shark/llvmHeaders.hpp"
 #include "shark/sharkRuntime.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "stack_zero.inline.hpp"
 #endif
 
--- a/hotspot/src/share/vm/shark/shark_globals.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/shark/shark_globals.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -27,7 +27,8 @@
 #define SHARE_VM_SHARK_SHARK_GLOBALS_HPP
 
 #include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "shark_globals_zero.hpp"
 #endif
 
--- a/hotspot/src/share/vm/utilities/bytes.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/utilities/bytes.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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,23 +25,8 @@
 #ifndef SHARE_VM_UTILITIES_BYTES_HPP
 #define SHARE_VM_UTILITIES_BYTES_HPP
 
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "bytes_aarch64.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(bytes)
 
 #endif // SHARE_VM_UTILITIES_BYTES_HPP
--- a/hotspot/src/share/vm/utilities/copy.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/utilities/copy.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -26,6 +26,7 @@
 #define SHARE_VM_UTILITIES_COPY_HPP
 
 #include "runtime/stubRoutines.hpp"
+#include "utilities/macros.hpp"
 
 // Assembly code for platforms that need it.
 extern "C" {
@@ -332,24 +333,7 @@
   }
 
   // Platform dependent implementations of the above methods.
-#ifdef TARGET_ARCH_x86
-# include "copy_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "copy_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "copy_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "copy_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "copy_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "copy_aarch64.hpp"
-#endif
+#include CPU_HEADER(copy)
 
 };
 
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -73,7 +73,6 @@
 #define ATTRIBUTE_SCANF(fmt, vargs)
 #endif
 
-
 #include "utilities/macros.hpp"
 
 // This file holds all globally used constants & types, class (forward)
@@ -456,24 +455,7 @@
 // Allow targets to reduce the default size of the code cache.
 #define CODE_CACHE_DEFAULT_LIMIT CODE_CACHE_SIZE_LIMIT
 
-#ifdef TARGET_ARCH_x86
-# include "globalDefinitions_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "globalDefinitions_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "globalDefinitions_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "globalDefinitions_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "globalDefinitions_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "globalDefinitions_aarch64.hpp"
-#endif
+#include CPU_HEADER(globalDefinitions)
 
 #ifndef INCLUDE_RTM_OPT
 #define INCLUDE_RTM_OPT 0
--- a/hotspot/src/share/vm/utilities/macros.hpp	Mon Jul 25 18:52:59 2016 +0000
+++ b/hotspot/src/share/vm/utilities/macros.hpp	Wed Jul 13 12:23:05 2016 +0200
@@ -316,6 +316,7 @@
 #endif
 
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#define BSD
 #define BSD_ONLY(code) code
 #define NOT_BSD(code)
 #else
@@ -429,6 +430,10 @@
 #define NOT_E500V2(code) code
 #endif
 
+// Note: There are three ARM ports. They set the following in the makefiles:
+// 1. Closed 32-bit port:   -DARM -DARM32           -DTARGET_ARCH_arm
+// 2. Closed 64-bit port:   -DARM -DAARCH64 -D_LP64 -DTARGET_ARCH_arm
+// 3. Open   64-bit port:         -DAARCH64 -D_LP64 -DTARGET_ARCH_aaarch64
 #ifdef ARM
 #define ARM_ONLY(code) code
 #define NOT_ARM(code)
@@ -463,4 +468,30 @@
 
 #define define_pd_global(type, name, value) const type pd_##name = value;
 
+// Helper macros for constructing file names for includes.
+#define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU)
+#define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS)
+#define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU))
+
+// Include platform dependent files.
+//
+// This macro constructs from basename and INCLUDE_SUFFIX_OS /
+// INCLUDE_SUFFIX_CPU, which are set on the command line, the name of
+// platform dependent files to be included.
+// Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_sparc
+//   CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_sparc.inline.hpp
+//   OS_CPU_HEADER(vmStructs)          --> vmStructs_linux_sparc.hpp
+//
+// basename<cpu>.hpp / basename<cpu>.inline.hpp
+#define CPU_HEADER_H(basename)         XSTR(CPU_HEADER_STEM(basename).h)
+#define CPU_HEADER(basename)           XSTR(CPU_HEADER_STEM(basename).hpp)
+#define CPU_HEADER_INLINE(basename)    XSTR(CPU_HEADER_STEM(basename).inline.hpp)
+// basename<os>.hpp / basename<os>.inline.hpp
+#define OS_HEADER_H(basename)          XSTR(OS_HEADER_STEM(basename).h)
+#define OS_HEADER(basename)            XSTR(OS_HEADER_STEM(basename).hpp)
+#define OS_HEADER_INLINE(basename)     XSTR(OS_HEADER_STEM(basename).inline.hpp)
+// basename<os><cpu>.hpp / basename<os><cpu>.inline.hpp
+#define OS_CPU_HEADER(basename)        XSTR(OS_CPU_HEADER_STEM(basename).hpp)
+#define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp)
+
 #endif // SHARE_VM_UTILITIES_MACROS_HPP