Merge
authorbobv
Tue, 14 Feb 2017 11:26:27 -0500
changeset 46268 cb4459e22f7a
parent 46267 dde19b81b7fd (current diff)
parent 46266 d5ccf56195af (diff)
child 46269 7e725659ea12
child 46275 d27ab535d88c
Merge
--- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -402,14 +402,6 @@
   return entry;
 }
 
-address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
-  address entry = __ pc();
-  // NULL last_sp until next java call
-  __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
-  __ dispatch_next(state);
-  return entry;
-}
-
 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
   address entry = __ pc();
 
--- a/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -270,12 +270,6 @@
   return entry;
 }
 
-address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
-  // Not used.
-  STOP("generate_continuation_for");
-  return NULL;
-}
-
 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
   address entry = __ pc();
 
--- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -646,12 +646,6 @@
   return entry;
 }
 
-address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
-  address entry = __ pc();
-  __ unimplemented("generate_continuation_for");
-  return entry;
-}
-
 // This entry is returned to when a call returns to the interpreter.
 // When we arrive here, we expect that the callee stack frame is already popped.
 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
--- a/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -642,13 +642,6 @@
   return entry;
 }
 
-// Unused, should never pass by.
-address TemplateInterpreterGenerator::generate_continuation_for (TosState state) {
-  address entry = __ pc();
-  __ should_not_reach_here();
-  return entry;
-}
-
 address TemplateInterpreterGenerator::generate_return_entry_for (TosState state, int step, size_t index_size) {
   address entry = __ pc();
 
--- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -466,12 +466,6 @@
 }
 
 
-address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
-  address entry = __ pc();
-  __ dispatch_next(state);
-  return entry;
-}
-
 //
 // Helpers for commoning out cases in the various type of method entries.
 //
--- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -171,16 +171,6 @@
   return entry;
 }
 
-
-address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
-  address entry = __ pc();
-  // NULL last_sp until next java call
-  __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
-  __ dispatch_next(state);
-  return entry;
-}
-
-
 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
   address entry = __ pc();
 
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -374,7 +374,7 @@
   }
   if (resolved_klass->is_instance_klass()) {
     return (Reflection::verify_class_access(accessing_klass->get_Klass(),
-                                            resolved_klass,
+                                            InstanceKlass::cast(resolved_klass),
                                             true) == Reflection::ACCESS_OK);
   }
   return true;
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -4374,10 +4374,12 @@
     }
 
     Reflection::VerifyClassAccessResults vca_result =
-      Reflection::verify_class_access(this_klass, super, false);
+      Reflection::verify_class_access(this_klass, InstanceKlass::cast(super), false);
     if (vca_result != Reflection::ACCESS_OK) {
       ResourceMark rm(THREAD);
-      char* msg =  Reflection::verify_class_access_msg(this_klass, super, vca_result);
+      char* msg = Reflection::verify_class_access_msg(this_klass,
+                                                      InstanceKlass::cast(super),
+                                                      vca_result);
       if (msg == NULL) {
         Exceptions::fthrow(
           THREAD_AND_LOCATION,
@@ -4406,10 +4408,12 @@
     Klass* const k = local_interfaces->at(i);
     assert (k != NULL && k->is_interface(), "invalid interface");
     Reflection::VerifyClassAccessResults vca_result =
-      Reflection::verify_class_access(this_klass, k, false);
+      Reflection::verify_class_access(this_klass, InstanceKlass::cast(k), false);
     if (vca_result != Reflection::ACCESS_OK) {
       ResourceMark rm(THREAD);
-      char* msg =  Reflection::verify_class_access_msg(this_klass, k, vca_result);
+      char* msg = Reflection::verify_class_access_msg(this_klass,
+                                                      InstanceKlass::cast(k),
+                                                      vca_result);
       if (msg == NULL) {
         Exceptions::fthrow(
           THREAD_AND_LOCATION,
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -275,10 +275,12 @@
 
 void LinkResolver::check_klass_accessability(KlassHandle ref_klass, KlassHandle sel_klass, TRAPS) {
   Reflection::VerifyClassAccessResults vca_result =
-    Reflection::verify_class_access(ref_klass(), sel_klass(), true);
+    Reflection::verify_class_access(ref_klass(), InstanceKlass::cast(sel_klass()), true);
   if (vca_result != Reflection::ACCESS_OK) {
     ResourceMark rm(THREAD);
-    char* msg = Reflection::verify_class_access_msg(ref_klass(), sel_klass(), vca_result);
+    char* msg = Reflection::verify_class_access_msg(ref_klass(),
+                                                    InstanceKlass::cast(sel_klass()),
+                                                    vca_result);
     if (msg == NULL) {
       Exceptions::fthrow(
         THREAD_AND_LOCATION,
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -193,7 +193,6 @@
 EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries];
 EntryPoint TemplateInterpreter::_earlyret_entry;
 EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ];
-EntryPoint TemplateInterpreter::_continuation_entry;
 EntryPoint TemplateInterpreter::_safept_entry;
 
 address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs];
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -119,7 +119,6 @@
   static EntryPoint _return_entry[number_of_return_entries];    // entry points to return to from a call
   static EntryPoint _earlyret_entry;                            // entry point to return early from a call
   static EntryPoint _deopt_entry[number_of_deopt_entries];      // entry points to return to from a deoptimization
-  static EntryPoint _continuation_entry;
   static EntryPoint _safept_entry;
 
   static address _invoke_return_entry[number_of_return_addrs];           // for invokestatic, invokespecial, invokevirtual return entries
@@ -158,7 +157,6 @@
 #ifndef PRODUCT
   static address    trace_code    (TosState state)              { return _trace_code.entry(state); }
 #endif // !PRODUCT
-  static address    continuation  (TosState state)              { return _continuation_entry.entry(state); }
   static address*   dispatch_table(TosState state)              { return _active_table.table_for(state); }
   static address*   dispatch_table()                            { return _active_table.table_for(); }
   static int        distance_from_dispatch_table(TosState state){ return _active_table.distance_from(state); }
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -165,21 +165,6 @@
     }
   }
 
-  { CodeletMark cm(_masm, "continuation entry points");
-    Interpreter::_continuation_entry =
-      EntryPoint(
-                 generate_continuation_for(btos),
-                 generate_continuation_for(ztos),
-                 generate_continuation_for(ctos),
-                 generate_continuation_for(stos),
-                 generate_continuation_for(atos),
-                 generate_continuation_for(itos),
-                 generate_continuation_for(ltos),
-                 generate_continuation_for(ftos),
-                 generate_continuation_for(dtos),
-                 generate_continuation_for(vtos)
-                 );
-  }
 
   { CodeletMark cm(_masm, "safepoint entry points");
     Interpreter::_safept_entry =
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -52,7 +52,6 @@
   address generate_exception_handler_common(const char* name, const char* message, bool pass_oop);
   address generate_ClassCastException_handler();
   address generate_ArrayIndexOutOfBounds_handler(const char* name);
-  address generate_continuation_for(TosState state);
   address generate_return_entry_for(TosState state, int step, size_t index_size);
   address generate_earlyret_entry_for(TosState state);
   address generate_deopt_entry_for(TosState state, int step);
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@
   }
   if (resolved_klass->is_instance_klass()) {
     Reflection::VerifyClassAccessResults result =
-      Reflection::verify_class_access(accessing_klass(), resolved_klass(), true);
+      Reflection::verify_class_access(accessing_klass(), InstanceKlass::cast(resolved_klass()), true);
     return result == Reflection::ACCESS_OK;
   }
   return true;
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1209,7 +1209,7 @@
       // Emulate LinkResolver::check_klass_accessability.
       Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh));
       if (Reflection::verify_class_access(caller,
-                                          reference_klass,
+                                          InstanceKlass::cast(reference_klass),
                                           true) != Reflection::ACCESS_OK) {
         THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
       }
--- a/hotspot/src/share/vm/runtime/atomic.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/runtime/atomic.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,8 +81,6 @@
   inline static size_t   add    (size_t   add_value, volatile size_t*   dest);
   inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest);
   inline static void*    add_ptr(intptr_t add_value, volatile void*     dest);
-  // See comment above about using jlong atomics on 32-bit platforms
-  inline static jlong    add    (jlong    add_value, volatile jlong*    dest);
 
   // Atomically increment location. inc*() provide:
   // <fence> increment-dest <membar StoreLoad|StoreStore>
@@ -199,16 +197,6 @@
                                        (jint)compare_value, order);
 }
 
-inline jlong Atomic::add(jlong    add_value, volatile jlong*    dest) {
-  jlong old = load(dest);
-  jlong new_value = old + add_value;
-  while (old != cmpxchg(new_value, dest, old)) {
-    old = load(dest);
-    new_value = old + add_value;
-  }
-  return old;
-}
-
 inline jshort Atomic::add(jshort add_value, volatile jshort* dest) {
   // Most platforms do not support atomic add on a 2-byte value. However,
   // if the value occupies the most significant 16 bits of an aligned 32-bit
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -477,7 +477,7 @@
  Note: a loose module is a module that can read all current and future unnamed modules.
 */
 Reflection::VerifyClassAccessResults Reflection::verify_class_access(
-  const Klass* current_class, const Klass* new_class, bool classloader_only) {
+  const Klass* current_class, const InstanceKlass* new_class, bool classloader_only) {
 
   // Verify that current_class can access new_class.  If the classloader_only
   // flag is set, we automatically allow any accesses in which current_class
@@ -504,13 +504,6 @@
     // Find the module entry for current_class, the accessor
     ModuleEntry* module_from = current_class->module();
     // Find the module entry for new_class, the accessee
-    if (new_class->is_objArray_klass()) {
-      new_class = ObjArrayKlass::cast(new_class)->bottom_klass();
-    }
-    if (new_class->is_typeArray_klass()) {
-      // A TypeArray's defining module is java.base, access to the TypeArray is allowed
-      return ACCESS_OK;
-    }
     ModuleEntry* module_to = new_class->module();
 
     // both in same (possibly unnamed) module
@@ -563,7 +556,7 @@
 // Return an error message specific to the specified Klass*'s and result.
 // This function must be called from within a block containing a ResourceMark.
 char* Reflection::verify_class_access_msg(const Klass* current_class,
-                                          const Klass* new_class,
+                                          const InstanceKlass* new_class,
                                           VerifyClassAccessResults result) {
   assert(result != ACCESS_OK, "must be failure result");
   char * msg = NULL;
--- a/hotspot/src/share/vm/runtime/reflection.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/runtime/reflection.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -82,12 +82,12 @@
 
   // Verification
   static VerifyClassAccessResults verify_class_access(const Klass* current_class,
-                                                      const Klass* new_class,
+                                                      const InstanceKlass* new_class,
                                                       bool classloader_only);
   // Return an error message specific to the specified Klass*'s and result.
   // This function must be called from within a block containing a ResourceMark.
   static char*    verify_class_access_msg(const Klass* current_class,
-                                          const Klass* new_class,
+                                          const InstanceKlass* new_class,
                                           const VerifyClassAccessResults result);
 
   static bool     verify_field_access(const Klass* current_class,
--- a/hotspot/src/share/vm/services/mallocSiteTable.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/services/mallocSiteTable.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -62,7 +62,7 @@
  public:
   MallocSiteHashtableEntry() : _next(NULL) { }
 
-  MallocSiteHashtableEntry(NativeCallStack stack):
+  MallocSiteHashtableEntry(const NativeCallStack& stack):
     _malloc_site(stack), _next(NULL) { }
 
   inline const MallocSiteHashtableEntry* next() const {
--- a/hotspot/src/share/vm/services/mallocTracker.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/services/mallocTracker.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,8 @@
  */
 class MemoryCounter VALUE_OBJ_CLASS_SPEC {
  private:
-  size_t   _count;
-  size_t   _size;
+  volatile size_t   _count;
+  volatile size_t   _size;
 
   DEBUG_ONLY(size_t   _peak_count;)
   DEBUG_ONLY(size_t   _peak_size; )
@@ -53,26 +53,28 @@
   }
 
   inline void allocate(size_t sz) {
-    Atomic::add(1, (volatile MemoryCounterType*)&_count);
+    Atomic::add(1, &_count);
     if (sz > 0) {
-      Atomic::add((MemoryCounterType)sz, (volatile MemoryCounterType*)&_size);
+      Atomic::add(sz, &_size);
       DEBUG_ONLY(_peak_size = MAX2(_peak_size, _size));
     }
     DEBUG_ONLY(_peak_count = MAX2(_peak_count, _count);)
   }
 
   inline void deallocate(size_t sz) {
-    assert(_count > 0, "Negative counter");
-    assert(_size >= sz, "Negative size");
-    Atomic::add(-1, (volatile MemoryCounterType*)&_count);
+    assert(_count > 0, "Nothing allocated yet");
+    assert(_size >= sz, "deallocation > allocated");
+    Atomic::add(-1, &_count);
     if (sz > 0) {
-      Atomic::add(-(MemoryCounterType)sz, (volatile MemoryCounterType*)&_size);
+      // unary minus operator applied to unsigned type, result still unsigned
+      #pragma warning(suppress: 4146)
+      Atomic::add(-sz, &_size);
     }
   }
 
   inline void resize(long sz) {
     if (sz != 0) {
-      Atomic::add((MemoryCounterType)sz, (volatile MemoryCounterType*)&_size);
+      Atomic::add(sz, &_size);
       DEBUG_ONLY(_peak_size = MAX2(_size, _peak_size);)
     }
   }
--- a/hotspot/src/share/vm/services/nmtCommon.hpp	Tue Feb 14 11:24:35 2017 -0500
+++ b/hotspot/src/share/vm/services/nmtCommon.hpp	Tue Feb 14 11:26:27 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,6 @@
 
 #define CALC_OBJ_SIZE_IN_TYPE(obj, type) (align_size_up_(sizeof(obj), sizeof(type))/sizeof(type))
 
-// Data type for memory counters
-#ifdef _LP64
-  typedef jlong    MemoryCounterType;
-#else
-  typedef jint     MemoryCounterType;
-#endif
-
 // Native memory tracking level
 enum NMT_TrackingLevel {
   NMT_unknown = 0xFF,