Merge
authoramurillo
Fri, 20 Feb 2015 14:14:08 -0800
changeset 29090 bf691f42c812
parent 29057 d6224d602145 (current diff)
parent 29089 c3404869ce6e (diff)
child 29091 9bbd69ad1f34
child 29193 3ede621e9262
child 29198 c1e6bf2dad41
child 29209 905a4254b6dd
child 29341 dedd5ddb0f95
Merge
hotspot/src/share/vm/oops/oop.inline2.hpp
--- a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -32,7 +32,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_ppc.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 #define __ masm.
 
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -29,6 +29,7 @@
 #include "interp_masm_ppc_64.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "prims/jvmtiThreadState.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #ifdef PRODUCT
 #define BLOCK_COMMENT(str) // nothing
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -33,6 +33,7 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 
 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
--- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -30,7 +30,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_sparc.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
 #ifdef _LP64
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -2943,24 +2943,14 @@
       }
 
       bind   (IsInflated);
-      if (EmitSync & 64) {
-         // If m->owner != null goto IsLocked
-         // Test-and-CAS vs CAS
-         // Pessimistic form avoids futile (doomed) CAS attempts
-         // The optimistic form avoids RTS->RTO cache line upgrades.
-         ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rscratch);
-         andcc(Rscratch, Rscratch, G0);
-         brx(Assembler::notZero, false, Assembler::pn, done);
-         delayed()->nop();
-         // m->owner == null : it's unlocked.
-      }
 
       // Try to CAS m->owner from null to Self
       // Invariant: if we acquire the lock then _recursions should be 0.
       add(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rmark);
       mov(G2_thread, Rscratch);
       cas_ptr(Rmark, G0, Rscratch);
-      cmp(Rscratch, G0);
+      andcc(Rscratch, Rscratch, G0);             // set ICCs for done: icc.zf iff success
+      // set icc.zf : 1=success 0=failure
       // ST box->displaced_header = NonZero.
       // Any non-zero value suffices:
       //    markOopDesc::unused_mark(), G2_thread, RBox, RScratch, rsp, etc.
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -33,6 +33,7 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 
 int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) {
--- a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,7 +31,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_x86.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   return NativeMovConstReg::instruction_size +
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1718,27 +1718,6 @@
       // Force all sync thru slow-path: slow_enter() and slow_exit()
       movptr (Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark()));
       cmpptr (rsp, (int32_t)NULL_WORD);
-  } else
-  if (EmitSync & 2) {
-      Label DONE_LABEL ;
-      if (UseBiasedLocking) {
-         // Note: tmpReg maps to the swap_reg argument and scrReg to the tmp_reg argument.
-         biased_locking_enter(boxReg, objReg, tmpReg, scrReg, false, DONE_LABEL, NULL, counters);
-      }
-
-      movptr(tmpReg, Address(objReg, 0));           // fetch markword
-      orptr (tmpReg, 0x1);
-      movptr(Address(boxReg, 0), tmpReg);           // Anticipate successful CAS
-      if (os::is_MP()) {
-        lock();
-      }
-      cmpxchgptr(boxReg, Address(objReg, 0));       // Updates tmpReg
-      jccb(Assembler::equal, DONE_LABEL);
-      // Recursive locking
-      subptr(tmpReg, rsp);
-      andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) );
-      movptr(Address(boxReg, 0), tmpReg);
-      bind(DONE_LABEL);
   } else {
     // Possible cases that we'll encounter in fast_lock
     // ------------------------------------------------
@@ -1923,29 +1902,19 @@
     }
 #else // _LP64
     // It's inflated
-
-    // TODO: someday avoid the ST-before-CAS penalty by
-    // relocating (deferring) the following ST.
-    // We should also think about trying a CAS without having
-    // fetched _owner.  If the CAS is successful we may
-    // avoid an RTO->RTS upgrade on the $line.
-
-    // Without cast to int32_t a movptr will destroy r10 which is typically obj
-    movptr(Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark()));
-
-    movptr (boxReg, tmpReg);
-    movptr(tmpReg, Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
-    testptr(tmpReg, tmpReg);
-    jccb   (Assembler::notZero, DONE_LABEL);
-
-    // It's inflated and appears unlocked
+    movq(scrReg, tmpReg);
+    xorq(tmpReg, tmpReg);
+
     if (os::is_MP()) {
       lock();
     }
-    cmpxchgptr(r15_thread, Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
+    cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
+    // Unconditionally set box->_displaced_header = markOopDesc::unused_mark().
+    // Without cast to int32_t movptr will destroy r10 which is typically obj.
+    movptr(Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark()));
     // Intentional fall-through into DONE_LABEL ...
+    // Propagate ICC.ZF from CAS above into DONE_LABEL.
 #endif // _LP64
-
 #if INCLUDE_RTM_OPT
     } // use_rtm()
 #endif
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -32,7 +32,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_zero.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   // NB set this once the functions below are implemented
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -24,12 +24,12 @@
 
 /**
  * A SAX based parser of LogCompilation output from HotSpot.  It takes a complete
- * @author never
  */
 
 package com.sun.hotspot.tools.compiler;
 
 import java.io.FileReader;
+import java.io.PrintStream;
 import java.io.Reader;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -134,6 +134,44 @@
         }
     };
 
+    class Jvms {
+        Jvms(Method method, int bci) {
+            this.method = method;
+            this.bci = bci;
+        }
+        final public Method method;
+        final public int bci;
+        final public String toString() {
+            return "@" + bci + " " + method;
+        }
+    }
+
+    class LockElimination extends BasicLogEvent {
+
+        ArrayList<Jvms> jvms = new ArrayList<Jvms>(1);
+        final String kind;
+        final String classId;
+        final String tagName;
+        LockElimination(String tagName, double start, String id, String kind, String classId) {
+            super(start, id);
+            this.kind = kind;
+            this.classId = classId;
+            this.tagName = tagName;
+        }
+
+        @Override
+        public void print(PrintStream stream) {
+            stream.printf("%s %s %s %s  %.3f ", getId(), tagName, kind, classId, getStart());
+            stream.print(jvms.toString());
+            stream.print("\n");
+        }
+
+        void addJVMS(Method method, int bci) {
+            jvms.add(new Jvms(method, bci));
+        }
+
+    }
+
     private ArrayList<LogEvent> events = new ArrayList<LogEvent>();
 
     private HashMap<String, String> types = new HashMap<String, String>();
@@ -147,6 +185,7 @@
     private CallSite site;
     private CallSite methodHandleSite;
     private Stack<Phase> phaseStack = new Stack<Phase>();
+    private LockElimination currentLockElimination;
     private UncommonTrapEvent currentTrap;
     private Stack<CallSite> lateInlineScope;
     private boolean lateInlining;
@@ -192,7 +231,12 @@
         }
 
         LogParser log = new LogParser();
-        p.parse(new InputSource(reader), log);
+        try {
+            p.parse(new InputSource(reader), log);
+        } catch (Throwable th) {
+            th.printStackTrace();
+            // Carry on with what we've got...
+        }
 
         // Associate compilations with their NMethods
         for (NMethod nm : log.nmethods.values()) {
@@ -418,8 +462,23 @@
                 // uncommon trap inserted during parsing.
                 // ignore for now
             }
+        } else if (qname.startsWith("eliminate_lock")) {
+            String id = atts.getValue("compile_id");
+            if (id != null) {
+                id = makeId(atts);
+                String kind = atts.getValue("kind");
+                String classId = atts.getValue("class_id");
+                currentLockElimination = new LockElimination(qname, Double.parseDouble(search(atts, "stamp")), id, kind, classId);
+                events.add(currentLockElimination);
+            }
         } else if (qname.equals("late_inline")) {
-            long inlineId = Long.parseLong(search(atts, "inline_id"));
+            long inlineId = 0;
+            try {
+                Long.parseLong(search(atts, "inline_id"));
+            } catch (InternalError ex) {
+                // Log files from older hotspots may lack inline_id,
+                // and zero is an acceptable substitute that allows processing to continue.
+            }
             lateInlineScope = new Stack<CallSite>();
             site = new CallSite(-999, method(search(atts, "method")));
             site.setInlineId(inlineId);
@@ -428,13 +487,14 @@
             // <jvms bci='4' method='java/io/DataInputStream readChar ()C' bytes='40' count='5815' iicount='20815'/>
             if (currentTrap != null) {
                 currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
+            } else if (currentLockElimination != null) {
+                  currentLockElimination.addJVMS(method(atts.getValue("method")), Integer.parseInt(atts.getValue("bci")));
             } else if (lateInlineScope != null) {
                 bci = Integer.parseInt(search(atts, "bci"));
                 site = new CallSite(bci, method(search(atts, "method")));
                 lateInlineScope.push(site);
             } else {
                 // Ignore <eliminate_allocation type='667'>,
-                //        <eliminate_lock lock='1'>,
                 //        <replace_string_concat arguments='2' string_alloc='0' multiple='0'>
             }
         } else if (qname.equals("inline_id")) {
@@ -512,6 +572,8 @@
             }
         } else if (qname.equals("uncommon_trap")) {
             currentTrap = null;
+        } else if (qname.startsWith("eliminate_lock")) {
+            currentLockElimination = null;
         } else if (qname.equals("late_inline")) {
             // Populate late inlining info.
             if (scopes.size() != 0) {
@@ -522,8 +584,8 @@
             CallSite caller = lateInlineScope.pop();
             Method m = compile.getMethod();
             if (m != caller.getMethod()) {
-                System.out.println(m);
-                System.out.println(caller.getMethod() + " bci: " + bci);
+                System.err.println(m);
+                System.err.println(caller.getMethod() + " bci: " + bci);
                 throw new InternalError("call site and late_inline info don't match");
             }
 
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -50,7 +50,7 @@
     }
 
     public void print(PrintStream stream) {
-        stream.printf("%s uncommon trap %s %s\n", getId(), getReason(), getAction());
+        stream.printf("%s uncommon trap %.3f %s %s\n", getId(), getStart(), getReason(), getAction());
         stream.print(getJvms());
     }
 
--- a/hotspot/src/share/vm/adlc/main.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/adlc/main.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -220,7 +220,6 @@
   AD.addInclude(AD._CPP_file, "oops/markOop.hpp");
   AD.addInclude(AD._CPP_file, "oops/method.hpp");
   AD.addInclude(AD._CPP_file, "oops/oop.inline.hpp");
-  AD.addInclude(AD._CPP_file, "oops/oop.inline2.hpp");
   AD.addInclude(AD._CPP_file, "opto/cfgnode.hpp");
   AD.addInclude(AD._CPP_file, "opto/locknode.hpp");
   AD.addInclude(AD._CPP_file, "opto/opcodes.hpp");
--- a/hotspot/src/share/vm/c1/c1_Compilation.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,12 +29,12 @@
 #include "c1/c1_LIRAssembler.hpp"
 #include "c1/c1_LinearScan.hpp"
 #include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_RangeCheckElimination.hpp"
 #include "c1/c1_ValueMap.hpp"
 #include "c1/c1_ValueStack.hpp"
 #include "code/debugInfoRec.hpp"
 #include "compiler/compileLog.hpp"
-#include "c1/c1_RangeCheckElimination.hpp"
-
+#include "runtime/sharedRuntime.hpp"
 
 typedef enum {
   _t_compile,
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -34,6 +34,7 @@
 #include "ci/ciMemberName.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/bytecode.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/vm_version.hpp"
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -32,6 +32,7 @@
 #include "ci/ciArrayKlass.hpp"
 #include "ci/ciInstance.hpp"
 #include "ci/ciObjArray.hpp"
+#include "memory/cardTableModRefBS.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -29,6 +29,7 @@
 #include "ci/ciMethodBlocks.hpp"
 #include "ci/ciStreams.hpp"
 #include "interpreter/bytecode.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 
 
--- a/hotspot/src/share/vm/ci/ciArray.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciArray.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,7 +28,8 @@
 #include "ci/ciConstant.hpp"
 #include "ci/ciKlass.hpp"
 #include "ci/ciUtilities.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.hpp"
 
 // ciArray
--- a/hotspot/src/share/vm/ci/ciBaseObject.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciBaseObject.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, 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
@@ -26,7 +26,6 @@
 #include "ci/ciBaseObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 // ------------------------------------------------------------------
 // ciBaseObject::set_ident
--- a/hotspot/src/share/vm/ci/ciCallSite.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciCallSite.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "ci/ciCallSite.hpp"
 #include "ci/ciUtilities.hpp"
 
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -46,8 +46,8 @@
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/init.hpp"
 #include "runtime/reflection.hpp"
--- a/hotspot/src/share/vm/ci/ciField.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -31,7 +31,6 @@
 #include "interpreter/linkResolver.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/fieldDescriptor.hpp"
 
 // ciField
--- a/hotspot/src/share/vm/ci/ciInstance.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciInstance.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,6 +27,7 @@
 
 #include "ci/ciObject.hpp"
 #include "oops/instanceOop.hpp"
+#include "oops/oop.hpp"
 
 // ciInstance
 //
--- a/hotspot/src/share/vm/ci/ciMetadata.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciMetadata.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,6 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 // ------------------------------------------------------------------
 // ciMetadata::print
--- a/hotspot/src/share/vm/ci/ciMethodData.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciMethodData.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -30,7 +30,7 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "oops/methodData.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "runtime/deoptimization.hpp"
 
 class ciBitData;
--- a/hotspot/src/share/vm/ci/ciObjArray.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciObjArray.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,7 @@
 #include "ci/ciNullObject.hpp"
 #include "ci/ciObjArray.hpp"
 #include "ci/ciUtilities.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 
 // ciObjArray
 //
--- a/hotspot/src/share/vm/ci/ciObject.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciObject.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,7 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/oop.inline.hpp"
 
 // ciObject
 //
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -40,11 +40,11 @@
 #include "ci/ciTypeArray.hpp"
 #include "ci/ciTypeArrayKlass.hpp"
 #include "ci/ciUtilities.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/fieldType.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/ci/ciReplay.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 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
@@ -31,6 +31,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -35,6 +35,7 @@
 #include "interpreter/bytecode.hpp"
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "opto/compile.hpp"
 #include "opto/node.hpp"
 #include "runtime/deoptimization.hpp"
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -25,10 +25,9 @@
 #include "precompiled.hpp"
 #include "classfile/classFileParser.hpp"
 #include "classfile/classLoader.hpp"
-#include "classfile/classLoaderData.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/defaultMethods.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/verificationType.hpp"
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -27,9 +27,7 @@
 
 #include "classfile/classFileStream.hpp"
 #include "memory/resourceArea.hpp"
-#include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.hpp"
-#include "runtime/handles.inline.hpp"
 #include "utilities/accessFlags.hpp"
 #include "classfile/symbolTable.hpp"
 
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -152,40 +152,6 @@
 }
 
 
-MetaIndex::MetaIndex(char** meta_package_names, int num_meta_package_names) {
-  if (num_meta_package_names == 0) {
-    _meta_package_names = NULL;
-    _num_meta_package_names = 0;
-  } else {
-    _meta_package_names = NEW_C_HEAP_ARRAY(char*, num_meta_package_names, mtClass);
-    _num_meta_package_names = num_meta_package_names;
-    memcpy(_meta_package_names, meta_package_names, num_meta_package_names * sizeof(char*));
-  }
-}
-
-
-MetaIndex::~MetaIndex() {
-  FREE_C_HEAP_ARRAY(char*, _meta_package_names);
-}
-
-
-bool MetaIndex::may_contain(const char* class_name) {
-  if ( _num_meta_package_names == 0) {
-    return false;
-  }
-  size_t class_name_len = strlen(class_name);
-  for (int i = 0; i < _num_meta_package_names; i++) {
-    char* pkg = _meta_package_names[i];
-    size_t pkg_len = strlen(pkg);
-    size_t min_len = MIN2(class_name_len, pkg_len);
-    if (!strncmp(class_name, pkg, min_len)) {
-      return true;
-    }
-  }
-  return false;
-}
-
-
 ClassPathEntry::ClassPathEntry() {
   set_next(NULL);
 }
@@ -315,7 +281,6 @@
 LazyClassPathEntry::LazyClassPathEntry(const char* path, const struct stat* st, bool throw_exception) : ClassPathEntry() {
   _path = os::strdup_check_oom(path);
   _st = *st;
-  _meta_index = NULL;
   _resolved_entry = NULL;
   _has_error = false;
   _throw_exception = throw_exception;
@@ -354,10 +319,6 @@
 }
 
 ClassFileStream* LazyClassPathEntry::open_stream(const char* name, TRAPS) {
-  if (_meta_index != NULL &&
-      !_meta_index->may_contain(name)) {
-    return NULL;
-  }
   if (_has_error) {
     return NULL;
   }
@@ -463,16 +424,6 @@
 }
 #endif
 
-static void print_meta_index(LazyClassPathEntry* entry,
-                             GrowableArray<char*>& meta_packages) {
-  tty->print("[Meta index for %s=", entry->name());
-  for (int i = 0; i < meta_packages.length(); i++) {
-    if (i > 0) tty->print(" ");
-    tty->print("%s", meta_packages.at(i));
-  }
-  tty->print_cr("]");
-}
-
 #if INCLUDE_CDS
 void ClassLoader::exit_with_path_failure(const char* error, const char* message) {
   assert(DumpSharedSpaces, "only called at dump time");
@@ -508,123 +459,6 @@
   }
 }
 
-void ClassLoader::setup_bootstrap_meta_index() {
-  // Set up meta index which allows us to open boot jars lazily if
-  // class data sharing is enabled
-  const char* meta_index_path = Arguments::get_meta_index_path();
-  const char* meta_index_dir  = Arguments::get_meta_index_dir();
-  setup_meta_index(meta_index_path, meta_index_dir, 0);
-}
-
-void ClassLoader::setup_meta_index(const char* meta_index_path, const char* meta_index_dir, int start_index) {
-  const char* known_version = "% VERSION 2";
-  FILE* file = fopen(meta_index_path, "r");
-  int line_no = 0;
-#if INCLUDE_CDS
-  if (DumpSharedSpaces) {
-    if (file != NULL) {
-      _shared_paths_misc_info->add_required_file(meta_index_path);
-    } else {
-      _shared_paths_misc_info->add_nonexist_path(meta_index_path);
-    }
-  }
-#endif
-  if (file != NULL) {
-    ResourceMark rm;
-    LazyClassPathEntry* cur_entry = NULL;
-    GrowableArray<char*> boot_class_path_packages(10);
-    char package_name[256];
-    bool skipCurrentJar = false;
-    while (fgets(package_name, sizeof(package_name), file) != NULL) {
-      ++line_no;
-      // Remove trailing newline
-      package_name[strlen(package_name) - 1] = '\0';
-      switch(package_name[0]) {
-        case '%':
-        {
-          if ((line_no == 1) && (strcmp(package_name, known_version) != 0)) {
-            if (TraceClassLoading && Verbose) {
-              tty->print("[Unsupported meta index version]");
-            }
-            fclose(file);
-            return;
-          }
-        }
-
-        // These directives indicate jar files which contain only
-        // classes, only non-classfile resources, or a combination of
-        // the two. See src/share/classes/sun/misc/MetaIndex.java and
-        // make/tools/MetaIndex/BuildMetaIndex.java in the J2SE
-        // workspace.
-        case '#':
-        case '!':
-        case '@':
-        {
-          // Hand off current packages to current lazy entry (if any)
-          if ((cur_entry != NULL) &&
-              (boot_class_path_packages.length() > 0)) {
-            if ((TraceClassLoading || TraceClassPaths) && Verbose) {
-              print_meta_index(cur_entry, boot_class_path_packages);
-            }
-            MetaIndex* index = new MetaIndex(boot_class_path_packages.adr_at(0),
-                                             boot_class_path_packages.length());
-            cur_entry->set_meta_index(index);
-          }
-          cur_entry = NULL;
-          boot_class_path_packages.clear();
-
-          // Find lazy entry corresponding to this jar file
-          int count = 0;
-          for (ClassPathEntry* entry = _first_entry; entry != NULL; entry = entry->next(), count++) {
-            if (count >= start_index &&
-                entry->is_lazy() &&
-                string_starts_with(entry->name(), meta_index_dir) &&
-                string_ends_with(entry->name(), &package_name[2])) {
-              cur_entry = (LazyClassPathEntry*) entry;
-              break;
-            }
-          }
-
-          // If the first character is '@', it indicates the following jar
-          // file is a resource only jar file in which case, we should skip
-          // reading the subsequent entries since the resource loading is
-          // totally handled by J2SE side.
-          if (package_name[0] == '@') {
-            if (cur_entry != NULL) {
-              cur_entry->set_meta_index(new MetaIndex(NULL, 0));
-            }
-            cur_entry = NULL;
-            skipCurrentJar = true;
-          } else {
-            skipCurrentJar = false;
-          }
-
-          break;
-        }
-
-        default:
-        {
-          if (!skipCurrentJar && cur_entry != NULL) {
-            char* new_name = os::strdup_check_oom(package_name);
-            boot_class_path_packages.append(new_name);
-          }
-        }
-      }
-    }
-    // Hand off current packages to current lazy entry (if any)
-    if ((cur_entry != NULL) &&
-        (boot_class_path_packages.length() > 0)) {
-      if ((TraceClassLoading || TraceClassPaths) && Verbose) {
-        print_meta_index(cur_entry, boot_class_path_packages);
-      }
-      MetaIndex* index = new MetaIndex(boot_class_path_packages.adr_at(0),
-                                       boot_class_path_packages.length());
-      cur_entry->set_meta_index(index);
-    }
-    fclose(file);
-  }
-}
-
 #if INCLUDE_CDS
 void ClassLoader::check_shared_classpath(const char *path) {
   if (strcmp(path, "") == 0) {
@@ -1315,10 +1149,6 @@
   }
 #endif
   setup_bootstrap_search_path();
-  if (LazyBootClassLoader) {
-    // set up meta index which makes boot classpath initialization lazier
-    setup_bootstrap_meta_index();
-  }
 }
 
 #if INCLUDE_CDS
@@ -1486,12 +1316,7 @@
 }
 
 bool ClassPathZipEntry::is_jrt() {
-  real_jzfile* zip = (real_jzfile*) _zip;
-  int len = (int)strlen(zip->name);
-  // Check whether zip name ends in "rt.jar"
-  // This will match other archives named rt.jar as well, but this is
-  // only used for debugging.
-  return string_ends_with(zip->name, "rt.jar");
+  return false;
 }
 
 void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
@@ -1519,7 +1344,7 @@
   ClassPathEntry* e = _first_entry;
   jlong start = os::javaTimeMillis();
   while (e != NULL) {
-    // We stop at rt.jar, unless it is the first bootstrap path entry
+    // We stop at bootmodules.jimage, unless it is the first bootstrap path entry
     if (e->is_jrt() && e != _first_entry) break;
     e->compile_the_world(system_class_loader, CATCH);
     e = e->next();
--- a/hotspot/src/share/vm/classfile/classLoader.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -33,18 +33,6 @@
 #include <sys/stat.h>
 
 
-// Meta-index (optional, to be able to skip opening boot classpath jar files)
-class MetaIndex: public CHeapObj<mtClass> {
- private:
-  char** _meta_package_names;
-  int    _num_meta_package_names;
- public:
-  MetaIndex(char** meta_package_names, int num_meta_package_names);
-  ~MetaIndex();
-  bool may_contain(const char* class_name);
-};
-
-
 // Class path entry (directory or zip file)
 
 class ClassPathEntry: public CHeapObj<mtClass> {
@@ -122,7 +110,6 @@
  private:
   const char* _path; // dir or file
   struct stat _st;
-  MetaIndex* _meta_index;
   bool _has_error;
   bool _throw_exception;
   volatile ClassPathEntry* _resolved_entry;
@@ -135,7 +122,6 @@
   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
 
   ClassFileStream* open_stream(const char* name, TRAPS);
-  void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
   virtual bool is_lazy();
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
@@ -231,9 +217,6 @@
   static bool add_package(const char *pkgname, int classpath_index, TRAPS);
 
   // Initialization
-  static void setup_bootstrap_meta_index();
-  static void setup_meta_index(const char* meta_index_path, const char* meta_index_dir,
-                               int start_index);
   static void setup_bootstrap_search_path();
   static void setup_search_path(const char *class_path);
 
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -57,6 +57,8 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/mutex.hpp"
--- a/hotspot/src/share/vm/classfile/classLoaderStats.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classLoaderStats.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderStats.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 
--- a/hotspot/src/share/vm/classfile/dictionary.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -27,7 +27,7 @@
 
 #include "classfile/systemDictionary.hpp"
 #include "oops/instanceKlass.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "utilities/hashtable.hpp"
 
 class DictionaryEntry;
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "code/debugInfo.hpp"
@@ -39,6 +39,8 @@
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayOop.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
@@ -149,6 +151,10 @@
 
 bool java_lang_String::initialized  = false;
 
+bool java_lang_String::is_instance(oop obj) {
+  return is_instance_inlined(obj);
+}
+
 void java_lang_String::compute_offsets() {
   assert(!initialized, "offsets should be initialized only once");
 
@@ -2730,6 +2736,11 @@
   }
 }
 
+bool java_lang_invoke_LambdaForm::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+
 oop java_lang_invoke_MethodHandle::type(oop mh) {
   return mh->obj_field(_type_offset);
 }
@@ -3076,6 +3087,10 @@
   return false;
 }
 
+bool java_lang_ClassLoader::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
 
 // For class loader classes, parallelCapable defined
 // based on non-null field
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -204,9 +204,8 @@
   static Symbol* as_symbol_or_null(oop java_string);
 
   // Testers
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::String_klass();
-  }
+  static bool is_instance(oop obj);
+  static bool is_instance_inlined(oop obj);
 
   // Debugging
   static void print(oop java_string, outputStream* st);
@@ -273,9 +272,8 @@
   static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
   static void print_signature(oop java_class, outputStream *st);
   // Testing
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
-  }
+  static bool is_instance(oop obj);
+
   static bool is_primitive(oop java_class);
   static BasicType primitive_type(oop java_class);
   static oop primitive_mirror(BasicType t);
@@ -989,9 +987,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::MethodHandle_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int type_offset_in_bytes()             { return _type_offset; }
@@ -1016,9 +1012,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int member_offset_in_bytes()           { return _member_offset; }
@@ -1045,9 +1039,7 @@
     return SystemDictionary::LambdaForm_klass() != NULL &&
       klass->is_subclass_of(SystemDictionary::LambdaForm_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int vmentry_offset_in_bytes()          { return _vmentry_offset; }
@@ -1111,9 +1103,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::MemberName_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   static bool is_method(oop obj);
 
@@ -1166,9 +1156,7 @@
   static Symbol*        as_signature(oop mt, bool intern_if_not_found, TRAPS);
   static void           print_signature(oop mt, outputStream* st);
 
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
-  }
+  static bool is_instance(oop obj);
 
   static bool equals(oop mt1, oop mt2);
 
@@ -1190,19 +1178,17 @@
 
 public:
   // Accessors
-  static oop              target(         oop site)             { return site->obj_field(             _target_offset);         }
-  static void         set_target(         oop site, oop target) {        site->obj_field_put(         _target_offset, target); }
+  static oop              target(         oop site);
+  static void         set_target(         oop site, oop target);
 
-  static volatile oop     target_volatile(oop site)             { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); }
-  static void         set_target_volatile(oop site, oop target) {        site->obj_field_put_volatile(_target_offset, target); }
+  static volatile oop     target_volatile(oop site);
+  static void         set_target_volatile(oop site, oop target);
 
   // Testers
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::CallSite_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int target_offset_in_bytes()           { return _target_offset; }
@@ -1268,9 +1254,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::ClassLoader_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Debugging
   friend class JavaClasses;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 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
+ * 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_CLASSFILE_JAVACLASSES_INLINE_HPP
+#define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
+
+#include "classfile/javaClasses.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oopsHierarchy.hpp"
+
+inline volatile oop java_lang_invoke_CallSite::target_volatile(oop site) {
+  return oop((oopDesc *)(site->obj_field_volatile(_target_offset)));
+}
+
+inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
+  site->obj_field_put_volatile(_target_offset, target);
+}
+
+inline oop  java_lang_invoke_CallSite::target(oop site) {
+  return site->obj_field(_target_offset);
+}
+
+inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
+  site->obj_field_put(_target_offset, target);
+}
+
+inline bool java_lang_String::is_instance_inlined(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::String_klass();
+}
+
+inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_MemberName::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_MethodType::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
+}
+
+inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_Class::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
+}
+
+inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -33,7 +33,6 @@
 #include "memory/filemap.hpp"
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -33,7 +33,6 @@
 #include "memory/filemap.hpp"
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/dictionary.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/loaderConstraints.hpp"
 #include "classfile/placeholders.hpp"
 #include "classfile/resolutionErrors.hpp"
@@ -44,8 +44,8 @@
 #include "oops/klass.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiEnvBase.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -28,7 +28,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "memory/allocation.hpp"
 #include "oops/instanceKlass.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/signature.hpp"
--- a/hotspot/src/share/vm/code/codeCache.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -39,6 +39,7 @@
 #include "oops/method.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/icache.hpp"
--- a/hotspot/src/share/vm/code/dependencies.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -27,6 +27,7 @@
 #include "ci/ciEnv.hpp"
 #include "ci/ciKlass.hpp"
 #include "ci/ciMethod.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "code/dependencies.hpp"
 #include "compiler/compileLog.hpp"
 #include "oops/oop.inline.hpp"
--- a/hotspot/src/share/vm/code/icBuffer.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/code/icBuffer.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -35,7 +35,6 @@
 #include "memory/universe.inline.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubRoutines.hpp"
 
--- a/hotspot/src/share/vm/code/nmethod.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -35,6 +35,7 @@
 #include "compiler/disassembler.hpp"
 #include "interpreter/bytecode.hpp"
 #include "oops/methodData.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "runtime/atomic.inline.hpp"
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -28,6 +28,7 @@
 #include "compiler/disassembler.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "memory/cardTableModRefBS.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -129,8 +129,8 @@
 // GenCollectedHeap heap.
 class VM_GenCollectFullConcurrent: public VM_GC_Operation {
  public:
-  VM_GenCollectFullConcurrent(unsigned int gc_count_before,
-                              unsigned int full_gc_count_before,
+  VM_GenCollectFullConcurrent(uint gc_count_before,
+                              uint full_gc_count_before,
                               GCCause::Cause gc_cause)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */)
   {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -333,7 +333,7 @@
   HeapRegion* lists[] = {_head,   _survivor_head};
   const char* names[] = {"YOUNG", "SURVIVOR"};
 
-  for (unsigned int list = 0; list < ARRAY_SIZE(lists); ++list) {
+  for (uint list = 0; list < ARRAY_SIZE(lists); ++list) {
     gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]);
     HeapRegion *curr = lists[list];
     if (curr == NULL)
@@ -765,8 +765,8 @@
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "we do not allow humongous TLABs");
 
-  unsigned int dummy_gc_count_before;
-  int dummy_gclocker_retry_count = 0;
+  uint dummy_gc_count_before;
+  uint dummy_gclocker_retry_count = 0;
   return attempt_allocation(word_size, &dummy_gc_count_before, &dummy_gclocker_retry_count);
 }
 
@@ -776,8 +776,8 @@
   assert_heap_not_locked_and_not_at_safepoint();
 
   // Loop until the allocation is satisfied, or unsatisfied after GC.
-  for (int try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
-    unsigned int gc_count_before;
+  for (uint try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
+    uint gc_count_before;
 
     HeapWord* result = NULL;
     if (!is_humongous(word_size)) {
@@ -829,8 +829,8 @@
 
 HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size,
                                                    AllocationContext_t context,
-                                                   unsigned int *gc_count_before_ret,
-                                                   int* gclocker_retry_count_ret) {
+                                                   uint* gc_count_before_ret,
+                                                   uint* gclocker_retry_count_ret) {
   // Make sure you read the note in attempt_allocation_humongous().
 
   assert_heap_not_locked_and_not_at_safepoint();
@@ -847,7 +847,7 @@
   HeapWord* result = NULL;
   for (int try_count = 1; /* we'll return */; try_count += 1) {
     bool should_try_gc;
-    unsigned int gc_count_before;
+    uint gc_count_before;
 
     {
       MutexLockerEx x(Heap_lock);
@@ -891,7 +891,7 @@
     if (should_try_gc) {
       bool succeeded;
       result = do_collection_pause(word_size, gc_count_before, &succeeded,
-          GCCause::_g1_inc_collection_pause);
+                                   GCCause::_g1_inc_collection_pause);
       if (result != NULL) {
         assert(succeeded, "only way to get back a non-NULL result");
         return result;
@@ -945,8 +945,8 @@
 }
 
 HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size,
-                                                        unsigned int * gc_count_before_ret,
-                                                        int* gclocker_retry_count_ret) {
+                                                        uint* gc_count_before_ret,
+                                                        uint* gclocker_retry_count_ret) {
   // The structure of this method has a lot of similarities to
   // attempt_allocation_slow(). The reason these two were not merged
   // into a single one is that such a method would require several "if
@@ -979,7 +979,7 @@
   HeapWord* result = NULL;
   for (int try_count = 1; /* we'll return */; try_count += 1) {
     bool should_try_gc;
-    unsigned int gc_count_before;
+    uint gc_count_before;
 
     {
       MutexLockerEx x(Heap_lock);
@@ -1017,7 +1017,7 @@
 
       bool succeeded;
       result = do_collection_pause(word_size, gc_count_before, &succeeded,
-          GCCause::_g1_humongous_allocation);
+                                   GCCause::_g1_humongous_allocation);
       if (result != NULL) {
         assert(succeeded, "only way to get back a non-NULL result");
         return result;
@@ -1815,7 +1815,7 @@
   assert(n_rem_sets > 0, "Invariant.");
 
   _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC);
-  _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues, mtGC);
+  _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
 
   for (int i = 0; i < n_queues; i++) {
@@ -2396,9 +2396,9 @@
 void G1CollectedHeap::collect(GCCause::Cause cause) {
   assert_heap_not_locked();
 
-  unsigned int gc_count_before;
-  unsigned int old_marking_count_before;
-  unsigned int full_gc_count_before;
+  uint gc_count_before;
+  uint old_marking_count_before;
+  uint full_gc_count_before;
   bool retry_gc;
 
   do {
@@ -3418,7 +3418,7 @@
 }
 
 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
-                                               unsigned int gc_count_before,
+                                               uint gc_count_before,
                                                bool* succeeded,
                                                GCCause::Cause gc_cause) {
   assert_heap_not_locked_and_not_at_safepoint();
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -325,11 +325,11 @@
 
   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   // concurrent cycles) we have started.
-  volatile unsigned int _old_marking_cycles_started;
+  volatile uint _old_marking_cycles_started;
 
   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   // concurrent cycles) we have completed.
-  volatile unsigned int _old_marking_cycles_completed;
+  volatile uint _old_marking_cycles_completed;
 
   bool _concurrent_cycle_started;
   bool _heap_summary_sent;
@@ -497,22 +497,22 @@
   // the mutator alloc region without taking the Heap_lock. This
   // should only be used for non-humongous allocations.
   inline HeapWord* attempt_allocation(size_t word_size,
-                                      unsigned int* gc_count_before_ret,
-                                      int* gclocker_retry_count_ret);
+                                      uint* gc_count_before_ret,
+                                      uint* gclocker_retry_count_ret);
 
   // Second-level mutator allocation attempt: take the Heap_lock and
   // retry the allocation attempt, potentially scheduling a GC
   // pause. This should only be used for non-humongous allocations.
   HeapWord* attempt_allocation_slow(size_t word_size,
                                     AllocationContext_t context,
-                                    unsigned int* gc_count_before_ret,
-                                    int* gclocker_retry_count_ret);
+                                    uint* gc_count_before_ret,
+                                    uint* gclocker_retry_count_ret);
 
   // Takes the Heap_lock and attempts a humongous allocation. It can
   // potentially schedule a GC pause.
   HeapWord* attempt_allocation_humongous(size_t word_size,
-                                         unsigned int* gc_count_before_ret,
-                                         int* gclocker_retry_count_ret);
+                                         uint* gc_count_before_ret,
+                                         uint* gclocker_retry_count_ret);
 
   // Allocation attempt that should be called during safepoints (e.g.,
   // at the end of a successful GC). expect_null_mutator_alloc_region
@@ -686,7 +686,7 @@
   // +ExplicitGCInvokesConcurrent).
   void increment_old_marking_cycles_completed(bool concurrent);
 
-  unsigned int old_marking_cycles_completed() {
+  uint old_marking_cycles_completed() {
     return _old_marking_cycles_completed;
   }
 
@@ -745,7 +745,7 @@
   // methods that call do_collection_pause() release the Heap_lock
   // before the call, so it's easy to read gc_count_before just before.
   HeapWord* do_collection_pause(size_t         word_size,
-                                unsigned int   gc_count_before,
+                                uint           gc_count_before,
                                 bool*          succeeded,
                                 GCCause::Cause gc_cause);
 
@@ -981,7 +981,7 @@
   // The heap region entry for a given worker is valid iff
   // the associated time stamp value matches the current value
   // of G1CollectedHeap::_gc_time_stamp.
-  unsigned int* _worker_cset_start_region_time_stamp;
+  uint* _worker_cset_start_region_time_stamp;
 
   enum G1H_process_roots_tasks {
     G1H_PS_filter_satb_buffers,
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -131,8 +131,8 @@
 }
 
 inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
-                                                     unsigned int* gc_count_before_ret,
-                                                     int* gclocker_retry_count_ret) {
+                                                     uint* gc_count_before_ret,
+                                                     uint* gclocker_retry_count_ret) {
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "attempt_allocation() should not "
          "be called for humongous allocation requests");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentMark.inline.hpp"
+#include "gc_implementation/g1/dirtyCardQueue.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1EvacFailure.hpp"
+#include "gc_implementation/g1/g1_globals.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+
+class UpdateRSetDeferred : public OopsInHeapRegionClosure {
+private:
+  G1CollectedHeap* _g1;
+  DirtyCardQueue *_dcq;
+  G1SATBCardTableModRefBS* _ct_bs;
+
+public:
+  UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
+    _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
+
+  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
+  virtual void do_oop(      oop* p) { do_oop_work(p); }
+  template <class T> void do_oop_work(T* p) {
+    assert(_from->is_in_reserved(p), "paranoia");
+    if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
+        !_from->is_survivor()) {
+      size_t card_index = _ct_bs->index_for(p);
+      if (_ct_bs->mark_card_deferred(card_index)) {
+        _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));
+      }
+    }
+  }
+};
+
+class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
+private:
+  G1CollectedHeap* _g1;
+  ConcurrentMark* _cm;
+  HeapRegion* _hr;
+  size_t _marked_bytes;
+  OopsInHeapRegionClosure *_update_rset_cl;
+  bool _during_initial_mark;
+  bool _during_conc_mark;
+  uint _worker_id;
+  HeapWord* _end_of_last_gap;
+  HeapWord* _last_gap_threshold;
+  HeapWord* _last_obj_threshold;
+
+public:
+  RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
+                                 HeapRegion* hr,
+                                 OopsInHeapRegionClosure* update_rset_cl,
+                                 bool during_initial_mark,
+                                 bool during_conc_mark,
+                                 uint worker_id) :
+    _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0),
+    _update_rset_cl(update_rset_cl),
+    _during_initial_mark(during_initial_mark),
+    _during_conc_mark(during_conc_mark),
+    _worker_id(worker_id),
+    _end_of_last_gap(hr->bottom()),
+    _last_gap_threshold(hr->bottom()),
+    _last_obj_threshold(hr->bottom()) { }
+
+  size_t marked_bytes() { return _marked_bytes; }
+
+  // <original comment>
+  // The original idea here was to coalesce evacuated and dead objects.
+  // However that caused complications with the block offset table (BOT).
+  // In particular if there were two TLABs, one of them partially refined.
+  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
+  // The BOT entries of the unrefined part of TLAB_2 point to the start
+  // of TLAB_2. If the last object of the TLAB_1 and the first object
+  // of TLAB_2 are coalesced, then the cards of the unrefined part
+  // would point into middle of the filler object.
+  // The current approach is to not coalesce and leave the BOT contents intact.
+  // </original comment>
+  //
+  // We now reset the BOT when we start the object iteration over the
+  // region and refine its entries for every object we come across. So
+  // the above comment is not really relevant and we should be able
+  // to coalesce dead objects if we want to.
+  void do_object(oop obj) {
+    HeapWord* obj_addr = (HeapWord*) obj;
+    assert(_hr->is_in(obj_addr), "sanity");
+    size_t obj_size = obj->size();
+    HeapWord* obj_end = obj_addr + obj_size;
+
+    if (_end_of_last_gap != obj_addr) {
+      // there was a gap before obj_addr
+      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
+    }
+
+    if (obj->is_forwarded() && obj->forwardee() == obj) {
+      // The object failed to move.
+
+      // We consider all objects that we find self-forwarded to be
+      // live. What we'll do is that we'll update the prev marking
+      // info so that they are all under PTAMS and explicitly marked.
+      if (!_cm->isPrevMarked(obj)) {
+        _cm->markPrev(obj);
+      }
+      if (_during_initial_mark) {
+        // For the next marking info we'll only mark the
+        // self-forwarded objects explicitly if we are during
+        // initial-mark (since, normally, we only mark objects pointed
+        // to by roots if we succeed in copying them). By marking all
+        // self-forwarded objects we ensure that we mark any that are
+        // still pointed to be roots. During concurrent marking, and
+        // after initial-mark, we don't need to mark any objects
+        // explicitly and all objects in the CSet are considered
+        // (implicitly) live. So, we won't mark them explicitly and
+        // we'll leave them over NTAMS.
+        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
+      }
+      _marked_bytes += (obj_size * HeapWordSize);
+      obj->set_mark(markOopDesc::prototype());
+
+      // While we were processing RSet buffers during the collection,
+      // we actually didn't scan any cards on the collection set,
+      // since we didn't want to update remembered sets with entries
+      // that point into the collection set, given that live objects
+      // from the collection set are about to move and such entries
+      // will be stale very soon.
+      // This change also dealt with a reliability issue which
+      // involved scanning a card in the collection set and coming
+      // across an array that was being chunked and looking malformed.
+      // The problem is that, if evacuation fails, we might have
+      // remembered set entries missing given that we skipped cards on
+      // the collection set. So, we'll recreate such entries now.
+      obj->oop_iterate(_update_rset_cl);
+    } else {
+
+      // The object has been either evacuated or is dead. Fill it with a
+      // dummy object.
+      MemRegion mr(obj_addr, obj_size);
+      CollectedHeap::fill_with_object(mr);
+
+      // must nuke all dead objects which we skipped when iterating over the region
+      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
+    }
+    _end_of_last_gap = obj_end;
+    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
+  }
+};
+
+class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
+  G1CollectedHeap* _g1h;
+  ConcurrentMark* _cm;
+  uint _worker_id;
+  HeapRegionClaimer* _hrclaimer;
+
+  DirtyCardQueue _dcq;
+  UpdateRSetDeferred _update_rset_cl;
+
+public:
+  RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
+                                uint worker_id,
+                                HeapRegionClaimer* hrclaimer) :
+      _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
+      _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
+  }
+
+  bool doHeapRegion(HeapRegion *hr) {
+    bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
+    bool during_conc_mark = _g1h->mark_in_progress();
+
+    assert(!hr->is_humongous(), "sanity");
+    assert(hr->in_collection_set(), "bad CS");
+
+    if (_hrclaimer->claim_region(hr->hrm_index())) {
+      if (hr->evacuation_failed()) {
+        RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
+                                            during_initial_mark,
+                                            during_conc_mark,
+                                            _worker_id);
+
+        hr->note_self_forwarding_removal_start(during_initial_mark,
+                                               during_conc_mark);
+        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
+
+        // In the common case (i.e. when there is no evacuation
+        // failure) we make sure that the following is done when
+        // the region is freed so that it is "ready-to-go" when it's
+        // re-allocated. However, when evacuation failure happens, a
+        // region will remain in the heap and might ultimately be added
+        // to a CSet in the future. So we have to be careful here and
+        // make sure the region's RSet is ready for parallel iteration
+        // whenever this might be required in the future.
+        hr->rem_set()->reset_for_par_iteration();
+        hr->reset_bot();
+        _update_rset_cl.set_region(hr);
+        hr->object_iterate(&rspc);
+
+        hr->rem_set()->clean_strong_code_roots(hr);
+
+        hr->note_self_forwarding_removal_end(during_initial_mark,
+                                             during_conc_mark,
+                                             rspc.marked_bytes());
+      }
+    }
+    return false;
+  }
+};
+
+G1ParRemoveSelfForwardPtrsTask::G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
+    AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
+    _hrclaimer(g1h->workers()->active_workers()) {}
+
+void G1ParRemoveSelfForwardPtrsTask::work(uint worker_id) {
+  RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
+
+  HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
+  _g1h->collection_set_iterate_from(hr, &rsfp_cl);
+}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -25,229 +25,24 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
 
-#include "gc_implementation/g1/concurrentMark.inline.hpp"
-#include "gc_implementation/g1/dirtyCardQueue.hpp"
-#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
-#include "gc_implementation/g1/g1_globals.hpp"
-#include "gc_implementation/g1/g1OopClosures.inline.hpp"
-#include "gc_implementation/g1/heapRegion.hpp"
-#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/g1/heapRegionManager.hpp"
+#include "utilities/globalDefinitions.hpp"
 #include "utilities/workgroup.hpp"
 
-// Closures and tasks associated with any self-forwarding pointers
-// installed as a result of an evacuation failure.
-
-class UpdateRSetDeferred : public OopsInHeapRegionClosure {
-private:
-  G1CollectedHeap* _g1;
-  DirtyCardQueue *_dcq;
-  G1SATBCardTableModRefBS* _ct_bs;
-
-public:
-  UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
-    _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
-
-  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
-  virtual void do_oop(      oop* p) { do_oop_work(p); }
-  template <class T> void do_oop_work(T* p) {
-    assert(_from->is_in_reserved(p), "paranoia");
-    if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
-        !_from->is_survivor()) {
-      size_t card_index = _ct_bs->index_for(p);
-      if (_ct_bs->mark_card_deferred(card_index)) {
-        _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));
-      }
-    }
-  }
-};
-
-class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
-private:
-  G1CollectedHeap* _g1;
-  ConcurrentMark* _cm;
-  HeapRegion* _hr;
-  size_t _marked_bytes;
-  OopsInHeapRegionClosure *_update_rset_cl;
-  bool _during_initial_mark;
-  bool _during_conc_mark;
-  uint _worker_id;
-  HeapWord* _end_of_last_gap;
-  HeapWord* _last_gap_threshold;
-  HeapWord* _last_obj_threshold;
-
-public:
-  RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
-                                 HeapRegion* hr,
-                                 OopsInHeapRegionClosure* update_rset_cl,
-                                 bool during_initial_mark,
-                                 bool during_conc_mark,
-                                 uint worker_id) :
-    _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0),
-    _update_rset_cl(update_rset_cl),
-    _during_initial_mark(during_initial_mark),
-    _during_conc_mark(during_conc_mark),
-    _worker_id(worker_id),
-    _end_of_last_gap(hr->bottom()),
-    _last_gap_threshold(hr->bottom()),
-    _last_obj_threshold(hr->bottom()) { }
-
-  size_t marked_bytes() { return _marked_bytes; }
-
-  // <original comment>
-  // The original idea here was to coalesce evacuated and dead objects.
-  // However that caused complications with the block offset table (BOT).
-  // In particular if there were two TLABs, one of them partially refined.
-  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
-  // The BOT entries of the unrefined part of TLAB_2 point to the start
-  // of TLAB_2. If the last object of the TLAB_1 and the first object
-  // of TLAB_2 are coalesced, then the cards of the unrefined part
-  // would point into middle of the filler object.
-  // The current approach is to not coalesce and leave the BOT contents intact.
-  // </original comment>
-  //
-  // We now reset the BOT when we start the object iteration over the
-  // region and refine its entries for every object we come across. So
-  // the above comment is not really relevant and we should be able
-  // to coalesce dead objects if we want to.
-  void do_object(oop obj) {
-    HeapWord* obj_addr = (HeapWord*) obj;
-    assert(_hr->is_in(obj_addr), "sanity");
-    size_t obj_size = obj->size();
-    HeapWord* obj_end = obj_addr + obj_size;
-
-    if (_end_of_last_gap != obj_addr) {
-      // there was a gap before obj_addr
-      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
-    }
-
-    if (obj->is_forwarded() && obj->forwardee() == obj) {
-      // The object failed to move.
+class G1CollectedHeap;
 
-      // We consider all objects that we find self-forwarded to be
-      // live. What we'll do is that we'll update the prev marking
-      // info so that they are all under PTAMS and explicitly marked.
-      if (!_cm->isPrevMarked(obj)) {
-        _cm->markPrev(obj);
-      }
-      if (_during_initial_mark) {
-        // For the next marking info we'll only mark the
-        // self-forwarded objects explicitly if we are during
-        // initial-mark (since, normally, we only mark objects pointed
-        // to by roots if we succeed in copying them). By marking all
-        // self-forwarded objects we ensure that we mark any that are
-        // still pointed to be roots. During concurrent marking, and
-        // after initial-mark, we don't need to mark any objects
-        // explicitly and all objects in the CSet are considered
-        // (implicitly) live. So, we won't mark them explicitly and
-        // we'll leave them over NTAMS.
-        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
-      }
-      _marked_bytes += (obj_size * HeapWordSize);
-      obj->set_mark(markOopDesc::prototype());
-
-      // While we were processing RSet buffers during the collection,
-      // we actually didn't scan any cards on the collection set,
-      // since we didn't want to update remembered sets with entries
-      // that point into the collection set, given that live objects
-      // from the collection set are about to move and such entries
-      // will be stale very soon.
-      // This change also dealt with a reliability issue which
-      // involved scanning a card in the collection set and coming
-      // across an array that was being chunked and looking malformed.
-      // The problem is that, if evacuation fails, we might have
-      // remembered set entries missing given that we skipped cards on
-      // the collection set. So, we'll recreate such entries now.
-      obj->oop_iterate(_update_rset_cl);
-    } else {
-
-      // The object has been either evacuated or is dead. Fill it with a
-      // dummy object.
-      MemRegion mr(obj_addr, obj_size);
-      CollectedHeap::fill_with_object(mr);
-
-      // must nuke all dead objects which we skipped when iterating over the region
-      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
-    }
-    _end_of_last_gap = obj_end;
-    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
-  }
-};
-
-class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
-  G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
-  uint _worker_id;
-  HeapRegionClaimer* _hrclaimer;
-
-  DirtyCardQueue _dcq;
-  UpdateRSetDeferred _update_rset_cl;
-
-public:
-  RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
-                                uint worker_id,
-                                HeapRegionClaimer* hrclaimer) :
-      _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
-      _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
-  }
-
-  bool doHeapRegion(HeapRegion *hr) {
-    bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
-    bool during_conc_mark = _g1h->mark_in_progress();
-
-    assert(!hr->is_humongous(), "sanity");
-    assert(hr->in_collection_set(), "bad CS");
-
-    if (_hrclaimer->claim_region(hr->hrm_index())) {
-      if (hr->evacuation_failed()) {
-        RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
-                                            during_initial_mark,
-                                            during_conc_mark,
-                                            _worker_id);
-
-        hr->note_self_forwarding_removal_start(during_initial_mark,
-                                               during_conc_mark);
-        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
-
-        // In the common case (i.e. when there is no evacuation
-        // failure) we make sure that the following is done when
-        // the region is freed so that it is "ready-to-go" when it's
-        // re-allocated. However, when evacuation failure happens, a
-        // region will remain in the heap and might ultimately be added
-        // to a CSet in the future. So we have to be careful here and
-        // make sure the region's RSet is ready for parallel iteration
-        // whenever this might be required in the future.
-        hr->rem_set()->reset_for_par_iteration();
-        hr->reset_bot();
-        _update_rset_cl.set_region(hr);
-        hr->object_iterate(&rspc);
-
-        hr->rem_set()->clean_strong_code_roots(hr);
-
-        hr->note_self_forwarding_removal_end(during_initial_mark,
-                                             during_conc_mark,
-                                             rspc.marked_bytes());
-      }
-    }
-    return false;
-  }
-};
-
+// Task to fixup self-forwarding pointers
+// installed as a result of an evacuation failure.
 class G1ParRemoveSelfForwardPtrsTask: public AbstractGangTask {
 protected:
   G1CollectedHeap* _g1h;
   HeapRegionClaimer _hrclaimer;
 
 public:
-  G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
-      AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
-      _hrclaimer(g1h->workers()->active_workers()) {}
+  G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h);
 
-  void work(uint worker_id) {
-    RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
-
-    HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
-    _g1h->collection_set_iterate_from(hr, &rsfp_cl);
-  }
+  void work(uint worker_id);
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -27,6 +27,7 @@
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "gc_implementation/g1/satbQueue.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.inline.hpp"
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -28,7 +28,7 @@
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "memory/cardTableModRefBS.hpp"
 #include "memory/memRegion.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "utilities/macros.hpp"
 
 class DirtyCardQueueSet;
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,7 +23,7 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
@@ -51,7 +51,7 @@
 }
 
 bool G1StringDedup::is_candidate_from_mark(oop obj) {
-  if (java_lang_String::is_instance(obj)) {
+  if (java_lang_String::is_instance_inlined(obj)) {
     bool from_young = G1CollectedHeap::heap()->heap_region_containing_raw(obj)->is_young();
     if (from_young && obj->age() < StringDeduplicationAgeThreshold) {
       // Candidate found. String is being evacuated from young to old but has not
@@ -73,7 +73,7 @@
 }
 
 bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) {
-  if (from_young && java_lang_String::is_instance(obj)) {
+  if (from_young && java_lang_String::is_instance_inlined(obj)) {
     if (to_young && obj->age() == StringDeduplicationAgeThreshold) {
       // Candidate found. String is being evacuated from young to young and just
       // reached the deduplication age threshold.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,9 +23,11 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
+#include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/g1/g1StringDedupQueue.hpp"
 #include "memory/gcLocker.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/stack.inline.hpp"
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -24,13 +24,14 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/g1StringDedupTable.hpp"
 #include "memory/gcLocker.hpp"
 #include "memory/padded.inline.hpp"
 #include "oops/typeArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 
 //
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -29,6 +29,7 @@
 #include "gc_implementation/g1/g1CollectedHeap.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 
 // This version requires locking.
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -34,12 +34,11 @@
 #include "gc_implementation/g1/vm_operations_g1.hpp"
 #include "runtime/interfaceSupport.hpp"
 
-VM_G1CollectForAllocation::VM_G1CollectForAllocation(
-                                                  unsigned int gc_count_before,
-                                                  size_t word_size)
+VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
+                                                     size_t word_size)
   : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
                                    GCCause::_allocation_failure) {
-  guarantee(word_size > 0, "an allocation should always be requested");
+  guarantee(word_size != 0, "An allocation should always be requested with this operation.");
 }
 
 void VM_G1CollectForAllocation::doit() {
@@ -57,12 +56,11 @@
   g1h->do_full_collection(false /* clear_all_soft_refs */);
 }
 
-VM_G1IncCollectionPause::VM_G1IncCollectionPause(
-                                      unsigned int   gc_count_before,
-                                      size_t         word_size,
-                                      bool           should_initiate_conc_mark,
-                                      double         target_pause_time_ms,
-                                      GCCause::Cause gc_cause)
+VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint           gc_count_before,
+                                                 size_t         word_size,
+                                                 bool           should_initiate_conc_mark,
+                                                 double         target_pause_time_ms,
+                                                 GCCause::Cause gc_cause)
   : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause),
     _should_initiate_conc_mark(should_initiate_conc_mark),
     _target_pause_time_ms(target_pause_time_ms),
@@ -75,7 +73,7 @@
 }
 
 bool VM_G1IncCollectionPause::doit_prologue() {
-  bool res = VM_GC_Operation::doit_prologue();
+  bool res = VM_G1OperationWithAllocRequest::doit_prologue();
   if (!res) {
     if (_should_initiate_conc_mark) {
       // The prologue can fail for a couple of reasons. The first is that another GC
@@ -165,7 +163,7 @@
 }
 
 void VM_G1IncCollectionPause::doit_epilogue() {
-  VM_GC_Operation::doit_epilogue();
+  VM_G1OperationWithAllocRequest::doit_epilogue();
 
   // If the pause was initiated by a System.gc() and
   // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -36,20 +36,17 @@
 //     - VM_G1CollectForAllocation
 //     - VM_G1IncCollectionPause
 
-class VM_G1OperationWithAllocRequest: public VM_GC_Operation {
+class VM_G1OperationWithAllocRequest : public VM_CollectForAllocation {
 protected:
-  size_t    _word_size;
-  HeapWord* _result;
   bool      _pause_succeeded;
   AllocationContext_t _allocation_context;
 
 public:
-  VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
-                                 size_t       word_size,
+  VM_G1OperationWithAllocRequest(uint           gc_count_before,
+                                 size_t         word_size,
                                  GCCause::Cause gc_cause)
-    : VM_GC_Operation(gc_count_before, gc_cause),
-      _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
-  HeapWord* result() { return _result; }
+    : VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
+      _pause_succeeded(false) {}
   bool pause_succeeded() { return _pause_succeeded; }
   void set_allocation_context(AllocationContext_t context) { _allocation_context = context; }
   AllocationContext_t  allocation_context() { return _allocation_context; }
@@ -57,8 +54,8 @@
 
 class VM_G1CollectFull: public VM_GC_Operation {
 public:
-  VM_G1CollectFull(unsigned int gc_count_before,
-                   unsigned int full_gc_count_before,
+  VM_G1CollectFull(uint gc_count_before,
+                   uint full_gc_count_before,
                    GCCause::Cause cause)
     : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
@@ -70,7 +67,7 @@
 
 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
 public:
-  VM_G1CollectForAllocation(unsigned int gc_count_before,
+  VM_G1CollectForAllocation(uint         gc_count_before,
                             size_t       word_size);
   virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
   virtual void doit();
@@ -84,9 +81,9 @@
   bool         _should_initiate_conc_mark;
   bool         _should_retry_gc;
   double       _target_pause_time_ms;
-  unsigned int _old_marking_cycles_completed_before;
+  uint         _old_marking_cycles_completed_before;
 public:
-  VM_G1IncCollectionPause(unsigned int   gc_count_before,
+  VM_G1IncCollectionPause(uint           gc_count_before,
                           size_t         word_size,
                           bool           should_initiate_conc_mark,
                           double         target_pause_time_ms,
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -126,7 +126,9 @@
 
 bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
                                               HeapWord* end_addr) const {
-  assert(start_addr <= end_addr, "range is wrong");
+  assert(start_addr <= end_addr,
+         err_msg("Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
+                 p2i(start_addr), p2i(end_addr)));
   if (start_addr > end_addr) {
     return false;
   }
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -119,8 +119,13 @@
 
   MemRegion covered_region() { return _covered_region; }
 
+#define assert_covered_region_contains(addr)                                                                 \
+        assert(_covered_region.contains(addr),                                                               \
+               err_msg(#addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",  \
+                       p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end())))
+
   void allocate_block(HeapWord* p) {
-    assert(_covered_region.contains(p), "Must be in covered region");
+    assert_covered_region_contains(p);
     jbyte* block = block_for_addr(p);
     HeapWord* block_base = addr_for_block(block);
     size_t offset = pointer_delta(p, block_base, sizeof(HeapWord*));
@@ -135,7 +140,7 @@
   // object in that block. Scroll backwards by one, and the first
   // object hit should be at the beginning of the block
   HeapWord* object_start(HeapWord* addr) const {
-    assert(_covered_region.contains(addr), "Must be in covered region");
+    assert_covered_region_contains(addr);
     jbyte* block = block_for_addr(addr);
     HeapWord* scroll_forward = offset_addr_for_block(block--);
     while (scroll_forward > addr) {
@@ -153,13 +158,14 @@
   }
 
   bool is_block_allocated(HeapWord* addr) {
-    assert(_covered_region.contains(addr), "Must be in covered region");
+    assert_covered_region_contains(addr);
     jbyte* block = block_for_addr(addr);
     if (*block == clean_block)
       return false;
 
     return true;
   }
+#undef assert_covered_region_contains
 
   // Return true if an object starts in the range of heap addresses.
   // If an object starts at an address corresponding to
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -260,7 +260,7 @@
 
   uint loop_count = 0;
   uint gc_count = 0;
-  int gclocker_stalled_count = 0;
+  uint gclocker_stalled_count = 0;
 
   while (result == NULL) {
     // We don't want to have multiple collections for a single filled generation.
@@ -520,8 +520,8 @@
   assert(!Heap_lock->owned_by_self(),
     "this thread should not own the Heap_lock");
 
-  unsigned int gc_count      = 0;
-  unsigned int full_gc_count = 0;
+  uint gc_count      = 0;
+  uint full_gc_count = 0;
   {
     MutexLocker ml(Heap_lock);
     // This value is guarded by the Heap_lock
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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,12 +32,10 @@
 #include "utilities/dtrace.hpp"
 
 // The following methods are used by the parallel scavenge collector
-VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
-                                                      unsigned int gc_count) :
-  VM_GC_Operation(gc_count, GCCause::_allocation_failure),
-  _size(size),
-  _result(NULL)
-{
+VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size,
+                                                             uint gc_count) :
+    VM_CollectForAllocation(word_size, gc_count, GCCause::_allocation_failure) {
+  assert(word_size != 0, "An allocation should always be requested with this operation.");
 }
 
 void VM_ParallelGCFailedAllocation::doit() {
@@ -47,7 +45,7 @@
   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
 
   GCCauseSetter gccs(heap, _gc_cause);
-  _result = heap->failed_mem_allocate(_size);
+  _result = heap->failed_mem_allocate(_word_size);
 
   if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
     set_gc_locked();
@@ -55,8 +53,8 @@
 }
 
 // Only used for System.gc() calls
-VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
-                                             unsigned int full_gc_count,
+VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(uint gc_count,
+                                             uint full_gc_count,
                                              GCCause::Cause gc_cause) :
   VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */)
 {
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -29,26 +29,19 @@
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "gc_interface/gcCause.hpp"
 
-class VM_ParallelGCFailedAllocation: public VM_GC_Operation {
- private:
-  size_t    _size;
-  HeapWord* _result;
-
+class VM_ParallelGCFailedAllocation : public VM_CollectForAllocation {
  public:
-  VM_ParallelGCFailedAllocation(size_t size, unsigned int gc_count);
+  VM_ParallelGCFailedAllocation(size_t word_size, uint gc_count);
 
   virtual VMOp_Type type() const {
     return VMOp_ParallelGCFailedAllocation;
   }
   virtual void doit();
-
-  HeapWord* result() const       { return _result; }
 };
 
 class VM_ParallelGCSystemGC: public VM_GC_Operation {
  public:
-  VM_ParallelGCSystemGC(unsigned int gc_count, unsigned int full_gc_count,
-                        GCCause::Cause gc_cause);
+  VM_ParallelGCSystemGC(uint gc_count, uint full_gc_count, GCCause::Cause gc_cause);
   virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; }
   virtual void doit();
 };
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,6 +31,7 @@
 #include "gc_implementation/shared/objectCountEventSender.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/referenceProcessorStats.hpp"
+#include "memory/resourceArea.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -41,6 +41,11 @@
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #endif // INCLUDE_ALL_GCS
 
+VM_GC_Operation::~VM_GC_Operation() {
+  CollectedHeap* ch = Universe::heap();
+  ch->collector_policy()->set_all_soft_refs_clear(false);
+}
+
 // The same dtrace probe can't be inserted in two different files, so we
 // have to call it here, so it's only in one file.  Can't create new probes
 // for the other file anymore.   The dtrace probes have to remain stable.
@@ -179,10 +184,10 @@
 
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   GCCauseSetter gccs(gch, _gc_cause);
-  _res = gch->satisfy_failed_allocation(_size, _tlab);
-  assert(gch->is_in_reserved_or_null(_res), "result not in heap");
+  _result = gch->satisfy_failed_allocation(_word_size, _tlab);
+  assert(gch->is_in_reserved_or_null(_result), "result not in heap");
 
-  if (_res == NULL && GC_locker::is_active_and_needs_gc()) {
+  if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
     set_gc_locked();
   }
 }
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
 
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/heapInspection.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/jniHandles.hpp"
@@ -38,11 +39,12 @@
 //  VM_Operation
 //      VM_GC_Operation
 //          VM_GC_HeapInspection
-//          VM_GenCollectForAllocation
 //          VM_GenCollectFull
 //          VM_GenCollectFullConcurrent
-//          VM_ParallelGCFailedAllocation
 //          VM_ParallelGCSystemGC
+//          VM_CollectForAllocation
+//              VM_GenCollectForAllocation
+//              VM_ParallelGCFailedAllocation
 //  VM_GC_Operation
 //   - implements methods common to all classes in the hierarchy:
 //     prevents multiple gc requests and manages lock on heap;
@@ -51,6 +53,7 @@
 //   - prints class histogram on SIGBREAK if PrintClassHistogram
 //     is specified; and also the attach "inspectheap" operation
 //
+//  VM_CollectForAllocation
 //  VM_GenCollectForAllocation
 //  VM_ParallelGCFailedAllocation
 //   - this operation is invoked when allocation is failed;
@@ -66,13 +69,13 @@
 
 class VM_GC_Operation: public VM_Operation {
  protected:
-  BasicLock     _pending_list_basic_lock; // for refs pending list notification (PLL)
-  unsigned int  _gc_count_before;         // gc count before acquiring PLL
-  unsigned int  _full_gc_count_before;    // full gc count before acquiring PLL
-  bool          _full;                    // whether a "full" collection
-  bool          _prologue_succeeded;      // whether doit_prologue succeeded
+  BasicLock      _pending_list_basic_lock; // for refs pending list notification (PLL)
+  uint           _gc_count_before;         // gc count before acquiring PLL
+  uint           _full_gc_count_before;    // full gc count before acquiring PLL
+  bool           _full;                    // whether a "full" collection
+  bool           _prologue_succeeded;      // whether doit_prologue succeeded
   GCCause::Cause _gc_cause;                // the putative cause for this gc op
-  bool          _gc_locked;               // will be set if gc was locked
+  bool           _gc_locked;               // will be set if gc was locked
 
   virtual bool skip_operation() const;
 
@@ -81,9 +84,9 @@
   void release_and_notify_pending_list_lock();
 
  public:
-  VM_GC_Operation(unsigned int gc_count_before,
+  VM_GC_Operation(uint gc_count_before,
                   GCCause::Cause _cause,
-                  unsigned int full_gc_count_before = 0,
+                  uint full_gc_count_before = 0,
                   bool full = false) {
     _full = full;
     _prologue_succeeded = false;
@@ -104,10 +107,7 @@
     // mutators have run.  Soft refs will be cleared again in this
     // collection.
   }
-  ~VM_GC_Operation() {
-    CollectedHeap* ch = Universe::heap();
-    ch->collector_policy()->set_all_soft_refs_clear(false);
-  }
+  ~VM_GC_Operation();
 
   // Acquire the reference synchronization lock
   virtual bool doit_prologue();
@@ -160,38 +160,46 @@
   bool collect();
 };
 
+class VM_CollectForAllocation : public VM_GC_Operation {
+ protected:
+  size_t    _word_size; // Size of object to be allocated (in number of words)
+  HeapWord* _result;    // Allocation result (NULL if allocation failed)
 
-class VM_GenCollectForAllocation: public VM_GC_Operation {
+ public:
+  VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
+    : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {}
+
+  HeapWord* result() const {
+    return _result;
+  }
+};
+
+class VM_GenCollectForAllocation : public VM_CollectForAllocation {
  private:
-  HeapWord*   _res;
-  size_t      _size;                       // size of object to be allocated.
   bool        _tlab;                       // alloc is of a tlab.
  public:
-  VM_GenCollectForAllocation(size_t size,
+  VM_GenCollectForAllocation(size_t word_size,
                              bool tlab,
-                             unsigned int gc_count_before)
-    : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
-      _size(size),
+                             uint gc_count_before)
+    : VM_CollectForAllocation(word_size, gc_count_before, GCCause::_allocation_failure),
       _tlab(tlab) {
-    _res = NULL;
+    assert(word_size != 0, "An allocation should always be requested with this operation.");
   }
   ~VM_GenCollectForAllocation()  {}
   virtual VMOp_Type type() const { return VMOp_GenCollectForAllocation; }
   virtual void doit();
-  HeapWord* result() const       { return _res; }
 };
 
-
 // VM operation to invoke a collection of the heap as a
 // GenCollectedHeap heap.
 class VM_GenCollectFull: public VM_GC_Operation {
  private:
   int _max_level;
  public:
-  VM_GenCollectFull(unsigned int gc_count_before,
-                    unsigned int full_gc_count_before,
+  VM_GenCollectFull(uint gc_count_before,
+                    uint full_gc_count_before,
                     GCCause::Cause gc_cause,
-                      int max_level)
+                    int max_level)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
       _max_level(max_level) { }
   ~VM_GenCollectFull() {}
@@ -208,9 +216,9 @@
  public:
   VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
                                   size_t size, Metaspace::MetadataType mdtype,
-                                      unsigned int gc_count_before,
-                                      unsigned int full_gc_count_before,
-                                      GCCause::Cause gc_cause)
+                                  uint gc_count_before,
+                                  uint full_gc_count_before,
+                                  GCCause::Cause gc_cause)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
       _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) {
   }
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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 @@
 #include "gc_interface/allocTracer.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/barrierSet.inline.hpp"
 #include "memory/metaspace.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/instanceMirrorKlass.hpp"
@@ -124,6 +125,14 @@
   }
 }
 
+void CollectedHeap::print_on_error(outputStream* st) const {
+  st->print_cr("Heap:");
+  print_extended_on(st);
+  st->cr();
+
+  _barrier_set->print_on(st);
+}
+
 void CollectedHeap::register_nmethod(nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
 }
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -28,7 +28,6 @@
 #include "gc_interface/gcCause.hpp"
 #include "gc_implementation/shared/gcWhen.hpp"
 #include "memory/allocation.hpp"
-#include "memory/barrierSet.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/safepoint.hpp"
@@ -576,13 +575,7 @@
     print_on(st);
   }
 
-  virtual void print_on_error(outputStream* st) const {
-    st->print_cr("Heap:");
-    print_extended_on(st);
-    st->cr();
-
-    _barrier_set->print_on(st);
-  }
+  virtual void print_on_error(outputStream* st) const;
 
   // Print all GC threads (other than the VM thread)
   // used by this heap.
--- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/bytecodeHistogram.hpp"
 #include "interpreter/bytecodeTracer.hpp"
 #include "interpreter/bytecodes.hpp"
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
@@ -38,6 +39,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -35,6 +35,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "prims/nativeLookup.hpp"
 #include "runtime/compilationPolicy.hpp"
--- a/hotspot/src/share/vm/memory/barrierSet.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -160,7 +160,7 @@
   // (For efficiency reasons, this operation is specialized for certain
   // barrier types.  Semantically, it should be thought of as a call to the
   // virtual "_work" function below, which must implement the barrier.)
-  inline void write_region(MemRegion mr);
+  void write_region(MemRegion mr);
 protected:
   virtual void write_region_work(MemRegion mr) = 0;
 public:
--- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -26,7 +26,7 @@
 #define SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP
 
 #include "memory/barrierSet.hpp"
-#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableModRefBS.inline.hpp"
 
 // Inline functions of BarrierSet, which de-virtualize certain
 // performance-critical calls when the barrier is the most common
@@ -76,7 +76,7 @@
 }
 
 
-void BarrierSet::write_region(MemRegion mr) {
+inline void BarrierSet::write_region(MemRegion mr) {
   if (kind() == CardTableModRef) {
     ((CardTableModRefBS*)this)->inline_write_region(mr);
   } else {
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableModRefBS.inline.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/sharedHeap.hpp"
 #include "memory/space.hpp"
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -27,7 +27,6 @@
 
 #include "memory/modRefBarrierSet.hpp"
 #include "oops/oop.hpp"
-#include "oops/oop.inline2.hpp"
 
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
@@ -45,6 +44,7 @@
 class OopsInGenClosure;
 class DirtyCardToOopClosure;
 class ClearNoncleanCardWrapper;
+class CardTableRS;
 
 class CardTableModRefBS: public ModRefBarrierSet {
   // Some classes get to look at some private stuff.
@@ -333,15 +333,7 @@
 
   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
 
-  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) {
-    jbyte* byte = byte_for((void*)field);
-    if (release) {
-      // Perform a releasing store if requested.
-      OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
-    } else {
-      *byte = dirty_card;
-    }
-  }
+  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release);
 
   // These are used by G1, when it uses the card table as a temporary data
   // structure for card claiming.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2000, 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
+ * 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_CARDTABLEMODREFBS_INLINE_HPP
+#define SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
+
+#include "memory/cardTableModRefBS.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/orderAccess.inline.hpp"
+
+template <class T> inline void CardTableModRefBS::inline_write_ref_field(T* field, oop newVal, bool release) {
+  jbyte* byte = byte_for((void*)field);
+  if (release) {
+    // Perform a releasing store if requested.
+    OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
+  } else {
+    *byte = dirty_card;
+  }
+}
+
+#endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -597,7 +597,7 @@
   HeapWord* result = NULL;
 
   // Loop until the allocation is satisfied, or unsatisfied after GC.
-  for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
+  for (uint try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
     HandleMark hm; // Discard any handles allocated in each iteration.
 
     // First allocation attempt is lock-free.
@@ -611,7 +611,7 @@
         return result;
       }
     }
-    unsigned int gc_count_before;  // Read inside the Heap_lock locked region.
+    uint gc_count_before;  // Read inside the Heap_lock locked region.
     {
       MutexLocker ml(Heap_lock);
       if (PrintGC && Verbose) {
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -41,7 +41,6 @@
 #include "memory/sharedHeap.hpp"
 #include "memory/space.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.hpp"
--- a/hotspot/src/share/vm/memory/genOopClosures.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/genOopClosures.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -189,16 +189,4 @@
   inline void do_oop_nv(narrowOop* p);
 };
 
-class VerifyOopClosure: public OopClosure {
- protected:
-  template <class T> inline void do_oop_work(T* p) {
-    oop obj = oopDesc::load_decode_heap_oop(p);
-    guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
-  }
- public:
-  virtual void do_oop(oop* p);
-  virtual void do_oop(narrowOop* p);
-  static VerifyOopClosure verify_oop;
-};
-
 #endif // SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
--- a/hotspot/src/share/vm/memory/heapInspection.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/heapInspection.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -24,10 +24,12 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.hpp"
+#include "classfile/systemDictionary.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
@@ -39,6 +41,19 @@
 
 // HeapInspection
 
+inline KlassInfoEntry::~KlassInfoEntry() {
+  if (_subclasses != NULL) {
+    delete _subclasses;
+  }
+}
+
+inline void KlassInfoEntry::add_subclass(KlassInfoEntry* cie) {
+  if (_subclasses == NULL) {
+    _subclasses = new  (ResourceObj::C_HEAP, mtInternal) GrowableArray<KlassInfoEntry*>(4, true);
+  }
+  _subclasses->append(cie);
+}
+
 int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) {
   if(e1->_instance_words > e2->_instance_words) {
     return -1;
@@ -129,7 +144,7 @@
   _table->lookup(k);
 }
 
-KlassInfoTable::KlassInfoTable(bool need_class_stats) {
+KlassInfoTable::KlassInfoTable(bool add_all_classes) {
   _size_of_instances_in_words = 0;
   _size = 0;
   _ref = (HeapWord*) Universe::boolArrayKlassObj();
@@ -141,7 +156,7 @@
     for (int index = 0; index < _size; index++) {
       _buckets[index].initialize();
     }
-    if (need_class_stats) {
+    if (add_all_classes) {
       AllClassesFinder finder(this);
       ClassLoaderDataGraph::classes_do(&finder);
     }
@@ -299,6 +314,191 @@
   st->cr();
 }
 
+class HierarchyClosure : public KlassInfoClosure {
+private:
+  GrowableArray<KlassInfoEntry*> *_elements;
+public:
+  HierarchyClosure(GrowableArray<KlassInfoEntry*> *_elements) : _elements(_elements) {}
+
+  void do_cinfo(KlassInfoEntry* cie) {
+    // ignore array classes
+    if (cie->klass()->oop_is_instance()) {
+      _elements->append(cie);
+    }
+  }
+};
+
+void KlassHierarchy::print_class_hierarchy(outputStream* st, bool print_interfaces,
+                                           bool print_subclasses, char* classname) {
+  ResourceMark rm;
+  Stack <KlassInfoEntry*, mtClass> class_stack;
+  GrowableArray<KlassInfoEntry*> elements;
+
+  // Add all classes to the KlassInfoTable, which allows for quick lookup.
+  // A KlassInfoEntry will be created for each class.
+  KlassInfoTable cit(true);
+  if (cit.allocation_failed()) {
+    st->print_cr("ERROR: Ran out of C-heap; hierarchy not generated");
+    return;
+  }
+
+  // Add all created KlassInfoEntry instances to the elements array for easy
+  // iteration, and to allow each KlassInfoEntry instance to have a unique index.
+  HierarchyClosure hc(&elements);
+  cit.iterate(&hc);
+
+  for(int i = 0; i < elements.length(); i++) {
+    KlassInfoEntry* cie = elements.at(i);
+    const InstanceKlass* k = (InstanceKlass*)cie->klass();
+    Klass* super = ((InstanceKlass*)k)->java_super();
+
+    // Set the index for the class.
+    cie->set_index(i + 1);
+
+    // Add the class to the subclass array of its superclass.
+    if (super != NULL) {
+      KlassInfoEntry* super_cie = cit.lookup(super);
+      assert(super_cie != NULL, "could not lookup superclass");
+      super_cie->add_subclass(cie);
+    }
+  }
+
+  // Set the do_print flag for each class that should be printed.
+  for(int i = 0; i < elements.length(); i++) {
+    KlassInfoEntry* cie = elements.at(i);
+    if (classname == NULL) {
+      // We are printing all classes.
+      cie->set_do_print(true);
+    } else {
+      // We are only printing the hierarchy of a specific class.
+      if (strcmp(classname, cie->klass()->external_name()) == 0) {
+        KlassHierarchy::set_do_print_for_class_hierarchy(cie, &cit, print_subclasses);
+      }
+    }
+  }
+
+  // Now we do a depth first traversal of the class hierachry. The class_stack will
+  // maintain the list of classes we still need to process. Start things off
+  // by priming it with java.lang.Object.
+  KlassInfoEntry* jlo_cie = cit.lookup(SystemDictionary::Object_klass());
+  assert(jlo_cie != NULL, "could not lookup java.lang.Object");
+  class_stack.push(jlo_cie);
+
+  // Repeatedly pop the top item off the stack, print its class info,
+  // and push all of its subclasses on to the stack. Do this until there
+  // are no classes left on the stack.
+  while (!class_stack.is_empty()) {
+    KlassInfoEntry* curr_cie = class_stack.pop();
+    if (curr_cie->do_print()) {
+      print_class(st, curr_cie, print_interfaces);
+      if (curr_cie->subclasses() != NULL) {
+        // Current class has subclasses, so push all of them onto the stack.
+        for (int i = 0; i < curr_cie->subclasses()->length(); i++) {
+          KlassInfoEntry* cie = curr_cie->subclasses()->at(i);
+          if (cie->do_print()) {
+            class_stack.push(cie);
+          }
+        }
+      }
+    }
+  }
+
+  st->flush();
+}
+
+// Sets the do_print flag for every superclass and subclass of the specified class.
+void KlassHierarchy::set_do_print_for_class_hierarchy(KlassInfoEntry* cie, KlassInfoTable* cit,
+                                                      bool print_subclasses) {
+  // Set do_print for all superclasses of this class.
+  Klass* super = ((InstanceKlass*)cie->klass())->java_super();
+  while (super != NULL) {
+    KlassInfoEntry* super_cie = cit->lookup(super);
+    super_cie->set_do_print(true);
+    super = super->super();
+  }
+
+  // Set do_print for this class and all of its subclasses.
+  Stack <KlassInfoEntry*, mtClass> class_stack;
+  class_stack.push(cie);
+  while (!class_stack.is_empty()) {
+    KlassInfoEntry* curr_cie = class_stack.pop();
+    curr_cie->set_do_print(true);
+    if (print_subclasses && curr_cie->subclasses() != NULL) {
+      // Current class has subclasses, so push all of them onto the stack.
+      for (int i = 0; i < curr_cie->subclasses()->length(); i++) {
+        KlassInfoEntry* cie = curr_cie->subclasses()->at(i);
+        class_stack.push(cie);
+      }
+    }
+  }
+}
+
+static void print_indent(outputStream* st, int indent) {
+  while (indent != 0) {
+    st->print("|");
+    indent--;
+    if (indent != 0) {
+      st->print("  ");
+    }
+  }
+}
+
+// Print the class name and its unique ClassLoader identifer.
+static void print_classname(outputStream* st, Klass* klass) {
+  oop loader_oop = klass->class_loader_data()->class_loader();
+  st->print("%s/", klass->external_name());
+  if (loader_oop == NULL) {
+    st->print("null");
+  } else {
+    st->print(INTPTR_FORMAT, klass->class_loader_data());
+  }
+}
+
+static void print_interface(outputStream* st, Klass* intf_klass, const char* intf_type, int indent) {
+  print_indent(st, indent);
+  st->print("  implements ");
+  print_classname(st, intf_klass);
+  st->print(" (%s intf)\n", intf_type);
+}
+
+void KlassHierarchy::print_class(outputStream* st, KlassInfoEntry* cie, bool print_interfaces) {
+  ResourceMark rm;
+  InstanceKlass* klass = (InstanceKlass*)cie->klass();
+  int indent = 0;
+
+  // Print indentation with proper indicators of superclass.
+  Klass* super = klass->super();
+  while (super != NULL) {
+    super = super->super();
+    indent++;
+  }
+  print_indent(st, indent);
+  if (indent != 0) st->print("--");
+
+  // Print the class name, its unique ClassLoader identifer, and if it is an interface.
+  print_classname(st, klass);
+  if (klass->is_interface()) {
+    st->print(" (intf)");
+  }
+  st->print("\n");
+
+  // Print any interfaces the class has.
+  if (print_interfaces) {
+    Array<Klass*>* local_intfs = klass->local_interfaces();
+    Array<Klass*>* trans_intfs = klass->transitive_interfaces();
+    for (int i = 0; i < local_intfs->length(); i++) {
+      print_interface(st, local_intfs->at(i), "declared", indent);
+    }
+    for (int i = 0; i < trans_intfs->length(); i++) {
+      Klass* trans_interface = trans_intfs->at(i);
+      // Only print transitive interfaces if they are not also declared.
+      if (!local_intfs->contains(trans_interface)) {
+        print_interface(st, trans_interface, "inherited", indent);
+      }
+    }
+  }
+}
+
 void KlassInfoHisto::print_class_stats(outputStream* st,
                                       bool csv_format, const char *columns) {
   ResourceMark rm;
@@ -320,6 +520,8 @@
     elements()->at(i)->set_index(i+1);
   }
 
+  // First iteration is for accumulating stats totals in colsum_table[].
+  // Second iteration is for printing stats for each class.
   for (int pass=1; pass<=2; pass++) {
     if (pass == 2) {
       print_title(st, csv_format, selected, width_table, name_table);
@@ -328,6 +530,7 @@
       KlassInfoEntry* e = (KlassInfoEntry*)elements()->at(i);
       const Klass* k = e->klass();
 
+      // Get the stats for this class.
       memset(&sz, 0, sizeof(sz));
       sz._inst_count = e->count();
       sz._inst_bytes = HeapWordSize * e->words();
@@ -335,11 +538,13 @@
       sz._total_bytes = sz._ro_bytes + sz._rw_bytes;
 
       if (pass == 1) {
+        // Add the stats for this class to the overall totals.
         for (int c=0; c<KlassSizeStats::_num_columns; c++) {
           colsum_table[c] += col_table[c];
         }
       } else {
         int super_index = -1;
+        // Print the stats for this class.
         if (k->oop_is_instance()) {
           Klass* super = ((InstanceKlass*)k)->java_super();
           if (super) {
@@ -373,6 +578,8 @@
     }
 
     if (pass == 1) {
+      // Calculate the minimum width needed for the column by accounting for the
+      // column header width and the width of the largest value in the column.
       for (int c=0; c<KlassSizeStats::_num_columns; c++) {
         width_table[c] = col_width(colsum_table[c], name_table[c]);
       }
@@ -381,6 +588,7 @@
 
   sz_sum._inst_size = 0;
 
+  // Print the column totals.
   if (csv_format) {
     st->print(",");
     for (int c=0; c<KlassSizeStats::_num_columns; c++) {
@@ -514,6 +722,7 @@
 
   KlassInfoTable cit(_print_class_stats);
   if (!cit.allocation_failed()) {
+    // populate table with object allocation info
     size_t missed_count = populate_table(&cit);
     if (missed_count != 0) {
       st->print_cr("WARNING: Ran out of C-heap; undercounted " SIZE_FORMAT
@@ -533,7 +742,7 @@
     histo.sort();
     histo.print_histo_on(st, _print_class_stats, _csv_format, _columns);
   } else {
-    st->print_cr("WARNING: Ran out of C-heap; histogram not generated");
+    st->print_cr("ERROR: Ran out of C-heap; histogram not generated");
   }
   st->flush();
 }
--- a/hotspot/src/share/vm/memory/heapInspection.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/heapInspection.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -25,8 +25,9 @@
 #ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 #define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 
-#include "memory/allocation.inline.hpp"
-#include "oops/oop.inline.hpp"
+#include "memory/allocation.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.hpp"
 #include "oops/annotations.hpp"
 #include "utilities/macros.hpp"
 
@@ -188,11 +189,15 @@
   long            _instance_count;
   size_t          _instance_words;
   long            _index;
+  bool            _do_print; // True if we should print this class when printing the class hierarchy.
+  GrowableArray<KlassInfoEntry*>* _subclasses;
 
  public:
   KlassInfoEntry(Klass* k, KlassInfoEntry* next) :
-    _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1)
+    _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1),
+    _do_print(false), _subclasses(NULL)
   {}
+  ~KlassInfoEntry();
   KlassInfoEntry* next() const   { return _next; }
   bool is_equal(const Klass* k)  { return k == _klass; }
   Klass* klass()  const      { return _klass; }
@@ -202,6 +207,10 @@
   void set_words(size_t wds) { _instance_words = wds; }
   void set_index(long index) { _index = index; }
   long index()    const      { return _index; }
+  GrowableArray<KlassInfoEntry*>* subclasses() const { return _subclasses; }
+  void add_subclass(KlassInfoEntry* cie);
+  void set_do_print(bool do_print) { _do_print = do_print; }
+  bool do_print() const      { return _do_print; }
   int compare(KlassInfoEntry* e1, KlassInfoEntry* e2);
   void print_on(outputStream* st) const;
   const char* name() const;
@@ -248,7 +257,7 @@
   };
 
  public:
-  KlassInfoTable(bool need_class_stats);
+  KlassInfoTable(bool add_all_classes);
   ~KlassInfoTable();
   bool record_instance(const oop obj);
   void iterate(KlassInfoClosure* cic);
@@ -256,6 +265,18 @@
   size_t size_of_instances_in_words() const;
 
   friend class KlassInfoHisto;
+  friend class KlassHierarchy;
+};
+
+class KlassHierarchy : AllStatic {
+ public:
+  static void print_class_hierarchy(outputStream* st, bool print_interfaces,  bool print_subclasses,
+                                    char* classname);
+
+ private:
+  static void set_do_print_for_class_hierarchy(KlassInfoEntry* cie, KlassInfoTable* cit,
+                                               bool print_subclasse);
+  static void print_class(outputStream* st, KlassInfoEntry* cie, bool print_subclasses);
 };
 
 class KlassInfoHisto : public StackObj {
--- a/hotspot/src/share/vm/memory/space.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/space.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -36,7 +36,6 @@
 #include "memory/space.inline.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/java.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/prefetch.inline.hpp"
--- a/hotspot/src/share/vm/memory/space.inline.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/space.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -29,6 +29,7 @@
 #include "gc_implementation/shared/markSweep.inline.hpp"
 #include "gc_implementation/shared/spaceDecorator.hpp"
 #include "gc_interface/collectedHeap.hpp"
+#include "memory/generation.hpp"
 #include "memory/space.hpp"
 #include "memory/universe.hpp"
 #include "runtime/prefetch.inline.hpp"
--- a/hotspot/src/share/vm/memory/universe.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/memory/universe.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -50,6 +50,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/instanceRefKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
--- a/hotspot/src/share/vm/oops/compiledICHolder.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -26,7 +26,6 @@
 #include "oops/compiledICHolder.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 
 volatile int CompiledICHolder::_live_count;
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -36,11 +36,14 @@
 #include "oops/constantPool.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/fieldType.hpp"
 #include "runtime/init.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/vframe.hpp"
+#include "utilities/copy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -28,7 +28,7 @@
 #include "interpreter/rewriter.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/cpCache.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/share/vm/oops/klass.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/klass.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -35,7 +35,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "trace/traceMacros.hpp"
--- a/hotspot/src/share/vm/oops/markOop.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/markOop.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,17 +25,40 @@
 #include "precompiled.hpp"
 #include "oops/markOop.hpp"
 #include "runtime/thread.inline.hpp"
+#include "runtime/objectMonitor.inline.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 void markOopDesc::print_on(outputStream* st) const {
-  if (is_locked()) {
-    st->print("locked(" INTPTR_FORMAT ")->", value());
-    markOop(*(markOop*)value())->print_on(st);
+  if (is_marked()) {
+    st->print(" marked(" INTPTR_FORMAT ")", value());
+  } else if (is_locked()) {
+    st->print(" locked(" INTPTR_FORMAT ")->", value());
+    if (is_neutral()) {
+      st->print("is_neutral");
+      if (has_no_hash()) st->print(" no_hash");
+      else st->print(" hash=" INTPTR_FORMAT, hash());
+      st->print(" age=%d", age());
+    } else if (has_bias_pattern()) {
+      st->print("is_biased");
+      JavaThread* jt = biased_locker();
+      st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt));
+    } else if (has_monitor()) {
+      ObjectMonitor* mon = monitor();
+      if (mon == NULL)
+        st->print("monitor=NULL");
+      else {
+        BasicLock * bl = (BasicLock *) mon->owner();
+        st->print("monitor={count="INTPTR_FORMAT",waiters="INTPTR_FORMAT",recursions="INTPTR_FORMAT",owner="INTPTR_FORMAT"}",
+                mon->count(), mon->waiters(), mon->recursions(), p2i(bl));
+      }
+    } else {
+      st->print("??");
+    }
   } else {
     assert(is_unlocked() || has_bias_pattern(), "just checking");
     st->print("mark(");
-    if (has_bias_pattern())  st->print("biased,");
+    if (has_bias_pattern()) st->print("biased,");
     st->print("hash %#lx,", hash());
     st->print("age %d)", age());
   }
--- a/hotspot/src/share/vm/oops/methodData.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -36,6 +36,7 @@
 #include "runtime/deoptimization.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "utilities/copy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -35,11 +35,9 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
-#include "oops/objArrayKlass.hpp"
 #include "oops/objArrayKlass.inline.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutexLocker.hpp"
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -78,15 +78,7 @@
   HeapWord* base() const      { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }
 
   // Accessing
-  oop obj_at(int index) const {
-    // With UseCompressedOops decode the narrow oop in the objArray to an
-    // uncompressed oop.  Otherwise this is simply a "*" operator.
-    if (UseCompressedOops) {
-      return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
-    } else {
-      return load_decode_heap_oop(obj_at_addr<oop>(index));
-    }
-  }
+  oop obj_at(int index) const;
 
   void obj_at_put(int index, oop value) {
     if (UseCompressedOops) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 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
+ * 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_OOPS_OBJARRAYOOP_INLINE_HPP
+#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
+
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/globals.hpp"
+
+inline oop objArrayOopDesc::obj_at(int index) const {
+  // With UseCompressedOops decode the narrow oop in the objArray to an
+  // uncompressed oop.  Otherwise this is simply a "*" operator.
+  if (UseCompressedOops) {
+    return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
+  } else {
+    return load_decode_heap_oop(obj_at_addr<oop>(index));
+  }
+}
+
+#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
--- a/hotspot/src/share/vm/oops/oop.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/oop.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -24,8 +24,9 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/copy.hpp"
@@ -120,5 +121,24 @@
 
 VerifyOopClosure VerifyOopClosure::verify_oop;
 
+template <class T> void VerifyOopClosure::do_oop_work(T* p) {
+  oop obj = oopDesc::load_decode_heap_oop(p);
+  guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
+}
+
 void VerifyOopClosure::do_oop(oop* p)       { VerifyOopClosure::do_oop_work(p); }
 void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); }
+
+// type test operations that doesn't require inclusion of oop.inline.hpp.
+bool oopDesc::is_instance_noinline()          const { return is_instance();            }
+bool oopDesc::is_instanceMirror_noinline()    const { return is_instanceMirror();      }
+bool oopDesc::is_instanceClassLoader_noline() const { return is_instanceClassLoader(); }
+bool oopDesc::is_instanceRef_noline()         const { return is_instanceRef();         }
+bool oopDesc::is_array_noinline()             const { return is_array();               }
+bool oopDesc::is_objArray_noinline()          const { return is_objArray();            }
+bool oopDesc::is_typeArray_noinline()         const { return is_typeArray();           }
+
+bool oopDesc::has_klass_gap() {
+  // Only has a klass gap when compressed class pointers are used.
+  return UseCompressedClassPointers;
+}
--- a/hotspot/src/share/vm/oops/oop.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/oop.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -108,7 +108,7 @@
   // to be able to figure out the size of an object knowing its klass.
   int size_given_klass(Klass* klass);
 
-  // type test operations (inlined in oop.inline.h)
+  // type test operations (inlined in oop.inline.hpp)
   bool is_instance()            const;
   bool is_instanceMirror()      const;
   bool is_instanceClassLoader() const;
@@ -117,6 +117,15 @@
   bool is_objArray()            const;
   bool is_typeArray()           const;
 
+  // type test operations that don't require inclusion of oop.inline.hpp.
+  bool is_instance_noinline()          const;
+  bool is_instanceMirror_noinline()    const;
+  bool is_instanceClassLoader_noline() const;
+  bool is_instanceRef_noline()         const;
+  bool is_array_noinline()             const;
+  bool is_objArray_noinline()          const;
+  bool is_typeArray_noinline()         const;
+
  private:
   // field addresses in oop
   void*     field_base(int offset)        const;
@@ -370,10 +379,15 @@
   markOop  displaced_mark() const;
   void     set_displaced_mark(markOop m);
 
+  static bool has_klass_gap();
+
   // for code generation
-  static int mark_offset_in_bytes()    { return offset_of(oopDesc, _mark); }
-  static int klass_offset_in_bytes()   { return offset_of(oopDesc, _metadata._klass); }
-  static int klass_gap_offset_in_bytes();
+  static int mark_offset_in_bytes()      { return offset_of(oopDesc, _mark); }
+  static int klass_offset_in_bytes()     { return offset_of(oopDesc, _metadata._klass); }
+  static int klass_gap_offset_in_bytes() {
+    assert(has_klass_gap(), "only applicable to compressed klass pointers");
+    return klass_offset_in_bytes() + sizeof(narrowKlass);
+  }
 };
 
 #endif // SHARE_VM_OOPS_OOP_HPP
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -71,11 +71,6 @@
   }
 }
 
-inline int oopDesc::klass_gap_offset_in_bytes() {
-  assert(UseCompressedClassPointers, "only applicable to compressed klass pointers");
-  return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass);
-}
-
 inline Klass** oopDesc::klass_addr() {
   // Only used internally and with CMS and will not work with
   // UseCompressedOops
@@ -602,8 +597,11 @@
   klass()->oop_follow_contents(this);
 }
 
+inline bool oopDesc::is_scavengable() const {
+  return Universe::heap()->is_scavengable(this);
+}
+
 // Used by scavengers
-
 inline bool oopDesc::is_forwarded() const {
   // The extra heap check is needed since the obj might be locked, in which case the
   // mark would point to a stack location and have the sentinel bit cleared
--- a/hotspot/src/share/vm/oops/oop.inline2.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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_OOPS_OOP_INLINE2_HPP
-#define SHARE_VM_OOPS_OOP_INLINE2_HPP
-
-#include "gc_interface/collectedHeap.hpp"
-#include "memory/generation.hpp"
-#include "memory/universe.hpp"
-#include "oops/oop.hpp"
-
-// Implementation of all inlined member functions defined in oop.hpp
-// We need a separate file to avoid circular references
-
-inline bool oopDesc::is_scavengable() const {
-  return Universe::heap()->is_scavengable(this);
-}
-#endif // SHARE_VM_OOPS_OOP_INLINE2_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/oops/verifyOopClosure.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 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
+ * 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_OOPS_VERIFYOOPCLOSURE_HPP
+#define SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
+
+#include "memory/iterator.hpp"
+
+class VerifyOopClosure: public OopClosure {
+ protected:
+  template <class T> void do_oop_work(T* p);
+ public:
+  virtual void do_oop(oop* p);
+  virtual void do_oop(narrowOop* p);
+  static VerifyOopClosure verify_oop;
+};
+
+#endif // SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
--- a/hotspot/src/share/vm/opto/callGenerator.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -39,7 +39,7 @@
 #include "opto/rootnode.hpp"
 #include "opto/runtime.hpp"
 #include "opto/subnode.hpp"
-
+#include "runtime/sharedRuntime.hpp"
 
 // Utility function.
 const TypeFunc* CallGenerator::tf() const {
--- a/hotspot/src/share/vm/opto/callnode.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
 #include "ci/bcEscapeAnalyzer.hpp"
 #include "compiler/oopMap.hpp"
 #include "opto/callGenerator.hpp"
@@ -1673,6 +1674,9 @@
       // The lock could be marked eliminated by lock coarsening
       // code during first IGVN before EA. Replace coarsened flag
       // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+      this->log_lock_optimization(phase->C,"eliminate_lock_set_non_esc1");
+#endif
       this->set_non_esc_obj();
       return result;
     }
@@ -1734,6 +1738,9 @@
           AbstractLockNode* lock = lock_ops.at(i);
 
           // Mark it eliminated by coarsening and update any counters
+#ifdef ASSERT
+          lock->log_lock_optimization(phase->C, "eliminate_lock_set_coarsened");
+#endif
           lock->set_coarsened();
         }
       } else if (ctrl->is_Region() &&
@@ -1752,16 +1759,33 @@
 
 //=============================================================================
 bool LockNode::is_nested_lock_region() {
+  return is_nested_lock_region(NULL);
+}
+
+// p is used for access to compilation log; no logging if NULL
+bool LockNode::is_nested_lock_region(Compile * c) {
   BoxLockNode* box = box_node()->as_BoxLock();
   int stk_slot = box->stack_slot();
-  if (stk_slot <= 0)
+  if (stk_slot <= 0) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_1");
+#endif
     return false; // External lock or it is not Box (Phi node).
+  }
 
   // Ignore complex cases: merged locks or multiple locks.
   Node* obj = obj_node();
   LockNode* unique_lock = NULL;
-  if (!box->is_simple_lock_region(&unique_lock, obj) ||
-      (unique_lock != this)) {
+  if (!box->is_simple_lock_region(&unique_lock, obj)) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_2a");
+#endif
+    return false;
+  }
+  if (unique_lock != this) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_2b");
+#endif
     return false;
   }
 
@@ -1781,6 +1805,9 @@
       }
     }
   }
+#ifdef ASSERT
+  this->log_lock_optimization(c, "eliminate_lock_INLR_3");
+#endif
   return false;
 }
 
@@ -1812,12 +1839,43 @@
       // The lock could be marked eliminated by lock coarsening
       // code during first IGVN before EA. Replace coarsened flag
       // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+      this->log_lock_optimization(phase->C, "eliminate_lock_set_non_esc2");
+#endif
       this->set_non_esc_obj();
     }
   }
   return result;
 }
 
+const char * AbstractLockNode::kind_as_string() const {
+  return is_coarsened()   ? "coarsened" :
+         is_nested()      ? "nested" :
+         is_non_esc_obj() ? "non_escaping" :
+         "?";
+}
+
+void AbstractLockNode::log_lock_optimization(Compile *C, const char * tag)  const {
+  if (C == NULL) {
+    return;
+  }
+  CompileLog* log = C->log();
+  if (log != NULL) {
+    log->begin_head("%s lock='%d' compile_id='%d' class_id='%s' kind='%s'",
+          tag, is_Lock(), C->compile_id(),
+          is_Unlock() ? "unlock" : is_Lock() ? "lock" : "?",
+          kind_as_string());
+    log->stamp();
+    log->end_head();
+    JVMState* p = is_Unlock() ? (as_Unlock()->dbg_jvms()) : jvms();
+    while (p != NULL) {
+      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
+      p = p->caller();
+    }
+    log->tail(tag);
+  }
+}
+
 ArrayCopyNode::ArrayCopyNode(Compile* C, bool alloc_tightly_coupled)
   : CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
     _alloc_tightly_coupled(alloc_tightly_coupled),
--- a/hotspot/src/share/vm/opto/callnode.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/callnode.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -985,6 +985,9 @@
   bool is_coarsened()   const { return (_kind == Coarsened); }
   bool is_nested()      const { return (_kind == Nested); }
 
+  const char * kind_as_string() const;
+  void log_lock_optimization(Compile* c, const char * tag) const;
+
   void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); }
   void set_coarsened()   { _kind = Coarsened; set_eliminated_lock_counter(); }
   void set_nested()      { _kind = Nested; set_eliminated_lock_counter(); }
@@ -1045,15 +1048,24 @@
   }
 
   bool is_nested_lock_region(); // Is this Lock nested?
+  bool is_nested_lock_region(Compile * c); // Why isn't this Lock nested?
 };
 
 //------------------------------Unlock---------------------------------------
 // High-level unlock operation
 class UnlockNode : public AbstractLockNode {
+private:
+#ifdef ASSERT
+  JVMState* const _dbg_jvms;      // Pointer to list of JVM State objects
+#endif
 public:
   virtual int Opcode() const;
   virtual uint size_of() const; // Size is bigger
-  UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf ) {
+  UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf )
+#ifdef ASSERT
+    , _dbg_jvms(NULL)
+#endif
+  {
     init_class_id(Class_Unlock);
     init_flags(Flag_is_macro);
     C->add_macro_node(this);
@@ -1061,6 +1073,14 @@
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
   // unlock is never a safepoint
   virtual bool        guaranteed_safepoint()  { return false; }
+#ifdef ASSERT
+  void set_dbg_jvms(JVMState* s) {
+    *(JVMState**)&_dbg_jvms = s;  // override const attribute in the accessor
+  }
+  JVMState* dbg_jvms() const { return _dbg_jvms; }
+#else
+  JVMState* dbg_jvms() const { return NULL; }
+#endif
 };
 
 class GraphKit;
--- a/hotspot/src/share/vm/opto/cfgnode.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -1015,7 +1015,6 @@
     if( jtip && ttip ) {
       if( jtip->is_loaded() &&  jtip->klass()->is_interface() &&
           ttip->is_loaded() && !ttip->klass()->is_interface() ) {
-        // Happens in a CTW of rt.jar, 320-341, no extra flags
         assert(ft == ttip->cast_to_ptr_type(jtip->ptr()) ||
                ft->isa_narrowoop() && ft->make_ptr() == ttip->cast_to_ptr_type(jtip->ptr()), "");
         jt = ft;
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/compile.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -64,6 +64,7 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/arguments.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/timer.hpp"
--- a/hotspot/src/share/vm/opto/convertnode.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/convertnode.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -28,6 +28,7 @@
 #include "opto/matcher.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 //=============================================================================
 //------------------------------Identity---------------------------------------
--- a/hotspot/src/share/vm/opto/escape.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/escape.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -1802,6 +1802,9 @@
             // The lock could be marked eliminated by lock coarsening
             // code during first IGVN before EA. Replace coarsened flag
             // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+            alock->log_lock_optimization(C, "eliminate_lock_set_non_esc3");
+#endif
             alock->set_non_esc_obj();
           }
         }
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -3244,6 +3244,9 @@
 
   const TypeFunc *tf = OptoRuntime::complete_monitor_exit_Type();
   UnlockNode *unlock = new UnlockNode(C, tf);
+#ifdef ASSERT
+  unlock->set_dbg_jvms(sync_jvms());
+#endif
   uint raw_idx = Compile::AliasIdxRaw;
   unlock->init_req( TypeFunc::Control, control() );
   unlock->init_req( TypeFunc::Memory , memory(raw_idx) );
@@ -3754,6 +3757,17 @@
   sync_kit(ideal);
 }
 
+Node* GraphKit::byte_map_base_node() {
+  // Get base of card map
+  CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
+  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
+  if (ct->byte_map_base != NULL) {
+    return makecon(TypeRawPtr::make((address)ct->byte_map_base));
+  } else {
+    return null();
+  }
+}
+
 // vanilla/CMS post barrier
 // Insert a write-barrier store.  This is to let generational GC work; we have
 // to flag all oop-stores before the next GC point.
--- a/hotspot/src/share/vm/opto/graphKit.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/graphKit.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -104,16 +104,7 @@
   // (See also macro MakeConX in type.hpp, which uses intcon or longcon.)
 
   // Helper for byte_map_base
-  Node* byte_map_base_node() {
-    // Get base of card map
-    CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
-    assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
-    if (ct->byte_map_base != NULL) {
-      return makecon(TypeRawPtr::make((address)ct->byte_map_base));
-    } else {
-      return null();
-    }
-  }
+  Node* byte_map_base_node();
 
   jint  find_int_con(Node* n, jint value_if_unknown) {
     return _gvn.find_int_con(n, value_if_unknown);
--- a/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -31,6 +31,7 @@
 #include "opto/cfgnode.hpp"
 #include "opto/machnode.hpp"
 #include "opto/runtime.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 // Optimization - Graph Style
 
--- a/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -2598,8 +2598,7 @@
   // bypassing each other.  Happens after null checks, so the
   // exception paths do not take memory state from the memory barrier,
   // so there's no problems making a strong assert about mixing users
-  // of safe & unsafe memory.  Otherwise fails in a CTW of rt.jar
-  // around 5701, class sun/reflect/UnsafeBooleanFieldAccessorImpl.
+  // of safe & unsafe memory.
   if (need_mem_bar) insert_mem_bar(Op_MemBarCPUOrder);
 
   if (!is_store) {
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -436,6 +436,19 @@
       return false; // cyclic loop or this loop trips only once
   }
 
+  if (phi_incr != NULL) {
+    // check if there is a possiblity of IV overflowing after the first increment
+    if (stride_con > 0) {
+      if (init_t->_hi > max_jint - stride_con) {
+        return false;
+      }
+    } else {
+      if (init_t->_lo < min_jint - stride_con) {
+        return false;
+      }
+    }
+  }
+
   // =================================================
   // ---- SUCCESS!   Found A Trip-Counted Loop!  -----
   //
--- a/hotspot/src/share/vm/opto/macro.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/macro.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -1890,7 +1890,7 @@
     // Box is used only in one lock region. Mark this box as eliminated.
     _igvn.hash_delete(oldbox);
     oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value
-    _igvn.hash_insert(oldbox);
+     _igvn.hash_insert(oldbox);
 
     for (uint i = 0; i < oldbox->outcnt(); i++) {
       Node* u = oldbox->raw_out(i);
@@ -1899,6 +1899,9 @@
         // Check lock's box since box could be referenced by Lock's debug info.
         if (alock->box_node() == oldbox) {
           // Mark eliminated all related locks and unlocks.
+#ifdef ASSERT
+          alock->log_lock_optimization(C, "eliminate_lock_set_non_esc4");
+#endif
           alock->set_non_esc_obj();
         }
       }
@@ -1925,6 +1928,9 @@
       AbstractLockNode* alock = u->as_AbstractLock();
       if (alock->box_node() == oldbox && alock->obj_node()->eqv_uncast(obj)) {
         // Replace Box and mark eliminated all related locks and unlocks.
+#ifdef ASSERT
+        alock->log_lock_optimization(C, "eliminate_lock_set_non_esc5");
+#endif
         alock->set_non_esc_obj();
         _igvn.rehash_node_delayed(alock);
         alock->set_box_node(newbox);
@@ -1971,26 +1977,38 @@
        return;
     } else if (!alock->is_non_esc_obj()) { // Not eliminated or coarsened
       // Only Lock node has JVMState needed here.
-      if (alock->jvms() != NULL && alock->as_Lock()->is_nested_lock_region()) {
-        // Mark eliminated related nested locks and unlocks.
-        Node* obj = alock->obj_node();
-        BoxLockNode* box_node = alock->box_node()->as_BoxLock();
-        assert(!box_node->is_eliminated(), "should not be marked yet");
-        // Note: BoxLock node is marked eliminated only here
-        // and it is used to indicate that all associated lock
-        // and unlock nodes are marked for elimination.
-        box_node->set_eliminated(); // Box's hash is always NO_HASH here
-        for (uint i = 0; i < box_node->outcnt(); i++) {
-          Node* u = box_node->raw_out(i);
-          if (u->is_AbstractLock()) {
-            alock = u->as_AbstractLock();
-            if (alock->box_node() == box_node) {
-              // Verify that this Box is referenced only by related locks.
-              assert(alock->obj_node()->eqv_uncast(obj), "");
-              // Mark all related locks and unlocks.
-              alock->set_nested();
+      // Not that preceding claim is documented anywhere else.
+      if (alock->jvms() != NULL) {
+        if (alock->as_Lock()->is_nested_lock_region()) {
+          // Mark eliminated related nested locks and unlocks.
+          Node* obj = alock->obj_node();
+          BoxLockNode* box_node = alock->box_node()->as_BoxLock();
+          assert(!box_node->is_eliminated(), "should not be marked yet");
+          // Note: BoxLock node is marked eliminated only here
+          // and it is used to indicate that all associated lock
+          // and unlock nodes are marked for elimination.
+          box_node->set_eliminated(); // Box's hash is always NO_HASH here
+          for (uint i = 0; i < box_node->outcnt(); i++) {
+            Node* u = box_node->raw_out(i);
+            if (u->is_AbstractLock()) {
+              alock = u->as_AbstractLock();
+              if (alock->box_node() == box_node) {
+                // Verify that this Box is referenced only by related locks.
+                assert(alock->obj_node()->eqv_uncast(obj), "");
+                // Mark all related locks and unlocks.
+#ifdef ASSERT
+                alock->log_lock_optimization(C, "eliminate_lock_set_nested");
+#endif
+                alock->set_nested();
+              }
             }
           }
+        } else {
+#ifdef ASSERT
+          alock->log_lock_optimization(C, "eliminate_lock_NOT_nested_lock_region");
+          if (C->log() != NULL)
+            alock->as_Lock()->is_nested_lock_region(C); // rerun for debugging output
+#endif
         }
       }
       return;
@@ -2035,19 +2053,10 @@
     assert(oldbox->is_eliminated(), "should be done already");
   }
 #endif
-  CompileLog* log = C->log();
-  if (log != NULL) {
-    log->head("eliminate_lock lock='%d'",
-              alock->is_Lock());
-    JVMState* p = alock->jvms();
-    while (p != NULL) {
-      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
-      p = p->caller();
-    }
-    log->tail("eliminate_lock");
-  }
 
-  #ifndef PRODUCT
+  alock->log_lock_optimization(C, "eliminate_lock");
+
+#ifndef PRODUCT
   if (PrintEliminateLocks) {
     if (alock->is_Lock()) {
       tty->print_cr("++++ Eliminated: %d Lock", alock->_idx);
@@ -2055,7 +2064,7 @@
       tty->print_cr("++++ Eliminated: %d Unlock", alock->_idx);
     }
   }
-  #endif
+#endif
 
   Node* mem  = alock->in(TypeFunc::Memory);
   Node* ctrl = alock->in(TypeFunc::Control);
--- a/hotspot/src/share/vm/opto/matcher.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -38,6 +38,7 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 OptoReg::Name OptoReg::c_frame_pointer;
 
--- a/hotspot/src/share/vm/opto/memnode.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -40,6 +40,7 @@
 #include "opto/narrowptrnode.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/regmask.hpp"
+#include "utilities/copy.hpp"
 
 // Portions of code courtesy of Clifford Click
 
--- a/hotspot/src/share/vm/opto/parse2.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/parse2.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -29,6 +29,7 @@
 #include "compiler/compileLog.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "opto/addnode.hpp"
 #include "opto/castnode.hpp"
 #include "opto/convertnode.hpp"
--- a/hotspot/src/share/vm/opto/stringopts.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/stringopts.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -34,6 +34,7 @@
 #include "opto/runtime.hpp"
 #include "opto/stringopts.hpp"
 #include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #define __ kit.
 
--- a/hotspot/src/share/vm/opto/type.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/opto/type.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -3122,7 +3122,6 @@
   if (ftip != NULL && ktip != NULL &&
       ftip->is_loaded() &&  ftip->klass()->is_interface() &&
       ktip->is_loaded() && !ktip->klass()->is_interface()) {
-    // Happens in a CTW of rt.jar, 320-341, no extra flags
     assert(!ftip->klass_is_exact(), "interface could not be exact");
     return ktip->cast_to_ptr_type(ftip->ptr());
   }
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -160,8 +160,6 @@
 # include "oops/objArrayKlass.hpp"
 # include "oops/objArrayOop.hpp"
 # include "oops/oop.hpp"
-# include "oops/oop.inline.hpp"
-# include "oops/oop.inline2.hpp"
 # include "oops/oopsHierarchy.hpp"
 # include "oops/symbol.hpp"
 # include "oops/typeArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/forte.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/forte.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -29,7 +29,6 @@
 #include "memory/space.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "prims/forte.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/thread.inline.hpp"
--- a/hotspot/src/share/vm/prims/jni.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jni.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -42,7 +42,7 @@
 #include "oops/markOop.hpp"
 #include "oops/method.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/guardedMemory.hpp"
--- a/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -25,18 +25,21 @@
 #include "precompiled.hpp"
 #include "classfile/classLoader.hpp"
 #include "classfile/javaAssertions.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "interpreter/bytecode.hpp"
+#include "memory/barrierSet.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/method.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Fri Feb 20 14:14:08 2015 -0800
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 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
@@ -39,6 +39,7 @@
 # include "precompiled.hpp"
 # include "utilities/macros.hpp"
 #if INCLUDE_JVMTI
+# include "oops/oop.inline.hpp"
 # include "prims/jvmtiEnter.hpp"
 # include "prims/jvmtiRawMonitor.hpp"
 # include "prims/jvmtiUtil.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,8 @@
 #include "memory/resourceArea.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jniCheck.hpp"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiAgentThread.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -27,6 +27,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiEnvBase.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExtensions.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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 @@
 #include "memory/resourceArea.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiCodeBlobEvents.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -24,9 +24,11 @@
 
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/universe.inline.hpp"
 #include "prims/jvmtiGetLoadedClasses.hpp"
 #include "runtime/thread.hpp"
+#include "utilities/stack.inline.hpp"
 
 
 // The closure for GetLoadedClasses
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -29,6 +29,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiAgentThread.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiImpl.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -36,6 +36,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/klassVtable.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
 #include "prims/methodComparator.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -30,7 +30,8 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -23,13 +23,17 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/oopMapCache.hpp"
+#include "interpreter/linkResolver.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/javaCalls.hpp"
@@ -405,7 +409,7 @@
     return java_lang_invoke_MethodType::as_signature(type_str, intern_if_not_found, THREAD);
   } else if (java_lang_Class::is_instance(type_str)) {
     return java_lang_Class::as_signature(type_str, false, THREAD);
-  } else if (java_lang_String::is_instance(type_str)) {
+  } else if (java_lang_String::is_instance_inlined(type_str)) {
     if (intern_if_not_found) {
       return java_lang_String::as_symbol(type_str, THREAD);
     } else {
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -25,6 +25,8 @@
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jni.h"
 #include "prims/jvm.h"
 #include "runtime/atomic.inline.hpp"
--- a/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, 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
@@ -23,16 +23,14 @@
  */
 
 #include "precompiled.hpp"
-
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
-
+#include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "prims/jni.h"
 #include "prims/whitebox.hpp"
 #include "prims/wbtestmethods/parserTests.hpp"
 #include "runtime/interfaceSupport.hpp"
-
-#include "memory/oopFactory.hpp"
-
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
 
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -109,8 +109,6 @@
 SystemProperty *Arguments::_java_class_path = NULL;
 SystemProperty *Arguments::_sun_boot_class_path = NULL;
 
-char* Arguments::_meta_index_path = NULL;
-char* Arguments::_meta_index_dir = NULL;
 char* Arguments::_ext_dirs = NULL;
 
 // Check if head of 'option' matches 'name', and sets 'tail' to the remaining
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -260,10 +260,6 @@
   static SystemProperty *_java_class_path;
   static SystemProperty *_sun_boot_class_path;
 
-  // Meta-index for knowing what packages are in the boot class path
-  static char* _meta_index_path;
-  static char* _meta_index_dir;
-
   // temporary: to emit warning if the default ext dirs are not empty.
   // remove this variable when the warning is no longer needed.
   static char* _ext_dirs;
@@ -600,16 +596,10 @@
   static void set_ext_dirs(char *value)     { _ext_dirs = os::strdup_check_oom(value); }
   static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
   static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
-  static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
-    _meta_index_path = meta_index_path;
-    _meta_index_dir  = meta_index_dir;
-  }
 
   static char* get_java_home() { return _java_home->value(); }
   static char* get_dll_dir() { return _sun_boot_library_path->value(); }
   static char* get_sysclasspath() { return _sun_boot_class_path->value(); }
-  static char* get_meta_index_path() { return _meta_index_path; }
-  static char* get_meta_index_dir()  { return _meta_index_dir;  }
   static char* get_ext_dirs()        { return _ext_dirs;  }
   static char* get_appclasspath() { return _java_class_path->value(); }
   static void  fix_appclasspath();
--- a/hotspot/src/share/vm/runtime/basicLock.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/basicLock.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -28,6 +28,9 @@
 
 void BasicLock::print_on(outputStream* st) const {
   st->print("monitor");
+  markOop moop = displaced_header();
+  if (moop != NULL)
+    moop->print_on(st);
 }
 
 void BasicLock::move_to(oop obj, BasicLock* dest) {
--- a/hotspot/src/share/vm/runtime/biasedLocking.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "oops/klass.inline.hpp"
 #include "oops/markOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -37,6 +37,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/compilationPolicy.hpp"
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,6 +29,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/annotations.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
--- a/hotspot/src/share/vm/runtime/fprofiler.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,7 +31,6 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
--- a/hotspot/src/share/vm/runtime/frame.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -36,7 +36,7 @@
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1520,7 +1520,7 @@
           "How much the GC can expand the eden by while the GC locker "     \
           "is active (as a percentage)")                                    \
                                                                             \
-  diagnostic(intx, GCLockerRetryAllocationCount, 2,                         \
+  diagnostic(uintx, GCLockerRetryAllocationCount, 2,                        \
           "Number of times to retry allocations when "                      \
           "blocked by the GC locker")                                       \
                                                                             \
--- a/hotspot/src/share/vm/runtime/handles.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/handles.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -123,10 +123,10 @@
   };
 
 
-DEF_HANDLE(instance         , is_instance         )
-DEF_HANDLE(array            , is_array            )
-DEF_HANDLE(objArray         , is_objArray         )
-DEF_HANDLE(typeArray        , is_typeArray        )
+DEF_HANDLE(instance         , is_instance_noinline         )
+DEF_HANDLE(array            , is_array_noinline            )
+DEF_HANDLE(objArray         , is_objArray_noinline         )
+DEF_HANDLE(typeArray        , is_typeArray_noinline        )
 
 //------------------------------------------------------------------------------------------------------------------------
 
--- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -511,6 +511,12 @@
     Thread* THREAD = thread;                                         \
     debug_only(VMEntryWrapper __vew;)
 
+#define JRT_BLOCK_NO_ASYNC                                           \
+    {                                                                \
+    ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
+    Thread* THREAD = thread;                                         \
+    debug_only(VMEntryWrapper __vew;)
+
 #define JRT_BLOCK_END }
 
 #define JRT_END }
--- a/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/os.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1223,14 +1223,6 @@
   const char* home = Arguments::get_java_home();
   int home_len = (int)strlen(home);
 
-  static const char* meta_index_dir_format = "%/lib/";
-  static const char* meta_index_format = "%/lib/meta-index";
-  char* meta_index = format_boot_path(meta_index_format, home, home_len, fileSep, pathSep);
-  if (meta_index == NULL) return false;
-  char* meta_index_dir = format_boot_path(meta_index_dir_format, home, home_len, fileSep, pathSep);
-  if (meta_index_dir == NULL) return false;
-  Arguments::set_meta_index_path(meta_index, meta_index_dir);
-
   char* sysclasspath = NULL;
   struct stat st;
 
@@ -1244,38 +1236,17 @@
   }
   FREE_C_HEAP_ARRAY(char, jimage);
 
-  // images build if rt.jar exists
-  char* rt_jar = format_boot_path("%/lib/rt.jar", home, home_len, fileSep, pathSep);
-  if (rt_jar == NULL) return false;
-  bool has_rt_jar = (os::stat(rt_jar, &st) == 0);
-  FREE_C_HEAP_ARRAY(char, rt_jar);
+  // check if developer build with exploded modules
+  char* modules_dir = format_boot_path("%/modules", home, home_len, fileSep, pathSep);
+  if (os::stat(modules_dir, &st) == 0) {
+    if ((st.st_mode & S_IFDIR) == S_IFDIR) {
+      sysclasspath = expand_entries_to_path(modules_dir, fileSep, pathSep);
+    }
+  }
 
-  if (has_rt_jar) {
-    // Any modification to the JAR-file list, for the boot classpath must be
-    // aligned with install/install/make/common/Pack.gmk. Note: boot class
-    // path class JARs, are stripped for StackMapTable to reduce download size.
-    static const char classpath_format[] =
-      "%/lib/resources.jar:"
-      "%/lib/rt.jar:"
-      "%/lib/jsse.jar:"
-      "%/lib/jce.jar:"
-      "%/lib/charsets.jar:"
-      "%/lib/jfr.jar:"
-      "%/classes";
-    sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
-  } else {
-    // no rt.jar, check if developer build with exploded modules
-    char* modules_dir = format_boot_path("%/modules", home, home_len, fileSep, pathSep);
-    if (os::stat(modules_dir, &st) == 0) {
-      if ((st.st_mode & S_IFDIR) == S_IFDIR) {
-        sysclasspath = expand_entries_to_path(modules_dir, fileSep, pathSep);
-      }
-    }
-
-    // fallback to classes
-    if (sysclasspath == NULL)
-      sysclasspath = format_boot_path("%/classes", home, home_len, fileSep, pathSep);
-  }
+  // fallback to classes
+  if (sysclasspath == NULL)
+    sysclasspath = format_boot_path("%/classes", home, home_len, fileSep, pathSep);
 
   if (sysclasspath == NULL) return false;
   Arguments::set_sysclasspath(sysclasspath);
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -34,7 +34,8 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
--- a/hotspot/src/share/vm/runtime/serviceThread.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/serviceThread.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -30,9 +30,10 @@
 #include "runtime/os.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "services/allocationContextService.hpp"
-#include "services/gcNotifier.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
+#include "services/gcNotifier.hpp"
+#include "services/lowMemoryDetector.hpp"
 
 ServiceThread* ServiceThread::_instance = NULL;
 
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -1792,7 +1792,17 @@
 
 
 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
-JRT_ENTRY_NO_ASYNC(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
+JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
+  if (!SafepointSynchronize::is_synchronizing()) {
+    // Only try quick_enter() if we're not trying to reach a safepoint
+    // so that the calling thread reaches the safepoint more quickly.
+    if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;
+  }
+  // NO_ASYNC required because an async exception on the state transition destructor
+  // would leave you with the lock held and it would never be released.
+  // The normal monitorenter NullPointerException is thrown without acquiring a lock
+  // and the model is that an exception implies the method failed.
+  JRT_BLOCK_NO_ASYNC
   oop obj(_obj);
   if (PrintBiasedLockingStatistics) {
     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
@@ -1805,6 +1815,7 @@
     ObjectSynchronizer::slow_enter(h_obj, lock, CHECK);
   }
   assert(!HAS_PENDING_EXCEPTION, "Should have no exception here");
+  JRT_BLOCK_END
 JRT_END
 
 // Handles the uncommon cases of monitor unlocking in compiled code
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -122,6 +122,70 @@
 static volatile int MonitorPopulation = 0;  // # Extant -- in circulation
 #define CHAINMARKER (cast_to_oop<intptr_t>(-1))
 
+
+// =====================> Quick functions
+
+// The quick_* forms are special fast-path variants used to improve
+// performance.  In the simplest case, a "quick_*" implementation could
+// simply return false, in which case the caller will perform the necessary
+// state transitions and call the slow-path form.
+// The fast-path is designed to handle frequently arising cases in an efficient
+// manner and is just a degenerate "optimistic" variant of the slow-path.
+// returns true  -- to indicate the call was satisfied.
+// returns false -- to indicate the call needs the services of the slow-path.
+// A no-loitering ordinance is in effect for code in the quick_* family
+// operators: safepoints or indefinite blocking (blocking that might span a
+// safepoint) are forbidden. Generally the thread_state() is _in_Java upon
+// entry.
+
+// The LockNode emitted directly at the synchronization site would have
+// been too big if it were to have included support for the cases of inflated
+// recursive enter and exit, so they go here instead.
+// Note that we can't safely call AsyncPrintJavaStack() from within
+// quick_enter() as our thread state remains _in_Java.
+
+bool ObjectSynchronizer::quick_enter(oop obj, Thread * Self,
+                                     BasicLock * Lock) {
+  assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
+  assert(Self->is_Java_thread(), "invariant");
+  assert(((JavaThread *) Self)->thread_state() == _thread_in_Java, "invariant");
+  No_Safepoint_Verifier nsv;
+  if (obj == NULL) return false;       // Need to throw NPE
+  const markOop mark = obj->mark();
+
+  if (mark->has_monitor()) {
+    ObjectMonitor * const m = mark->monitor();
+    assert(m->object() == obj, "invariant");
+    Thread * const owner = (Thread *) m->_owner;
+
+    // Lock contention and Transactional Lock Elision (TLE) diagnostics
+    // and observability
+    // Case: light contention possibly amenable to TLE
+    // Case: TLE inimical operations such as nested/recursive synchronization
+
+    if (owner == Self) {
+      m->_recursions++;
+      return true;
+    }
+
+    if (owner == NULL &&
+        Atomic::cmpxchg_ptr(Self, &(m->_owner), NULL) == NULL) {
+      assert(m->_recursions == 0, "invariant");
+      assert(m->_owner == Self, "invariant");
+      return true;
+    }
+  }
+
+  // Note that we could inflate in quick_enter.
+  // This is likely a useful optimization
+  // Critically, in quick_enter() we must not:
+  // -- perform bias revocation, or
+  // -- block indefinitely, or
+  // -- reach a safepoint
+
+  return false;        // revert to slow-path
+}
+
 // -----------------------------------------------------------------------------
 //  Fast Monitor Enter/Exit
 // This the fast monitor enter. The interpreter and compiler use
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -72,6 +72,8 @@
   static void notify(Handle obj, TRAPS);
   static void notifyall(Handle obj, TRAPS);
 
+  static bool quick_enter(oop obj, Thread* Self, BasicLock* Lock);
+
   // Special internal-use-only method for use by JVM infrastructure
   // that needs to wait() on a java-level object but that can't risk
   // throwing unexpected InterruptedExecutionExceptions.
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -42,6 +42,7 @@
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -189,6 +189,7 @@
       if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code
         if (monitor->owner_is_scalar_replaced()) {
           Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
+          // format below for lockbits matches this one.
           st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
         } else {
           oop obj = monitor->owner();
@@ -206,9 +207,10 @@
         // see if we have completed the lock or we are blocked trying to
         // acquire it - we can only be blocked if the monitor is inflated
 
+        markOop mark = NULL;
         const char *lock_state = "locked"; // assume we have the monitor locked
         if (!found_first_monitor && frame_count == 0) {
-          markOop mark = monitor->owner()->mark();
+          mark = monitor->owner()->mark();
           if (mark->has_monitor() &&
               ( // we have marked ourself as pending on this monitor
                 mark->monitor() == thread()->current_pending_monitor() ||
@@ -216,11 +218,19 @@
                 !mark->monitor()->is_entered(thread())
               )) {
             lock_state = "waiting to lock";
+          } else {
+            mark = NULL; // Disable printing below
           }
         }
+        print_locked_object_class_name(st, monitor->owner(), lock_state);
+        if (Verbose && mark != NULL) {
+          // match with format above, replacing "-" with " ".
+          st->print("\t  lockbits=");
+          mark->print_on(st);
+          st->cr();
+        }
 
         found_first_monitor = true;
-        print_locked_object_class_name(st, monitor->owner(), lock_state);
       }
     }
   }
@@ -577,10 +587,15 @@
       tty->print("( null )");
     } else {
       monitor->owner()->print_value();
-      tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner());
+      tty->print("(owner=" INTPTR_FORMAT ")", (address)monitor->owner());
     }
-    if (monitor->eliminated() && is_compiled_frame())
-      tty->print(" ( lock is eliminated )");
+    if (monitor->eliminated()) {
+      if(is_compiled_frame()) {
+        tty->print(" ( lock is eliminated in compiled frame )");
+      } else {
+        tty->print(" ( lock is eliminated, frame not compiled )");
+      }
+    }
     tty->cr();
     tty->print("\t  ");
     monitor->lock()->print_on(tty);
--- a/hotspot/src/share/vm/runtime/vframe_hp.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vframe_hp.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "code/codeCache.hpp"
 #include "code/debugInfoRec.hpp"
 #include "code/nmethod.hpp"
--- a/hotspot/src/share/vm/runtime/vmThread.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -28,6 +28,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/runtime/vm_operations.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,6 +29,7 @@
 #include "compiler/compileBroker.hpp"
 #include "compiler/compilerOracle.hpp"
 #include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "memory/heapInspection.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/arguments.hpp"
@@ -486,3 +487,9 @@
 void VM_PrintCodeCache::doit() {
   CodeCache::print_layout(_out);
 }
+
+#if INCLUDE_SERVICES
+void VM_PrintClassHierarchy::doit() {
+  KlassHierarchy::print_class_hierarchy(_out, _print_interfaces, _print_subclasses, _classname);
+}
+#endif
--- a/hotspot/src/share/vm/runtime/vm_operations.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vm_operations.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -105,6 +105,7 @@
   template(PrintCompileQueue)                     \
   template(PrintCodeList)                         \
   template(PrintCodeCache)                        \
+  template(PrintClassHierarchy)                   \
 
 class VM_Operation: public CHeapObj<mtInternal> {
  public:
@@ -457,5 +458,21 @@
   void doit();
 };
 
+#if INCLUDE_SERVICES
+class VM_PrintClassHierarchy: public VM_Operation {
+ private:
+  outputStream* _out;
+  bool _print_interfaces;
+  bool _print_subclasses;
+  char* _classname;
+
+ public:
+  VM_PrintClassHierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, char* classname) :
+    _out(st), _print_interfaces(print_interfaces), _print_subclasses(print_subclasses),
+    _classname(classname) {}
+  VMOp_Type type() const { return VMOp_PrintClassHierarchy; }
+  void doit();
+};
+#endif // INCLUDE_SERVICES
 
 #endif // SHARE_VM_RUNTIME_VM_OPERATIONS_HPP
--- a/hotspot/src/share/vm/services/attachListener.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/attachListener.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -27,6 +27,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, 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
@@ -26,6 +26,7 @@
 #include "classfile/classLoaderStats.hpp"
 #include "classfile/compactHashtable.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
 #include "services/diagnosticArgument.hpp"
@@ -57,6 +58,7 @@
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
+  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
 #endif // INCLUDE_SERVICES
@@ -695,3 +697,35 @@
   VMThread::execute(&printCodeCacheOp);
 }
 
+#if INCLUDE_SERVICES
+ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
+                                       DCmdWithParser(output, heap),
+  _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
+  _print_subclasses("-s", "If a classname is specified, print its subclasses. "
+                    "Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"),
+  _classname("classname", "Name of class whose hierarchy should be printed. "
+             "If not specified, all class hierarchies are printed.",
+             "STRING", false) {
+  _dcmdparser.add_dcmd_option(&_print_interfaces);
+  _dcmdparser.add_dcmd_option(&_print_subclasses);
+  _dcmdparser.add_dcmd_argument(&_classname);
+}
+
+void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
+  VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(),
+                                               _print_subclasses.value(), _classname.value());
+  VMThread::execute(&printClassHierarchyOp);
+}
+
+int ClassHierarchyDCmd::num_arguments() {
+  ResourceMark rm;
+  ClassHierarchyDCmd* dcmd = new ClassHierarchyDCmd(NULL, false);
+  if (dcmd != NULL) {
+    DCmdMark mark(dcmd);
+    return dcmd->_dcmdparser.num_arguments();
+  } else {
+    return 0;
+  }
+}
+
+#endif
--- a/hotspot/src/share/vm/services/diagnosticCommand.hpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, 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
@@ -271,6 +271,34 @@
   virtual void execute(DCmdSource source, TRAPS);
 };
 
+
+class ClassHierarchyDCmd : public DCmdWithParser {
+protected:
+  DCmdArgument<bool> _print_interfaces; // true if inherited interfaces should be printed.
+  DCmdArgument<bool> _print_subclasses; // true if subclasses of the specified classname should be printed.
+  DCmdArgument<char*> _classname; // Optional single class name whose hierarchy should be printed.
+public:
+  ClassHierarchyDCmd(outputStream* output, bool heap);
+  static const char* name() {
+    return "VM.class_hierarchy";
+  }
+  static const char* description() {
+    return "Print a list of all loaded classes, indented to show the class hiearchy. "
+           "The name of each class is followed by the ClassLoaderData* of its ClassLoader, "
+           "or \"null\" if loaded by the bootstrap class loader.";
+  }
+  static const char* impact() {
+      return "Medium: Depends on number of loaded classes.";
+  }
+  static const JavaPermission permission() {
+    JavaPermission p = {"java.lang.management.ManagementPermission",
+                        "monitor", NULL};
+    return p;
+  }
+  static int num_arguments();
+  virtual void execute(DCmdSource source, TRAPS);
+};
+
 // See also: thread_dump in attachListener.cpp
 class ThreadDumpDCmd : public DCmdWithParser {
 protected:
--- a/hotspot/src/share/vm/services/diagnosticFramework.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/diagnosticFramework.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, 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
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "services/diagnosticArgument.hpp"
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -31,6 +31,8 @@
 #include "memory/genCollectedHeap.hpp"
 #include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/services/management.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/management.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -30,6 +30,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/klass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
--- a/hotspot/src/share/vm/services/writeableFlags.cpp	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp	Fri Feb 20 14:14:08 2015 -0800
@@ -223,4 +223,5 @@
     ShouldNotReachHere();
   }
   return ERR_OTHER;
-}
\ No newline at end of file
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/loopopts/CountedLoopProblem.java	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 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
+ * 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 8072753
+ * @summary Inner loop induction variable increment occurs before compare which causes integer overflow
+ * @run main/othervm CountedLoopProblem
+ *
+ */
+
+import java.util.*;
+
+public class CountedLoopProblem {
+    public static void main(String[] args) throws Exception {
+        Random r = new Random(42);
+        int x = 0;
+        StringBuilder sb = new StringBuilder();
+        for(int i = 0; i < 1000000; ++i) {
+            int v = Math.abs(r.nextInt());
+            sb.append('+').append(v).append('\n');
+            x += v;
+            // To trigger the problem we must OSR in the following loop
+            // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62
+            while(x < 0) x += 1000000000;
+            sb.append('=').append(x).append('\n');
+        }
+        if (sb.toString().hashCode() != 0xaba94591) {
+            throw new Exception("Unexpected result");
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java	Fri Feb 20 14:14:08 2015 -0800
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 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
+ * 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 Test of diagnostic command VM.class_hierarchy
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng ClassHierarchyTest
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.util.Iterator;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class ClassHierarchyTest {
+
+    // $> jcmd DcmdTestClass VM.class_hierarchy  DcmdTestClass | grep DcmdTestClass\$\$Lambda
+    // |--DcmdTestClass$$Lambda$1/4081552/0xa529fbb0
+
+    // > VM.class_hierarchy DcmdBaseClass
+    // java.lang.Object/null
+    // |--DcmdBaseClass/0xa4abcd48
+
+    // > VM.class_hierarchy DcmdBaseClass -s
+    // java.lang.Object/null
+    // |--DcmdBaseClass/0xa4abcd48
+    // |  |--DcmdTestClass/0xa4abcd48
+
+    // > VM.class_hierarchy DcmdBaseClass -i -s
+    // java.lang.Object/null
+    // |--DcmdBaseClass/0xa4abcd48
+    // |  implements Intf2/0xa4abcd48 (declared intf)
+    // |  implements Intf1/0xa4abcd48 (inherited intf)
+    // |  |--DcmdTestClass/0xa4abcd48
+    // |  |  implements Intf1/0xa4abcd48 (inherited intf)
+    // |  |  implements Intf2/0xa4abcd48 (inherited intf)
+
+    static Pattern expected_lambda_line =
+        Pattern.compile("\\|--DcmdTestClass\\$\\$Lambda.*");
+
+    static Pattern expected_lines[] = {
+        Pattern.compile("java.lang.Object/null"),
+        Pattern.compile("\\|--DcmdBaseClass/0x(\\p{XDigit}*)"),
+        Pattern.compile("\\|  implements Intf2/0x(\\p{XDigit}*) \\(declared intf\\)"),
+        Pattern.compile("\\|  implements Intf1/0x(\\p{XDigit}*) \\(inherited intf\\)"),
+        Pattern.compile("\\|  \\|--DcmdTestClass/0x(\\p{XDigit}*)"),
+        Pattern.compile("\\|  \\|  implements Intf1/0x(\\p{XDigit}*) \\(inherited intf\\)"),
+        Pattern.compile("\\|  \\|  implements Intf2/0x(\\p{XDigit}*) \\(inherited intf\\)")
+    };
+
+    public void run(CommandExecutor executor) throws ClassNotFoundException {
+        OutputAnalyzer output;
+        Iterator<String> lines;
+        int i;
+
+        // Load our test class whose hierarchy we will print.
+        Class<?> c = Class.forName("DcmdTestClass");
+
+        // Verify the presence of the lamba anonymous class
+        output = executor.execute("VM.class_hierarchy");
+        lines = output.asLines().iterator();
+        Boolean foundMatch = false;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lambda_line.matcher(line);
+            if (m.matches()) {
+                foundMatch = true;
+                break;
+            }
+        }
+        if (!foundMatch) {
+            Assert.fail("Failed to find lamda class");
+        }
+
+        // Verify the output for the simple hierachry of just DcmdBaseClass.
+        output = executor.execute("VM.class_hierarchy DcmdBaseClass");
+        lines = output.asLines().iterator();
+        i = 0;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lines[i].matcher(line);
+            i++;
+            if (!m.matches()) {
+                Assert.fail("Failed to match line #" + i + ": " + line);
+            }
+            // Should only be two lines of output in this form.
+            if (i == 2) break;
+        }
+        if (lines.hasNext()) {
+            String line = lines.next();
+            Assert.fail("Unexpected dcmd output: " + line);
+        }
+
+        // Verify the output for the full hierarchy of DcmdBaseClass, but without interfaces.
+        output = executor.execute("VM.class_hierarchy DcmdBaseClass -s");
+        lines = output.asLines().iterator();
+        i = 0;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lines[i].matcher(line);
+            i++;
+            if (!m.matches()) {
+                Assert.fail("Failed to match line #" + i + ": " + line);
+            }
+            // "implements" lines should not be in this output.
+            if (i == 2 || i == 4) i += 2;
+        }
+        if (lines.hasNext()) {
+            String line = lines.next();
+            Assert.fail("Unexpected dcmd output: " + line);
+        }
+
+        // Verify the output for the full hierarchy of DcmdBaseClass, including interfaces.
+        output = executor.execute("VM.class_hierarchy DcmdBaseClass -i -s");
+        lines = output.asLines().iterator();
+        i = 0;
+        String classLoaderAddr = null;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lines[i].matcher(line);
+            i++;
+            if (!m.matches()) {
+                Assert.fail("Failed to match line #" + i + ": " + line);
+            }
+            if (i == 2) {
+                // Fetch the ClassLoader address, which should be the same in
+                // subsequent lines.
+                classLoaderAddr = m.group(1);
+                System.out.println(classLoaderAddr);
+            } else if (i > 2) {
+                if (!classLoaderAddr.equals(m.group(1))) {
+                    Assert.fail("Classloader address didn't match on line #"
+                                        + i + ": " + line);
+                }
+            }
+            if (i == expected_lines.length) break;
+        }
+        if (lines.hasNext()) {
+            String line = lines.next();
+            Assert.fail("Unexpected dcmd output: " + line);
+        }
+    }
+
+    @Test
+    public void jmx() throws ClassNotFoundException {
+        run(new JMXExecutor());
+    }
+}
+
+interface Intf1 {
+}
+
+interface Intf2 extends Intf1 {
+}
+
+class DcmdBaseClass implements Intf2 {
+}
+
+class DcmdTestClass extends DcmdBaseClass {
+    static {
+        // Force creation of anonymous class (for the lambdaform).
+        Runnable r = () -> System.out.println("Hello");
+        r.run();
+    }
+}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java	Wed Jul 05 20:21:13 2017 +0200
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java	Fri Feb 20 14:14:08 2015 -0800
@@ -33,8 +33,6 @@
 import java.util.Collections;
 import java.util.List;
 
-import sun.management.VMManagement;
-
 public final class ProcessTools {
 
   private ProcessTools() {
@@ -90,19 +88,8 @@
    * @return Process id
    */
   public static int getProcessId() throws Exception {
-
-    // Get the current process id using a reflection hack
     RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
-    Field jvm = runtime.getClass().getDeclaredField("jvm");
-
-    jvm.setAccessible(true);
-    VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime);
-
-    Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId");
-
-    pid_method.setAccessible(true);
-
-    int pid = (Integer) pid_method.invoke(mgmt);
+    int pid = Integer.parseInt(runtime.getName().split("@")[0]);
 
     return pid;
   }