changeset 27685:26a697375de3

Merge
author jwilhelm
date Mon, 17 Nov 2014 21:32:32 +0100
parents 74c92bdda9b5 e0391b2bf625
children f91c482793e6 3a6367d7110b
files hotspot/src/os/aix/vm/perfMemory_aix.cpp hotspot/src/os/bsd/vm/perfMemory_bsd.cpp hotspot/src/os/linux/vm/os_linux.cpp hotspot/src/os/linux/vm/perfMemory_linux.cpp hotspot/src/os/solaris/vm/perfMemory_solaris.cpp hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp hotspot/src/share/vm/ci/ciObjectFactory.cpp hotspot/src/share/vm/classfile/classFileParser.cpp hotspot/src/share/vm/classfile/classLoader.cpp hotspot/src/share/vm/classfile/classLoaderData.cpp hotspot/src/share/vm/oops/instanceKlass.cpp hotspot/src/share/vm/oops/methodData.cpp hotspot/src/share/vm/prims/jni.cpp hotspot/src/share/vm/prims/jvm.cpp hotspot/src/share/vm/prims/unsafe.cpp hotspot/src/share/vm/prims/whitebox.cpp hotspot/src/share/vm/runtime/globals.cpp hotspot/src/share/vm/runtime/interfaceSupport.cpp hotspot/src/share/vm/runtime/reflection.cpp hotspot/src/share/vm/utilities/ostream.cpp
diffstat 67 files changed, 184 insertions(+), 164 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/make/linux/makefiles/gcc.make	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/make/linux/makefiles/gcc.make	Mon Nov 17 21:32:32 2014 +0100
@@ -214,7 +214,7 @@
   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
 endif
 
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
 
 ifeq ($(USE_CLANG),)
   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -27,6 +27,7 @@
 #define CPU_PPC_VM_MACROASSEMBLER_PPC_HPP
 
 #include "asm/assembler.hpp"
+#include "utilities/macros.hpp"
 
 // MacroAssembler extends Assembler by a few frequently used macros.
 
--- a/hotspot/src/cpu/x86/vm/x86_32.ad	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad	Mon Nov 17 21:32:32 2014 +0100
@@ -1210,6 +1210,7 @@
 
 
   Unimplemented();
+  return 0; // Mute compiler
 }
 
 #ifndef PRODUCT
--- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -422,7 +422,7 @@
 // return the name of the user that owns the JVM indicated by the given vmid.
 //
 static char* get_user_name(int vmid, TRAPS) {
-  return get_user_name_slow(vmid, CHECK_NULL);
+  return get_user_name_slow(vmid, THREAD);
 }
 
 // return the file name of the backing store file for the named
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -422,7 +422,7 @@
 // return the name of the user that owns the JVM indicated by the given vmid.
 //
 static char* get_user_name(int vmid, TRAPS) {
-  return get_user_name_slow(vmid, CHECK_NULL);
+  return get_user_name_slow(vmid, THREAD);
 }
 
 // return the file name of the backing store file for the named
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -68,6 +68,7 @@
 #include "utilities/events.hpp"
 #include "utilities/elfFile.hpp"
 #include "utilities/growableArray.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
 
 // put OS-includes here
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -422,7 +422,7 @@
 // return the name of the user that owns the JVM indicated by the given vmid.
 //
 static char* get_user_name(int vmid, TRAPS) {
-  return get_user_name_slow(vmid, CHECK_NULL);
+  return get_user_name_slow(vmid, THREAD);
 }
 
 // return the file name of the backing store file for the named
--- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -461,7 +461,7 @@
   // since the structured procfs and old procfs interfaces can't be
   // mixed, we attempt to find the file through a directory search.
 
-  return get_user_name_slow(vmid, CHECK_NULL);
+  return get_user_name_slow(vmid, THREAD);
 }
 
 // return the file name of the backing store file for the named
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -542,6 +542,7 @@
   err.report_and_die();
 
   ShouldNotReachHere();
+  return true; // Mute compiler
 }
 
 void os::Linux::init_thread_fpu_state(void) {
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -46,6 +46,7 @@
 #include "oops/oop.inline.hpp"
 #include "oops/oop.inline2.hpp"
 #include "runtime/fieldType.hpp"
+#include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
 # include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #endif
--- a/hotspot/src/share/vm/ci/ciReplay.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -332,7 +332,7 @@
   // Lookup a klass
   Klass* resolve_klass(const char* klass, TRAPS) {
     Symbol* klass_name = SymbolTable::lookup(klass, (int)strlen(klass), CHECK_NULL);
-    return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, CHECK_NULL);
+    return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
   }
 
   // Parse the standard tuple of <klass> <name> <signature>
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -31,9 +31,6 @@
 #include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
-#if INCLUDE_CDS
-#include "classfile/systemDictionaryShared.hpp"
-#endif
 #include "classfile/verificationType.hpp"
 #include "classfile/verifier.hpp"
 #include "classfile/vmSymbols.hpp"
@@ -63,7 +60,11 @@
 #include "services/threadService.hpp"
 #include "utilities/array.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/ostream.hpp"
+#if INCLUDE_CDS
+#include "classfile/systemDictionaryShared.hpp"
+#endif
 
 // We generally try to create the oops directly when parsing, rather than
 // allocating temporary data structures and copying the bytes twice. A
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -29,10 +29,6 @@
 #include "classfile/classLoaderExt.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/javaClasses.hpp"
-#if INCLUDE_CDS
-#include "classfile/sharedPathsMiscInfo.hpp"
-#include "classfile/sharedClassUtil.hpp"
-#endif
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
@@ -64,8 +60,13 @@
 #include "services/management.hpp"
 #include "services/threadService.hpp"
 #include "utilities/events.hpp"
-#include "utilities/hashtable.hpp"
 #include "utilities/hashtable.inline.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_CDS
+#include "classfile/sharedPathsMiscInfo.hpp"
+#include "classfile/sharedClassUtil.hpp"
+#endif
+
 
 // Entry points in zip.dll for loading zip/jar file entries
 
--- a/hotspot/src/share/vm/classfile/classLoader.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -27,6 +27,7 @@
 
 #include "classfile/classFileParser.hpp"
 #include "runtime/perfData.hpp"
+#include "utilities/macros.hpp"
 
 // The VM class loader.
 #include <sys/stat.h>
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -472,7 +472,7 @@
 // These anonymous class loaders are to contain classes used for JSR292
 ClassLoaderData* ClassLoaderData::anonymous_class_loader_data(oop loader, TRAPS) {
   // Add a new class loader data to the graph.
-  return ClassLoaderDataGraph::add(loader, true, CHECK_NULL);
+  return ClassLoaderDataGraph::add(loader, true, THREAD);
 }
 
 const char* ClassLoaderData::loader_name() {
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -493,7 +493,7 @@
 };
 
 Symbol* MethodFamily::generate_no_defaults_message(TRAPS) const {
-  return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL);
+  return SymbolTable::new_symbol("No qualifying defaults found", THREAD);
 }
 
 Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method, TRAPS) const {
@@ -506,7 +506,7 @@
   ss.write((const char*)name->bytes(), name->utf8_length());
   ss.write((const char*)signature->bytes(), signature->utf8_length());
   ss.print(" is abstract");
-  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
 }
 
 Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
@@ -521,7 +521,7 @@
     ss.print(".");
     ss.write((const char*)name->bytes(), name->utf8_length());
   }
-  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
 }
 
 
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -1952,7 +1952,7 @@
   // This class is eagerly initialized during VM initialization, since we keep a refence
   // to one of the methods
   assert(InstanceKlass::cast(klass)->is_initialized(), "must be initialized");
-  return InstanceKlass::cast(klass)->allocate_instance_handle(CHECK_NH);
+  return InstanceKlass::cast(klass)->allocate_instance_handle(THREAD);
 }
 
 oop java_lang_reflect_Method::clazz(oop reflect) {
@@ -2130,7 +2130,7 @@
   instanceKlassHandle klass (THREAD, k);
   // Ensure it is initialized
   klass->initialize(CHECK_NH);
-  return klass->allocate_instance_handle(CHECK_NH);
+  return klass->allocate_instance_handle(THREAD);
 }
 
 oop java_lang_reflect_Constructor::clazz(oop reflect) {
@@ -2270,7 +2270,7 @@
   instanceKlassHandle klass (THREAD, k);
   // Ensure it is initialized
   klass->initialize(CHECK_NH);
-  return klass->allocate_instance_handle(CHECK_NH);
+  return klass->allocate_instance_handle(THREAD);
 }
 
 oop java_lang_reflect_Field::clazz(oop reflect) {
@@ -2397,7 +2397,7 @@
   instanceKlassHandle klass (THREAD, k);
   // Ensure it is initialized
   klass->initialize(CHECK_NH);
-  return klass->allocate_instance_handle(CHECK_NH);
+  return klass->allocate_instance_handle(THREAD);
 }
 
 oop java_lang_reflect_Parameter::name(oop param) {
@@ -2447,7 +2447,7 @@
   instanceKlassHandle klass (THREAD, k);
   // Ensure it is initialized
   klass->initialize(CHECK_NH);
-  return klass->allocate_instance_handle(CHECK_NH);
+  return klass->allocate_instance_handle(THREAD);
 }
 
 
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -36,6 +36,7 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
+#include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -235,7 +235,7 @@
   MutexLocker ml(SymbolTable_lock, THREAD);
 
   // Otherwise, add to symbol to table
-  return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL);
+  return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD);
 }
 
 Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
@@ -274,7 +274,7 @@
   // Grab SymbolTable_lock first.
   MutexLocker ml(SymbolTable_lock, THREAD);
 
-  return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL);
+  return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD);
 }
 
 Symbol* SymbolTable::lookup_only(const char* name, int len,
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -31,10 +31,6 @@
 #include "classfile/resolutionErrors.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
-#if INCLUDE_CDS
-#include "classfile/sharedClassUtil.hpp"
-#include "classfile/systemDictionaryShared.hpp"
-#endif
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/bytecodeStream.hpp"
@@ -65,7 +61,10 @@
 #include "services/threadService.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/ticks.hpp"
-
+#if INCLUDE_CDS
+#include "classfile/sharedClassUtil.hpp"
+#include "classfile/systemDictionaryShared.hpp"
+#endif
 #if INCLUDE_TRACE
  #include "trace/tracing.hpp"
 #endif
@@ -123,7 +122,7 @@
 
 ClassLoaderData* SystemDictionary::register_loader(Handle class_loader, TRAPS) {
   if (class_loader() == NULL) return ClassLoaderData::the_null_class_loader_data();
-  return ClassLoaderDataGraph::find_or_create(class_loader, CHECK_NULL);
+  return ClassLoaderDataGraph::find_or_create(class_loader, THREAD);
 }
 
 // ----------------------------------------------------------------------------
@@ -233,15 +232,15 @@
                  class_name->as_C_string(),
                  class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
   if (FieldType::is_array(class_name)) {
-    return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
+    return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
   } else if (FieldType::is_obj(class_name)) {
     ResourceMark rm(THREAD);
     // Ignore wrapping L and ;.
     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
                                    class_name->utf8_length() - 2, CHECK_NULL);
-    return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL);
+    return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
   } else {
-    return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
+    return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD);
   }
 }
 
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -289,7 +289,7 @@
           if (is_reference() && from.is_reference()) {
             return is_reference_assignable_from(from, context,
                                                 from_field_is_protected,
-                                                CHECK_false);
+                                                THREAD);
           } else {
             return false;
           }
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -1927,7 +1927,7 @@
 
   return SystemDictionary::resolve_or_fail(
     name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
-    true, CHECK_NULL);
+    true, THREAD);
 }
 
 bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -42,8 +42,12 @@
 void VM_CMS_Operation::acquire_pending_list_lock() {
   // The caller may block while communicating
   // with the SLT thread in order to acquire/release the PLL.
-  ConcurrentMarkSweepThread::slt()->
-    manipulatePLL(SurrogateLockerThread::acquirePLL);
+  SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
+  if (slt != NULL) {
+    slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
+  } else {
+    SurrogateLockerThread::report_missing_slt();
+  }
 }
 
 void VM_CMS_Operation::release_and_notify_pending_list_lock() {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -4270,10 +4270,11 @@
 
   if (state == G1CollectedHeap::InCSet) {
     oop forwardee;
-    if (obj->is_forwarded()) {
-      forwardee = obj->forwardee();
+    markOop m = obj->mark();
+    if (m->is_marked()) {
+      forwardee = (oop) m->decode_pointer();
     } else {
-      forwardee = _par_scan_state->copy_to_survivor_space(obj);
+      forwardee = _par_scan_state->copy_to_survivor_space(obj, m);
     }
     assert(forwardee != NULL, "forwardee should not be NULL");
     oopDesc::encode_store_heap_oop(p, forwardee);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -150,7 +150,8 @@
   } while (!_refs->is_empty());
 }
 
-oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
+oop G1ParScanThreadState::copy_to_survivor_space(oop const old,
+                                                 markOop const old_mark) {
   size_t word_sz = old->size();
   HeapRegion* from_region = _g1h->heap_region_containing_raw(old);
   // +1 to make the -1 indexes valid...
@@ -158,9 +159,8 @@
   assert( (from_region->is_young() && young_index >  0) ||
          (!from_region->is_young() && young_index == 0), "invariant" );
   G1CollectorPolicy* g1p = _g1h->g1_policy();
-  markOop m = old->mark();
-  int age = m->has_displaced_mark_helper() ? m->displaced_mark_helper()->age()
-                                           : m->age();
+  uint age = old_mark->has_displaced_mark_helper() ? old_mark->displaced_mark_helper()->age()
+                                                   : old_mark->age();
   GCAllocPurpose alloc_purpose = g1p->evacuation_destination(from_region, age,
                                                              word_sz);
   AllocationContext_t context = from_region->allocation_context();
@@ -196,30 +196,22 @@
     alloc_purpose = to_region->is_young() ? GCAllocForSurvived : GCAllocForTenured;
 
     if (g1p->track_object_age(alloc_purpose)) {
-      // We could simply do obj->incr_age(). However, this causes a
-      // performance issue. obj->incr_age() will first check whether
-      // the object has a displaced mark by checking its mark word;
-      // getting the mark word from the new location of the object
-      // stalls. So, given that we already have the mark word and we
-      // are about to install it anyway, it's better to increase the
-      // age on the mark word, when the object does not have a
-      // displaced mark word. We're not expecting many objects to have
-      // a displaced marked word, so that case is not optimized
-      // further (it could be...) and we simply call obj->incr_age().
-
-      if (m->has_displaced_mark_helper()) {
-        // in this case, we have to install the mark word first,
+      if (age < markOopDesc::max_age) {
+        age++;
+      }
+      if (old_mark->has_displaced_mark_helper()) {
+        // In this case, we have to install the mark word first,
         // otherwise obj looks to be forwarded (the old mark word,
         // which contains the forward pointer, was copied)
-        obj->set_mark(m);
-        obj->incr_age();
+        obj->set_mark(old_mark);
+        markOop new_mark = old_mark->displaced_mark_helper()->set_age(age);
+        old_mark->set_displaced_mark_helper(new_mark);
       } else {
-        m = m->incr_age();
-        obj->set_mark(m);
+        obj->set_mark(old_mark->set_age(age));
       }
-      age_table()->add(obj, word_sz);
+      age_table()->add(age, word_sz);
     } else {
-      obj->set_mark(m);
+      obj->set_mark(old_mark);
     }
 
     if (G1StringDedup::is_enabled()) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -195,7 +195,7 @@
   inline void dispatch_reference(StarTask ref);
  public:
 
-  oop copy_to_survivor_space(oop const obj);
+  oop copy_to_survivor_space(oop const obj, markOop const old_mark);
 
   void trim_queue();
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -41,10 +41,11 @@
   G1CollectedHeap::in_cset_state_t in_cset_state = _g1h->in_cset_state(obj);
   if (in_cset_state == G1CollectedHeap::InCSet) {
     oop forwardee;
-    if (obj->is_forwarded()) {
-      forwardee = obj->forwardee();
+    markOop m = obj->mark();
+    if (m->is_marked()) {
+      forwardee = (oop) m->decode_pointer();
     } else {
-      forwardee = copy_to_survivor_space(obj);
+      forwardee = copy_to_survivor_space(obj, m);
     }
     oopDesc::encode_store_heap_oop(p, forwardee);
   } else if (in_cset_state == G1CollectedHeap::IsHumongous) {
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -1004,10 +1004,13 @@
 HeapWord* G1OffsetTableContigSpace::saved_mark_word() const {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   assert( _gc_time_stamp <= g1h->get_gc_time_stamp(), "invariant" );
-  if (_gc_time_stamp < g1h->get_gc_time_stamp())
-    return top();
-  else
+  HeapWord* local_top = top();
+  OrderAccess::loadload();
+  if (_gc_time_stamp < g1h->get_gc_time_stamp()) {
+    return local_top;
+  } else {
     return Space::saved_mark_word();
+  }
 }
 
 void G1OffsetTableContigSpace::record_top_and_timestamp() {
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -213,8 +213,12 @@
   assert(_needs_pll, "don't call this otherwise");
   // The caller may block while communicating
   // with the SLT thread in order to acquire/release the PLL.
-  ConcurrentMarkThread::slt()->
-    manipulatePLL(SurrogateLockerThread::acquirePLL);
+  SurrogateLockerThread* slt = ConcurrentMarkThread::slt();
+  if (slt != NULL) {
+    slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
+  } else {
+    SurrogateLockerThread::report_missing_slt();
+  }
 }
 
 void VM_CGC_Operation::release_and_notify_pending_list_lock() {
--- a/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -55,7 +55,10 @@
 
   // add entry
   void add(oop p, size_t oop_size) {
-    uint age = p->age();
+    add(p->age(), oop_size);
+  }
+
+  void add(uint age, size_t oop_size) {
     assert(age > 0 && age < table_size, "invalid age of object");
     sizes[age] += oop_size;
   }
--- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -138,6 +138,13 @@
   return res;
 }
 
+void SurrogateLockerThread::report_missing_slt() {
+  vm_exit_during_initialization(
+    "GC before GC support fully initialized: "
+    "SLT is needed but has not yet been created.");
+  ShouldNotReachHere();
+}
+
 void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) {
   MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
   assert(_buffer == empty, "Should be empty");
--- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -93,6 +93,9 @@
  public:
   static SurrogateLockerThread* make(TRAPS);
 
+  // Terminate VM with error message that SLT needed but not yet created.
+  static void report_missing_slt();
+
   SurrogateLockerThread();
 
   bool is_hidden_from_external_view() const     { return true; }
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -33,8 +33,8 @@
 #include "memory/referenceProcessorStats.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/ticks.inline.hpp"
-
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/evacuationInfo.hpp"
 #endif
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -33,12 +33,11 @@
 #include "memory/allocation.hpp"
 #include "memory/metaspace.hpp"
 #include "memory/referenceType.hpp"
+#include "utilities/macros.hpp"
+#include "utilities/ticks.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1YCTypes.hpp"
 #endif
-#include "utilities/macros.hpp"
-#include "utilities/ticks.hpp"
-
 
 class EvacuationInfo;
 class GCHeapSummary;
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -31,6 +31,7 @@
 #include "runtime/os.hpp"
 #include "trace/tracing.hpp"
 #include "trace/traceBackend.hpp"
+#include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/evacuationInfo.hpp"
 #include "gc_implementation/g1/g1YCTypes.hpp"
--- a/hotspot/src/share/vm/memory/allocation.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -50,8 +50,7 @@
                                  size_t word_size, bool read_only,
                                  MetaspaceObj::Type type, TRAPS) throw() {
   // Klass has it's own operator new
-  return Metaspace::allocate(loader_data, word_size, read_only,
-                             type, CHECK_NULL);
+  return Metaspace::allocate(loader_data, word_size, read_only, type, THREAD);
 }
 
 bool MetaspaceObj::is_shared() const {
--- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -23,8 +23,8 @@
  */
 
 #include "precompiled.hpp"
-#include "utilities/macros.hpp"
 #include "gc_implementation/shared/allocationStats.hpp"
+#include "gc_implementation/shared/spaceDecorator.hpp"
 #include "memory/binaryTreeDictionary.hpp"
 #include "memory/freeList.hpp"
 #include "memory/freeBlockDictionary.hpp"
@@ -32,7 +32,6 @@
 #include "runtime/globals.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/macros.hpp"
-#include "gc_implementation/shared/spaceDecorator.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp"
 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
--- a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -23,14 +23,13 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/freeBlockDictionary.hpp"
+#include "memory/metachunk.hpp"
+#include "runtime/thread.inline.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
 #endif // INCLUDE_ALL_GCS
-#include "memory/freeBlockDictionary.hpp"
-#include "memory/metachunk.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/macros.hpp"
 
 #ifndef PRODUCT
 template <class Chunk> Mutex* FreeBlockDictionary<Chunk>::par_lock() const {
--- a/hotspot/src/share/vm/memory/freeList.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/freeList.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -31,7 +31,6 @@
 #include "runtime/mutex.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/macros.hpp"
-
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
 #endif // INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/memory/heapInspection.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/heapInspection.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -367,7 +367,7 @@
       _csv_format(csv_format), _print_help(print_help),
       _print_class_stats(print_class_stats), _columns(columns) {}
   void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
-  size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN;
+  size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0);
   static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
  private:
   void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -47,6 +47,7 @@
 #include "services/memoryService.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/debug.hpp"
+#include "utilities/macros.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/memory/metaspaceShared.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -92,7 +92,7 @@
   static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
   static int preload_and_dump(const char * class_list_path,
                               GrowableArray<Klass*>* class_promote_order,
-                              TRAPS) NOT_CDS_RETURN;
+                              TRAPS) NOT_CDS_RETURN_(0);
 
   static ReservedSpace* shared_rs() {
     CDS_ONLY(return _shared_rs);
--- a/hotspot/src/share/vm/memory/oopFactory.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/oopFactory.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -41,20 +41,20 @@
 class oopFactory: AllStatic {
  public:
   // Basic type leaf array allocation
-  static typeArrayOop    new_boolArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::boolArrayKlassObj  ())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_charArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::charArrayKlassObj  ())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_singleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_doubleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_byteArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::byteArrayKlassObj  ())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_shortArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_intArray   (int length, TRAPS) { return TypeArrayKlass::cast(Universe::intArrayKlassObj   ())->allocate(length, CHECK_NULL); }
-  static typeArrayOop    new_longArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::longArrayKlassObj  ())->allocate(length, CHECK_NULL); }
+  static typeArrayOop    new_boolArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::boolArrayKlassObj  ())->allocate(length, THREAD); }
+  static typeArrayOop    new_charArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::charArrayKlassObj  ())->allocate(length, THREAD); }
+  static typeArrayOop    new_singleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, THREAD); }
+  static typeArrayOop    new_doubleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, THREAD); }
+  static typeArrayOop    new_byteArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::byteArrayKlassObj  ())->allocate(length, THREAD); }
+  static typeArrayOop    new_shortArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, THREAD); }
+  static typeArrayOop    new_intArray   (int length, TRAPS) { return TypeArrayKlass::cast(Universe::intArrayKlassObj   ())->allocate(length, THREAD); }
+  static typeArrayOop    new_longArray  (int length, TRAPS) { return TypeArrayKlass::cast(Universe::longArrayKlassObj  ())->allocate(length, THREAD); }
 
   // create java.lang.Object[]
   static objArrayOop     new_objectArray(int length, TRAPS)  {
     assert(Universe::objectArrayKlassObj() != NULL, "Too early?");
     return ObjArrayKlass::
-      cast(Universe::objectArrayKlassObj())->allocate(length, CHECK_NULL);
+      cast(Universe::objectArrayKlassObj())->allocate(length, THREAD);
   }
 
   static typeArrayOop    new_charArray           (const char* utf8_str,  TRAPS);
--- a/hotspot/src/share/vm/memory/universe.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/memory/universe.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -26,9 +26,6 @@
 #include "classfile/classLoader.hpp"
 #include "classfile/classLoaderData.hpp"
 #include "classfile/javaClasses.hpp"
-#if INCLUDE_CDS
-#include "classfile/sharedClassUtil.hpp"
-#endif
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
@@ -82,6 +79,9 @@
 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #endif // INCLUDE_ALL_GCS
+#if INCLUDE_CDS
+#include "classfile/sharedClassUtil.hpp"
+#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -461,7 +461,7 @@
 
 
 Klass* ConstantPool::klass_ref_at(int which, TRAPS) {
-  return klass_at(klass_ref_index_at(which), CHECK_NULL);
+  return klass_at(klass_ref_index_at(which), THREAD);
 }
 
 
--- a/hotspot/src/share/vm/oops/constantPool.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/constantPool.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -336,13 +336,13 @@
 
   Klass* klass_at(int which, TRAPS) {
     constantPoolHandle h_this(THREAD, this);
-    return klass_at_impl(h_this, which, true, CHECK_NULL);
+    return klass_at_impl(h_this, which, true, THREAD);
   }
 
   // Version of klass_at that doesn't save the resolution error, called during deopt
   Klass* klass_at_ignore_error(int which, TRAPS) {
     constantPoolHandle h_this(THREAD, this);
-    return klass_at_impl(h_this, which, false, CHECK_NULL);
+    return klass_at_impl(h_this, which, false, THREAD);
   }
 
   Symbol* klass_name_at(int which);  // Returns the name, w/o resolving.
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -532,7 +532,7 @@
   // 1) Verify the bytecodes
   Verifier::Mode mode =
     throw_verifyerror ? Verifier::ThrowException : Verifier::NoException;
-  return Verifier::verify(this_k, mode, this_k->should_verify_class(), CHECK_false);
+  return Verifier::verify(this_k, mode, this_k->should_verify_class(), THREAD);
 }
 
 
@@ -1130,7 +1130,7 @@
   if (or_null) {
     return oak->array_klass_or_null(n);
   }
-  return oak->array_klass(n, CHECK_NULL);
+  return oak->array_klass(n, THREAD);
 }
 
 Klass* InstanceKlass::array_klass_impl(bool or_null, TRAPS) {
--- a/hotspot/src/share/vm/oops/klass.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/klass.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -152,7 +152,7 @@
 
 void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw() {
   return Metaspace::allocate(loader_data, word_size, /*read_only*/false,
-                             MetaspaceObj::ClassType, CHECK_NULL);
+                             MetaspaceObj::ClassType, THREAD);
 }
 
 Klass::Klass() {
--- a/hotspot/src/share/vm/oops/methodData.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -658,7 +658,7 @@
   int size = MethodData::compute_allocation_size_in_words(method);
 
   return new (loader_data, size, false, MetaspaceObj::MethodDataType, THREAD)
-    MethodData(method(), size, CHECK_NULL);
+    MethodData(method(), size, THREAD);
 }
 
 int MethodData::bytecode_cell_count(Bytecodes::Code code) {
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -189,7 +189,7 @@
     if (length <= arrayOopDesc::max_array_length(T_OBJECT)) {
       int size = objArrayOopDesc::object_size(length);
       KlassHandle h_k(THREAD, this);
-      return (objArrayOop)CollectedHeap::array_allocate(h_k, size, length, CHECK_NULL);
+      return (objArrayOop)CollectedHeap::array_allocate(h_k, size, length, THREAD);
     } else {
       report_java_out_of_memory("Requested array size exceeds VM limit");
       JvmtiExport::post_array_size_exhausted();
@@ -362,11 +362,11 @@
   if (or_null) {
     return ak->array_klass_or_null(n);
   }
-  return ak->array_klass(n, CHECK_NULL);
+  return ak->array_klass(n, THREAD);
 }
 
 Klass* ObjArrayKlass::array_klass_impl(bool or_null, TRAPS) {
-  return array_klass_impl(or_null, dimension() +  1, CHECK_NULL);
+  return array_klass_impl(or_null, dimension() +  1, THREAD);
 }
 
 bool ObjArrayKlass::can_be_primary_super_slow() const {
--- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -25,8 +25,8 @@
 #ifndef SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
 #define SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
 
+#include "runtime/atomic.inline.hpp"
 #include "utilities/macros.hpp"
-#include "runtime/atomic.inline.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/parNew/parNewGeneration.hpp"
 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
--- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -191,7 +191,7 @@
   if (or_null) {
     return h_ak->array_klass_or_null(n);
   }
-  return h_ak->array_klass(n, CHECK_NULL);
+  return h_ak->array_klass(n, THREAD);
 }
 
 Klass* TypeArrayKlass::array_klass_impl(bool or_null, TRAPS) {
--- a/hotspot/src/share/vm/prims/jni.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/prims/jni.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -32,10 +32,6 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "interpreter/linkResolver.hpp"
-#include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
-#endif // INCLUDE_ALL_GCS
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/gcLocker.inline.hpp"
@@ -81,6 +77,10 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif // INCLUDE_ALL_GCS
 
 static jint CurrentVersion = JNI_VERSION_1_8;
 
@@ -603,6 +603,7 @@
 
   THROW_OOP_(JNIHandles::resolve(obj), JNI_OK);
   ShouldNotReachHere();
+  return 0;  // Mute compiler.
 JNI_END
 
 
@@ -623,6 +624,7 @@
   Handle protection_domain (THREAD, k->protection_domain());
   THROW_MSG_LOADER_(name, (char *)message, class_loader, protection_domain, JNI_OK);
   ShouldNotReachHere();
+  return 0;  // Mute compiler.
 JNI_END
 
 
--- a/hotspot/src/share/vm/prims/jvm.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -28,10 +28,6 @@
 #include "classfile/javaClasses.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
-#if INCLUDE_CDS
-#include "classfile/sharedClassUtil.hpp"
-#include "classfile/systemDictionaryShared.hpp"
-#endif
 #include "classfile/vmSymbols.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "interpreter/bytecode.hpp"
@@ -73,8 +69,13 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/top.hpp"
 #include "utilities/utf8.hpp"
+#if INCLUDE_CDS
+#include "classfile/sharedClassUtil.hpp"
+#include "classfile/systemDictionaryShared.hpp"
+#endif
 #ifdef TARGET_OS_FAMILY_linux
 # include "jvm_linux.h"
 #endif
@@ -3552,7 +3553,7 @@
     JVM_DTraceProvider* providers))
   JVMWrapper("JVM_DTraceActivate");
   return DTraceJSDT::activate(
-    version, module_name, providers_count, providers, CHECK_0);
+    version, module_name, providers_count, providers, THREAD);
 JVM_END
 
 JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -399,12 +399,12 @@
 // convert the external string or reflective type to an internal signature
 Symbol* MethodHandles::lookup_signature(oop type_str, bool intern_if_not_found, TRAPS) {
   if (java_lang_invoke_MethodType::is_instance(type_str)) {
-    return java_lang_invoke_MethodType::as_signature(type_str, intern_if_not_found, CHECK_NULL);
+    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, CHECK_NULL);
+    return java_lang_Class::as_signature(type_str, false, THREAD);
   } else if (java_lang_String::is_instance(type_str)) {
     if (intern_if_not_found) {
-      return java_lang_String::as_symbol(type_str, CHECK_NULL);
+      return java_lang_String::as_symbol(type_str, THREAD);
     } else {
       return java_lang_String::as_symbol_or_null(type_str);
     }
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -24,10 +24,6 @@
 
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
-#include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
-#endif // INCLUDE_ALL_GCS
 #include "memory/allocation.inline.hpp"
 #include "prims/jni.h"
 #include "prims/jvm.h"
@@ -43,6 +39,10 @@
 #include "trace/tracing.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/dtrace.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif // INCLUDE_ALL_GCS
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -26,45 +26,38 @@
 
 #include <new>
 
+#include "classfile/classLoaderData.hpp"
+#include "classfile/stringTable.hpp"
 #include "code/codeCache.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
-
-#include "classfile/stringTable.hpp"
-#include "classfile/classLoaderData.hpp"
-
+#include "prims/wbtestmethods/parserTests.hpp"
 #include "prims/whitebox.hpp"
-#include "prims/wbtestmethods/parserTests.hpp"
-
-#include "runtime/thread.hpp"
 #include "runtime/arguments.hpp"
+#include "runtime/compilationPolicy.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sweeper.hpp"
+#include "runtime/thread.hpp"
 #include "runtime/vm_version.hpp"
-#include "runtime/sweeper.hpp"
-
 #include "utilities/array.hpp"
 #include "utilities/debug.hpp"
+#include "utilities/exceptions.hpp"
 #include "utilities/macros.hpp"
-#include "utilities/exceptions.hpp"
-
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
 #include "gc_implementation/g1/concurrentMark.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/heapRegionRemSet.hpp"
 #endif // INCLUDE_ALL_GCS
-
 #if INCLUDE_NMT
 #include "services/mallocSiteTable.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/nativeCallStack.hpp"
 #endif // INCLUDE_NMT
 
-#include "compiler/compileBroker.hpp"
-#include "runtime/compilationPolicy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -94,7 +94,7 @@
 }
 
 oop fieldDescriptor::string_initial_value(TRAPS) const {
-  return constants()->uncached_string_at(initial_value_index(), CHECK_0);
+  return constants()->uncached_string_at(initial_value_index(), THREAD);
 }
 
 void fieldDescriptor::reinitialize(InstanceKlass* ik, int index) {
--- a/hotspot/src/share/vm/runtime/globals.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/globals.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -29,10 +29,10 @@
 #include "runtime/globals.hpp"
 #include "runtime/globals_extension.hpp"
 #include "runtime/os.hpp"
+#include "trace/tracing.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/top.hpp"
-#include "trace/tracing.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1_globals.hpp"
 #endif // INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -87,7 +87,7 @@
   // Short-circuit any possible re-entrant gc-a-lot attempt
   if (thread->skip_gcalot()) return;
 
-  if (is_init_completed()) {
+  if (Threads::is_vm_complete()) {
 
     if (++_fullgc_alot_invocation < FullGCALotStart) {
       return;
--- a/hotspot/src/share/vm/runtime/perfData.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/perfData.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -773,7 +773,7 @@
     static PerfStringVariable* create_string_variable(CounterNS ns,
                                                       const char* name,
                                                       const char *s, TRAPS) {
-      return create_string_variable(ns, name, 0, s, CHECK_NULL);
+      return create_string_variable(ns, name, 0, s, THREAD);
     };
 
     static PerfLongVariable* create_long_variable(CounterNS ns,
@@ -784,7 +784,7 @@
     static PerfLongVariable* create_long_variable(CounterNS ns,
                                                   const char* name,
                                                   PerfData::Units u, TRAPS) {
-      return create_long_variable(ns, name, u, (jlong)0, CHECK_NULL);
+      return create_long_variable(ns, name, u, (jlong)0, THREAD);
     };
 
     static PerfLongVariable* create_long_variable(CounterNS, const char* name,
@@ -805,7 +805,7 @@
 
     static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
                                                 PerfData::Units u, TRAPS) {
-      return create_long_counter(ns, name, u, (jlong)0, CHECK_NULL);
+      return create_long_counter(ns, name, u, (jlong)0, THREAD);
     };
 
     static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
@@ -823,49 +823,49 @@
 
     static PerfConstant* create_constant(CounterNS ns, const char* name,
                                          PerfData::Units u, jlong val, TRAPS) {
-      return create_long_constant(ns, name, u, val, CHECK_NULL);
+      return create_long_constant(ns, name, u, val, THREAD);
     }
 
     static PerfVariable* create_variable(CounterNS ns, const char* name,
                                          PerfData::Units u, jlong ival, TRAPS) {
-      return create_long_variable(ns, name, u, ival, CHECK_NULL);
+      return create_long_variable(ns, name, u, ival, THREAD);
     }
 
     static PerfVariable* create_variable(CounterNS ns, const char* name,
                                          PerfData::Units u, TRAPS) {
-      return create_long_variable(ns, name, u, (jlong)0, CHECK_NULL);
+      return create_long_variable(ns, name, u, (jlong)0, THREAD);
     }
 
     static PerfVariable* create_variable(CounterNS ns, const char* name,
                                          PerfData::Units u, jlong* sp, TRAPS) {
-      return create_long_variable(ns, name, u, sp, CHECK_NULL);
+      return create_long_variable(ns, name, u, sp, THREAD);
     }
 
     static PerfVariable* create_variable(CounterNS ns, const char* name,
                                          PerfData::Units u,
                                          PerfSampleHelper* sh, TRAPS) {
-      return create_long_variable(ns, name, u, sh, CHECK_NULL);
+      return create_long_variable(ns, name, u, sh, THREAD);
     }
 
     static PerfCounter* create_counter(CounterNS ns, const char* name,
                                        PerfData::Units u, jlong ival, TRAPS) {
-      return create_long_counter(ns, name, u, ival, CHECK_NULL);
+      return create_long_counter(ns, name, u, ival, THREAD);
     }
 
     static PerfCounter* create_counter(CounterNS ns, const char* name,
                                        PerfData::Units u, TRAPS) {
-      return create_long_counter(ns, name, u, (jlong)0, CHECK_NULL);
+      return create_long_counter(ns, name, u, (jlong)0, THREAD);
     }
 
     static PerfCounter* create_counter(CounterNS ns, const char* name,
                                        PerfData::Units u, jlong* sp, TRAPS) {
-      return create_long_counter(ns, name, u, sp, CHECK_NULL);
+      return create_long_counter(ns, name, u, sp, THREAD);
     }
 
     static PerfCounter* create_counter(CounterNS ns, const char* name,
                                        PerfData::Units u,
                                        PerfSampleHelper* sh, TRAPS) {
-      return create_long_counter(ns, name, u, sh, CHECK_NULL);
+      return create_long_counter(ns, name, u, sh, THREAD);
     }
 
     static void destroy();
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -635,7 +635,7 @@
 }
 
 objArrayHandle Reflection::get_exception_types(methodHandle method, TRAPS) {
-  return method->resolved_checked_exceptions(CHECK_(objArrayHandle()));
+  return method->resolved_checked_exceptions(THREAD);
 }
 
 
@@ -1003,7 +1003,7 @@
   } else {
     if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT)
       narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
-    return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
+    return box((jvalue*) result.get_value_addr(), rtype, THREAD);
   }
 }
 
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -986,7 +986,7 @@
   // last java frame on stack (which includes native call frames)
   vframeStream vfst(thread, true);  // Do not skip and javaCalls
 
-  return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle()));
+  return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD);
 }
 
 
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -169,7 +169,7 @@
   void waitUninterruptibly(TRAPS) { ObjectSynchronizer::waitUninterruptibly(_obj, 0, CHECK); }
   // complete_exit gives up lock completely, returning recursion count
   // reenter reclaims lock with original recursion count
-  intptr_t complete_exit(TRAPS)  { return ObjectSynchronizer::complete_exit(_obj, CHECK_0); }
+  intptr_t complete_exit(TRAPS)  { return ObjectSynchronizer::complete_exit(_obj, THREAD); }
   void reenter(intptr_t recursion, TRAPS)  { ObjectSynchronizer::reenter(_obj, recursion, CHECK); }
 };
 
--- a/hotspot/src/share/vm/services/memTracker.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/services/memTracker.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -64,7 +64,7 @@
     const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
   static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
   static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); }
-  static inline Tracker get_virtual_memory_release_tracker() { }
+  static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); }
   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
   static inline void record_thread_stack(void* addr, size_t size) { }
   static inline void release_thread_stack(void* addr, size_t size) { }
--- a/hotspot/src/share/vm/utilities/array.hpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/utilities/array.hpp	Mon Nov 17 21:32:32 2014 +0100
@@ -322,7 +322,7 @@
   void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) throw() {
     size_t word_size = Array::size(length);
     return (void*) Metaspace::allocate(loader_data, word_size, read_only,
-                                       MetaspaceObj::array_type(sizeof(T)), CHECK_NULL);
+                                       MetaspaceObj::array_type(sizeof(T)), THREAD);
   }
 
   static size_t byte_sizeof(int length) { return sizeof(Array<T>) + MAX2(length - 1, 0) * sizeof(T); }
--- a/hotspot/src/share/vm/utilities/ostream.cpp	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Mon Nov 17 21:32:32 2014 +0100
@@ -30,6 +30,7 @@
 #include "runtime/os.hpp"
 #include "runtime/vm_version.hpp"
 #include "utilities/defaultStream.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/top.hpp"
 #include "utilities/xmlstream.hpp"