Merge
authorcoleenp
Fri, 09 Mar 2018 12:03:20 -0500
changeset 49366 f95ef5511e1f
parent 49365 825f006619e5 (current diff)
parent 49364 601146c66cad (diff)
child 49367 6a532ba7d9e9
child 49368 2ed1c37df3a5
Merge
src/hotspot/share/memory/metachunk.hpp
src/hotspot/share/memory/metaspace.cpp
src/hotspot/share/memory/universe.inline.hpp
test/hotspot/gtest/runtime/test_threadstack_tracking.cpp
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
--- a/make/autoconf/spec.gmk.in	Tue Mar 06 19:24:13 2018 +0100
+++ b/make/autoconf/spec.gmk.in	Fri Mar 09 12:03:20 2018 -0500
@@ -513,6 +513,8 @@
 NM:=@NM@
 GNM:=@GNM@
 STRIP:=@STRIP@
+OBJDUMP:=@OBJDUMP@
+CXXFILT:=@CXXFILT@
 
 LIPO:=@LIPO@
 INSTALL_NAME_TOOL:=@INSTALL_NAME_TOOL@
--- a/make/autoconf/toolchain.m4	Tue Mar 06 19:24:13 2018 +0100
+++ b/make/autoconf/toolchain.m4	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -726,6 +726,14 @@
     # bails if argument is missing.
     BASIC_FIXUP_EXECUTABLE(OBJDUMP)
   fi
+
+  case $TOOLCHAIN_TYPE in
+    gcc|clang|solstudio)
+      BASIC_CHECK_TOOLS(CXXFILT, [c++filt])
+      BASIC_CHECK_NONEMPTY(CXXFILT)
+      BASIC_FIXUP_EXECUTABLE(CXXFILT)
+      ;;
+  esac
 ])
 
 # Setup the build tools (i.e, the compiler and linker used to build programs
--- a/make/conf/jib-profiles.js	Tue Mar 06 19:24:13 2018 +0100
+++ b/make/conf/jib-profiles.js	Fri Mar 09 12:03:20 2018 -0500
@@ -765,7 +765,7 @@
 var getJibProfilesDependencies = function (input, common) {
 
     var devkit_platform_revisions = {
-        linux_x64: "gcc4.9.2-OEL6.4+1.2",
+        linux_x64: "gcc4.9.2-OEL6.4+1.3",
         macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
         solaris_x64: "SS12u4-Solaris11u1+1.0",
         solaris_sparcv9: "SS12u4-Solaris11u1+1.1",
--- a/make/devkit/Tools.gmk	Tue Mar 06 19:24:13 2018 +0100
+++ b/make/devkit/Tools.gmk	Fri Mar 09 12:03:20 2018 -0500
@@ -562,8 +562,8 @@
 	ln -s $(TARGET)-$* $@
 
   missing-links := $(addprefix $(PREFIX)/bin/, \
-      addr2line ar as c++ c++filt elfedit g++ gcc gprof ld nm objcopy ranlib readelf \
-      size strings strip ld.bfd ld.gold dtrace)
+      addr2line ar as c++ c++filt dwp elfedit g++ gcc gcc-$(GCC_VER) gprof ld ld.bfd \
+      ld.gold nm objcopy objdump ranlib readelf size strings strip)
 endif
 
 ##########################################################################################
--- a/make/hotspot/lib/CompileJvm.gmk	Tue Mar 06 19:24:13 2018 +0100
+++ b/make/hotspot/lib/CompileJvm.gmk	Fri Mar 09 12:03:20 2018 -0500
@@ -270,3 +270,62 @@
 include lib/JvmMapfile.gmk
 
 TARGETS += $(BUILD_LIBJVM)
+
+################################################################################
+# Hotspot disallows the use of global operators 'new' and 'delete'. This build
+# time check helps enforce this requirement. If you trigger this check and the
+# reference is not obvious from the source, GNU objdump can be used to help find
+# the reference if compiled with GCC:
+#
+# objdump -lrdSC <path/to/file.o>
+#
+# -C demangle
+# -d disassemble
+# -r print relocation entries, interspersed with the disassembly
+# -S print source code, intermixed with disassembly
+# -l include filenames and line numbers
+#
+# Search the output for the operator(s) of interest, to see where they are
+# referenced.
+
+ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang solstudio), )
+
+  DEMANGLED_REGEXP := [^:]operator (new|delete)
+
+  # Running c++filt to find offending symbols in all files is too expensive,
+  # especially on Solaris, so use mangled names when looking for symbols.
+  # Save the demangling for when something is actually found.
+  ifeq ($(TOOLCHAIN_TYPE), solstudio)
+    MANGLED_SYMS := \
+        __1c2n6FL_pv_ \
+        __1c2N6FL_pv_ \
+        __1c2k6Fpv_v_ \
+        __1c2K6Fpv_v_ \
+        #
+    UNDEF_PATTERN := UNDEF
+  else
+    MANGLED_SYMS := \
+        _ZdaPv \
+        _ZdlPv \
+        _Znam \
+        _Znwm \
+        #
+    UNDEF_PATTERN := ' U '
+  endif
+
+  define SetupOperatorNewDeleteCheck
+    $1.op_check: $1
+	if [ -n "`$(NM) $$< | $(GREP) $(addprefix -e , $(MANGLED_SYMS)) \
+	    | $(GREP) $(UNDEF_PATTERN)`" ]; then \
+	  $(ECHO) "$$<: Error: Use of global operators new and delete is not allowed in Hotspot:"; \
+	  $(NM) $$< | $(CXXFILT) | $(EGREP) '$(DEMANGLED_REGEXP)' | $(GREP) $(UNDEF_PATTERN); \
+	  $(ECHO) "See: $(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \
+	  exit 1; \
+	fi
+	$(TOUCH) $$@
+
+    TARGETS += $1.op_check
+  endef
+
+  $(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o)))
+endif
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -37,7 +37,7 @@
 // secondary complication -- not all code employing C call convention
 // executes as x86 code though -- we generate some of it
 
-class Argument VALUE_OBJ_CLASS_SPEC {
+class Argument {
  public:
   enum {
     n_int_register_parameters_c   = 8,  // r0, r1, ... r7 (c_rarg0, c_rarg1, ...)
@@ -338,7 +338,7 @@
 static inline unsigned long uabs(int n) { return uabs((unsigned int)n); }
 
 // Addressing modes
-class Address VALUE_OBJ_CLASS_SPEC {
+class Address {
  public:
 
   enum mode { no_mode, base_plus_offset, pre, post, pcrel,
--- a/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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.
  *
@@ -27,7 +27,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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.
  *
@@ -49,7 +49,7 @@
 // The base class for different kinds of native instruction abstractions.
 // Provides the primitive operations to manipulate code relative to this.
 
-class NativeInstruction VALUE_OBJ_CLASS_SPEC {
+class NativeInstruction {
   friend class Relocation;
   friend bool is_NativeCallTrampolineStub_at(address);
  public:
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -29,7 +29,7 @@
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "oops/objArrayKlass.hpp"
--- a/src/hotspot/cpu/arm/assembler_arm.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/assembler_arm.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,7 +76,7 @@
 
 
 // ARM Addressing Modes 2 and 3 - Load and store
-class Address VALUE_OBJ_CLASS_SPEC {
+class Address {
  private:
   Register  _base;
   Register  _index;
@@ -334,7 +334,7 @@
 };
 
 #ifdef COMPILER2
-class VFP VALUE_OBJ_CLASS_SPEC {
+class VFP {
   // Helper classes to detect whether a floating point constant can be
   // encoded in a fconstd or fconsts instruction
   // The conversion from the imm8, 8 bit constant, to the floating
--- a/src/hotspot/cpu/arm/assembler_arm_32.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #define CPU_ARM_VM_ASSEMBLER_ARM_32_HPP
 
 // ARM Addressing Mode 1 - Data processing operands
-class AsmOperand VALUE_OBJ_CLASS_SPEC {
+class AsmOperand {
  private:
   int _encoding;
 
@@ -99,7 +99,7 @@
 
 
 // ARM Addressing Mode 4 - Load and store multiple
-class RegisterSet VALUE_OBJ_CLASS_SPEC {
+class RegisterSet {
  private:
   int _encoding;
 
@@ -155,7 +155,7 @@
 #endif
 
 // ARM Addressing Mode 5 - Load and store multiple VFP registers
-class FloatRegisterSet VALUE_OBJ_CLASS_SPEC {
+class FloatRegisterSet {
  private:
   int _encoding;
 
--- a/src/hotspot/cpu/arm/assembler_arm_64.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/assembler_arm_64.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
 };
 
 // Shifted register operand for data processing instructions.
-class AsmOperand VALUE_OBJ_CLASS_SPEC {
+class AsmOperand {
  private:
   Register _reg;
   AsmShift _shift;
--- a/src/hotspot/cpu/arm/interpreterRT_arm.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/interpreterRT_arm.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/arm/macroAssembler_arm.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 
 // Introduced AddressLiteral and its subclasses to ease portability from
 // x86 and avoid relocation issues
-class AddressLiteral VALUE_OBJ_CLASS_SPEC {
+class AddressLiteral {
   RelocationHolder _rspec;
   // Typically we use AddressLiterals we want to use their rval
   // However in some situations we want the lval (effect address) of the item.
@@ -1394,7 +1394,7 @@
 // The purpose of this class is to build several code fragments of the same size
 // in order to allow fast table branch.
 
-class FixedSizeCodeBlock VALUE_OBJ_CLASS_SPEC {
+class FixedSizeCodeBlock {
 public:
   FixedSizeCodeBlock(MacroAssembler* masm, int size_in_instrs, bool enabled);
   ~FixedSizeCodeBlock();
--- a/src/hotspot/cpu/arm/nativeInst_arm_32.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/nativeInst_arm_32.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 // back-end extensions or the actual instructions size.
 class NativeInstruction;
 
-class RawNativeInstruction VALUE_OBJ_CLASS_SPEC {
+class RawNativeInstruction {
  public:
 
   enum ARM_specific {
--- a/src/hotspot/cpu/arm/nativeInst_arm_64.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/nativeInst_arm_64.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
 // back-end extensions or the actual instructions size.
 class NativeInstruction;
 
-class RawNativeInstruction VALUE_OBJ_CLASS_SPEC {
+class RawNativeInstruction {
  public:
 
   enum ARM_specific {
--- a/src/hotspot/cpu/arm/templateTable_arm.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/arm/templateTable_arm.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -28,7 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/templateTable.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/cpCache.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
--- a/src/hotspot/cpu/ppc/assembler_ppc.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/ppc/assembler_ppc.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -31,7 +31,7 @@
 // Address is an abstraction used to represent a memory location
 // as used in assembler instructions.
 // PPC instructions grok either baseReg + indexReg or baseReg + disp.
-class Address VALUE_OBJ_CLASS_SPEC {
+class Address {
  private:
   Register _base;         // Base register.
   Register _index;        // Index register.
@@ -64,7 +64,7 @@
   bool     is_const() const { return _base == noreg && _index == noreg; }
 };
 
-class AddressLiteral VALUE_OBJ_CLASS_SPEC {
+class AddressLiteral {
  private:
   address          _address;
   RelocationHolder _rspec;
@@ -117,7 +117,7 @@
 // with the PPC Application Binary Interface, or ABI. This is
 // often referred to as the native or C calling convention.
 
-class Argument VALUE_OBJ_CLASS_SPEC {
+class Argument {
  private:
   int _number;  // The number of the argument.
  public:
@@ -153,7 +153,7 @@
 
 #if !defined(ABI_ELFv2)
 // A ppc64 function descriptor.
-struct FunctionDescriptor VALUE_OBJ_CLASS_SPEC {
+struct FunctionDescriptor {
  private:
   address _entry;
   address _toc;
--- a/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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.
  *
@@ -28,7 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -45,7 +45,7 @@
 
 // The base class for different kinds of native instruction abstractions.
 // It provides the primitive operations to manipulate code relative to this.
-class NativeInstruction VALUE_OBJ_CLASS_SPEC {
+class NativeInstruction {
   friend class Relocation;
 
  public:
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -30,7 +30,7 @@
 #include "interpreter/interp_masm.hpp"
 #include "interpreter/templateInterpreter.hpp"
 #include "interpreter/templateTable.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
--- a/src/hotspot/cpu/s390/assembler_s390.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/s390/assembler_s390.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -31,7 +31,7 @@
 // Immediate is an abstraction to represent the various immediate
 // operands which exist on z/Architecture. Neither this class nor
 // instances hereof have an own state. It consists of methods only.
-class Immediate VALUE_OBJ_CLASS_SPEC {
+class Immediate {
 
  public:
     static bool is_simm(int64_t x, unsigned int nbits) {
@@ -82,7 +82,7 @@
 // displacements which exist with addresses on z/ArchiTecture.
 // Neither this class nor instances hereof have an own state. It
 // consists of methods only.
-class Displacement VALUE_OBJ_CLASS_SPEC {
+class Displacement {
 
  public: // These tests are used outside the (Macro)Assembler world, e.g. in ad-file.
 
@@ -101,7 +101,7 @@
 // form they are used on z/Architecture for instructions which access
 // their operand with pc-relative addresses. Neither this class nor
 // instances hereof have an own state. It consists of methods only.
-class RelAddr VALUE_OBJ_CLASS_SPEC {
+class RelAddr {
 
  private: // No public use at all. Solely for (Macro)Assembler.
 
@@ -177,7 +177,7 @@
 //
 // Note: A register location is represented via a Register, not
 // via an address for efficiency & simplicity reasons.
-class Address VALUE_OBJ_CLASS_SPEC {
+class Address {
  private:
   Register _base;    // Base register.
   Register _index;   // Index register
@@ -275,7 +275,7 @@
   friend class Assembler;
 };
 
-class AddressLiteral VALUE_OBJ_CLASS_SPEC {
+class AddressLiteral {
  private:
   address          _address;
   RelocationHolder _rspec;
@@ -398,7 +398,7 @@
 // memory or in a register, in a manner consistent with the
 // z/Architecture Application Binary Interface, or ABI. This is often
 // referred to as the native or C calling convention.
-class Argument VALUE_OBJ_CLASS_SPEC {
+class Argument {
  private:
   int _number;
   bool _is_in;
--- a/src/hotspot/cpu/s390/interpreterRT_s390.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/s390/interpreterRT_s390.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,7 +28,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/icache.hpp"
--- a/src/hotspot/cpu/s390/nativeInst_s390.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/s390/nativeInst_s390.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -72,7 +72,7 @@
 //  N a t i v e I n s t r u c t i o n
 //-------------------------------------
 
-class NativeInstruction VALUE_OBJ_CLASS_SPEC {
+class NativeInstruction {
   friend class Relocation;
 
  public:
--- a/src/hotspot/cpu/s390/templateTable_s390.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/s390/templateTable_s390.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -29,7 +29,7 @@
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
--- a/src/hotspot/cpu/sparc/interpreterRT_sparc.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/sparc/interpreterRT_sparc.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -239,7 +239,7 @@
 // Note: A register location is represented via a Register, not
 //       via an address for efficiency & simplicity reasons.
 
-class Address VALUE_OBJ_CLASS_SPEC {
+class Address {
  private:
   Register           _base;           // Base register.
   RegisterOrConstant _index_or_disp;  // Index register or constant displacement.
@@ -320,7 +320,7 @@
 };
 
 
-class AddressLiteral VALUE_OBJ_CLASS_SPEC {
+class AddressLiteral {
  private:
   address          _address;
   RelocationHolder _rspec;
@@ -452,7 +452,7 @@
 // with the SPARC Application Binary Interface, or ABI.  This is
 // often referred to as the native or C calling convention.
 
-class Argument VALUE_OBJ_CLASS_SPEC {
+class Argument {
  private:
   int _number;
   bool _is_in;
--- a/src/hotspot/cpu/sparc/nativeInst_sparc.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/sparc/nativeInst_sparc.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 // - - NativeIllegalInstruction
 // The base class for different kinds of native instruction abstractions.
 // Provides the primitive operations to manipulate code relative to this.
-class NativeInstruction VALUE_OBJ_CLASS_SPEC {
+class NativeInstruction {
   friend class Relocation;
 
  public:
--- a/src/hotspot/cpu/sparc/templateTable_sparc.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/sparc/templateTable_sparc.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -27,7 +27,7 @@
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/cpu/x86/assembler_x86.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/assembler_x86.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 // Contains all the definitions needed for x86 assembly code generation.
 
 // Calling convention
-class Argument VALUE_OBJ_CLASS_SPEC {
+class Argument {
  public:
   enum {
 #ifdef _LP64
@@ -155,7 +155,7 @@
 
 class ArrayAddress;
 
-class Address VALUE_OBJ_CLASS_SPEC {
+class Address {
  public:
   enum ScaleFactor {
     no_scale = -1,
@@ -333,7 +333,7 @@
 // on the instruction and the platform. As small step on the way to merging i486/amd64
 // directories.
 //
-class AddressLiteral VALUE_OBJ_CLASS_SPEC {
+class AddressLiteral {
   friend class ArrayAddress;
   RelocationHolder _rspec;
   // Typically we use AddressLiterals we want to use their rval
@@ -423,7 +423,7 @@
 // address amd64 can't. We create a class that expresses the concept but does extra
 // magic on amd64 to get the final result
 
-class ArrayAddress VALUE_OBJ_CLASS_SPEC {
+class ArrayAddress {
   private:
 
   AddressLiteral _base;
--- a/src/hotspot/cpu/x86/c1_FpuStackSim_x86.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/c1_FpuStackSim_x86.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 
 class Compilation;
 
-class FpuStackSim VALUE_OBJ_CLASS_SPEC {
+class FpuStackSim {
  private:
   Compilation* _compilation;
   int          _stack_size;
--- a/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
 }
 
 
-class FpuStackAllocator VALUE_OBJ_CLASS_SPEC {
+class FpuStackAllocator {
  private:
   Compilation* _compilation;
   LinearScan* _allocator;
--- a/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -26,7 +26,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/x86/nativeInst_x86.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/nativeInst_x86.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -50,7 +50,7 @@
 // The base class for different kinds of native instruction abstractions.
 // Provides the primitive operations to manipulate code relative to this.
 
-class NativeInstruction VALUE_OBJ_CLASS_SPEC {
+class NativeInstruction {
   friend class Relocation;
 
  public:
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -678,6 +678,7 @@
     assert_different_registers(start, count);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
+#if INCLUDE_ALL_GCS
       case BarrierSet::G1BarrierSet:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!uninitialized_target) {
@@ -727,6 +728,7 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
     assert_different_registers(start, count);
     switch (bs->kind()) {
+#if INCLUDE_ALL_GCS
       case BarrierSet::G1BarrierSet:
         {
           __ pusha();                      // push registers
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -28,7 +28,7 @@
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "interpreter/templateTable.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/cpu/zero/interpreterRT_zero.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/zero/interpreterRT_zero.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -27,7 +27,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/cpu/zero/nativeInst_zero.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/cpu/zero/nativeInst_zero.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -46,7 +46,7 @@
 // The base class for different kinds of native instruction abstractions.
 // Provides the primitive operations to manipulate code relative to this.
 
-class NativeInstruction VALUE_OBJ_CLASS_SPEC {
+class NativeInstruction {
  public:
   bool is_jump() {
     ShouldNotCallThis();
--- a/src/hotspot/os/linux/os_linux.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os/linux/os_linux.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -3053,12 +3053,10 @@
   return res  != (uintptr_t) MAP_FAILED;
 }
 
-// If there is no page mapped/committed, top (bottom + size) is returned
-static address get_stack_mapped_bottom(address bottom,
-                                       size_t size,
-                                       bool committed_only /* must have backing pages */) {
-  // address used to test if the page is mapped/committed
-  address test_addr = bottom + size;
+static address get_stack_commited_bottom(address bottom, size_t size) {
+  address nbot = bottom;
+  address ntop = bottom + size;
+
   size_t page_sz = os::vm_page_size();
   unsigned pages = size / page_sz;
 
@@ -3070,39 +3068,38 @@
 
   while (imin < imax) {
     imid = (imax + imin) / 2;
-    test_addr = bottom + (imid * page_sz);
+    nbot = ntop - (imid * page_sz);
 
     // Use a trick with mincore to check whether the page is mapped or not.
     // mincore sets vec to 1 if page resides in memory and to 0 if page
     // is swapped output but if page we are asking for is unmapped
     // it returns -1,ENOMEM
-    mincore_return_value = mincore(test_addr, page_sz, vec);
-
-    if (mincore_return_value == -1 || (committed_only && (vec[0] & 0x01) == 0)) {
-      // Page is not mapped/committed go up
-      // to find first mapped/committed page
-      if ((mincore_return_value == -1 && errno != EAGAIN)
-        || (committed_only && (vec[0] & 0x01) == 0)) {
-        assert(mincore_return_value != -1 || errno == ENOMEM, "Unexpected mincore errno");
-
-        imin = imid + 1;
+    mincore_return_value = mincore(nbot, page_sz, vec);
+
+    if (mincore_return_value == -1) {
+      // Page is not mapped go up
+      // to find first mapped page
+      if (errno != EAGAIN) {
+        assert(errno == ENOMEM, "Unexpected mincore errno");
+        imax = imid;
       }
     } else {
-      // mapped/committed, go down
-      imax= imid;
+      // Page is mapped go down
+      // to find first not mapped page
+      imin = imid + 1;
     }
   }
 
-  // Adjust stack bottom one page up if last checked page is not mapped/committed
-  if (mincore_return_value == -1 || (committed_only && (vec[0] & 0x01) == 0)) {
-    assert(mincore_return_value != -1 || (errno != EAGAIN && errno != ENOMEM),
-      "Should not get to here");
-
-    test_addr = test_addr + page_sz;
-  }
-
-  return test_addr;
-}
+  nbot = nbot + page_sz;
+
+  // Adjust stack bottom one page up if last checked page is not mapped
+  if (mincore_return_value == -1) {
+    nbot = nbot + page_sz;
+  }
+
+  return nbot;
+}
+
 
 // Linux uses a growable mapping for the stack, and if the mapping for
 // the stack guard pages is not removed when we detach a thread the
@@ -3140,9 +3137,9 @@
 
     if (mincore((address)stack_extent, os::vm_page_size(), vec) == -1) {
       // Fallback to slow path on all errors, including EAGAIN
-      stack_extent = (uintptr_t) get_stack_mapped_bottom(os::Linux::initial_thread_stack_bottom(),
-                                                         (size_t)addr - stack_extent,
-                                                         false /* committed_only */);
+      stack_extent = (uintptr_t) get_stack_commited_bottom(
+                                                           os::Linux::initial_thread_stack_bottom(),
+                                                           (size_t)addr - stack_extent);
     }
 
     if (stack_extent < (uintptr_t)addr) {
@@ -3169,11 +3166,6 @@
   return os::uncommit_memory(addr, size);
 }
 
-size_t os::committed_stack_size(address bottom, size_t size) {
-  address bot = get_stack_mapped_bottom(bottom, size, true /* committed_only */);
-  return size_t(bottom + size - bot);
-}
-
 // If 'fixed' is true, anon_mmap() will attempt to reserve anonymous memory
 // at 'requested_addr'. If there are existing memory mappings at the same
 // location, however, they will be overwritten. If 'fixed' is false,
--- a/src/hotspot/os/posix/os_posix.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os/posix/os_posix.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -23,10 +23,12 @@
  */
 
 #include "jvm.h"
+#include "memory/allocation.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/os.hpp"
+#include "services/memTracker.hpp"
 #include "utilities/align.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
--- a/src/hotspot/os/windows/os_windows.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os/windows/os_windows.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -363,25 +363,6 @@
   return sz;
 }
 
-size_t os::committed_stack_size(address bottom, size_t size) {
-  MEMORY_BASIC_INFORMATION minfo;
-  address top = bottom + size;
-  size_t committed_size = 0;
-
-  while (committed_size < size) {
-    // top is exclusive
-    VirtualQuery(top - 1, &minfo, sizeof(minfo));
-    if ((minfo.State & MEM_COMMIT) != 0) {
-      committed_size += minfo.RegionSize;
-      top -= minfo.RegionSize;
-    } else {
-      break;
-    }
-  }
-
-  return MIN2(committed_size, size);
-}
-
 struct tm* os::localtime_pd(const time_t* clock, struct tm* res) {
   const struct tm* time_struct_ptr = localtime(clock);
   if (time_struct_ptr != NULL) {
--- a/src/hotspot/os/windows/symbolengine.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os/windows/symbolengine.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -375,10 +375,10 @@
     const int len_returned = (int)::GetModuleFileName(hMod, filebuffer, (DWORD)file_buffer_capacity);
     DEBUG_ONLY(g_buffers.dir_name.check();)
     if (len_returned == 0) {
-      // Error. This is suspicious - this may happen if a module has just been
-      // unloaded concurrently after our call to EnumProcessModules and
-      // GetModuleFileName, but probably just indicates a coding error.
-      assert(false, "GetModuleFileName failed (%u)", ::GetLastError());
+      // This may happen when a module gets unloaded after our call to EnumProcessModules.
+      // It should be rare but may sporadically happen. Just ignore and continue with the
+      // next module.
+      continue;
     } else if (len_returned == file_buffer_capacity) {
       // Truncation. Just skip this module and continue with the next module.
       continue;
--- a/src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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.
  *
@@ -80,7 +80,6 @@
 
 template<size_t byte_size>
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
--- a/src/hotspot/os_cpu/bsd_x86/orderAccess_bsd_x86.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/bsd_x86/orderAccess_bsd_x86.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,7 +65,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -78,7 +77,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -91,7 +89,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -105,7 +102,6 @@
 #ifdef AMD64
 template<>
 struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
--- a/src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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.
  *
@@ -52,7 +52,6 @@
 
 template<size_t byte_size>
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const { T data; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
@@ -60,7 +59,6 @@
 
 template<size_t byte_size>
 struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
@@ -68,7 +66,6 @@
 
 template<size_t byte_size>
 struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
--- a/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedLoad<1, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const {
@@ -148,7 +147,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedLoad<2, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const {
@@ -164,7 +162,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedLoad<4, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const {
@@ -180,7 +177,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedLoad<8, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const {
@@ -196,7 +192,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -210,7 +205,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -224,7 +218,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -238,7 +231,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
--- a/src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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.
  *
@@ -83,7 +83,6 @@
 
 template<size_t byte_size>
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
--- a/src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -76,7 +76,6 @@
 
 template<size_t byte_size>
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   T operator()(const volatile T* p) const { register T t = *p; inlasm_zarch_acquire(); return t; }
--- a/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -74,7 +73,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -87,7 +85,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -101,7 +98,6 @@
 #ifdef AMD64
 template<>
 struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
--- a/src/hotspot/os_cpu/solaris_sparc/atomic_solaris_sparc.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/solaris_sparc/atomic_solaris_sparc.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 
 // Implement ADD using a CAS loop.
 template<size_t byte_size>
-struct Atomic::PlatformAdd VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformAdd {
   template<typename I, typename D>
   inline D operator()(I add_value, D volatile* dest) const {
     D old_value = *dest;
--- a/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,6 @@
 #ifndef AMD64
 template<>
 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -89,7 +88,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
@@ -103,7 +101,6 @@
 
 template<>
 struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-  VALUE_OBJ_CLASS_SPEC
 {
   template <typename T>
   void operator()(T v, volatile T* p) const {
--- a/src/hotspot/share/aot/aotCodeHeap.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/aot/aotCodeHeap.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -34,6 +34,7 @@
 #include "interpreter/abstractInterpreter.hpp"
 #include "jvmci/compilerRuntime.hpp"
 #include "jvmci/jvmciRuntime.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/method.inline.hpp"
 #include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/aot/aotCompiledMethod.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/aot/aotCompiledMethod.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -36,6 +36,7 @@
 #include "jvmci/compilerRuntime.hpp"
 #include "jvmci/jvmciRuntime.hpp"
 #include "oops/method.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
@@ -448,4 +449,3 @@
     }
   }
 }
-
--- a/src/hotspot/share/aot/aotLoader.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/aot/aotLoader.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,9 @@
 #include "aot/aotCodeHeap.hpp"
 #include "aot/aotLoader.inline.hpp"
 #include "jvmci/jvmciRuntime.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/method.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/os.hpp"
 #include "runtime/timerTrace.hpp"
 
--- a/src/hotspot/share/ci/ciEnv.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/ci/ciEnv.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -45,7 +45,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/constantPool.inline.hpp"
 #include "oops/cpCache.inline.hpp"
 #include "oops/method.inline.hpp"
--- a/src/hotspot/share/ci/ciField.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/ci/ciField.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "interpreter/linkResolver.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/fieldDescriptor.hpp"
 
--- a/src/hotspot/share/classfile/bytecodeAssembler.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/bytecodeAssembler.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -28,6 +28,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/oopFactory.hpp"
 #include "oops/constantPool.hpp"
+#include "runtime/handles.inline.hpp"
 #include "utilities/bytes.hpp"
 
 u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) {
--- a/src/hotspot/share/classfile/bytecodeAssembler.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/bytecodeAssembler.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 };
 
 // Entries in a yet-to-be-created constant pool.  Limited types for now.
-class BytecodeCPEntry VALUE_OBJ_CLASS_SPEC {
+class BytecodeCPEntry {
  public:
   enum tag {
     ERROR_TAG,
--- a/src/hotspot/share/classfile/classFileParser.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -44,7 +44,7 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/annotations.hpp"
 #include "oops/constantPool.inline.hpp"
 #include "oops/fieldStreams.hpp"
@@ -1858,7 +1858,7 @@
 
 
 // Class file LocalVariableTable elements.
-class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
+class Classfile_LVT_Element {
  public:
   u2 start_bci;
   u2 length;
@@ -3767,9 +3767,7 @@
   int next_static_oop_offset    = InstanceMirrorKlass::offset_of_static_fields();
   int next_static_double_offset = next_static_oop_offset +
                                       ((fac->count[STATIC_OOP]) * heapOopSize);
-  if ( fac->count[STATIC_DOUBLE] &&
-       (Universe::field_type_should_be_aligned(T_DOUBLE) ||
-        Universe::field_type_should_be_aligned(T_LONG)) ) {
+  if (fac->count[STATIC_DOUBLE]) {
     next_static_double_offset = align_up(next_static_double_offset, BytesPerLong);
   }
 
@@ -4382,7 +4380,7 @@
     // add super class dependency
     Klass* const super = defined_klass->super();
     if (super != NULL) {
-      defining_loader_data->record_dependency(super, CHECK);
+      defining_loader_data->record_dependency(super);
     }
 
     // add super interface dependencies
@@ -4390,7 +4388,7 @@
     if (local_interfaces != NULL) {
       const int length = local_interfaces->length();
       for (int i = 0; i < length; i++) {
-        defining_loader_data->record_dependency(local_interfaces->at(i), CHECK);
+        defining_loader_data->record_dependency(local_interfaces->at(i));
       }
     }
   }
@@ -5363,6 +5361,16 @@
 void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loadhook, TRAPS) {
   assert(ik != NULL, "invariant");
 
+  // Set name and CLD before adding to CLD
+  ik->set_class_loader_data(_loader_data);
+  ik->set_name(_class_name);
+
+  // Add all classes to our internal class loader list here,
+  // including classes in the bootstrap (NULL) class loader.
+  const bool publicize = !is_internal();
+
+  _loader_data->add_class(ik, publicize);
+
   set_klass_to_deallocate(ik);
 
   assert(_field_info != NULL, "invariant");
@@ -5377,7 +5385,6 @@
   ik->set_should_verify_class(_need_verify);
 
   // Not yet: supers are done below to support the new subtype-checking fields
-  ik->set_class_loader_data(_loader_data);
   ik->set_nonstatic_field_size(_field_info->nonstatic_field_size);
   ik->set_has_nonstatic_fields(_field_info->has_nonstatic_fields);
   assert(_fac != NULL, "invariant");
@@ -5408,8 +5415,6 @@
   // has to be changed accordingly.
   ik->set_initial_method_idnum(ik->methods()->length());
 
-  ik->set_name(_class_name);
-
   if (is_anonymous()) {
     // _this_class_index is a CONSTANT_Class entry that refers to this
     // anonymous class itself. If this class needs to refer to its own methods or
--- a/src/hotspot/share/classfile/classFileParser.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/classFileParser.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
 //
 // The bytes describing the class file structure is read from a Stream object
 
-class ClassFileParser VALUE_OBJ_CLASS_SPEC {
+class ClassFileParser {
 
  class ClassAnnotationCollector;
  class FieldAllocationCount;
--- a/src/hotspot/share/classfile/classLoader.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/classLoader.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -48,7 +48,7 @@
 #include "memory/filemap.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/method.inline.hpp"
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -59,6 +59,7 @@
 #include "gc/shared/gcLocker.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
@@ -85,7 +86,25 @@
 
 ClassLoaderData * ClassLoaderData::_the_null_class_loader_data = NULL;
 
-ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies) :
+void ClassLoaderData::init_null_class_loader_data() {
+  assert(_the_null_class_loader_data == NULL, "cannot initialize twice");
+  assert(ClassLoaderDataGraph::_head == NULL, "cannot initialize twice");
+
+  _the_null_class_loader_data = new ClassLoaderData(Handle(), false);
+  ClassLoaderDataGraph::_head = _the_null_class_loader_data;
+  assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be");
+
+  LogTarget(Debug, class, loader, data) lt;
+  if (lt.is_enabled()) {
+    ResourceMark rm;
+    LogStream ls(lt);
+    ls.print("create ");
+    _the_null_class_loader_data->print_value_on(&ls);
+    ls.cr();
+  }
+}
+
+ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous) :
   _class_loader(h_class_loader()),
   _is_anonymous(is_anonymous),
   // An anonymous class loader data doesn't have anything to keep
@@ -96,7 +115,7 @@
   _modules(NULL), _packages(NULL),
   _claimed(0), _modified_oops(true), _accumulated_modified_oops(false),
   _jmethod_ids(NULL), _handles(), _deallocate_list(NULL),
-  _next(NULL), _dependencies(dependencies),
+  _next(NULL),
   _metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
                             Monitor::_safepoint_check_never)) {
 
@@ -112,28 +131,16 @@
       // Create unnamed module for all other loaders
       _unnamed_module = ModuleEntry::create_unnamed_module(this);
     }
-  } else {
-    _unnamed_module = NULL;
-  }
-
-  if (!is_anonymous) {
     _dictionary = create_dictionary();
   } else {
+    _packages = NULL;
+    _unnamed_module = NULL;
     _dictionary = NULL;
   }
-  TRACE_INIT_ID(this);
-}
 
-void ClassLoaderData::init_dependencies(TRAPS) {
-  assert(!Universe::is_fully_initialized(), "should only be called when initializing");
-  assert(is_the_null_class_loader_data(), "should only call this for the null class loader");
-  _dependencies.init(CHECK);
-}
+  NOT_PRODUCT(_dependency_count = 0); // number of class loader dependencies
 
-void ClassLoaderData::Dependencies::init(TRAPS) {
-  // Create empty dependencies array to add to. CMS requires this to be
-  // an oop so that it can track additions via card marks.  We think.
-  _list_head = oopFactory::new_objectArray(2, CHECK);
+  TRACE_INIT_ID(this);
 }
 
 ClassLoaderData::ChunkedHandleList::~ChunkedHandleList() {
@@ -156,6 +163,16 @@
   return handle;
 }
 
+int ClassLoaderData::ChunkedHandleList::count() const {
+  int count = 0;
+  Chunk* chunk = _head;
+  while (chunk != NULL) {
+    count += chunk->_size;
+    chunk = chunk->_next;
+  }
+  return count;
+}
+
 inline void ClassLoaderData::ChunkedHandleList::oops_do_chunk(OopClosure* f, Chunk* c, const juint size) {
   for (juint i = 0; i < size; i++) {
     if (c->_data[i] != NULL) {
@@ -175,16 +192,15 @@
   }
 }
 
-#ifdef ASSERT
 class VerifyContainsOopClosure : public OopClosure {
-  oop* _target;
+  oop  _target;
   bool _found;
 
  public:
-  VerifyContainsOopClosure(oop* target) : _target(target), _found(false) {}
+  VerifyContainsOopClosure(oop target) : _target(target), _found(false) {}
 
   void do_oop(oop* p) {
-    if (p == _target) {
+    if (p != NULL && *p == _target) {
       _found = true;
     }
   }
@@ -199,12 +215,11 @@
   }
 };
 
-bool ClassLoaderData::ChunkedHandleList::contains(oop* p) {
+bool ClassLoaderData::ChunkedHandleList::contains(oop p) {
   VerifyContainsOopClosure cl(p);
   oops_do(&cl);
   return cl.found();
 }
-#endif // ASSERT
 
 bool ClassLoaderData::claim() {
   if (_claimed == 1) {
@@ -244,14 +259,9 @@
   }
 
   f->do_oop(&_class_loader);
-  _dependencies.oops_do(f);
   _handles.oops_do(f);
 }
 
-void ClassLoaderData::Dependencies::oops_do(OopClosure* f) {
-  f->do_oop((oop*)&_list_head);
-}
-
 void ClassLoaderData::classes_do(KlassClosure* klass_closure) {
   // Lock-free access requires load_acquire
   for (Klass* k = OrderAccess::load_acquire(&_klasses); k != NULL; k = k->next_link()) {
@@ -326,7 +336,7 @@
   }
 }
 
-void ClassLoaderData::record_dependency(const Klass* k, TRAPS) {
+void ClassLoaderData::record_dependency(const Klass* k) {
   assert(k != NULL, "invariant");
 
   ClassLoaderData * const from_cld = this;
@@ -361,77 +371,27 @@
     }
   }
 
-  // It's a dependency we won't find through GC, add it. This is relatively rare.
-  // Must handle over GC point.
-  Handle dependency(THREAD, to);
-  from_cld->_dependencies.add(dependency, CHECK);
-
-  // Added a potentially young gen oop to the ClassLoaderData
-  record_modified_oops();
+  // It's a dependency we won't find through GC, add it.
+  if (!_handles.contains(to)) {
+    NOT_PRODUCT(Atomic::inc(&_dependency_count));
+    LogTarget(Trace, class, loader, data) lt;
+    if (lt.is_enabled()) {
+      ResourceMark rm;
+      LogStream ls(lt);
+      ls.print("adding dependency from ");
+      print_value_on(&ls);
+      ls.print(" to ");
+      to_cld->print_value_on(&ls);
+      ls.cr();
+    }
+    Handle dependency(Thread::current(), to);
+    add_handle(dependency);
+    // Added a potentially young gen oop to the ClassLoaderData
+    record_modified_oops();
+  }
 }
 
 
-void ClassLoaderData::Dependencies::add(Handle dependency, TRAPS) {
-  // Check first if this dependency is already in the list.
-  // Save a pointer to the last to add to under the lock.
-  objArrayOop ok = _list_head;
-  objArrayOop last = NULL;
-  while (ok != NULL) {
-    last = ok;
-    if (ok->obj_at(0) == dependency()) {
-      // Don't need to add it
-      return;
-    }
-    ok = (objArrayOop)ok->obj_at(1);
-  }
-
-  // Must handle over GC points
-  assert (last != NULL, "dependencies should be initialized");
-  objArrayHandle last_handle(THREAD, last);
-
-  // Create a new dependency node with fields for (class_loader or mirror, next)
-  objArrayOop deps = oopFactory::new_objectArray(2, CHECK);
-  deps->obj_at_put(0, dependency());
-
-  // Must handle over GC points
-  objArrayHandle new_dependency(THREAD, deps);
-
-  // Add the dependency under lock
-  locked_add(last_handle, new_dependency, THREAD);
-}
-
-void ClassLoaderData::Dependencies::locked_add(objArrayHandle last_handle,
-                                               objArrayHandle new_dependency,
-                                               Thread* THREAD) {
-
-  // Have to lock and put the new dependency on the end of the dependency
-  // array so the card mark for CMS sees that this dependency is new.
-  // Can probably do this lock free with some effort.
-  ObjectLocker ol(Handle(THREAD, _list_head), THREAD);
-
-  oop loader_or_mirror = new_dependency->obj_at(0);
-
-  // Since the dependencies are only added, add to the end.
-  objArrayOop end = last_handle();
-  objArrayOop last = NULL;
-  while (end != NULL) {
-    last = end;
-    // check again if another thread added it to the end.
-    if (end->obj_at(0) == loader_or_mirror) {
-      // Don't need to add it
-      return;
-    }
-    end = (objArrayOop)end->obj_at(1);
-  }
-  assert (last != NULL, "dependencies should be initialized");
-  // fill in the first element with the oop in new_dependency.
-  if (last->obj_at(0) == NULL) {
-    last->obj_at_put(0, new_dependency->obj_at(0));
-  } else {
-    last->obj_at_put(1, new_dependency());
-  }
-}
-
 void ClassLoaderDataGraph::clear_claimed_marks() {
   for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
     cld->clear_claimed();
@@ -453,15 +413,15 @@
     }
   }
 
-  if (publicize && k->class_loader_data() != NULL) {
-    ResourceMark rm;
-    log_trace(class, loader, data)("Adding k: " PTR_FORMAT " %s to CLD: "
-                  PTR_FORMAT " loader: " PTR_FORMAT " %s",
-                  p2i(k),
-                  k->external_name(),
-                  p2i(k->class_loader_data()),
-                  p2i((void *)k->class_loader()),
-                  loader_name());
+  if (publicize) {
+    LogTarget(Trace, class, loader, data) lt;
+    if (lt.is_enabled()) {
+      ResourceMark rm;
+      LogStream ls(lt);
+      ls.print("Adding k: " PTR_FORMAT " %s to ", p2i(k), k->external_name());
+      print_value_on(&ls);
+      ls.cr();
+    }
   }
 }
 
@@ -578,12 +538,8 @@
   if (lt.is_enabled()) {
     ResourceMark rm;
     LogStream ls(lt);
-    ls.print(": unload loader data " INTPTR_FORMAT, p2i(this));
-    ls.print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
-               loader_name());
-    if (is_anonymous()) {
-      ls.print(" for anonymous class  " INTPTR_FORMAT " ", p2i(_klasses));
-    }
+    ls.print("unload ");
+    print_value_on(&ls);
     ls.cr();
   }
 
@@ -779,14 +735,8 @@
         assert (class_loader() == NULL, "Must be");
         metaspace = new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType);
       } else if (is_anonymous()) {
-        if (class_loader() != NULL) {
-          log_trace(class, loader, data)("is_anonymous: %s", class_loader()->klass()->internal_name());
-        }
         metaspace = new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType);
       } else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
-        if (class_loader() != NULL) {
-          log_trace(class, loader, data)("is_reflection: %s", class_loader()->klass()->internal_name());
-        }
         metaspace = new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType);
       } else {
         metaspace = new Metaspace(_metaspace_lock, Metaspace::StandardMetaspaceType);
@@ -808,7 +758,7 @@
   assert(!is_unloading(), "Do not remove a handle for a CLD that is unloading");
   oop* ptr = h.ptr_raw();
   if (ptr != NULL) {
-    assert(_handles.contains(ptr), "Got unexpected handle " PTR_FORMAT, p2i(ptr));
+    assert(_handles.contains(*ptr), "Got unexpected handle " PTR_FORMAT, p2i(ptr));
     // This root is not walked in safepoints, and hence requires an appropriate
     // decorator that e.g. maintains the SATB invariant in SATB collectors.
     RootAccess<IN_CONCURRENT_ROOT>::oop_store(ptr, oop(NULL));
@@ -902,49 +852,44 @@
 }
 
 // These anonymous class loaders are to contain classes used for JSR292
-ClassLoaderData* ClassLoaderData::anonymous_class_loader_data(oop loader, TRAPS) {
+ClassLoaderData* ClassLoaderData::anonymous_class_loader_data(Handle loader) {
   // Add a new class loader data to the graph.
-  Handle lh(THREAD, loader);
-  return ClassLoaderDataGraph::add(lh, true, THREAD);
+  return ClassLoaderDataGraph::add(loader, true);
 }
 
-const char* ClassLoaderData::loader_name() {
+const char* ClassLoaderData::loader_name() const {
   // Handles null class loader
   return SystemDictionary::loader_name(class_loader());
 }
 
-#ifndef PRODUCT
-// Define to dump klasses
-#undef CLD_DUMP_KLASSES
 
-void ClassLoaderData::dump(outputStream * const out) {
-  out->print("ClassLoaderData CLD: " PTR_FORMAT ", loader: " PTR_FORMAT ", loader_klass: " PTR_FORMAT " %s {",
-      p2i(this), p2i((void *)class_loader()),
-      p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
-  if (claimed()) out->print(" claimed ");
-  if (is_unloading()) out->print(" unloading ");
-  out->cr();
-  if (metaspace_or_null() != NULL) {
-    out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
-    metaspace_or_null()->dump(out);
+void ClassLoaderData::print_value_on(outputStream* out) const {
+  if (class_loader() != NULL) {
+    out->print("loader data: " INTPTR_FORMAT " for instance ", p2i(this));
+    class_loader()->print_value_on(out);  // includes loader_name() and address of class loader instance
   } else {
-    out->print_cr("metaspace: NULL");
+    // loader data: 0xsomeaddr of <bootloader>
+    out->print("loader data: " INTPTR_FORMAT " of %s", p2i(this), loader_name());
   }
+  if (is_anonymous()) {
+    out->print(" anonymous");
+  }
+}
 
-#ifdef CLD_DUMP_KLASSES
-  if (Verbose) {
-    Klass* k = _klasses;
-    while (k != NULL) {
-      out->print_cr("klass " PTR_FORMAT ", %s", p2i(k), k->name()->as_C_string());
-      assert(k != k->next_link(), "no loops!");
-      k = k->next_link();
-    }
-  }
-#endif  // CLD_DUMP_KLASSES
-#undef CLD_DUMP_KLASSES
+#ifndef PRODUCT
+void ClassLoaderData::print_on(outputStream* out) const {
+  out->print("ClassLoaderData CLD: " PTR_FORMAT ", loader: " PTR_FORMAT ", loader_klass: %s {",
+              p2i(this), p2i((void *)class_loader()), loader_name());
+  if (is_anonymous()) out->print(" anonymous");
+  if (claimed()) out->print(" claimed");
+  if (is_unloading()) out->print(" unloading");
+  out->print(" metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
+
   if (_jmethod_ids != NULL) {
     Method::print_jmethod_ids(this, out);
   }
+  out->print(" handles count %d", _handles.count());
+  out->print(" dependencies %d", _dependency_count);
   out->print_cr("}");
 }
 #endif // PRODUCT
@@ -988,16 +933,12 @@
 
 // Add a new class loader data node to the list.  Assign the newly created
 // ClassLoaderData into the java/lang/ClassLoader object as a hidden field
-ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRAPS) {
-  // We need to allocate all the oops for the ClassLoaderData before allocating the
-  // actual ClassLoaderData object.
-  ClassLoaderData::Dependencies dependencies(CHECK_NULL);
-
+ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous) {
   NoSafepointVerifier no_safepoints; // we mustn't GC until we've installed the
                                      // ClassLoaderData in the graph since the CLD
                                      // contains unhandled oops
 
-  ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous, dependencies);
+  ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous);
 
 
   if (!is_anonymous) {
@@ -1021,9 +962,11 @@
     if (exchanged == next) {
       LogTarget(Debug, class, loader, data) lt;
       if (lt.is_enabled()) {
-       PauseNoSafepointVerifier pnsv(&no_safepoints); // Need safe points for JavaCalls::call_virtual
-       LogStream ls(lt);
-       print_creation(&ls, loader, cld, CHECK_NULL);
+        ResourceMark rm;
+        LogStream ls(lt);
+        ls.print("create ");
+        cld->print_value_on(&ls);
+        ls.cr();
       }
       return cld;
     }
@@ -1031,36 +974,6 @@
   } while (true);
 }
 
-void ClassLoaderDataGraph::print_creation(outputStream* out, Handle loader, ClassLoaderData* cld, TRAPS) {
-  Handle string;
-  if (loader.not_null()) {
-    // Include the result of loader.toString() in the output. This allows
-    // the user of the log to identify the class loader instance.
-    JavaValue result(T_OBJECT);
-    Klass* spec_klass = SystemDictionary::ClassLoader_klass();
-    JavaCalls::call_virtual(&result,
-                            loader,
-                            spec_klass,
-                            vmSymbols::toString_name(),
-                            vmSymbols::void_string_signature(),
-                            CHECK);
-    assert(result.get_type() == T_OBJECT, "just checking");
-    string = Handle(THREAD, (oop)result.get_jobject());
-  }
-
-  ResourceMark rm;
-  out->print("create class loader data " INTPTR_FORMAT, p2i(cld));
-  out->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
-             cld->loader_name());
-
-  if (string.not_null()) {
-    out->print(": ");
-    java_lang_String::print(string(), out);
-  }
-  out->cr();
-}
-
-
 void ClassLoaderDataGraph::oops_do(OopClosure* f, bool must_claim) {
   for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
     cld->oops_do(f, must_claim);
@@ -1477,7 +1390,8 @@
 #ifndef PRODUCT
 // callable from debugger
 extern "C" int print_loader_data_graph() {
-  ClassLoaderDataGraph::dump_on(tty);
+  ResourceMark rm;
+  ClassLoaderDataGraph::print_on(tty);
   return 0;
 }
 
@@ -1487,32 +1401,13 @@
   }
 }
 
-void ClassLoaderDataGraph::dump_on(outputStream * const out) {
+void ClassLoaderDataGraph::print_on(outputStream * const out) {
   for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
-    data->dump(out);
+    data->print_on(out);
   }
-  MetaspaceAux::dump(out);
 }
 #endif // PRODUCT
 
-void ClassLoaderData::print_value_on(outputStream* out) const {
-  if (class_loader() == NULL) {
-    out->print("NULL class loader");
-  } else {
-    out->print("class loader " INTPTR_FORMAT " ", p2i(this));
-    class_loader()->print_value_on(out);
-  }
-}
-
-void ClassLoaderData::print_on(outputStream* out) const {
-  if (class_loader() == NULL) {
-    out->print("NULL class loader");
-  } else {
-    out->print("class loader " INTPTR_FORMAT " ", p2i(this));
-    class_loader()->print_on(out);
-  }
-}
-
 #if INCLUDE_TRACE
 
 Ticks ClassLoaderDataGraph::_class_unload_time;
--- a/src/hotspot/share/classfile/classLoaderData.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/classLoaderData.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -83,10 +83,10 @@
   static volatile size_t  _num_instance_classes;
   static volatile size_t  _num_array_classes;
 
-  static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
+  static ClassLoaderData* add(Handle class_loader, bool anonymous);
   static void post_class_unload_events();
  public:
-  static ClassLoaderData* find_or_create(Handle class_loader, TRAPS);
+  static ClassLoaderData* find_or_create(Handle class_loader);
   static void purge();
   static void clear_claimed_marks();
   // oops do
@@ -151,10 +151,9 @@
   static bool has_metaspace_oom()           { return _metaspace_oom; }
   static void set_metaspace_oom(bool value) { _metaspace_oom = value; }
 
-  static void dump_on(outputStream * const out) PRODUCT_RETURN;
-  static void dump() { dump_on(tty); }
+  static void print_on(outputStream * const out) PRODUCT_RETURN;
+  static void print() { print_on(tty); }
   static void verify();
-  static void print_creation(outputStream* out, Handle loader, ClassLoaderData* cld, TRAPS);
 
   static bool unload_list_contains(const void* x);
 
@@ -181,23 +180,9 @@
 
 class ClassLoaderData : public CHeapObj<mtClass> {
   friend class VMStructs;
+
  private:
-  class Dependencies VALUE_OBJ_CLASS_SPEC {
-    objArrayOop _list_head;
-    void locked_add(objArrayHandle last,
-                    objArrayHandle new_dependency,
-                    Thread* THREAD);
-   public:
-    Dependencies() : _list_head(NULL) {}
-    Dependencies(TRAPS) : _list_head(NULL) {
-      init(CHECK);
-    }
-    void add(Handle dependency, TRAPS);
-    void init(TRAPS);
-    void oops_do(OopClosure* f);
-  };
-
-  class ChunkedHandleList VALUE_OBJ_CLASS_SPEC {
+  class ChunkedHandleList {
     struct Chunk : public CHeapObj<mtClass> {
       static const size_t CAPACITY = 32;
 
@@ -219,10 +204,10 @@
     // Only one thread at a time can add, guarded by ClassLoaderData::metaspace_lock().
     // However, multiple threads can execute oops_do concurrently with add.
     oop* add(oop o);
-#ifdef ASSERT
-    bool contains(oop* p);
-#endif
+    bool contains(oop p);
     void oops_do(OopClosure* f);
+
+    int count() const;
   };
 
   friend class ClassLoaderDataGraph;
@@ -237,8 +222,6 @@
 
   oop _class_loader;          // oop used to uniquely identify a class loader
                               // class loader or a canonical class path
-  Dependencies _dependencies; // holds dependencies from this class loader
-                              // data to others.
 
   Metaspace * volatile _metaspace;  // Meta-space where meta-data defined by the
                                     // classes in the class loader are allocated.
@@ -261,6 +244,8 @@
   ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
                               // have the same life cycle of the corresponding ClassLoader.
 
+  NOT_PRODUCT(volatile int _dependency_count;)  // number of class loader dependencies
+
   Klass* volatile _klasses;              // The classes defined by the class loader.
   PackageEntryTable* volatile _packages; // The packages defined by the class loader.
   ModuleEntryTable*  volatile _modules;  // The modules defined by the class loader.
@@ -289,7 +274,7 @@
   void set_next(ClassLoaderData* next) { _next = next; }
   ClassLoaderData* next() const        { return _next; }
 
-  ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
+  ClassLoaderData(Handle h_class_loader, bool is_anonymous);
   ~ClassLoaderData();
 
   // The CLD are not placed in the Heap, so the Card Table or
@@ -341,20 +326,18 @@
 
   bool is_anonymous() const { return _is_anonymous; }
 
-  static void init_null_class_loader_data() {
-    assert(_the_null_class_loader_data == NULL, "cannot initialize twice");
-    assert(ClassLoaderDataGraph::_head == NULL, "cannot initialize twice");
-
-    // We explicitly initialize the Dependencies object at a later phase in the initialization
-    _the_null_class_loader_data = new ClassLoaderData(Handle(), false, Dependencies());
-    ClassLoaderDataGraph::_head = _the_null_class_loader_data;
-    assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be");
-  }
+  static void init_null_class_loader_data();
 
   bool is_the_null_class_loader_data() const {
     return this == _the_null_class_loader_data;
   }
+
+  // Returns true if this class loader data is for the system class loader.
+  // (Note that the class loader data may be anonymous.)
   bool is_system_class_loader_data() const;
+
+  // Returns true if this class loader data is for the platform class loader.
+  // (Note that the class loader data may be anonymous.)
   bool is_platform_class_loader_data() const;
 
   // Returns true if this class loader data is for the boot class loader.
@@ -397,12 +380,11 @@
   void set_jmethod_ids(JNIMethodBlock* new_block)  { _jmethod_ids = new_block; }
 
   void print()                                     { print_on(tty); }
-  void print_on(outputStream* out) const;
+  void print_on(outputStream* out) const PRODUCT_RETURN;
   void print_value()                               { print_value_on(tty); }
   void print_value_on(outputStream* out) const;
-  void dump(outputStream * const out) PRODUCT_RETURN;
   void verify();
-  const char* loader_name();
+  const char* loader_name() const;
 
   OopHandle add_handle(Handle h);
   void remove_handle(OopHandle h);
@@ -410,8 +392,7 @@
   void add_class(Klass* k, bool publicize = true);
   void remove_class(Klass* k);
   bool contains_klass(Klass* k);
-  void record_dependency(const Klass* to, TRAPS);
-  void init_dependencies(TRAPS);
+  void record_dependency(const Klass* to);
   PackageEntryTable* packages() { return _packages; }
   ModuleEntry* unnamed_module() { return _unnamed_module; }
   ModuleEntryTable* modules();
@@ -424,8 +405,7 @@
 
   static ClassLoaderData* class_loader_data(oop loader);
   static ClassLoaderData* class_loader_data_or_null(oop loader);
-  static ClassLoaderData* anonymous_class_loader_data(oop loader, TRAPS);
-  static void print_loader(ClassLoaderData *loader_data, outputStream *out);
+  static ClassLoaderData* anonymous_class_loader_data(Handle loader);
 
   TRACE_DEFINE_TRACE_ID_METHODS;
 };
--- a/src/hotspot/share/classfile/classLoaderData.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/classLoaderData.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -43,7 +43,7 @@
 }
 
 
-inline ClassLoaderData *ClassLoaderDataGraph::find_or_create(Handle loader, TRAPS) {
+inline ClassLoaderData *ClassLoaderDataGraph::find_or_create(Handle loader) {
   guarantee(loader() != NULL && oopDesc::is_oop(loader()), "Loader must be oop");
   // Gets the class loader data out of the java/lang/ClassLoader object, if non-null
   // it's already in the loader_data, so no need to add
@@ -51,7 +51,7 @@
   if (loader_data) {
      return loader_data;
   }
-  return ClassLoaderDataGraph::add(loader, false, THREAD);
+  return ClassLoaderDataGraph::add(loader, false);
 }
 
 size_t ClassLoaderDataGraph::num_instance_classes() {
--- a/src/hotspot/share/classfile/compactHashtable.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/compactHashtable.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 class SerializeClosure;
 
 // Stats for symbol tables in the CDS archive
-class CompactHashtableStats VALUE_OBJ_CLASS_SPEC {
+class CompactHashtableStats {
 public:
   int hashentry_count;
   int hashentry_bytes;
@@ -71,7 +71,7 @@
 //
 class CompactHashtableWriter: public StackObj {
 public:
-  class Entry VALUE_OBJ_CLASS_SPEC {
+  class Entry {
     unsigned int _hash;
     u4 _value;
 
@@ -194,7 +194,7 @@
 // See CompactHashtableWriter::dump() for how the table is written at CDS
 // dump time.
 //
-class SimpleCompactHashtable VALUE_OBJ_CLASS_SPEC {
+class SimpleCompactHashtable {
 protected:
   address  _base_address;
   u4  _bucket_count;
@@ -281,7 +281,7 @@
 // Because the dump file may be big (hundred of MB in extreme cases),
 // we use mmap for fast access when reading it.
 //
-class HashtableTextDump VALUE_OBJ_CLASS_SPEC {
+class HashtableTextDump {
   int _fd;
   const char* _base;
   const char* _p;
--- a/src/hotspot/share/classfile/dictionary.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/dictionary.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -605,13 +605,16 @@
       Klass* e = probe->instance_klass();
       bool is_defining_class =
          (loader_data() == e->class_loader_data());
-      st->print("%4d: %s%s, loader ", index, is_defining_class ? " " : "^", e->external_name());
-      ClassLoaderData* loader_data = e->class_loader_data();
-      if (loader_data == NULL) {
+      st->print("%4d: %s%s", index, is_defining_class ? " " : "^", e->external_name());
+      ClassLoaderData* cld = e->class_loader_data();
+      if (cld == NULL) {
         // Shared class not restored yet in shared dictionary
-        st->print("<shared, not restored>");
-      } else {
-        loader_data->print_value_on(st);
+        st->print(", loader data <shared, not restored>");
+      } else if (!loader_data()->is_the_null_class_loader_data()) {
+        // Class loader output for the dictionary for the null class loader data is
+        // redundant and obvious.
+        st->print(", ");
+        cld->print_value_on(st);
       }
       st->cr();
     }
--- a/src/hotspot/share/classfile/javaClasses.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,7 +38,7 @@
 #include "memory/oopFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
@@ -689,10 +689,10 @@
   assert(str2->klass() == SystemDictionary::String_klass(),
          "must be java String");
   typeArrayOop value1    = java_lang_String::value_no_keepalive(str1);
-  int          length1   = java_lang_String::length(value1);
+  int          length1   = java_lang_String::length(str1);
   bool         is_latin1 = java_lang_String::is_latin1(str1);
   typeArrayOop value2    = java_lang_String::value_no_keepalive(str2);
-  int          length2   = java_lang_String::length(value2);
+  int          length2   = java_lang_String::length(str2);
   bool         is_latin2 = java_lang_String::is_latin1(str2);
 
   if ((length1 != length2) || (is_latin1 != is_latin2)) {
@@ -3300,7 +3300,7 @@
   module->obj_field_put(name_offset, value);
 }
 
-ModuleEntry* java_lang_Module::module_entry(oop module, TRAPS) {
+ModuleEntry* java_lang_Module::module_entry(oop module) {
   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
   assert(module != NULL, "module can't be null");
   assert(oopDesc::is_oop(module), "module must be oop");
@@ -3310,8 +3310,8 @@
     // If the inject field containing the ModuleEntry* is null then return the
     // class loader's unnamed module.
     oop loader = java_lang_Module::loader(module);
-    Handle h_loader = Handle(THREAD, loader);
-    ClassLoaderData* loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
+    Handle h_loader = Handle(Thread::current(), loader);
+    ClassLoaderData* loader_cld = SystemDictionary::register_loader(h_loader);
     return loader_cld->unnamed_module();
   }
   return module_entry;
--- a/src/hotspot/share/classfile/javaClasses.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/javaClasses.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -798,7 +798,7 @@
     static oop name(oop module);
     static void set_name(oop module, oop value);
 
-    static ModuleEntry* module_entry(oop module, TRAPS);
+    static ModuleEntry* module_entry(oop module);
     static void set_module_entry(oop module, ModuleEntry* module_entry);
 
   friend class JavaClasses;
--- a/src/hotspot/share/classfile/modules.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/modules.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -85,27 +85,27 @@
   return java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(version));
 }
 
-static ModuleEntryTable* get_module_entry_table(Handle h_loader, TRAPS) {
+static ModuleEntryTable* get_module_entry_table(Handle h_loader) {
   // This code can be called during start-up, before the classLoader's classLoader data got
   // created.  So, call register_loader() to make sure the classLoader data gets created.
-  ClassLoaderData *loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
+  ClassLoaderData *loader_cld = SystemDictionary::register_loader(h_loader);
   return loader_cld->modules();
 }
 
-static PackageEntryTable* get_package_entry_table(Handle h_loader, TRAPS) {
+static PackageEntryTable* get_package_entry_table(Handle h_loader) {
   // This code can be called during start-up, before the classLoader's classLoader data got
   // created.  So, call register_loader() to make sure the classLoader data gets created.
-  ClassLoaderData *loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
+  ClassLoaderData *loader_cld = SystemDictionary::register_loader(h_loader);
   return loader_cld->packages();
 }
 
 static ModuleEntry* get_module_entry(jobject module, TRAPS) {
-  Handle module_h(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_Module::is_instance(module_h())) {
+  oop m = JNIHandles::resolve(module);
+  if (!java_lang_Module::is_instance(m)) {
     THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
                    "module is not an instance of type java.lang.Module");
   }
-  return java_lang_Module::module_entry(module_h(), CHECK_NULL);
+  return java_lang_Module::module_entry(m);
 }
 
 static PackageEntry* get_package_entry(ModuleEntry* module_entry, const char* package_name, TRAPS) {
@@ -124,7 +124,7 @@
     ResourceMark rm(THREAD);
     if (Modules::verify_package_name(package->as_C_string())) {
       PackageEntryTable* const package_entry_table =
-        get_package_entry_table(h_loader, CHECK_NULL);
+        get_package_entry_table(h_loader);
       assert(package_entry_table != NULL, "Unexpected null package entry table");
       return package_entry_table->lookup_only(package);
     }
@@ -186,7 +186,7 @@
   Handle h_loader(THREAD, loader);
 
   // Ensure the boot loader's PackageEntryTable has been created
-  PackageEntryTable* package_table = get_package_entry_table(h_loader, CHECK);
+  PackageEntryTable* package_table = get_package_entry_table(h_loader);
   assert(pkg_list->length() == 0 || package_table != NULL, "Bad package_table");
 
   // Ensure java.base's ModuleEntry has been created
@@ -346,7 +346,7 @@
     pkg_list->append(pkg_symbol);
   }
 
-  ModuleEntryTable* module_table = get_module_entry_table(h_loader, CHECK);
+  ModuleEntryTable* module_table = get_module_entry_table(h_loader);
   assert(module_table != NULL, "module entry table shouldn't be null");
 
   // Create symbol* entry for module name.
@@ -382,7 +382,7 @@
     MutexLocker ml(Module_lock, THREAD);
 
     if (num_packages > 0) {
-      package_table = get_package_entry_table(h_loader, CHECK);
+      package_table = get_package_entry_table(h_loader);
       assert(package_table != NULL, "Missing package_table");
 
       // Check that none of the packages exist in the class loader's package table.
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -150,9 +150,9 @@
   CDS_ONLY(SystemDictionaryShared::initialize(CHECK);)
 }
 
-ClassLoaderData* SystemDictionary::register_loader(Handle class_loader, TRAPS) {
+ClassLoaderData* SystemDictionary::register_loader(Handle class_loader) {
   if (class_loader() == NULL) return ClassLoaderData::the_null_class_loader_data();
-  return ClassLoaderDataGraph::find_or_create(class_loader, THREAD);
+  return ClassLoaderDataGraph::find_or_create(class_loader);
 }
 
 // ----------------------------------------------------------------------------
@@ -664,7 +664,7 @@
 
   // Fix for 4474172; see evaluation for more details
   class_loader = Handle(THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader()));
-  ClassLoaderData *loader_data = register_loader(class_loader, CHECK_NULL);
+  ClassLoaderData* loader_data = register_loader(class_loader);
   Dictionary* dictionary = loader_data->dictionary();
   unsigned int d_hash = dictionary->compute_hash(name);
 
@@ -989,7 +989,7 @@
     // Create a new CLD for anonymous class, that uses the same class loader
     // as the host_klass
     guarantee(host_klass->class_loader() == class_loader(), "should be the same");
-    loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader(), CHECK_NULL);
+    loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader);
   } else {
     loader_data = ClassLoaderData::class_loader_data(class_loader());
   }
@@ -1067,7 +1067,7 @@
     DoObjectLock = false;
   }
 
-  ClassLoaderData* loader_data = register_loader(class_loader, CHECK_NULL);
+  ClassLoaderData* loader_data = register_loader(class_loader);
 
   // Make sure we are synchronized on the class loader before we proceed
   Handle lockObject = compute_loader_lock_object(class_loader, THREAD);
@@ -2505,11 +2505,10 @@
       }
       (*appendix_result) = Handle(THREAD, appendix);
       // the target is stored in the cpCache and if a reference to this
-      // MethodName is dropped we need a way to make sure the
+      // MemberName is dropped we need a way to make sure the
       // class_loader containing this method is kept alive.
-      // FIXME: the appendix might also preserve this dependency.
       ClassLoaderData* this_key = accessing_klass->class_loader_data();
-      this_key->record_dependency(m->method_holder(), CHECK_NULL); // Can throw OOM
+      this_key->record_dependency(m->method_holder());
       return methodHandle(THREAD, m);
     }
   }
@@ -3044,6 +3043,9 @@
       _master_dictionary(master_dictionary) {}
     void do_cld(ClassLoaderData* cld) {
       ResourceMark rm;
+      if (cld->is_anonymous()) {
+        return;
+      }
       if (cld->is_system_class_loader_data() || cld->is_platform_class_loader_data()) {
         for (int i = 0; i < cld->dictionary()->table_size(); ++i) {
           Dictionary* curr_dictionary = cld->dictionary();
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -493,7 +493,7 @@
   static void compute_java_loaders(TRAPS);
 
   // Register a new class loader
-  static ClassLoaderData* register_loader(Handle class_loader, TRAPS);
+  static ClassLoaderData* register_loader(Handle class_loader);
 protected:
   // Mirrors for primitive classes (created eagerly)
   static oop check_mirror(oop m) {
--- a/src/hotspot/share/classfile/systemDictionaryShared.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -497,7 +497,7 @@
     // Fix for 4474172; see evaluation for more details
     class_loader = Handle(
       THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader()));
-    ClassLoaderData *loader_data = register_loader(class_loader, CHECK_NULL);
+    ClassLoaderData *loader_data = register_loader(class_loader);
     Dictionary* dictionary = loader_data->dictionary();
 
     unsigned int d_hash = dictionary->compute_hash(name);
--- a/src/hotspot/share/classfile/verificationType.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/verificationType.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
 
 class ClassVerifier;
 
-class VerificationType VALUE_OBJ_CLASS_SPEC {
+class VerificationType {
   private:
     // Least significant bits of _handle are always 0, so we use these as
     // the indicator that the _handle is valid.  Otherwise, the _data field
--- a/src/hotspot/share/classfile/verifier.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/verifier.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
 #define CHECK_VERIFY_(verifier, result) \
   CHECK_(result)); if ((verifier)->has_error()) return (result); ((void)0
 
-class TypeOrigin VALUE_OBJ_CLASS_SPEC {
+class TypeOrigin {
  private:
   typedef enum {
     CF_LOCALS,  // Comes from the current frame locals
@@ -146,7 +146,7 @@
 #endif
 };
 
-class ErrorContext VALUE_OBJ_CLASS_SPEC {
+class ErrorContext {
  private:
   typedef enum {
     INVALID_BYTECODE,     // There was a problem with the bytecode
--- a/src/hotspot/share/classfile/vmSymbols.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/classfile/vmSymbols.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 #include "jvm.h"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compilerDirectives.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/metaspaceClosure.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/code/compiledIC.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/code/compiledIC.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -37,6 +37,7 @@
 #include "oops/method.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/icache.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/src/hotspot/share/code/icBuffer.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/code/icBuffer.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/mutexLocker.hpp"
--- a/src/hotspot/share/compiler/compilerDirectives.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/compiler/compilerDirectives.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 #include "compiler/abstractCompiler.hpp"
 #include "compiler/compilerDirectives.hpp"
 #include "compiler/compilerOracle.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 
 CompilerDirectives::CompilerDirectives() :_match(NULL), _next(NULL), _ref_count(0) {
--- a/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -36,7 +36,7 @@
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/share/gc/g1/concurrentMarkThread.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/g1/concurrentMarkThread.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,6 +38,7 @@
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/debug.hpp"
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -81,6 +81,7 @@
 #include "oops/oop.inline.hpp"
 #include "prims/resolvedMethodTable.hpp"
 #include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/threadSMR.hpp"
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -43,6 +43,7 @@
 #include "gc/shared/weakProcessor.hpp"
 #include "logging/log.hpp"
 #include "runtime/biasedLocking.hpp"
+#include "runtime/handles.inline.hpp"
 #include "utilities/debug.hpp"
 
 static void clear_and_activate_derived_pointers() {
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -39,6 +39,7 @@
 #include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 
 class VerifyRootsClosure: public OopClosure {
 private:
--- a/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 #include "gc/parallel/mutableNUMASpace.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/spaceDecorator.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/thread.inline.hpp"
--- a/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -51,6 +51,7 @@
 #include "logging/log.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/biasedLocking.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -61,6 +61,7 @@
 #include "oops/objArrayKlass.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -39,6 +39,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadSMR.hpp"
--- a/src/hotspot/share/gc/shared/referencePolicy.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/referencePolicy.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 #ifndef SHARE_VM_GC_SHARED_REFERENCEPOLICY_HPP
 #define SHARE_VM_GC_SHARED_REFERENCEPOLICY_HPP
 
+#include "oops/oopsHierarchy.hpp"
+
 // referencePolicy is used to determine when soft reference objects
 // should be cleared.
 
--- a/src/hotspot/share/gc/shared/referenceProcessor.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -32,7 +32,7 @@
 #include "gc/shared/referencePolicy.hpp"
 #include "gc/shared/referenceProcessor.inline.hpp"
 #include "logging/log.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,10 @@
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/referenceProcessorPhaseTimes.hpp"
 #include "gc/shared/referenceProcessor.inline.hpp"
+#include "gc/shared/workerDataArray.inline.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 
 RefProcWorkerTimeTracker::RefProcWorkerTimeTracker(ReferenceProcessorPhaseTimes::RefProcPhaseNumbers number,
                                                    ReferenceProcessorPhaseTimes* phase_times,
--- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_SHARED_REFERENCEPROCESSORPHASETIMES_HPP
 
 #include "gc/shared/referenceProcessorStats.hpp"
-#include "gc/shared/workerDataArray.inline.hpp"
+#include "gc/shared/workerDataArray.hpp"
 #include "memory/referenceType.hpp"
 #include "utilities/ticks.hpp"
 
--- a/src/hotspot/share/gc/shared/space.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/space.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -33,7 +33,7 @@
 #include "gc/shared/space.hpp"
 #include "gc/shared/space.inline.hpp"
 #include "gc/shared/spaceDecorator.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/java.hpp"
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 #include "gc/shared/threadLocalAllocBuffer.inline.hpp"
 #include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadSMR.hpp"
--- a/src/hotspot/share/interpreter/bytecode.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/interpreter/bytecode.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -129,7 +129,7 @@
 
 
 // Abstractions for lookupswitch bytecode
-class LookupswitchPair VALUE_OBJ_CLASS_SPEC {
+class LookupswitchPair {
  private:
   const address _bcp;
 
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -37,7 +37,7 @@
 #include "logging/log.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/constantPool.hpp"
 #include "oops/cpCache.inline.hpp"
 #include "oops/instanceKlass.hpp"
--- a/src/hotspot/share/interpreter/invocationCounter.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/interpreter/invocationCounter.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 // more significant bits. The counter is incremented before a method is activated and an
 // action is triggered when count() > limit().
 
-class InvocationCounter VALUE_OBJ_CLASS_SPEC {
+class InvocationCounter {
   friend class VMStructs;
   friend class JVMCIVMStructs;
   friend class ciReplay;
--- a/src/hotspot/share/interpreter/linkResolver.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/interpreter/linkResolver.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,7 +38,7 @@
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/cpCache.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/method.hpp"
--- a/src/hotspot/share/interpreter/templateInterpreter.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/interpreter/templateInterpreter.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
 // A little wrapper class to group tosca-specific entry points into a unit.
 // (tosca = Top-Of-Stack CAche)
 
-class EntryPoint VALUE_OBJ_CLASS_SPEC {
+class EntryPoint {
  private:
   address _entry[number_of_states];
 
@@ -62,7 +62,7 @@
 //------------------------------------------------------------------------------------------------------------------------
 // A little wrapper class to group tosca-specific dispatch tables into a unit.
 
-class DispatchTable VALUE_OBJ_CLASS_SPEC {
+class DispatchTable {
  public:
   enum { length = 1 << BitsPerByte };                 // an entry point for each byte value (also for undefined bytecodes)
 
--- a/src/hotspot/share/interpreter/templateTable.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/interpreter/templateTable.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
 // A Template describes the properties of a code template for a given bytecode
 // and provides a generator to generate the code template.
 
-class Template VALUE_OBJ_CLASS_SPEC {
+class Template {
  private:
   enum Flags {
     uses_bcp_bit,                                // set if template needs the bcp pointing to bytecode
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -34,6 +34,7 @@
 #include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciRuntime.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/arrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/objArrayOop.inline.hpp"
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -295,6 +295,7 @@
   NOT_PRODUCT(do_intx_flag(CompileTheWorldStopAt))                         \
   do_intx_flag(ContendedPaddingWidth)                                      \
   do_bool_flag(DontCompileHugeMethods)                                     \
+  do_bool_flag(EagerJVMCI)                                                 \
   do_bool_flag(EnableContended)                                            \
   do_intx_flag(FieldsAllocationStyle)                                      \
   do_bool_flag(FoldStableValues)                                           \
@@ -1375,53 +1376,40 @@
   return false;
 }
 
-C2V_VMENTRY(jobject, getNextStackFrame, (JNIEnv*, jobject compilerToVM, jobject hs_frame, jobjectArray methods, jint initialSkip))
+void call_interface(JavaValue* result, Klass* spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
+  CallInfo callinfo;
+  Handle receiver = args->receiver();
+  Klass* recvrKlass = receiver.is_null() ? (Klass*)NULL : receiver->klass();
+  LinkInfo link_info(spec_klass, name, signature);
+  LinkResolver::resolve_interface_call(
+          callinfo, receiver, recvrKlass, link_info, true, CHECK);
+  methodHandle method = callinfo.selected_method();
+  assert(method.not_null(), "should have thrown exception");
+
+  // Invoke the method
+  JavaCalls::call(result, method, args, CHECK);
+}
+
+C2V_VMENTRY(jobject, iterateFrames, (JNIEnv*, jobject compilerToVM, jobjectArray initial_methods, jobjectArray match_methods, jint initialSkip, jobject visitor_handle))
   ResourceMark rm;
 
-  if (!thread->has_last_Java_frame()) return NULL;
-  Handle result = HotSpotStackFrameReference::klass()->allocate_instance_handle(CHECK_NULL);
+  if (!thread->has_last_Java_frame()) {
+    return NULL;
+  }
+  Handle visitor(THREAD, JNIHandles::resolve_non_null(visitor_handle));
+  Handle frame_reference = HotSpotStackFrameReference::klass()->allocate_instance_handle(CHECK_NULL);
   HotSpotStackFrameReference::klass()->initialize(CHECK_NULL);
 
   StackFrameStream fst(thread);
-  if (hs_frame != NULL) {
-    // look for the correct stack frame if one is given
-    intptr_t* stack_pointer = (intptr_t*) HotSpotStackFrameReference::stackPointer(hs_frame);
-    while (fst.current()->sp() != stack_pointer && !fst.is_done()) {
-      fst.next();
-    }
-    if (fst.current()->sp() != stack_pointer) {
-      THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "stack frame not found")
-    }
-  }
+
+  jobjectArray methods = initial_methods;
 
   int frame_number = 0;
   vframe* vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
-  if (hs_frame != NULL) {
-    // look for the correct vframe within the stack frame if one is given
-    int last_frame_number = HotSpotStackFrameReference::frameNumber(hs_frame);
-    while (frame_number < last_frame_number) {
-      if (vf->is_top()) {
-        THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "invalid frame number")
-      }
-      vf = vf->sender();
-      frame_number ++;
-    }
-    // move one frame forward
-    if (vf->is_top()) {
-      if (fst.is_done()) {
-        return NULL;
-      }
-      fst.next();
-      vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
-      frame_number = 0;
-    } else {
-      vf = vf->sender();
-      frame_number++;
-    }
-  }
 
   while (true) {
     // look for the given method
+    bool realloc_called = false;
     while (true) {
       StackValueCollection* locals = NULL;
       if (vf->is_compiled_frame()) {
@@ -1429,13 +1417,28 @@
         compiledVFrame* cvf = compiledVFrame::cast(vf);
         if (methods == NULL || matches(methods, cvf->method())) {
           if (initialSkip > 0) {
-            initialSkip --;
+            initialSkip--;
           } else {
             ScopeDesc* scope = cvf->scope();
             // native wrappers do not have a scope
             if (scope != NULL && scope->objects() != NULL) {
-              bool realloc_failures = Deoptimization::realloc_objects(thread, fst.current(), scope->objects(), CHECK_NULL);
-              Deoptimization::reassign_fields(fst.current(), fst.register_map(), scope->objects(), realloc_failures, false);
+              GrowableArray<ScopeValue*>* objects;
+              if (!realloc_called) {
+                objects = scope->objects();
+              } else {
+                // some object might already have been re-allocated, only reallocate the non-allocated ones
+                objects = new GrowableArray<ScopeValue*>(scope->objects()->length());
+                int ii = 0;
+                for (int i = 0; i < scope->objects()->length(); i++) {
+                  ObjectValue* sv = (ObjectValue*) scope->objects()->at(i);
+                  if (sv->value().is_null()) {
+                    objects->at_put(ii++, sv);
+                  }
+                }
+              }
+              bool realloc_failures = Deoptimization::realloc_objects(thread, fst.current(), objects, CHECK_NULL);
+              Deoptimization::reassign_fields(fst.current(), fst.register_map(), objects, realloc_failures, false);
+              realloc_called = true;
 
               GrowableArray<ScopeValue*>* local_values = scope->locals();
               assert(local_values != NULL, "NULL locals");
@@ -1447,15 +1450,15 @@
                   array->bool_at_put(i, true);
                 }
               }
-              HotSpotStackFrameReference::set_localIsVirtual(result, array());
+              HotSpotStackFrameReference::set_localIsVirtual(frame_reference, array());
             } else {
-              HotSpotStackFrameReference::set_localIsVirtual(result, NULL);
+              HotSpotStackFrameReference::set_localIsVirtual(frame_reference, NULL);
             }
 
             locals = cvf->locals();
-            HotSpotStackFrameReference::set_bci(result, cvf->bci());
+            HotSpotStackFrameReference::set_bci(frame_reference, cvf->bci());
             oop method = CompilerToVM::get_jvmci_method(cvf->method(), CHECK_NULL);
-            HotSpotStackFrameReference::set_method(result, method);
+            HotSpotStackFrameReference::set_method(frame_reference, method);
           }
         }
       } else if (vf->is_interpreted_frame()) {
@@ -1463,22 +1466,23 @@
         interpretedVFrame* ivf = interpretedVFrame::cast(vf);
         if (methods == NULL || matches(methods, ivf->method())) {
           if (initialSkip > 0) {
-            initialSkip --;
+            initialSkip--;
           } else {
             locals = ivf->locals();
-            HotSpotStackFrameReference::set_bci(result, ivf->bci());
+            HotSpotStackFrameReference::set_bci(frame_reference, ivf->bci());
             oop method = CompilerToVM::get_jvmci_method(ivf->method(), CHECK_NULL);
-            HotSpotStackFrameReference::set_method(result, method);
-            HotSpotStackFrameReference::set_localIsVirtual(result, NULL);
+            HotSpotStackFrameReference::set_method(frame_reference, method);
+            HotSpotStackFrameReference::set_localIsVirtual(frame_reference, NULL);
           }
         }
       }
 
       // locals != NULL means that we found a matching frame and result is already partially initialized
       if (locals != NULL) {
-        HotSpotStackFrameReference::set_compilerToVM(result, JNIHandles::resolve(compilerToVM));
-        HotSpotStackFrameReference::set_stackPointer(result, (jlong) fst.current()->sp());
-        HotSpotStackFrameReference::set_frameNumber(result, frame_number);
+        methods = match_methods;
+        HotSpotStackFrameReference::set_compilerToVM(frame_reference, JNIHandles::resolve(compilerToVM));
+        HotSpotStackFrameReference::set_stackPointer(frame_reference, (jlong) fst.current()->sp());
+        HotSpotStackFrameReference::set_frameNumber(frame_reference, frame_number);
 
         // initialize the locals array
         objArrayOop array_oop = oopFactory::new_objectArray(locals->size(), CHECK_NULL);
@@ -1489,9 +1493,41 @@
             array->obj_at_put(i, locals->at(i)->get_obj()());
           }
         }
-        HotSpotStackFrameReference::set_locals(result, array());
+        HotSpotStackFrameReference::set_locals(frame_reference, array());
+        HotSpotStackFrameReference::set_objectsMaterialized(frame_reference, JNI_FALSE);
 
-        return JNIHandles::make_local(thread, result());
+        JavaValue result(T_OBJECT);
+        JavaCallArguments args(visitor);
+        args.push_oop(frame_reference);
+        call_interface(&result, SystemDictionary::InspectedFrameVisitor_klass(), vmSymbols::visitFrame_name(), vmSymbols::visitFrame_signature(), &args, CHECK_NULL);
+        if (result.get_jobject() != NULL) {
+          return JNIHandles::make_local(thread, (oop) result.get_jobject());
+        }
+        assert(initialSkip == 0, "There should be no match before initialSkip == 0");
+        if (HotSpotStackFrameReference::objectsMaterialized(frame_reference) == JNI_TRUE) {
+          // the frame has been deoptimized, we need to re-synchronize the frame and vframe
+          intptr_t* stack_pointer = (intptr_t*) HotSpotStackFrameReference::stackPointer(frame_reference);
+          fst = StackFrameStream(thread);
+          while (fst.current()->sp() != stack_pointer && !fst.is_done()) {
+            fst.next();
+          }
+          if (fst.current()->sp() != stack_pointer) {
+            THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "stack frame not found after deopt")
+          }
+          vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
+          if (!vf->is_compiled_frame()) {
+            THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "compiled stack frame expected")
+          }
+          for (int i = 0; i < frame_number; i++) {
+            if (vf->is_top()) {
+              THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "vframe not found after deopt")
+            }
+            vf = vf->sender();
+            assert(vf->is_compiled_frame(), "Wrong frame type");
+          }
+        }
+        frame_reference = HotSpotStackFrameReference::klass()->allocate_instance_handle(CHECK_NULL);
+        HotSpotStackFrameReference::klass()->initialize(CHECK_NULL);
       }
 
       if (vf->is_top()) {
@@ -1711,6 +1747,7 @@
       array->obj_at_put(i, locals->at(i)->get_obj()());
     }
   }
+  HotSpotStackFrameReference::set_objectsMaterialized(hs_frame, JNI_TRUE);
 C2V_END
 
 C2V_VMENTRY(void, writeDebugOutput, (JNIEnv*, jobject, jbyteArray bytes, jint offset, jint length))
@@ -1825,24 +1862,25 @@
 #define CC (char*)  /*cast a literal from (const char*)*/
 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
 
-#define STRING                "Ljava/lang/String;"
-#define OBJECT                "Ljava/lang/Object;"
-#define CLASS                 "Ljava/lang/Class;"
-#define EXECUTABLE            "Ljava/lang/reflect/Executable;"
-#define STACK_TRACE_ELEMENT   "Ljava/lang/StackTraceElement;"
-#define INSTALLED_CODE        "Ljdk/vm/ci/code/InstalledCode;"
-#define TARGET_DESCRIPTION    "Ljdk/vm/ci/code/TargetDescription;"
-#define BYTECODE_FRAME        "Ljdk/vm/ci/code/BytecodeFrame;"
-#define RESOLVED_METHOD       "Ljdk/vm/ci/meta/ResolvedJavaMethod;"
-#define HS_RESOLVED_METHOD    "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;"
-#define HS_RESOLVED_KLASS     "Ljdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl;"
-#define HS_CONSTANT_POOL      "Ljdk/vm/ci/hotspot/HotSpotConstantPool;"
-#define HS_COMPILED_CODE      "Ljdk/vm/ci/hotspot/HotSpotCompiledCode;"
-#define HS_CONFIG             "Ljdk/vm/ci/hotspot/HotSpotVMConfig;"
-#define HS_METADATA           "Ljdk/vm/ci/hotspot/HotSpotMetaData;"
-#define HS_STACK_FRAME_REF    "Ljdk/vm/ci/hotspot/HotSpotStackFrameReference;"
-#define HS_SPECULATION_LOG    "Ljdk/vm/ci/hotspot/HotSpotSpeculationLog;"
-#define METASPACE_METHOD_DATA "J"
+#define STRING                  "Ljava/lang/String;"
+#define OBJECT                  "Ljava/lang/Object;"
+#define CLASS                   "Ljava/lang/Class;"
+#define EXECUTABLE              "Ljava/lang/reflect/Executable;"
+#define STACK_TRACE_ELEMENT     "Ljava/lang/StackTraceElement;"
+#define INSTALLED_CODE          "Ljdk/vm/ci/code/InstalledCode;"
+#define TARGET_DESCRIPTION      "Ljdk/vm/ci/code/TargetDescription;"
+#define BYTECODE_FRAME          "Ljdk/vm/ci/code/BytecodeFrame;"
+#define INSPECTED_FRAME_VISITOR "Ljdk/vm/ci/code/stack/InspectedFrameVisitor;"
+#define RESOLVED_METHOD         "Ljdk/vm/ci/meta/ResolvedJavaMethod;"
+#define HS_RESOLVED_METHOD      "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;"
+#define HS_RESOLVED_KLASS       "Ljdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl;"
+#define HS_CONSTANT_POOL        "Ljdk/vm/ci/hotspot/HotSpotConstantPool;"
+#define HS_COMPILED_CODE        "Ljdk/vm/ci/hotspot/HotSpotCompiledCode;"
+#define HS_CONFIG               "Ljdk/vm/ci/hotspot/HotSpotVMConfig;"
+#define HS_METADATA             "Ljdk/vm/ci/hotspot/HotSpotMetaData;"
+#define HS_STACK_FRAME_REF      "Ljdk/vm/ci/hotspot/HotSpotStackFrameReference;"
+#define HS_SPECULATION_LOG      "Ljdk/vm/ci/hotspot/HotSpotSpeculationLog;"
+#define METASPACE_METHOD_DATA   "J"
 
 JNINativeMethod CompilerToVM::methods[] = {
   {CC "getBytecode",                                  CC "(" HS_RESOLVED_METHOD ")[B",                                                      FN_PTR(getBytecode)},
@@ -1898,7 +1936,7 @@
   {CC "isMature",                                     CC "(" METASPACE_METHOD_DATA ")Z",                                                    FN_PTR(isMature)},
   {CC "hasCompiledCodeForOSR",                        CC "(" HS_RESOLVED_METHOD "II)Z",                                                     FN_PTR(hasCompiledCodeForOSR)},
   {CC "getSymbol",                                    CC "(J)" STRING,                                                                      FN_PTR(getSymbol)},
-  {CC "getNextStackFrame",                            CC "(" HS_STACK_FRAME_REF "[" RESOLVED_METHOD "I)" HS_STACK_FRAME_REF,                FN_PTR(getNextStackFrame)},
+  {CC "iterateFrames",                                CC "([" RESOLVED_METHOD "[" RESOLVED_METHOD "I" INSPECTED_FRAME_VISITOR ")" OBJECT,   FN_PTR(iterateFrames)},
   {CC "materializeVirtualObjects",                    CC "(" HS_STACK_FRAME_REF "Z)V",                                                      FN_PTR(materializeVirtualObjects)},
   {CC "shouldDebugNonSafepoints",                     CC "()Z",                                                                             FN_PTR(shouldDebugNonSafepoints)},
   {CC "writeDebugOutput",                             CC "([BII)V",                                                                         FN_PTR(writeDebugOutput)},
--- a/src/hotspot/share/jvmci/jvmciEnv.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/jvmciEnv.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -37,7 +37,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/constantPool.inline.hpp"
 #include "oops/cpCache.inline.hpp"
 #include "oops/method.inline.hpp"
--- a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -288,6 +288,7 @@
   end_class                                                                                                                                                    \
   start_class(HotSpotStackFrameReference)                                                                                                                      \
     oop_field(HotSpotStackFrameReference, compilerToVM, "Ljdk/vm/ci/hotspot/CompilerToVM;")                                                                    \
+    boolean_field(HotSpotStackFrameReference, objectsMaterialized)                                                                                             \
     long_field(HotSpotStackFrameReference, stackPointer)                                                                                                       \
     int_field(HotSpotStackFrameReference, frameNumber)                                                                                                         \
     int_field(HotSpotStackFrameReference, bci)                                                                                                                 \
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -34,6 +34,7 @@
 #include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciEnv.hpp"
 #include "logging/log.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/jvmci/systemDictionary_jvmci.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/systemDictionary_jvmci.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -80,6 +80,7 @@
   do_klass(site_Infopoint_klass,                         jdk_vm_ci_code_site_Infopoint,                         Jvmci) \
   do_klass(site_Site_klass,                              jdk_vm_ci_code_site_Site,                              Jvmci) \
   do_klass(site_InfopointReason_klass,                   jdk_vm_ci_code_site_InfopointReason,                   Jvmci) \
+  do_klass(InspectedFrameVisitor_klass,                  jdk_vm_ci_code_stack_InspectedFrameVisitor,            Jvmci) \
   do_klass(JavaConstant_klass,                           jdk_vm_ci_meta_JavaConstant,                           Jvmci) \
   do_klass(PrimitiveConstant_klass,                      jdk_vm_ci_meta_PrimitiveConstant,                      Jvmci) \
   do_klass(RawConstant_klass,                            jdk_vm_ci_meta_RawConstant,                            Jvmci) \
--- a/src/hotspot/share/jvmci/vmSymbols_jvmci.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/jvmci/vmSymbols_jvmci.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -88,9 +88,12 @@
   template(jdk_vm_ci_code_site_ExceptionHandler,                  "jdk/vm/ci/code/site/ExceptionHandler")                  \
   template(jdk_vm_ci_code_site_Mark,                              "jdk/vm/ci/code/site/Mark")                              \
   template(jdk_vm_ci_code_site_Infopoint,                         "jdk/vm/ci/code/site/Infopoint")                         \
+  template(jdk_vm_ci_code_stack_InspectedFrameVisitor,            "jdk/vm/ci/code/stack/InspectedFrameVisitor")            \
   template(jdk_vm_ci_code_site_Site,                              "jdk/vm/ci/code/site/Site")                              \
   template(jdk_vm_ci_code_site_InfopointReason,                   "jdk/vm/ci/code/site/InfopointReason")                   \
   template(jdk_vm_ci_common_JVMCIError,                           "jdk/vm/ci/common/JVMCIError")                           \
+  template(visitFrame_name,                                       "visitFrame")                                            \
+  template(visitFrame_signature,                                  "(Ljdk/vm/ci/code/stack/InspectedFrame;)Ljava/lang/Object;") \
   template(adjustCompilationLevel_name,                           "adjustCompilationLevel")                                \
   template(adjustCompilationLevel_signature,                      "(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;ZI)I") \
   template(compileMethod_name,                                    "compileMethod")                                         \
--- a/src/hotspot/share/libadt/dict.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/libadt/dict.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 
 // Dictionaries - An Abstract Data Type
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/thread.hpp"
 
--- a/src/hotspot/share/logging/log.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/logging/log.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -110,7 +110,7 @@
 
 template <LogTagType T0, LogTagType T1 = LogTag::__NO_TAG, LogTagType T2 = LogTag::__NO_TAG, LogTagType T3 = LogTag::__NO_TAG,
           LogTagType T4 = LogTag::__NO_TAG, LogTagType GuardTag = LogTag::__NO_TAG>
-class LogImpl VALUE_OBJ_CLASS_SPEC {
+class LogImpl {
  private:
   static const size_t LogBufferSize = 512;
  public:
--- a/src/hotspot/share/logging/logDecorations.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/logging/logDecorations.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 #include "memory/allocation.hpp"
 
 // Temporary object containing the necessary data for a log call's decorations (timestamps, etc).
-class LogDecorations VALUE_OBJ_CLASS_SPEC {
+class LogDecorations {
  public:
   static const int DecorationsBufferSize = 256;
  private:
--- a/src/hotspot/share/logging/logDecorators.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/logging/logDecorators.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
 // each log message for a given output. Decorators are always prepended in the order
 // declared above. For example, logging with 'uptime, level, tags' decorators results in:
 // [0,943s][info   ][logging] message.
-class LogDecorators VALUE_OBJ_CLASS_SPEC {
+class LogDecorators {
  public:
   enum Decorator {
 #define DECORATOR(name, abbr) name##_decorator,
--- a/src/hotspot/share/logging/logMessageBuffer.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/logging/logMessageBuffer.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 class LogMessageBuffer : public StackObj {
   friend class LogMessageTest;
  protected:
-  struct LogLine VALUE_OBJ_CLASS_SPEC {
+  struct LogLine {
     LogLevelType level;
     size_t message_offset;
   };
--- a/src/hotspot/share/logging/logOutputList.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/logging/logOutputList.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 // To remove a node from the list the node must first be unlinked,
 // and the memory for that node can be freed whenever the removing
 // thread observes an active reader count of 0 (after unlinking it).
-class LogOutputList VALUE_OBJ_CLASS_SPEC {
+class LogOutputList {
  private:
   struct LogOutputNode : public CHeapObj<mtLogging> {
     LogOutput*      _value;
@@ -88,7 +88,7 @@
   // Set (add/update/remove) the output to the specified level.
   void set_output_level(LogOutput* output, LogLevelType level);
 
-  class Iterator VALUE_OBJ_CLASS_SPEC {
+  class Iterator {
     friend class LogOutputList;
    private:
     LogOutputNode*  _current;
--- a/src/hotspot/share/logging/logTagSet.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/logging/logTagSet.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
 // The tagset represents a combination of tags that occur in a log call somewhere.
 // Tagsets are created automatically by the LogTagSetMappings and should never be
 // instantiated directly somewhere else.
-class LogTagSet VALUE_OBJ_CLASS_SPEC {
+class LogTagSet {
  private:
   static LogTagSet* _list;
   static size_t _ntagsets;
--- a/src/hotspot/share/memory/allocation.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/allocation.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -196,14 +196,12 @@
 // if the superclass does not have any virtual methods or
 // instance fields. The HotSpot implementation relies on this
 // not to happen. So never make a ValueObj class a direct subclass
-// of this object, but use the VALUE_OBJ_CLASS_SPEC class instead, e.g.,
 // like this:
 //
-//   class A VALUE_OBJ_CLASS_SPEC {
+//   class A {
 //     ...
 //   }
 //
-// With gcc and possible other compilers the VALUE_OBJ_CLASS_SPEC can
 // be defined as a an empty string "".
 //
 class _ValueObj {
--- a/src/hotspot/share/memory/filemap.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/filemap.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -42,7 +42,7 @@
 
 static const int JVM_IDENT_MAX = 256;
 
-class SharedClassPathEntry VALUE_OBJ_CLASS_SPEC {
+class SharedClassPathEntry {
 protected:
   bool   _is_dir;
   time_t _timestamp;          // jar/jimage timestamp,  0 if is directory or other
--- a/src/hotspot/share/memory/freeList.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/freeList.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 class Mutex;
 
 template <class Chunk_t>
-class FreeList VALUE_OBJ_CLASS_SPEC {
+class FreeList {
   friend class CompactibleFreeListSpace;
   friend class VMStructs;
 
--- a/src/hotspot/share/memory/heap.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/heap.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 
 // Blocks
 
-class HeapBlock VALUE_OBJ_CLASS_SPEC {
+class HeapBlock {
   friend class VMStructs;
 
  public:
--- a/src/hotspot/share/memory/memRegion.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/memRegion.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
 
 class MetaWord;
 
-class MemRegion VALUE_OBJ_CLASS_SPEC {
+class MemRegion {
   friend class VMStructs;
 private:
   HeapWord* _start;
--- a/src/hotspot/share/memory/metachunk.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/metachunk.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 // Super class of Metablock and Metachunk to allow them to
 // be put on the FreeList and in the BinaryTreeDictionary.
 template <class T>
-class Metabase VALUE_OBJ_CLASS_SPEC {
+class Metabase {
   size_t _word_size;
   T*     _next;
   T*     _prev;
--- a/src/hotspot/share/memory/metaspace.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/metaspace.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -4044,7 +4044,7 @@
   }
 }
 
-class MetadataStats VALUE_OBJ_CLASS_SPEC {
+class MetadataStats {
 private:
   size_t _capacity;
   size_t _used;
@@ -4886,7 +4886,7 @@
     if (log.is_debug()) {
       if (loader_data->metaspace_or_null() != NULL) {
         LogStream ls(log.debug());
-        loader_data->dump(&ls);
+        loader_data->print_value_on(&ls);
       }
     }
     LogStream ls(log.info());
--- a/src/hotspot/share/memory/metaspaceChunkFreeListSummary.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/metaspaceChunkFreeListSummary.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 
 #include "memory/allocation.hpp"
 
-class MetaspaceChunkFreeListSummary VALUE_OBJ_CLASS_SPEC {
+class MetaspaceChunkFreeListSummary {
   size_t _num_specialized_chunks;
   size_t _num_small_chunks;
   size_t _num_medium_chunks;
--- a/src/hotspot/share/memory/metaspaceShared.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/metaspaceShared.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,7 +38,7 @@
 
 class FileMapInfo;
 
-class MetaspaceSharedStats VALUE_OBJ_CLASS_SPEC {
+class MetaspaceSharedStats {
 public:
   MetaspaceSharedStats() {
     memset(this, 0, sizeof(*this));
--- a/src/hotspot/share/memory/oopFactory.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/oopFactory.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -30,7 +30,7 @@
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceOop.hpp"
 #include "oops/objArrayOop.hpp"
--- a/src/hotspot/share/memory/universe.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/universe.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -49,7 +49,7 @@
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/constantPool.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceKlass.hpp"
@@ -460,10 +460,6 @@
     assert(i == _fullgc_alot_dummy_array->length(), "just checking");
   }
   #endif
-
-  // Initialize dependency array for null class loader
-  ClassLoaderData::the_null_class_loader_data()->init_dependencies(CHECK);
-
 }
 
 void Universe::initialize_basic_type_mirrors(TRAPS) {
--- a/src/hotspot/share/memory/universe.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/universe.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -462,8 +462,6 @@
   static bool is_module_initialized()                 { return _module_initialized; }
   static bool is_fully_initialized()                  { return _fully_initialized; }
 
-  static inline bool element_type_should_be_aligned(BasicType type);
-  static inline bool field_type_should_be_aligned(BasicType type);
   static bool        on_page_boundary(void* addr);
   static bool        should_fill_in_stack_trace(Handle throwable);
   static void check_alignment(uintx size, uintx alignment, const char* name);
--- a/src/hotspot/share/memory/universe.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1997, 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 SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
-#define SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
-
-#include "memory/universe.hpp"
-
-// Check whether an element of a typeArrayOop with the given type must be
-// aligned 0 mod 8.  The typeArrayOop itself must be aligned at least this
-// strongly.
-
-inline bool Universe::element_type_should_be_aligned(BasicType type) {
-  return type == T_DOUBLE || type == T_LONG;
-}
-
-// Check whether an object field (static/non-static) of the given type must be aligned 0 mod 8.
-
-inline bool Universe::field_type_should_be_aligned(BasicType type) {
-  return type == T_DOUBLE || type == T_LONG;
-}
-
-#endif // SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
--- a/src/hotspot/share/memory/virtualspace.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/memory/virtualspace.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 
 // ReservedSpace is a data structure for reserving a contiguous address range.
 
-class ReservedSpace VALUE_OBJ_CLASS_SPEC {
+class ReservedSpace {
   friend class VMStructs;
  protected:
   char*  _base;
@@ -133,7 +133,7 @@
 
 // VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
 
-class VirtualSpace VALUE_OBJ_CLASS_SPEC {
+class VirtualSpace {
   friend class VMStructs;
  private:
   // Reserved area
--- a/src/hotspot/share/metaprogramming/integralConstant.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/metaprogramming/integralConstant.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 // T is an integral type, and is the value_type.
 // v is an integral constant, and is the value.
 template<typename T, T v>
-struct IntegralConstant VALUE_OBJ_CLASS_SPEC {
+struct IntegralConstant {
   typedef T value_type;
   static const value_type value = v;
   typedef IntegralConstant<T, v> type;
--- a/src/hotspot/share/metaprogramming/primitiveConversions.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/metaprogramming/primitiveConversions.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,7 +104,7 @@
 
 // Give an informative error if the sizes differ.
 template<typename T, typename U>
-struct PrimitiveConversions::Cast<T, U, false> VALUE_OBJ_CLASS_SPEC {
+struct PrimitiveConversions::Cast<T, U, false> {
   STATIC_ASSERT(sizeof(T) == sizeof(U));
 };
 
@@ -113,7 +113,6 @@
 struct PrimitiveConversions::Cast<
   T, U, true,
   typename EnableIf<IsIntegral<T>::value && IsIntegral<U>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(U x) const { return cast_using_union<T>(x); }
 };
@@ -125,7 +124,6 @@
   typename EnableIf<IsIntegral<T>::value &&
                     (IsRegisteredEnum<U>::value ||
                      IsFloatingPoint<U>::value)>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(U x) const { return cast_using_union<T>(x); }
 };
@@ -137,7 +135,6 @@
   typename EnableIf<IsIntegral<U>::value &&
                     (IsRegisteredEnum<T>::value ||
                      IsFloatingPoint<T>::value)>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(U x) const { return cast_using_union<T>(x); }
 };
@@ -147,7 +144,6 @@
 struct PrimitiveConversions::Cast<
   T, U*, true,
   typename EnableIf<IsIntegral<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(U* x) const { return reinterpret_cast<T>(x); }
 };
@@ -157,7 +153,6 @@
 struct PrimitiveConversions::Cast<
   T*, U, true,
   typename EnableIf<IsIntegral<U>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T* operator()(U x) const { return reinterpret_cast<T*>(x); }
 };
--- a/src/hotspot/share/oops/accessBackend.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/accessBackend.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -130,7 +130,7 @@
   template <DecoratorSet decorators, typename T, BarrierType barrier_type>
   typename AccessFunction<decorators, T, barrier_type>::type resolve_oop_barrier();
 
-  class AccessLocker VALUE_OBJ_CLASS_SPEC {
+  class AccessLocker {
   public:
     AccessLocker();
     ~AccessLocker();
--- a/src/hotspot/share/oops/arrayKlass.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/arrayKlass.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 #include "jvmtifiles/jvmti.h"
 #include "memory/metaspaceClosure.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/arrayKlass.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/instanceKlass.hpp"
--- a/src/hotspot/share/oops/arrayOop.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/arrayOop.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_OOPS_ARRAYOOP_HPP
 #define SHARE_VM_OOPS_ARRAYOOP_HPP
 
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.hpp"
 #include "utilities/align.hpp"
 
@@ -62,6 +62,13 @@
     return (int)hs;
   }
 
+  // Check whether an element of a typeArrayOop with the given type must be
+  // aligned 0 mod 8.  The typeArrayOop itself must be aligned at least this
+  // strongly.
+  static bool element_type_should_be_aligned(BasicType type) {
+    return type == T_DOUBLE || type == T_LONG;
+  }
+
  public:
   // The _length field is not declared in C++.  It is allocated after the
   // declared nonstatic fields in arrayOopDesc if not compressed, otherwise
@@ -99,7 +106,7 @@
   // array object type.
   static int header_size(BasicType type) {
     size_t typesize_in_bytes = header_size_in_bytes();
-    return (int)(Universe::element_type_should_be_aligned(type)
+    return (int)(element_type_should_be_aligned(type)
       ? align_object_offset(typesize_in_bytes/HeapWordSize)
       : typesize_in_bytes/HeapWordSize);
   }
--- a/src/hotspot/share/oops/constMethod.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/constMethod.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,14 +88,14 @@
 
 
 // Utility class describing elements in checked exceptions table inlined in Method*.
-class CheckedExceptionElement VALUE_OBJ_CLASS_SPEC {
+class CheckedExceptionElement {
  public:
   u2 class_cp_index;
 };
 
 
 // Utility class describing elements in local variable table inlined in Method*.
-class LocalVariableTableElement VALUE_OBJ_CLASS_SPEC {
+class LocalVariableTableElement {
  public:
   u2 start_bci;
   u2 length;
@@ -106,7 +106,7 @@
 };
 
 // Utility class describing elements in exception table
-class ExceptionTableElement VALUE_OBJ_CLASS_SPEC {
+class ExceptionTableElement {
  public:
   u2 start_pc;
   u2 end_pc;
@@ -115,7 +115,7 @@
 };
 
 // Utility class describing elements in method parameters
-class MethodParametersElement VALUE_OBJ_CLASS_SPEC {
+class MethodParametersElement {
  public:
   u2 name_cp_index;
   u2 flags;
--- a/src/hotspot/share/oops/constantPool.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/constantPool.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -499,7 +499,7 @@
 
   // Make this class loader depend upon the class loader owning the class reference
   ClassLoaderData* this_key = this_cp->pool_holder()->class_loader_data();
-  this_key->record_dependency(k, CHECK_NULL); // Can throw OOM
+  this_key->record_dependency(k);
 
   // logging for class+resolve.
   if (log_is_enabled(Debug, class, resolve)){
@@ -2533,6 +2533,17 @@
 }
 
 
+SymbolHashMap::~SymbolHashMap() {
+  SymbolHashMapEntry* next;
+  for (int i = 0; i < _table_size; i++) {
+    for (SymbolHashMapEntry* cur = bucket(i); cur != NULL; cur = next) {
+      next = cur->next();
+      delete(cur);
+    }
+  }
+  FREE_C_HEAP_ARRAY(SymbolHashMapBucket, _buckets);
+}
+
 void SymbolHashMap::add_entry(Symbol* sym, u2 value) {
   char *str = sym->as_utf8();
   unsigned int hash = compute_hash(str, sym->utf8_length());
--- a/src/hotspot/share/oops/constantPool.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/constantPool.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_OOPS_CONSTANTPOOLOOP_HPP
 #define SHARE_VM_OOPS_CONSTANTPOOLOOP_HPP
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/cpCache.hpp"
 #include "oops/objArrayOop.hpp"
@@ -48,7 +48,7 @@
 
 class SymbolHashMap;
 
-class CPSlot VALUE_OBJ_CLASS_SPEC {
+class CPSlot {
  friend class ConstantPool;
   intptr_t _ptr;
   enum TagBits  {_pseudo_bit = 1};
@@ -67,7 +67,7 @@
 
 // This represents a JVM_CONSTANT_Class, JVM_CONSTANT_UnresolvedClass, or
 // JVM_CONSTANT_UnresolvedClassInError slot in the constant pool.
-class CPKlassSlot VALUE_OBJ_CLASS_SPEC {
+class CPKlassSlot {
   // cp->symbol_at(_name_index) gives the name of the class.
   int _name_index;
 
@@ -1023,16 +1023,7 @@
     return (entry == NULL) ? 0 : entry->value();
   }
 
-  ~SymbolHashMap() {
-    SymbolHashMapEntry* next;
-    for (int i = 0; i < _table_size; i++) {
-      for (SymbolHashMapEntry* cur = bucket(i); cur != NULL; cur = next) {
-        next = cur->next();
-        delete(cur);
-      }
-    }
-    FREE_C_HEAP_ARRAY(SymbolHashMapBucket, _buckets);
-  }
+  ~SymbolHashMap();
 }; // End SymbolHashMap class
 
 #endif // SHARE_VM_OOPS_CONSTANTPOOLOOP_HPP
--- a/src/hotspot/share/oops/cpCache.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/cpCache.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -32,7 +32,7 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceClosure.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/constantPool.inline.hpp"
 #include "oops/cpCache.inline.hpp"
--- a/src/hotspot/share/oops/cpCache.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/cpCache.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -129,7 +129,7 @@
 
 class CallInfo;
 
-class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
+class ConstantPoolCacheEntry {
   friend class VMStructs;
   friend class constantPoolCacheKlass;
   friend class ConstantPool;
--- a/src/hotspot/share/oops/fieldInfo.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/fieldInfo.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 // array type.  FieldInfo generally shouldn't be used directly.
 // Fields should be queried either through InstanceKlass or through
 // the various FieldStreams.
-class FieldInfo VALUE_OBJ_CLASS_SPEC {
+class FieldInfo {
   friend class fieldDescriptor;
   friend class JavaFieldStream;
   friend class ClassFileParser;
--- a/src/hotspot/share/oops/generateOopMap.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/generateOopMap.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 
 #include "interpreter/bytecodeStream.hpp"
 #include "memory/allocation.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.hpp"
 #include "oops/oopsHierarchy.hpp"
 #include "runtime/signature.hpp"
@@ -71,7 +71,7 @@
 };
 
 
-class RetTable VALUE_OBJ_CLASS_SPEC {
+class RetTable {
  private:
   RetTableEntry *_first;
   static int _init_nof_entries;
@@ -87,7 +87,7 @@
 //
 // CellTypeState
 //
-class CellTypeState VALUE_OBJ_CLASS_SPEC {
+class CellTypeState {
  private:
   unsigned int _state;
 
@@ -288,7 +288,7 @@
 //
 // Main class used to compute the pointer-maps in a Method
 //
-class GenerateOopMap VALUE_OBJ_CLASS_SPEC {
+class GenerateOopMap {
  protected:
 
   // _monitor_top is set to this constant to indicate that a monitor matching
--- a/src/hotspot/share/oops/instanceKlass.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -44,6 +44,7 @@
 #include "logging/log.hpp"
 #include "logging/logMessage.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
@@ -184,13 +185,6 @@
     return NULL;
   }
 
-  assert(ik != NULL, "invariant");
-
-  const bool publicize = !parser.is_internal();
-
-  // Add all classes to our internal class loader list here,
-  // including classes in the bootstrap (NULL) class loader.
-  loader_data->add_class(ik, publicize);
   return ik;
 }
 
--- a/src/hotspot/share/oops/instanceKlass.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/instanceKlass.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -87,9 +87,8 @@
 };
 #endif  // !PRODUCT
 
-// ValueObjs embedded in klass. Describes where oops are located in instances of
-// this klass.
-class OopMapBlock VALUE_OBJ_CLASS_SPEC {
+// Describes where oops are located in instances of this klass.
+class OopMapBlock {
  public:
   // Byte offset of the first oop mapped by this block.
   int offset() const          { return _offset; }
--- a/src/hotspot/share/oops/klassVtable.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/klassVtable.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -31,7 +31,7 @@
 #include "logging/logStream.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klassVtable.hpp"
 #include "oops/method.hpp"
--- a/src/hotspot/share/oops/klassVtable.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/klassVtable.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
 
 class vtableEntry;
 
-class klassVtable VALUE_OBJ_CLASS_SPEC {
+class klassVtable {
   Klass*       _klass;            // my klass
   int          _tableOffset;      // offset of start of vtable data within klass
   int          _length;           // length of vtable (number of entries)
@@ -188,7 +188,7 @@
 //    destination is compiled:
 //      from_compiled_code_entry_point -> nmethod entry point
 //      from_interpreter_entry_point   -> i2cadapter
-class vtableEntry VALUE_OBJ_CLASS_SPEC {
+class vtableEntry {
   friend class VMStructs;
   friend class JVMCIVMStructs;
 
@@ -234,7 +234,7 @@
 class klassItable;
 class itableMethodEntry;
 
-class itableOffsetEntry VALUE_OBJ_CLASS_SPEC {
+class itableOffsetEntry {
  private:
   Klass* _interface;
   int      _offset;
@@ -257,7 +257,7 @@
 };
 
 
-class itableMethodEntry VALUE_OBJ_CLASS_SPEC {
+class itableMethodEntry {
  private:
   Method* _method;
 
@@ -294,7 +294,7 @@
 //    -- vtable for interface 2 ---
 //    ...
 //
-class klassItable VALUE_OBJ_CLASS_SPEC {
+class klassItable {
  private:
   InstanceKlass*       _klass;             // my klass
   int                  _table_offset;      // offset of start of itable data within klass (in words)
--- a/src/hotspot/share/oops/method.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/method.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -35,6 +35,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/oopMapCache.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceClosure.hpp"
@@ -2190,8 +2191,8 @@
 }
 
 #ifndef PRODUCT
-void Method::print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) {
-  out->print_cr("jni_method_id count = %d", loader_data->jmethod_ids()->count_methods());
+void Method::print_jmethod_ids(const ClassLoaderData* loader_data, outputStream* out) {
+  out->print(" jni_method_id count = %d", loader_data->jmethod_ids()->count_methods());
 }
 #endif // PRODUCT
 
--- a/src/hotspot/share/oops/method.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/method.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -809,7 +809,7 @@
 
   // Clear methods
   static void clear_jmethod_ids(ClassLoaderData* loader_data);
-  static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
+  static void print_jmethod_ids(const ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
 
   // Get this method's jmethodID -- allocate if it doesn't exist
   jmethodID jmethod_id()                            { return method_holder()->get_jmethod_id(this); }
--- a/src/hotspot/share/oops/methodData.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/methodData.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -74,7 +74,7 @@
 // DataLayout
 //
 // Overlay for generic profiling data.
-class DataLayout VALUE_OBJ_CLASS_SPEC {
+class DataLayout {
   friend class VMStructs;
   friend class JVMCIVMStructs;
 
--- a/src/hotspot/share/oops/objArrayKlass.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/objArrayKlass.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceClosure.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/arrayKlass.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
--- a/src/hotspot/share/oops/typeArrayKlass.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/oops/typeArrayKlass.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/arrayKlass.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
--- a/src/hotspot/share/opto/library_call.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/opto/library_call.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -2578,7 +2578,8 @@
       // the one that guards them: pin the Load node
       LoadNode::ControlDependency dep = LoadNode::Pinned;
       Node* ctrl = control();
-      if (adr_type->isa_instptr()) {
+      // non volatile loads may be able to float
+      if (!need_mem_bar && adr_type->isa_instptr()) {
         assert(adr_type->meet(TypePtr::NULL_PTR) != adr_type->remove_speculative(), "should be not null");
         intptr_t offset = Type::OffsetBot;
         AddPNode::Ideal_base_and_offset(adr, &_gvn, offset);
--- a/src/hotspot/share/opto/parse2.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/opto/parse2.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -29,7 +29,7 @@
 #include "compiler/compileLog.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "opto/addnode.hpp"
 #include "opto/castnode.hpp"
--- a/src/hotspot/share/opto/parse3.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/opto/parse3.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "compiler/compileLog.hpp"
 #include "interpreter/linkResolver.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "opto/addnode.hpp"
 #include "opto/castnode.hpp"
--- a/src/hotspot/share/precompiled/precompiled.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/precompiled/precompiled.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -138,7 +138,7 @@
 # include "memory/oopFactory.hpp"
 # include "memory/resourceArea.hpp"
 # include "memory/universe.hpp"
-# include "memory/universe.inline.hpp"
+# include "memory/universe.hpp"
 # include "memory/virtualspace.hpp"
 # include "oops/array.hpp"
 # include "oops/arrayKlass.hpp"
--- a/src/hotspot/share/prims/cdsoffsets.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/cdsoffsets.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,13 @@
 #include "memory/allocation.inline.hpp"
 #include "prims/cdsoffsets.hpp"
 
+CDSOffsets::CDSOffsets(const char* name, int offset, CDSOffsets* next) {
+  _name = NEW_C_HEAP_ARRAY(char, strlen(name) + 1, mtInternal);
+  strcpy(_name, name);
+  _offset = offset;
+  _next = next;
+}
+
 CDSOffsets* CDSOffsets::_all = NULL;
 #define ADD_NEXT(list, name, value) \
   list->add_end(new CDSOffsets(name, value, NULL))
--- a/src/hotspot/share/prims/cdsoffsets.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/cdsoffsets.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 
 #ifndef SHARE_PRIMS_CDSOFFSETS_HPP
 #define SHARE_PRIMS_CDSOFFSETS_HPP
+
 class CDSOffsets: public CHeapObj<mtInternal> {
  private:
   char* _name;
@@ -31,12 +32,7 @@
   CDSOffsets* _next;
   static CDSOffsets* _all;  // sole list for cds
  public:
-  CDSOffsets(const char* name, int offset, CDSOffsets* next) {
-     _name = NEW_C_HEAP_ARRAY(char, strlen(name) + 1, mtInternal);
-     strcpy(_name, name);
-     _offset = offset;
-     _next = next;
-  }
+  CDSOffsets(const char* name, int offset, CDSOffsets* next);
 
   char* get_name() const { return _name; }
   int   get_offset() const { return _offset; }
@@ -45,4 +41,5 @@
 
   static int find_offset(const char* name);
 };
+
 #endif // SHARE_PRIMS_CDSOFFSETS_HPP
--- a/src/hotspot/share/prims/forte.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/forte.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -27,7 +27,7 @@
 #include "code/pcDesc.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "gc/shared/space.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/forte.hpp"
 #include "runtime/javaCalls.hpp"
--- a/src/hotspot/share/prims/jni.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jni.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -42,7 +42,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/arrayOop.inline.hpp"
 #include "oops/instanceKlass.hpp"
@@ -4215,25 +4215,26 @@
 
 jint JNICALL jni_DetachCurrentThread(JavaVM *vm)  {
   HOTSPOT_JNI_DETACHCURRENTTHREAD_ENTRY(vm);
-  VM_Exit::block_if_vm_exited();
 
   JNIWrapper("DetachCurrentThread");
 
   // If the thread has already been detached the operation is a no-op
   if (Thread::current_or_null() == NULL) {
-  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
+    HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
     return JNI_OK;
   }
 
+  VM_Exit::block_if_vm_exited();
+
   JavaThread* thread = JavaThread::current();
   if (thread->has_last_Java_frame()) {
-  HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN((uint32_t) JNI_ERR);
+    HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN((uint32_t) JNI_ERR);
     // Can't detach a thread that's running java, that can't work.
     return JNI_ERR;
   }
 
   // Safepoint support. Have to do call-back to safepoint code, if in the
-  // middel of a safepoint operation
+  // middle of a safepoint operation
   ThreadStateTransition::transition_from_native(thread, _thread_in_vm);
 
   // XXX: Note that JavaThread::exit() call below removes the guards on the
--- a/src/hotspot/share/prims/jniCheck.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jniCheck.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -28,6 +28,7 @@
 #include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/guardedMemory.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/prims/jvm.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvm.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -39,7 +39,7 @@
 #include "interpreter/bytecode.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceKlass.hpp"
--- a/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 #include "code/codeCache.hpp"
 #include "code/scopeDesc.hpp"
 #include "code/vtableStubs.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiCodeBlobEvents.hpp"
--- a/src/hotspot/share/prims/jvmtiEnv.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -35,7 +35,7 @@
 #include "logging/log.hpp"
 #include "logging/logConfiguration.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/prims/jvmtiEnvThreadState.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiEnvThreadState.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 // overkill as a means to get an assert and name the geater than
 // operator.  I'm trying to to rewrite everything.
 
-class JvmtiFramePop VALUE_OBJ_CLASS_SPEC {
+class JvmtiFramePop {
  private:
   // Frame number counting from BOTTOM (oldest) frame;
   // bottom frame == #0
--- a/src/hotspot/share/prims/jvmtiEventController.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiEventController.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@
 // for inlines see jvmtiEventController_inline.hpp
 //
 
-class JvmtiEventEnabled VALUE_OBJ_CLASS_SPEC {
+class JvmtiEventEnabled {
 private:
   friend class JvmtiEventControllerPrivate;
   jlong _enabled_bits;
@@ -104,7 +104,7 @@
 // for inlines see jvmtiEventController_inline.hpp
 //
 
-class JvmtiEnvThreadEventEnable VALUE_OBJ_CLASS_SPEC {
+class JvmtiEnvThreadEventEnable {
 private:
   friend class JvmtiEventControllerPrivate;
   JvmtiEventEnabled _event_user_enabled;
@@ -127,7 +127,7 @@
 // for inlines see jvmtiEventController_inline.hpp
 //
 
-class JvmtiThreadEventEnable VALUE_OBJ_CLASS_SPEC {
+class JvmtiThreadEventEnable {
 private:
   friend class JvmtiEventControllerPrivate;
   JvmtiEventEnabled _event_enabled;
@@ -148,7 +148,7 @@
 // for inlines see jvmtiEventController_inline.hpp
 //
 
-class JvmtiEnvEventEnable VALUE_OBJ_CLASS_SPEC {
+class JvmtiEnvEventEnable {
 private:
   friend class JvmtiEventControllerPrivate;
 
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -31,6 +31,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/collectedHeap.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "prims/jvmtiGetLoadedClasses.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/thread.hpp"
--- a/src/hotspot/share/prims/jvmtiImpl.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/prims/jvmtiImpl.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiImpl.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
   virtual void metadata_do(void f(Metadata*)) =0;
 };
 
-class GrowableCache VALUE_OBJ_CLASS_SPEC {
+class GrowableCache {
 
 private:
   // Object pointer passed into cache & listener functions.
@@ -451,7 +451,7 @@
  * This is currently only used for posting compiled-method-load and unload
  * events, which we don't want posted from the compiler thread.
  */
-class JvmtiDeferredEvent VALUE_OBJ_CLASS_SPEC {
+class JvmtiDeferredEvent {
   friend class JvmtiDeferredEventQueue;
  private:
   typedef enum {
--- a/src/hotspot/share/prims/jvmtiRawMonitor.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiRawMonitor.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
 #include "prims/jvmtiRawMonitor.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/interfaceSupport.hpp"
@@ -421,4 +422,3 @@
   SimpleNotify (THREAD, true) ;
   return OM_OK;
 }
-
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -37,7 +37,7 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/klassVtable.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -29,6 +29,7 @@
 #include "classfile/vmSymbols.hpp"
 #include "code/codeCache.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/arrayOop.inline.hpp"
@@ -1761,7 +1762,7 @@
 
 // Base class for all heap walk contexts. The base class maintains a flag
 // to indicate if the context is valid or not.
-class HeapWalkContext VALUE_OBJ_CLASS_SPEC {
+class HeapWalkContext {
  private:
   bool _valid;
  public:
--- a/src/hotspot/share/prims/nativeLookup.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/nativeLookup.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 #include "classfile/vmSymbols.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/prims/privilegedStack.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/prims/privilegedStack.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 #include "runtime/vframe.hpp"
 #include "utilities/growableArray.hpp"
 
-class PrivilegedElement VALUE_OBJ_CLASS_SPEC {
+class PrivilegedElement {
  private:
   Klass*    _klass;                // klass for method
   oop       _privileged_context;   // context for operation
--- a/src/hotspot/share/runtime/arguments.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/arguments.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,7 +38,7 @@
 #include "logging/logStream.hpp"
 #include "logging/logTag.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
--- a/src/hotspot/share/runtime/arguments.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/arguments.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@
 };
 
 // maintain an order of entry list of AgentLibrary
-class AgentLibraryList VALUE_OBJ_CLASS_SPEC {
+class AgentLibraryList {
  private:
   AgentLibrary*   _first;
   AgentLibrary*   _last;
--- a/src/hotspot/share/runtime/atomic.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/atomic.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -367,7 +367,6 @@
   T,
   PlatformOp,
   typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value || IsPointer<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(T const volatile* dest) const {
     // Forward to the platform handler for the size of T.
@@ -387,7 +386,6 @@
   T,
   PlatformOp,
   typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(T const volatile* dest) const {
     typedef PrimitiveConversions::Translate<T> Translator;
@@ -405,7 +403,7 @@
 // supports wide atomics, then it has to use specialization
 // of Atomic::PlatformLoad for that wider size class.
 template<size_t byte_size>
-struct Atomic::PlatformLoad VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformLoad {
   template<typename T>
   T operator()(T const volatile* dest) const {
     STATIC_ASSERT(sizeof(T) <= sizeof(void*)); // wide atomics need specialization
@@ -421,7 +419,6 @@
   T, T,
   PlatformOp,
   typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   void operator()(T new_value, T volatile* dest) const {
     // Forward to the platform handler for the size of T.
@@ -439,7 +436,6 @@
   T*, D*,
   PlatformOp,
   typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   void operator()(T* new_value, D* volatile* dest) const {
     // Allow derived to base conversion, and adding cv-qualifiers.
@@ -459,7 +455,6 @@
   T, T,
   PlatformOp,
   typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   void operator()(T new_value, T volatile* dest) const {
     typedef PrimitiveConversions::Translate<T> Translator;
@@ -477,7 +472,7 @@
 // supports wide atomics, then it has to use specialization
 // of Atomic::PlatformStore for that wider size class.
 template<size_t byte_size>
-struct Atomic::PlatformStore VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformStore {
   template<typename T>
   void operator()(T new_value,
                   T volatile* dest) const {
@@ -491,13 +486,13 @@
 // be complete.
 
 template<typename Derived>
-struct Atomic::FetchAndAdd VALUE_OBJ_CLASS_SPEC {
+struct Atomic::FetchAndAdd {
   template<typename I, typename D>
   D operator()(I add_value, D volatile* dest) const;
 };
 
 template<typename Derived>
-struct Atomic::AddAndFetch VALUE_OBJ_CLASS_SPEC {
+struct Atomic::AddAndFetch {
   template<typename I, typename D>
   D operator()(I add_value, D volatile* dest) const;
 };
@@ -541,7 +536,7 @@
 // specializations of the class.  The platform file is responsible for
 // providing those.
 template<size_t byte_size>
-struct Atomic::PlatformCmpxchg VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformCmpxchg {
   template<typename T>
   T operator()(T exchange_value,
                T volatile* dest,
@@ -552,7 +547,7 @@
 // Define the class before including platform file, which may use this
 // as a base class, requiring it be complete.  The definition is later
 // in this file, near the other definitions related to cmpxchg.
-struct Atomic::CmpxchgByteUsingInt VALUE_OBJ_CLASS_SPEC {
+struct Atomic::CmpxchgByteUsingInt {
   template<typename T>
   T operator()(T exchange_value,
                T volatile* dest,
@@ -566,7 +561,7 @@
 // specializations of the class.  The platform file is responsible for
 // providing those.
 template<size_t byte_size>
-struct Atomic::PlatformXchg VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformXchg {
   template<typename T>
   T operator()(T exchange_value,
                T volatile* dest) const;
@@ -605,7 +600,6 @@
                     IsIntegral<D>::value &&
                     (sizeof(I) <= sizeof(D)) &&
                     (IsSigned<I>::value == IsSigned<D>::value)>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   D operator()(I add_value, D volatile* dest) const {
     D addend = add_value;
@@ -617,7 +611,6 @@
 struct Atomic::AddImpl<
   I, P*,
   typename EnableIf<IsIntegral<I>::value && (sizeof(I) <= sizeof(P*))>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   P* operator()(I add_value, P* volatile* dest) const {
     STATIC_ASSERT(sizeof(intptr_t) == sizeof(P*));
@@ -640,7 +633,7 @@
 //
 // Use the ATOMIC_SHORT_PAIR macro (see macros.hpp) to get the desired alignment.
 template<>
-struct Atomic::AddImpl<short, short> VALUE_OBJ_CLASS_SPEC {
+struct Atomic::AddImpl<short, short> {
   short operator()(short add_value, short volatile* dest) const {
 #ifdef VM_LITTLE_ENDIAN
     assert((intx(dest) & 0x03) == 0x02, "wrong alignment");
@@ -707,7 +700,6 @@
 struct Atomic::CmpxchgImpl<
   T, T, T,
   typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(T exchange_value, T volatile* dest, T compare_value,
                cmpxchg_memory_order order) const {
@@ -734,7 +726,6 @@
   typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value &&
                     IsSame<typename RemoveCV<D>::type,
                            typename RemoveCV<U>::type>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   D* operator()(T* exchange_value, D* volatile* dest, U* compare_value,
                cmpxchg_memory_order order) const {
@@ -758,7 +749,6 @@
 struct Atomic::CmpxchgImpl<
   T, T, T,
   typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(T exchange_value, T volatile* dest, T compare_value,
                cmpxchg_memory_order order) const {
@@ -830,7 +820,6 @@
 struct Atomic::XchgImpl<
   T, T,
   typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(T exchange_value, T volatile* dest) const {
     // Forward to the platform handler for the size of T.
@@ -847,7 +836,6 @@
 struct Atomic::XchgImpl<
   T*, D*,
   typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   D* operator()(T* exchange_value, D* volatile* dest) const {
     // Allow derived to base conversion, and adding cv-qualifiers.
@@ -867,7 +855,6 @@
 struct Atomic::XchgImpl<
   T, T,
   typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
-  VALUE_OBJ_CLASS_SPEC
 {
   T operator()(T exchange_value, T volatile* dest) const {
     typedef PrimitiveConversions::Translate<T> Translator;
--- a/src/hotspot/share/runtime/basicLock.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/basicLock.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 #include "oops/markOop.hpp"
 #include "runtime/handles.hpp"
 
-class BasicLock VALUE_OBJ_CLASS_SPEC {
+class BasicLock {
   friend class VMStructs;
   friend class JVMCIVMStructs;
  private:
@@ -54,7 +54,7 @@
 // alignment of the embedded BasicLock objects on such machines, we
 // put the embedded BasicLock at the beginning of the struct.
 
-class BasicObjectLock VALUE_OBJ_CLASS_SPEC {
+class BasicObjectLock {
   friend class VMStructs;
  private:
   BasicLock _lock;                                    // the lock, must be double word aligned
--- a/src/hotspot/share/runtime/biasedLocking.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/biasedLocking.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,7 +108,7 @@
 // again, a bulk heap sweep.
 
 // Biased locking counters
-class BiasedLockingCounters VALUE_OBJ_CLASS_SPEC {
+class BiasedLockingCounters {
  private:
   int _total_entry_count;
   int _biased_lock_entry_count;
--- a/src/hotspot/share/runtime/extendedPC.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/extendedPC.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 // An ExtendedPC contains the _pc from a signal handler in a platform
 // independent way.
 
-class ExtendedPC VALUE_OBJ_CLASS_SPEC {
+class ExtendedPC {
  private:
   address _pc;
 
--- a/src/hotspot/share/runtime/fieldDescriptor.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/fieldDescriptor.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -26,7 +26,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/annotations.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/runtime/fieldDescriptor.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/fieldDescriptor.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 // It needs the class constant pool to work (because it only holds indices into the pool
 // rather than the actual info).
 
-class fieldDescriptor VALUE_OBJ_CLASS_SPEC {
+class fieldDescriptor {
  private:
   AccessFlags         _access_flags;
   int                 _index; // the field index
--- a/src/hotspot/share/runtime/fieldType.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/fieldType.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,14 +31,6 @@
 #include "runtime/fieldType.hpp"
 #include "runtime/signature.hpp"
 
-void FieldType::skip_optional_size(Symbol* signature, int* index) {
-  jchar c = signature->byte_at(*index);
-  while (c >= '0' && c <= '9') {
-    *index = *index + 1;
-    c = signature->byte_at(*index);
-  }
-}
-
 BasicType FieldType::basic_type(Symbol* signature) {
   return char2type(signature->byte_at(0));
 }
@@ -78,11 +70,9 @@
   assert(basic_type(signature) == T_ARRAY, "must be array");
   int index = 1;
   int dim   = 1;
-  skip_optional_size(signature, &index);
   while (signature->byte_at(index) == '[') {
     index++;
     dim++;
-    skip_optional_size(signature, &index);
   }
   ResourceMark rm;
   char *element = signature->as_C_string() + index;
--- a/src/hotspot/share/runtime/fieldType.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/fieldType.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,6 @@
 
 class FieldType: public AllStatic {
  private:
-  static void skip_optional_size(Symbol* signature, int* index);
   static bool is_valid_array_signature(Symbol* signature);
  public:
 
--- a/src/hotspot/share/runtime/frame.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/frame.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/oopMapCache.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/markOop.hpp"
 #include "oops/method.hpp"
 #include "oops/methodData.hpp"
--- a/src/hotspot/share/runtime/frame.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/frame.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 // so that one physical frame can correspond to multiple source level
 // frames because of inlining.
 
-class frame VALUE_OBJ_CLASS_SPEC {
+class frame {
  private:
   // Instance variables:
   intptr_t* _sp; // stack pointer (from Thread::last_Java_sp)
@@ -426,7 +426,7 @@
 
 #ifndef PRODUCT
 // A simple class to describe a location on the stack
-class FrameValue VALUE_OBJ_CLASS_SPEC {
+class FrameValue {
  public:
   intptr_t* location;
   char* description;
--- a/src/hotspot/share/runtime/handles.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/handles.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
 // Base class for all handles. Provides overloading of frequently
 // used operators for ease of use.
 
-class Handle VALUE_OBJ_CLASS_SPEC {
+class Handle {
  private:
   oop* _handle;
 
--- a/src/hotspot/share/runtime/handshake.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/handshake.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
 // VM thread and JavaThread are serialized with the semaphore making sure
 // the operation is only done by either VM thread on behalf of the JavaThread
 // or the JavaThread itself.
-class HandshakeState VALUE_OBJ_CLASS_SPEC {
+class HandshakeState {
   HandshakeOperation* volatile _operation;
 
   Semaphore _semaphore;
--- a/src/hotspot/share/runtime/java.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/java.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -341,7 +341,9 @@
   }
 
   if (PrintSystemDictionaryAtExit) {
+    ResourceMark rm;
     SystemDictionary::print();
+    ClassLoaderDataGraph::print();
   }
 
   if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
@@ -483,7 +485,7 @@
     Universe::print_on(&ls_info);
     if (log.is_trace()) {
       LogStream ls_trace(log.trace());
-      ClassLoaderDataGraph::dump_on(&ls_trace);
+      ClassLoaderDataGraph::print_on(&ls_trace);
     }
   }
 
--- a/src/hotspot/share/runtime/java.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/java.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
  * as defined by JEP-223, most of the code related to handle the version
  * string prior to JDK 1.6 was removed (partial initialization)
  */
-class JDK_Version VALUE_OBJ_CLASS_SPEC {
+class JDK_Version {
   friend class VMStructs;
   friend class Universe;
   friend void JDK_Version_init();
--- a/src/hotspot/share/runtime/javaCalls.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/javaCalls.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -29,7 +29,7 @@
 #include "compiler/compileBroker.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/linkResolver.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/method.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jniCheck.hpp"
--- a/src/hotspot/share/runtime/javaFrameAnchor.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/javaFrameAnchor.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 //
 class JavaThread;
 
-class JavaFrameAnchor VALUE_OBJ_CLASS_SPEC {
+class JavaFrameAnchor {
 // Too many friends...
 friend class CallNativeDirectNode;
 friend class OptoRuntime;
--- a/src/hotspot/share/runtime/orderAccess.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/orderAccess.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -296,7 +296,7 @@
 // generalized variant is used.
 
 template<size_t byte_size, ScopedFenceType type>
-struct OrderAccess::PlatformOrderedStore VALUE_OBJ_CLASS_SPEC {
+struct OrderAccess::PlatformOrderedStore {
   template <typename T>
   void operator()(T v, volatile T* p) const {
     ordered_store<T, type>(p, v);
@@ -304,7 +304,7 @@
 };
 
 template<size_t byte_size, ScopedFenceType type>
-struct OrderAccess::PlatformOrderedLoad VALUE_OBJ_CLASS_SPEC {
+struct OrderAccess::PlatformOrderedLoad {
   template <typename T>
   T operator()(const volatile T* p) const {
     return ordered_load<T, type>(p);
--- a/src/hotspot/share/runtime/os.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/os.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -245,13 +245,6 @@
   return OS_OK;
 }
 
-
-#if !defined(LINUX) && !defined(_WINDOWS)
-size_t os::committed_stack_size(address bottom, size_t size) {
-  return size;
-}
-#endif
-
 bool os::dll_build_name(char* buffer, size_t size, const char* fname) {
   int n = jio_snprintf(buffer, size, "%s%s%s", JNI_LIB_PREFIX, fname, JNI_LIB_SUFFIX);
   return (n != -1);
--- a/src/hotspot/share/runtime/os.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/os.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -271,10 +271,6 @@
   static void map_stack_shadow_pages(address sp);
   static bool stack_shadow_pages_available(Thread *thread, const methodHandle& method, address sp);
 
-  // Return size of stack that is actually committed. For Java thread, the bottom should be above
-  // guard pages (stack grows downward)
-  static size_t committed_stack_size(address bottom, size_t size);
-
   // OS interface to Virtual Memory
 
   // Return the default page size.
--- a/src/hotspot/share/runtime/perfData.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/perfData.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 #include "jvm.h"
 #include "classfile/vmSymbols.hpp"
 #include "logging/log.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
--- a/src/hotspot/share/runtime/reflection.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/reflection.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 #include "interpreter/linkResolver.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.inline.hpp"
--- a/src/hotspot/share/runtime/reflectionUtils.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/reflectionUtils.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/javaClasses.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "runtime/reflectionUtils.hpp"
 
 KlassStream::KlassStream(InstanceKlass* klass, bool local_only,
--- a/src/hotspot/share/runtime/reflectionUtils.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/reflectionUtils.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,10 +29,11 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oopsHierarchy.hpp"
-#include "runtime/handles.inline.hpp"
+#include "runtime/handles.hpp"
 #include "runtime/reflection.hpp"
 #include "utilities/accessFlags.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/growableArray.hpp"
 
 // A KlassStream is an abstract stream for streaming over self, superclasses
 // and (super)interfaces. Streaming is done in reverse order (subclasses first,
@@ -43,7 +44,7 @@
 //      ...
 //    }
 
-class KlassStream VALUE_OBJ_CLASS_SPEC {
+class KlassStream {
  protected:
   InstanceKlass*      _klass;           // current klass/interface iterated over
   InstanceKlass*      _base_klass;      // initial klass/interface to iterate over
--- a/src/hotspot/share/runtime/relocator.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/relocator.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/oopFactory.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/relocator.hpp"
--- a/src/hotspot/share/runtime/rtmLocking.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/rtmLocking.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@
 // supported for stack locks just like inflated locks.
 
 // RTM locking counters
-class RTMLockingCounters VALUE_OBJ_CLASS_SPEC {
+class RTMLockingCounters {
  private:
   uintx _total_count; // Total RTM locks count
   uintx _abort_count; // Total aborts count
--- a/src/hotspot/share/runtime/safepoint.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/safepoint.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -40,7 +40,7 @@
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/atomic.hpp"
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -41,7 +41,7 @@
 #include "logging/log.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.inline.hpp"
 #include "oops/objArrayKlass.hpp"
--- a/src/hotspot/share/runtime/signature.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/signature.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,14 +54,6 @@
   _index++;
 }
 
-
-void SignatureIterator::skip_optional_size() {
-  Symbol* sig = _signature;
-  char c = sig->byte_at(_index);
-  while ('0' <= c && c <= '9') c = sig->byte_at(++_index);
-}
-
-
 int SignatureIterator::parse_type() {
   // Note: This function could be simplified by using "return T_XXX_size;"
   //       instead of the assignment and the break statements. However, it
@@ -99,11 +91,9 @@
       break;
     case '[':
       { int begin = ++_index;
-        skip_optional_size();
         Symbol* sig = _signature;
         while (sig->byte_at(_index) == '[') {
           _index++;
-          skip_optional_size();
         }
         if (sig->byte_at(_index) == 'L') {
           while (sig->byte_at(_index++) != ';') ;
@@ -250,10 +240,8 @@
       case '[':
         {
           int begin = ++_index;
-          skip_optional_size();
           while (sig->byte_at(_index) == '[') {
             _index++;
-            skip_optional_size();
           }
           if (sig->byte_at(_index) == 'L') {
             while (sig->byte_at(_index++) != ';') ;
--- a/src/hotspot/share/runtime/signature.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/signature.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,6 @@
   BasicType    _return_type;
 
   void expect(char c);
-  void skip_optional_size();
   int  parse_type();                   // returns the parameter size in words (0 for void)
   void check_signature_end();
 
--- a/src/hotspot/share/runtime/sweeper.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/sweeper.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 #include "compiler/compileBroker.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "runtime/atomic.hpp"
--- a/src/hotspot/share/runtime/synchronizer.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/synchronizer.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "logging/log.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/padded.hpp"
 #include "memory/resourceArea.hpp"
--- a/src/hotspot/share/runtime/thread.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/thread.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -43,10 +43,11 @@
 #include "logging/log.hpp"
 #include "logging/logConfiguration.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/runtime/timer.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/timer.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 
 // Timers for simple measurement.
 
-class elapsedTimer VALUE_OBJ_CLASS_SPEC {
+class elapsedTimer {
   friend class VMStructs;
  private:
   jlong _counter;
@@ -50,7 +50,7 @@
 };
 
 // TimeStamp is used for recording when an event took place.
-class TimeStamp VALUE_OBJ_CLASS_SPEC {
+class TimeStamp {
  private:
   jlong _counter;
  public:
--- a/src/hotspot/share/runtime/vframeArray.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/runtime/vframeArray.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 #include "interpreter/interpreter.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.inline.hpp"
+#include "memory/universe.hpp"
 #include "oops/methodData.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiThreadState.hpp"
--- a/src/hotspot/share/services/allocationSite.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/allocationSite.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 
 // Allocation site represents a code path that makes a memory
 // allocation
-template <class E> class AllocationSite VALUE_OBJ_CLASS_SPEC {
+template <class E> class AllocationSite {
  private:
   NativeCallStack  _call_stack;
   E                e;
--- a/src/hotspot/share/services/attachListener.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/attachListener.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -32,6 +32,7 @@
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
--- a/src/hotspot/share/services/heapDumper.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/heapDumper.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -30,6 +30,7 @@
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
 #include "gc/shared/vmGCOperations.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
@@ -650,7 +651,7 @@
   // dump a jdouble
   static void dump_double(DumpWriter* writer, jdouble d);
   // dumps the raw value of the given field
-  static void dump_field_value(DumpWriter* writer, char type, address addr);
+  static void dump_field_value(DumpWriter* writer, char type, oop obj, int offset);
   // dumps static fields of the given class
   static void dump_static_fields(DumpWriter* writer, Klass* k);
   // dump the raw values of the instance fields of the given object
@@ -754,64 +755,59 @@
 }
 
 // dumps the raw value of the given field
-void DumperSupport::dump_field_value(DumpWriter* writer, char type, address addr) {
+void DumperSupport::dump_field_value(DumpWriter* writer, char type, oop obj, int offset) {
   switch (type) {
     case JVM_SIGNATURE_CLASS :
     case JVM_SIGNATURE_ARRAY : {
-      oop o;
-      if (UseCompressedOops) {
-        o = oopDesc::load_decode_heap_oop((narrowOop*)addr);
-      } else {
-        o = oopDesc::load_decode_heap_oop((oop*)addr);
-      }
-
-      // reflection and Unsafe classes may have a reference to a
-      // Klass* so filter it out.
+      oop o = obj->obj_field_access<ON_UNKNOWN_OOP_REF>(offset);
       assert(oopDesc::is_oop_or_null(o), "Expected an oop or NULL at " PTR_FORMAT, p2i(o));
       writer->write_objectID(o);
       break;
     }
-    case JVM_SIGNATURE_BYTE     : {
-      jbyte* b = (jbyte*)addr;
-      writer->write_u1((u1)*b);
+    case JVM_SIGNATURE_BYTE : {
+      jbyte b = obj->byte_field(offset);
+      writer->write_u1((u1)b);
       break;
     }
-    case JVM_SIGNATURE_CHAR     : {
-      jchar* c = (jchar*)addr;
-      writer->write_u2((u2)*c);
+    case JVM_SIGNATURE_CHAR : {
+      jchar c = obj->char_field(offset);
+      writer->write_u2((u2)c);
       break;
     }
     case JVM_SIGNATURE_SHORT : {
-      jshort* s = (jshort*)addr;
-      writer->write_u2((u2)*s);
+      jshort s = obj->short_field(offset);
+      writer->write_u2((u2)s);
       break;
     }
     case JVM_SIGNATURE_FLOAT : {
-      jfloat* f = (jfloat*)addr;
-      dump_float(writer, *f);
+      jfloat f = obj->float_field(offset);
+      dump_float(writer, f);
       break;
     }
     case JVM_SIGNATURE_DOUBLE : {
-      jdouble* f = (jdouble*)addr;
-      dump_double(writer, *f);
+      jdouble d = obj->double_field(offset);
+      dump_double(writer, d);
       break;
     }
     case JVM_SIGNATURE_INT : {
-      jint* i = (jint*)addr;
-      writer->write_u4((u4)*i);
+      jint i = obj->int_field(offset);
+      writer->write_u4((u4)i);
       break;
     }
-    case JVM_SIGNATURE_LONG     : {
-      jlong* l = (jlong*)addr;
-      writer->write_u8((u8)*l);
+    case JVM_SIGNATURE_LONG : {
+      jlong l = obj->long_field(offset);
+      writer->write_u8((u8)l);
       break;
     }
     case JVM_SIGNATURE_BOOLEAN : {
-      jboolean* b = (jboolean*)addr;
-      writer->write_u1((u1)*b);
+      jboolean b = obj->bool_field(offset);
+      writer->write_u1((u1)b);
       break;
     }
-    default : ShouldNotReachHere();
+    default : {
+      ShouldNotReachHere();
+      break;
+    }
   }
 }
 
@@ -893,10 +889,7 @@
       writer->write_u1(sig2tag(sig));       // type
 
       // value
-      int offset = fld.offset();
-      address addr = (address)ik->java_mirror() + offset;
-
-      dump_field_value(writer, sig->byte_at(0), addr);
+      dump_field_value(writer, sig->byte_at(0), ik->java_mirror(), fld.offset());
     }
   }
 
@@ -932,9 +925,7 @@
   for (FieldStream fld(ik, false, false); !fld.eos(); fld.next()) {
     if (!fld.access_flags().is_static()) {
       Symbol* sig = fld.signature();
-      address addr = (address)o + fld.offset();
-
-      dump_field_value(writer, sig->byte_at(0), addr);
+      dump_field_value(writer, sig->byte_at(0), o, fld.offset());
     }
   }
 }
--- a/src/hotspot/share/services/mallocTracker.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/mallocTracker.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,7 +38,7 @@
  * records total memory allocation size and number of allocations.
  * The counters are updated atomically.
  */
-class MemoryCounter VALUE_OBJ_CLASS_SPEC {
+class MemoryCounter {
  private:
   volatile size_t   _count;
   volatile size_t   _size;
@@ -89,7 +89,7 @@
  * It includes the memory acquired through os::malloc()
  * call and arena's backing memory.
  */
-class MallocMemory VALUE_OBJ_CLASS_SPEC {
+class MallocMemory {
  private:
   MemoryCounter _malloc;
   MemoryCounter _arena;
@@ -242,7 +242,7 @@
  * which ensures 8-bytes alignment on 32-bit systems and 16-bytes on 64-bit systems (Product build).
  */
 
-class MallocHeader VALUE_OBJ_CLASS_SPEC {
+class MallocHeader {
 #ifdef _LP64
   size_t           _size      : 64;
   size_t           _flags     : 8;
--- a/src/hotspot/share/services/management.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/management.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -26,6 +26,7 @@
 #include "jmm.h"
 #include "classfile/systemDictionary.hpp"
 #include "compiler/compileBroker.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/iterator.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
--- a/src/hotspot/share/services/memBaseline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/memBaseline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -42,7 +42,7 @@
 /*
  * Baseline a memory snapshot
  */
-class MemBaseline VALUE_OBJ_CLASS_SPEC {
+class MemBaseline {
  public:
   enum BaselineThreshold {
     SIZE_THRESHOLD = K        // Only allocation size over this threshold will be baselined.
--- a/src/hotspot/share/services/memTracker.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/memTracker.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -246,7 +246,7 @@
     if (addr != NULL) {
       // uses thread stack malloc slot for book keeping number of threads
       MallocMemorySummary::record_malloc(0, mtThreadStack);
-      record_virtual_memory_reserve(addr, size, CALLER_PC, mtThreadStack);
+      record_virtual_memory_reserve_and_commit(addr, size, CALLER_PC, mtThreadStack);
     }
   }
 
--- a/src/hotspot/share/services/memoryManager.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/memoryManager.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
--- a/src/hotspot/share/services/memoryUsage.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/memoryUsage.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 //     memory for memory management could be less than the amount of
 //     committed memory.  Its value may be undefined.
 
-class MemoryUsage VALUE_OBJ_CLASS_SPEC {
+class MemoryUsage {
 private:
   size_t _initSize;
   size_t _used;
--- a/src/hotspot/share/services/virtualMemoryTracker.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/virtualMemoryTracker.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -38,12 +38,6 @@
   ::new ((void*)_snapshot) VirtualMemorySnapshot();
 }
 
-void VirtualMemorySummary::snapshot(VirtualMemorySnapshot* s) {
-  // Snapshot current thread stacks
-  VirtualMemoryTracker::snapshot_thread_stacks();
-  as_snapshot()->copy_to(s);
-}
-
 SortedLinkedList<ReservedMemoryRegion, compare_reserved_region_base>* VirtualMemoryTracker::_reserved_regions;
 
 int compare_committed_region(const CommittedMemoryRegion& r1, const CommittedMemoryRegion& r2) {
@@ -292,26 +286,6 @@
   }
 }
 
-address ReservedMemoryRegion::thread_stack_uncommitted_bottom() const {
-  assert(flag() == mtThreadStack, "Only for thread stack");
-  LinkedListNode<CommittedMemoryRegion>* head = _committed_regions.head();
-  address bottom = base();
-  address top = base() + size();
-  while (head != NULL) {
-    address committed_top = head->data()->base() + head->data()->size();
-    if (committed_top < top) {
-      // committed stack guard pages, skip them
-      bottom = head->data()->base() + head->data()->size();
-      head = head->next();
-    } else {
-      assert(top == committed_top, "Sanity");
-      break;
-    }
-  }
-
-  return bottom;
-}
-
 bool VirtualMemoryTracker::initialize(NMT_TrackingLevel level) {
   if (level >= NMT_summary) {
     VirtualMemorySummary::initialize();
@@ -486,32 +460,6 @@
   }
 }
 
-// Walk all known thread stacks, snapshot their committed ranges.
-class SnapshotThreadStackWalker : public VirtualMemoryWalker {
-public:
-  SnapshotThreadStackWalker() {}
-
-  bool do_allocation_site(const ReservedMemoryRegion* rgn) {
-    if (rgn->flag() == mtThreadStack) {
-      address stack_bottom = rgn->thread_stack_uncommitted_bottom();
-      size_t stack_size = rgn->base() + rgn->size() - stack_bottom;
-      size_t committed_size = os::committed_stack_size(stack_bottom, stack_size);
-      if (committed_size > 0) {
-        ReservedMemoryRegion* region = const_cast<ReservedMemoryRegion*>(rgn);
-        NativeCallStack ncs; // empty stack
-
-        // Stack grows downward
-        region->add_committed_region(rgn->base() + rgn->size() - committed_size, committed_size, ncs);
-      }
-    }
-    return true;
-  }
-};
-
-void VirtualMemoryTracker::snapshot_thread_stacks() {
-  SnapshotThreadStackWalker walker;
-  walk_virtual_memory(&walker);
-}
 
 bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) {
   assert(_reserved_regions != NULL, "Sanity check");
--- a/src/hotspot/share/services/virtualMemoryTracker.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/virtualMemoryTracker.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -39,7 +39,7 @@
 /*
  * Virtual memory counter
  */
-class VirtualMemory VALUE_OBJ_CLASS_SPEC {
+class VirtualMemory {
  private:
   size_t     _reserved;
   size_t     _committed;
@@ -160,7 +160,9 @@
     as_snapshot()->by_type(to)->commit_memory(size);
   }
 
-  static void snapshot(VirtualMemorySnapshot* s);
+  static inline void snapshot(VirtualMemorySnapshot* s) {
+    as_snapshot()->copy_to(s);
+  }
 
   static VirtualMemorySnapshot* as_snapshot() {
     return (VirtualMemorySnapshot*)_snapshot;
@@ -175,7 +177,7 @@
 /*
  * A virtual memory region
  */
-class VirtualMemoryRegion VALUE_OBJ_CLASS_SPEC {
+class VirtualMemoryRegion {
  private:
   address      _base_address;
   size_t       _size;
@@ -334,9 +336,6 @@
     return compare(rgn) == 0;
   }
 
-  // uncommitted thread stack bottom, above guard pages if there is any.
-  address thread_stack_uncommitted_bottom() const;
-
   bool    add_committed_region(address addr, size_t size, const NativeCallStack& stack);
   bool    remove_uncommitted_region(address addr, size_t size);
 
@@ -390,7 +389,6 @@
 // Main class called from MemTracker to track virtual memory allocations, commits and releases.
 class VirtualMemoryTracker : AllStatic {
   friend class VirtualMemoryTrackerTest;
-  friend class ThreadStackTrackingTest;
 
  public:
   static bool initialize(NMT_TrackingLevel level);
@@ -410,9 +408,6 @@
 
   static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to);
 
-  // Snapshot current thread stacks
-  static void snapshot_thread_stacks();
-
  private:
   static SortedLinkedList<ReservedMemoryRegion, compare_reserved_region_base>* _reserved_regions;
 };
--- a/src/hotspot/share/services/writeableFlags.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/services/writeableFlags.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/javaClasses.hpp"
+#include "memory/allocation.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/commandLineFlagRangeList.hpp"
 #include "runtime/java.hpp"
--- a/src/hotspot/share/utilities/accessFlags.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/accessFlags.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,7 +97,7 @@
 };
 
 
-class AccessFlags VALUE_OBJ_CLASS_SPEC {
+class AccessFlags {
   friend class VMStructs;
  private:
   jint _flags;
--- a/src/hotspot/share/utilities/bitMap.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/bitMap.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 //
 // The allocation of the backing storage for the BitMap are handled by
 // the subclasses. BitMap doesn't allocate or delete backing storage.
-class BitMap VALUE_OBJ_CLASS_SPEC {
+class BitMap {
   friend class BitMap2D;
 
  public:
@@ -381,7 +381,7 @@
 };
 
 // Convenience class wrapping BitMap which provides multiple bits per slot.
-class BitMap2D VALUE_OBJ_CLASS_SPEC {
+class BitMap2D {
  public:
   typedef BitMap::idx_t idx_t;          // Type used for bit and word indices.
   typedef BitMap::bm_word_t bm_word_t;  // Element type of array that
@@ -427,7 +427,7 @@
 
 // Closure for iterating over BitMaps
 
-class BitMapClosure VALUE_OBJ_CLASS_SPEC {
+class BitMapClosure {
  public:
   // Callback when bit in map is set.  Should normally return "true";
   // return of false indicates that the bitmap iteration should terminate.
--- a/src/hotspot/share/utilities/constantTag.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/constantTag.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
 };
 
 
-class constantTag VALUE_OBJ_CLASS_SPEC {
+class constantTag {
  private:
   jbyte _tag;
  public:
--- a/src/hotspot/share/utilities/elfFile.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/elfFile.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -76,7 +76,7 @@
 class ElfFuncDescTable;
 
 // ELF section, may or may not have cached data
-class ElfSection VALUE_OBJ_CLASS_SPEC {
+class ElfSection {
 private:
   Elf_Shdr      _section_hdr;
   void*         _section_data;
--- a/src/hotspot/share/utilities/fakeRttiSupport.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/fakeRttiSupport.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
 // bound on the size of a class hierarchy this utility can be used
 // with.
 template<typename T, typename TagType>
-class FakeRttiSupport VALUE_OBJ_CLASS_SPEC {
+class FakeRttiSupport {
   friend class VMStructs;
 public:
   // Construct with the indicated concrete tag, and include the
--- a/src/hotspot/share/utilities/ostream.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/ostream.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "jvm.h"
 #include "compiler/compileLog.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/os.hpp"
--- a/src/hotspot/share/utilities/sizes.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/sizes.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
 
 #ifdef ASSERT
 
-class ByteSize VALUE_OBJ_CLASS_SPEC {
+class ByteSize {
  private:
   int _size;
 
@@ -92,7 +92,7 @@
 inline int      in_bytes(ByteSize x)  { return x._size; }
 
 
-class WordSize VALUE_OBJ_CLASS_SPEC {
+class WordSize {
  private:
   int _size;
 
--- a/src/hotspot/share/utilities/stack.inline.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/stack.inline.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_UTILITIES_STACK_INLINE_HPP
 #define SHARE_VM_UTILITIES_STACK_INLINE_HPP
 
+#include "memory/allocation.inline.hpp"
 #include "utilities/align.hpp"
 #include "utilities/stack.hpp"
 #include "utilities/copy.hpp"
--- a/src/hotspot/share/utilities/ticks.hpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/ticks.hpp	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 
 class Ticks;
 
-class Tickspan VALUE_OBJ_CLASS_SPEC {
+class Tickspan {
   friend class Ticks;
   friend Tickspan operator-(const Ticks& end, const Ticks& start);
 
@@ -53,7 +53,7 @@
 
 };
 
-class Ticks VALUE_OBJ_CLASS_SPEC {
+class Ticks {
  private:
   jlong _stamp_ticks;
 
--- a/src/hotspot/share/utilities/xmlstream.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/hotspot/share/utilities/xmlstream.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -31,6 +31,7 @@
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/deoptimization.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/vmError.hpp"
 #include "utilities/xmlstream.hpp"
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java	Fri Mar 09 12:03:20 2018 -0500
@@ -27,15 +27,16 @@
 public interface StackIntrospection {
 
     /**
-     * Accesses the current stack, providing {@link InspectedFrame}s to the visitor that can be used
-     * to inspect the stack frames' contents. Iteration continues as long as
+     * Walks the current stack, providing {@link InspectedFrame}s to the visitor that can be used to
+     * inspect the stack frame's contents. Iteration continues as long as
      * {@link InspectedFrameVisitor#visitFrame}, which is invoked for every {@link InspectedFrame},
-     * returns null. Any non-null result of the visitor indicates that frame iteration should stop.
+     * returns {@code null}. A non-null return value from {@link InspectedFrameVisitor#visitFrame}
+     * indicates that frame iteration should stop.
      *
-     * @param initialMethods if this is non-{@code null}, then the stack trace will start at these
-     *            methods
-     * @param matchingMethods if this is non-{@code null}, then only matching stack frames are
-     *            returned
+     * @param initialMethods if this is non-{@code null}, then the stack walk will start at the
+     *            first frame whose method is one of these methods.
+     * @param matchingMethods if this is non-{@code null}, then only frames whose methods are in
+     *            this array are visited
      * @param initialSkip the number of matching methods to skip (including the initial method)
      * @param visitor the visitor that is called for every matching method
      * @return the last result returned by the visitor (which is non-null to indicate that iteration
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -32,6 +32,7 @@
 import jdk.vm.ci.code.InstalledCode;
 import jdk.vm.ci.code.InvalidInstalledCodeException;
 import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.code.stack.InspectedFrameVisitor;
 import jdk.vm.ci.common.InitTimer;
 import jdk.vm.ci.common.JVMCIError;
 import jdk.vm.ci.meta.JavaType;
@@ -514,13 +515,9 @@
     native String getSymbol(long metaspaceSymbol);
 
     /**
-     * Looks for the next Java stack frame matching an entry in {@code methods}.
-     *
-     * @param frame the starting point of the search, where {@code null} refers to the topmost frame
-     * @param methods the methods to look for, where {@code null} means that any frame is returned
-     * @return the frame, or {@code null} if the end of the stack was reached during the search
+     * @see jdk.vm.ci.code.stack.StackIntrospection#iterateFrames
      */
-    native HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, ResolvedJavaMethod[] methods, int initialSkip);
+    native <T> T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor<T> visitor);
 
     /**
      * Materializes all virtual objects within {@code stackFrame} and updates its locals.
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,12 @@
         static {
             try (InitTimer t = timer("HotSpotJVMCIRuntime.<init>")) {
                 instance = new HotSpotJVMCIRuntime();
+
+                // Can only do eager initialization of the JVMCI compiler
+                // once the singleton instance is available.
+                if (instance.config.getFlag("EagerJVMCI", Boolean.class)) {
+                    instance.getCompiler();
+                }
             }
         }
     }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java	Fri Mar 09 12:03:20 2018 -0500
@@ -30,6 +30,8 @@
 public class HotSpotStackFrameReference implements InspectedFrame {
 
     private CompilerToVM compilerToVM;
+    // set in the VM when materializeVirtualObjects is called
+    @SuppressWarnings("unused") private boolean objectsMaterialized;
 
     // information used to find the stack frame
     private long stackPointer;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,14 +37,6 @@
     @Override
     public <T> T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor<T> visitor) {
         CompilerToVM compilerToVM = runtime.getCompilerToVM();
-        HotSpotStackFrameReference current = compilerToVM.getNextStackFrame(null, initialMethods, initialSkip);
-        while (current != null) {
-            T result = visitor.visitFrame(current);
-            if (result != null) {
-                return result;
-            }
-            current = compilerToVM.getNextStackFrame(current, matchingMethods, 0);
-        }
-        return null;
+        return compilerToVM.iterateFrames(initialMethods, matchingMethods, initialSkip, visitor);
     }
 }
--- a/test/hotspot/gtest/logging/logTestFixture.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ b/test/hotspot/gtest/logging/logTestFixture.cpp	Fri Mar 09 12:03:20 2018 -0500
@@ -27,6 +27,7 @@
 #include "logTestUtils.inline.hpp"
 #include "logging/logConfiguration.hpp"
 #include "logging/logOutput.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "unittest.hpp"
 #include "utilities/ostream.hpp"
--- a/test/hotspot/gtest/runtime/test_threadstack_tracking.cpp	Tue Mar 06 19:24:13 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-
-// Included early because the NMT flags don't include it.
-#include "utilities/macros.hpp"
-
-#include "runtime/thread.hpp"
-#include "services/memTracker.hpp"
-#include "services/virtualMemoryTracker.hpp"
-#include "utilities/globalDefinitions.hpp"
-#include "unittest.hpp"
-
-
-class ThreadStackTrackingTest {
-public:
-  static void test() {
-    VirtualMemoryTracker::initialize(NMT_detail);
-    VirtualMemoryTracker::late_initialize(NMT_detail);
-
-    Thread* thr = Thread::current();
-    address stack_end = thr->stack_end();
-    size_t  stack_size = thr->stack_size();
-
-    MemTracker::record_thread_stack(stack_end, stack_size);
-
-    VirtualMemoryTracker::add_reserved_region(stack_end, stack_size, CALLER_PC, mtThreadStack);
-
-    // snapshot current stack usage
-    VirtualMemoryTracker::snapshot_thread_stacks();
-
-    ReservedMemoryRegion* rmr = VirtualMemoryTracker::_reserved_regions->find(ReservedMemoryRegion(stack_end, stack_size));
-    ASSERT_TRUE(rmr != NULL);
-
-    ASSERT_EQ(rmr->base(), stack_end);
-    ASSERT_EQ(rmr->size(), stack_size);
-
-    CommittedRegionIterator iter = rmr->iterate_committed_regions();
-    int i = 0;
-    address i_addr = (address)&i;
-
-    // stack grows downward
-    address stack_top = stack_end + stack_size;
-    bool found_stack_top = false;
-
-    for (const CommittedMemoryRegion* region = iter.next(); region != NULL; region = iter.next()) {
-      if (region->base() + region->size() == stack_top) {
-        // This should be active part, "i" should be here
-        ASSERT_TRUE(i_addr < stack_top && i_addr >= region->base());
-        ASSERT_TRUE(region->size() <= stack_size);
-        found_stack_top = true;
-      }
-
-      i++;
-    }
-
-    // NMT was not turned on when the thread was created, so we don't have guard pages
-    ASSERT_TRUE(i == 1);
-    ASSERT_TRUE(found_stack_top);
-  }
-};
-
-TEST_VM(VirtualMemoryTracker, thread_stack_tracking) {
-  ThreadStackTrackingTest::test();
-}
--- a/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 import jdk.vm.ci.code.InstalledCode;
 import jdk.vm.ci.code.InvalidInstalledCodeException;
 import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.code.stack.InspectedFrameVisitor;
 import jdk.vm.ci.meta.ConstantPool;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import java.lang.reflect.Executable;
@@ -258,10 +259,12 @@
         return CTVM.getSymbol(metaspaceSymbol);
     }
 
-    public static HotSpotStackFrameReference getNextStackFrame(
-            HotSpotStackFrameReference frame,
-            ResolvedJavaMethod[] methods, int initialSkip) {
-        return CTVM.getNextStackFrame(frame, methods, initialSkip);
+    public static <T> T iterateFrames(
+            ResolvedJavaMethod[] initialMethods,
+            ResolvedJavaMethod[] matchingMethods,
+            int initialSkip,
+            InspectedFrameVisitor<T> visitor) {
+        return CTVM.iterateFrames(initialMethods, matchingMethods, initialSkip, visitor);
     }
 
     public static void materializeVirtualObjects(
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java	Tue Mar 06 19:24:13 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8136421
- * @requires vm.jvmci
- * @library / /test/lib
- * @library ../common/patches
- * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
- *          jdk.internal.vm.ci/jdk.vm.ci.code
- *          jdk.internal.vm.ci/jdk.vm.ci.meta
- * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -Djvmci.Compiler=null
- *                   compiler.jvmci.compilerToVM.GetNextStackFrameTest
- */
-
-package compiler.jvmci.compilerToVM;
-
-import compiler.jvmci.common.CTVMUtilities;
-import jdk.test.lib.Asserts;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotStackFrameReference;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
-import java.lang.reflect.Method;
-
-public class GetNextStackFrameTest {
-    private static final int RECURSION_AMOUNT = 3;
-    private static final ResolvedJavaMethod REC_FRAME_METHOD;
-    private static final ResolvedJavaMethod FRAME1_METHOD;
-    private static final ResolvedJavaMethod FRAME2_METHOD;
-    private static final ResolvedJavaMethod FRAME3_METHOD;
-    private static final ResolvedJavaMethod FRAME4_METHOD;
-    private static final ResolvedJavaMethod RUN_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> aClass = GetNextStackFrameTest.class;
-            method = aClass.getDeclaredMethod("recursiveFrame", int.class);
-            REC_FRAME_METHOD = CTVMUtilities.getResolvedMethod(method);
-            method = aClass.getDeclaredMethod("frame1");
-            FRAME1_METHOD = CTVMUtilities.getResolvedMethod(method);
-            method = aClass.getDeclaredMethod("frame2");
-            FRAME2_METHOD = CTVMUtilities.getResolvedMethod(method);
-            method = aClass.getDeclaredMethod("frame3");
-            FRAME3_METHOD = CTVMUtilities.getResolvedMethod(method);
-            method = aClass.getDeclaredMethod("frame4");
-            FRAME4_METHOD = CTVMUtilities.getResolvedMethod(method);
-            method = Thread.class.getDeclaredMethod("run");
-            RUN_METHOD = CTVMUtilities.getResolvedMethod(Thread.class, method);
-        } catch (NoSuchMethodException e) {
-            throw new Error("TEST BUG: can't find a test method : " + e, e);
-        }
-    }
-
-    public static void main(String[] args) {
-        new GetNextStackFrameTest().test();
-    }
-
-    private void test() {
-        // Create new thread to get new clean stack
-        Thread thread = new Thread(() -> recursiveFrame(RECURSION_AMOUNT));
-        thread.start();
-        try {
-            thread.join();
-        } catch (InterruptedException e) {
-            throw new Error("Interrupted while waiting to join", e);
-        }
-    }
-
-    // Helper methods for a longer stack
-    private void recursiveFrame(int recursionAmount) {
-        if (--recursionAmount != 0) {
-            recursiveFrame(recursionAmount);
-        } else {
-            frame1();
-        }
-    }
-
-    private void frame1() {
-        frame2();
-    }
-
-    private void frame2() {
-        frame3();
-    }
-
-    private void frame3() {
-        frame4();
-    }
-
-    private void frame4() {
-        check();
-    }
-
-    private void check() {
-        findFirst();
-        walkThrough();
-        skipAll();
-        findNextSkipped();
-        findYourself();
-    }
-
-    /**
-     * Finds the first topmost frame from the list of methods to search
-     */
-    private void findFirst() {
-        checkNextFrameFor(null /* topmost frame */,
-                new ResolvedJavaMethod[]
-                        {FRAME2_METHOD, FRAME3_METHOD, FRAME4_METHOD},
-                FRAME4_METHOD, 0);
-    }
-
-    /**
-     * Walks through whole stack and checks that every frame could be found
-     * while going down the stack till the end
-     */
-    private void walkThrough() {
-        // Check that we would get a frame 4 starting from the topmost frame
-        HotSpotStackFrameReference nextStackFrame = checkNextFrameFor(
-                null /* topmost frame */,
-                new ResolvedJavaMethod[] {FRAME4_METHOD},
-                FRAME4_METHOD, 0);
-        // Check that we would get a frame 3 starting from frame 4 when we try
-        // to search one of the next two frames
-        nextStackFrame = checkNextFrameFor(nextStackFrame,
-                new ResolvedJavaMethod[] {FRAME3_METHOD,
-                        FRAME2_METHOD},
-                FRAME3_METHOD, 0);
-        // Check that we would get a frame 1
-        nextStackFrame = checkNextFrameFor(nextStackFrame,
-                new ResolvedJavaMethod[] {FRAME1_METHOD},
-                FRAME1_METHOD, 0);
-        // Check that we would skip (RECURSION_AMOUNT - 1) methods and find a
-        // recursionFrame starting from frame 1
-        nextStackFrame = checkNextFrameFor(nextStackFrame,
-                new ResolvedJavaMethod[] {REC_FRAME_METHOD},
-                REC_FRAME_METHOD, RECURSION_AMOUNT - 1);
-        // Check that we would get a Thread::run method frame;
-        nextStackFrame = checkNextFrameFor(nextStackFrame,
-                new ResolvedJavaMethod[] {RUN_METHOD},
-                RUN_METHOD, 0);
-        // Check that there are no more frames after thread's run method
-        nextStackFrame = CompilerToVMHelper.getNextStackFrame(nextStackFrame,
-                null /* any */, 0);
-        Asserts.assertNull(nextStackFrame,
-                "Found stack frame after Thread::run");
-    }
-
-    /**
-     * Skips all frames to get null at the end of the stack
-     */
-    private void skipAll() {
-        // Skip all frames (stack size) + 2 (getNextStackFrame() itself
-        // and from CompilerToVMHelper)
-        int initialSkip = Thread.currentThread().getStackTrace().length + 2;
-        HotSpotStackFrameReference nextStackFrame = CompilerToVMHelper
-                .getNextStackFrame(null /* topmost frame */, null /* any */,
-                        initialSkip);
-        Asserts.assertNull(nextStackFrame, "Unexpected frame");
-    }
-
-    /**
-     * Search for any frame skipping one frame
-     */
-    private void findNextSkipped() {
-        // Get frame 4
-        HotSpotStackFrameReference nextStackFrame = CompilerToVMHelper
-                .getNextStackFrame(null /* topmost frame */,
-                        new ResolvedJavaMethod[] {FRAME4_METHOD}, 0);
-        // Get frame 2 by skipping one method starting from frame 4
-        checkNextFrameFor(nextStackFrame, null /* any */,
-                FRAME2_METHOD , 1 /* skip one */);
-    }
-
-    /**
-     * Finds test method in the stack
-     */
-    private void findYourself() {
-        Method method;
-        Class<?> aClass = CompilerToVMHelper.CompilerToVMClass();
-        try {
-            method = aClass.getDeclaredMethod(
-                    "getNextStackFrame",
-                    HotSpotStackFrameReference.class,
-                    ResolvedJavaMethod[].class,
-                    int.class);
-        } catch (NoSuchMethodException e) {
-            throw new Error("TEST BUG: can't find getNextStackFrame : " + e, e);
-        }
-        ResolvedJavaMethod self
-                = CTVMUtilities.getResolvedMethod(aClass, method);
-        checkNextFrameFor(null /* topmost frame */, null /* any */, self, 0);
-    }
-
-    /**
-     * Searches next frame and checks that it equals to expected
-     *
-     * @param currentFrame  start frame to search from
-     * @param searchMethods a list of methods to search
-     * @param expected      expected frame
-     * @param skip          amount of frames to be skipped
-     * @return frame reference
-     */
-    private HotSpotStackFrameReference checkNextFrameFor(
-            HotSpotStackFrameReference currentFrame,
-            ResolvedJavaMethod[] searchMethods,
-            ResolvedJavaMethod expected,
-            int skip) {
-        HotSpotStackFrameReference nextStackFrame = CompilerToVMHelper
-                .getNextStackFrame(currentFrame, searchMethods, skip);
-        Asserts.assertNotNull(nextStackFrame);
-        Asserts.assertTrue(nextStackFrame.isMethod(expected),
-                "Unexpected next frame: " + nextStackFrame
-                        + " from current frame: " + currentFrame);
-        return nextStackFrame;
-    }
-}
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Fri Mar 09 12:03:20 2018 -0500
@@ -34,6 +34,7 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
  *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.stack
  *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
@@ -91,6 +92,7 @@
 import compiler.testlibrary.CompilerUtils;
 import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.code.stack.InspectedFrame;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotStackFrameReference;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
@@ -200,18 +202,30 @@
         // Materialize virtual objects on last invocation
         if (iteration == COMPILE_THRESHOLD) {
             // get frames and check not-null
-            HotSpotStackFrameReference materialized = CompilerToVMHelper.getNextStackFrame(
-                    /* topmost frame */ null, new ResolvedJavaMethod[]{MATERIALIZED_RESOLVED},
-                    /* don't skip any */ 0);
+            HotSpotStackFrameReference materialized = CompilerToVMHelper.iterateFrames(
+                new ResolvedJavaMethod[] {MATERIALIZED_RESOLVED},
+                null /* any */,
+                0,
+                f -> (HotSpotStackFrameReference) f);
             Asserts.assertNotNull(materialized, getName()
                     + " : got null frame for materialized method");
-            HotSpotStackFrameReference notMaterialized = CompilerToVMHelper.getNextStackFrame(
-                    /* topmost frame */ null, new ResolvedJavaMethod[]{NOT_MATERIALIZED_RESOLVED},
-                    /* don't skip any */ 0);
+            Asserts.assertTrue(materialized.isMethod(MATERIALIZED_RESOLVED),
+                "Expected materialized method but got " + materialized);
+            InspectedFrame notMaterialized = CompilerToVMHelper.iterateFrames(
+                new ResolvedJavaMethod[] {NOT_MATERIALIZED_RESOLVED},
+                null /* any */,
+                0,
+                f -> f);
             Asserts.assertNE(materialized, notMaterialized,
                     "Got same frame pointer for both tested frames");
+            Asserts.assertTrue(notMaterialized.isMethod(NOT_MATERIALIZED_RESOLVED),
+                "Expected notMaterialized method but got " + notMaterialized);
             Asserts.assertNotNull(notMaterialized, getName()
                     + " : got null frame for not materialized method");
+            Asserts.assertTrue(WB.isMethodCompiled(MATERIALIZED_METHOD), getName()
+                + " : materialized method not compiled");
+            Asserts.assertTrue(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD),
+                getName() + " : not materialized method not compiled");
             // check that frames has virtual objects before materialization stage
             Asserts.assertTrue(materialized.hasVirtualObjects(), getName()
                     + ": materialized frame has no virtual object before materialization");
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java	Fri Mar 09 12:03:20 2018 -0500
@@ -81,7 +81,7 @@
             output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary-verbose");
             try {
                 output.shouldContain("Shared Dictionary");
-                output.shouldContain("Dictionary for class loader 0x");
+                output.shouldContain("Dictionary for loader data: 0x");
                 output.shouldContain("^java.lang.String");
             } catch (RuntimeException e) {
                 output.shouldContain("Unknown diagnostic command");
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
         pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary", "-verbose"});
         output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary");
         try {
-            output.shouldContain("Dictionary for class loader 0x");
+            output.shouldContain("Dictionary for loader data: 0x");
             output.shouldContain("^java.lang.String");
         } catch (RuntimeException e) {
             output.shouldContain("Unknown diagnostic command");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/appcds/javaldr/AnonVmClassesDuringDump.java	Fri Mar 09 12:03:20 2018 -0500
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * @test
+ * @summary When dumping the CDS archive, try to load VM anonymous classes to make sure they
+ *          are handled properly. Note: these are not "anonymous inner classes" in the Java source code,
+ *          but rather classes that are not recorded in any ClassLoaderData::dictionary(),
+ *          such as classes that are generated for Lambda expressions.
+ *          See https://blogs.oracle.com/jrose/anonymous-classes-in-the-vm.
+ * @library /test/lib /test/hotspot/jtreg/runtime/appcds /test/hotspot/jtreg/runtime/appcds/test-classes
+ * @requires vm.cds
+ * @requires vm.flavor != "minimal"
+ * @modules java.base/jdk.internal.misc
+ *          jdk.jartool/sun.tools.jar
+ *          java.management
+ * @build AnonVmClassesDuringDumpTransformer Hello
+ * @run main/othervm AnonVmClassesDuringDump
+ */
+
+public class AnonVmClassesDuringDump {
+    public static String appClasses[] = {
+        "Hello",
+    };
+    public static String agentClasses[] = {
+        "AnonVmClassesDuringDumpTransformer",
+    };
+
+    public static void main(String[] args) throws Throwable {
+        String agentJar =
+            ClassFileInstaller.writeJar("AnonVmClassesDuringDumpTransformer.jar",
+                                        ClassFileInstaller.Manifest.fromSourceFile("AnonVmClassesDuringDumpTransformer.mf"),
+                                        agentClasses);
+
+        String appJar =
+            ClassFileInstaller.writeJar("AnonVmClassesDuringDumpApp.jar", appClasses);
+
+        TestCommon.testDump(appJar, TestCommon.list("Hello"),
+                            "-javaagent:" + agentJar,
+                            // Set the following property to see logs for dynamically generated classes
+                            // in STDOUT
+                            "-Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true");
+        TestCommon.run("-cp", appJar, "Hello")
+            .assertNormalExit();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/appcds/javaldr/AnonVmClassesDuringDumpTransformer.java	Fri Mar 09 12:03:20 2018 -0500
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+import java.lang.instrument.ClassFileTransformer;
+import java.lang.instrument.Instrumentation;
+import java.lang.instrument.IllegalClassFormatException;
+import java.security.ProtectionDomain;
+
+public class AnonVmClassesDuringDumpTransformer implements ClassFileTransformer {
+    public byte[] transform(ClassLoader loader, String name, Class<?> classBeingRedefined,
+                            ProtectionDomain pd, byte[] buffer) throws IllegalClassFormatException {
+        return null;
+    }
+
+    private static Instrumentation savedInstrumentation;
+
+    public static void premain(String agentArguments, Instrumentation instrumentation) {
+        System.out.println("ClassFileTransformer.premain() is called");
+        instrumentation.addTransformer(new AnonVmClassesDuringDumpTransformer(), /*canRetransform=*/true);
+        savedInstrumentation = instrumentation;
+
+        // This will create a Lambda, which will result in some Anonymous VM Classes
+        // being generated.
+        //
+        // Look for something like these in the STDOUT:
+        // ----------------
+        // ClassFileTransformer.premain() is called
+        // Dumping class files to DUMP_CLASS_FILES/...
+        // dump: DUMP_CLASS_FILES/java/lang/invoke/LambdaForm$MH000.class
+        // dump: DUMP_CLASS_FILES/java/lang/invoke/LambdaForm$MH001.class
+        // Invoked inside a Lambda
+        // ----------------
+        Runnable r = () -> {
+            System.out.println("Invoked inside a Lambda");
+        };
+        r.run();
+    }
+
+    public static Instrumentation getInstrumentation() {
+        return savedInstrumentation;
+    }
+
+    public static void agentmain(String args, Instrumentation inst) throws Exception {
+        premain(args, inst);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/appcds/javaldr/AnonVmClassesDuringDumpTransformer.mf	Fri Mar 09 12:03:20 2018 -0500
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Premain-Class: AnonVmClassesDuringDumpTransformer
+Agent-Class: AnonVmClassesDuringDumpTransformer
+Can-Retransform-Classes: true
+Can-Redefine-Classes: true
--- a/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java	Tue Mar 06 19:24:13 2018 +0100
+++ b/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java	Fri Mar 09 12:03:20 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@
 
         //  -Xlog:class+loader+data=trace
         pb = exec("-Xlog:class+loader+data=trace");
-        checkFor("[class,loader,data]", "create class loader data");
+        checkFor("[class,loader,data]", "create loader data");
 
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java	Fri Mar 09 12:03:20 2018 -0500
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8199137
+ * @summary VerifyStringTableAtExit should not crash
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ * @run main StringTableVerifyTest
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+public class StringTableVerifyTest {
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStringTableAtExit", "-version");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+    }
+}
+