changeset 516:4cd7d914b0e3 tip

rebase to current hsx/hotspot-comp
author jrose
date Sun, 06 Oct 2013 23:32:13 -0700
parents 3e126536de3f
children
files series value-obj-8001111.patch
diffstat 2 files changed, 52 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/series	Fri Sep 13 22:46:24 2013 -0700
+++ b/series	Sun Oct 06 23:32:13 2013 -0700
@@ -1,11 +1,10 @@
-# base = 01b268b3080a in http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot [2013-09-13]
+# base = 5f1241525a01 in http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot [2013-10-04]
 
 # review pending before push to hotspot-comp:
 
 # non-pushed files are under review or development, or merely experimental:
-anno-stable-8001107.patch       #-/meth #+01b268b3080a #-testable
-value-obj-8001111.patch         #-/meth #+01b268b3080a #-testable
-meth.patch                      #-/meth #+01b268b3080a
+value-obj-8001111.patch         #-/meth #+5f1241525a01 #-testable
+meth.patch                      #-/meth #+5f1241525a01
 
 meth.proj.patch                 #-/meth #+projects
 anonk.proj.patch                #-/anonk #+projects
@@ -21,7 +20,7 @@
 hotswaplight.patch   #+hotswaplight       #-/hotswaplight
 
 # Coroutine patches: full version and simple version (no thread migration, no serialization, no stack sharing) 
-coro.patch                      #+coro          #(01b268b3080a)
-coro-simple.patch               #+coro-simple   #(01b268b3080a)
+coro.patch                      #+coro          #(5f1241525a01)
+coro-simple.patch               #+coro-simple   #(5f1241525a01)
 
 tuple-tsig.patch        #+tuple #-/tuple #-testable
--- a/value-obj-8001111.patch	Fri Sep 13 22:46:24 2013 -0700
+++ b/value-obj-8001111.patch	Sun Oct 06 23:32:13 2013 -0700
@@ -18,7 +18,7 @@
 diff --git a/src/cpu/x86/vm/templateTable_x86_64.cpp b/src/cpu/x86/vm/templateTable_x86_64.cpp
 --- a/src/cpu/x86/vm/templateTable_x86_64.cpp
 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp
-@@ -601,6 +601,11 @@
+@@ -608,6 +608,11 @@
    // destroys rbx
    // check array
    __ null_check(array, arrayOopDesc::length_offset_in_bytes());
@@ -30,7 +30,7 @@
    // sign extend index for use by indexed load
    __ movl2ptr(index, index);
    // check index
-@@ -2237,6 +2242,24 @@
+@@ -2262,6 +2267,24 @@
    __ pop_ptr(r);
    __ null_check(r);  // for field access must check obj.
    __ verify_oop(r);
@@ -69,7 +69,7 @@
 diff --git a/src/share/vm/interpreter/interpreterRuntime.cpp b/src/share/vm/interpreter/interpreterRuntime.cpp
 --- a/src/share/vm/interpreter/interpreterRuntime.cpp
 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp
-@@ -489,6 +489,14 @@
+@@ -490,6 +490,14 @@
  IRT_END
  
  
@@ -87,9 +87,9 @@
 diff --git a/src/share/vm/interpreter/interpreterRuntime.hpp b/src/share/vm/interpreter/interpreterRuntime.hpp
 --- a/src/share/vm/interpreter/interpreterRuntime.hpp
 +++ b/src/share/vm/interpreter/interpreterRuntime.hpp
-@@ -107,6 +107,7 @@
-   static void    create_klass_exception(JavaThread* thread, char* name, oopDesc* obj);
-   static address exception_handler_for_exception(JavaThread* thread, oopDesc* exception);
+@@ -99,6 +99,7 @@
+   static void    member_name_arg_or_null(JavaThread* thread, address dmh, Method* m, address bcp);
+ #endif
    static void    throw_pending_exception(JavaThread* thread);
 +  static void    throw_if_locked_permanently(JavaThread* thread, oopDesc* obj);
  
@@ -109,7 +109,7 @@
 diff --git a/src/share/vm/oops/markOop.cpp b/src/share/vm/oops/markOop.cpp
 --- a/src/share/vm/oops/markOop.cpp
 +++ b/src/share/vm/oops/markOop.cpp
-@@ -46,6 +46,7 @@
+@@ -34,6 +34,7 @@
      assert(is_unlocked() || has_bias_pattern(), "just checking");
      st->print("mark(");
      if (has_bias_pattern())  st->print("biased,");
@@ -369,7 +369,7 @@
 diff --git a/src/share/vm/oops/oop.cpp b/src/share/vm/oops/oop.cpp
 --- a/src/share/vm/oops/oop.cpp
 +++ b/src/share/vm/oops/oop.cpp
-@@ -106,10 +106,10 @@
+@@ -95,10 +95,10 @@
  
  intptr_t oopDesc::slow_identity_hash() {
    // slow case; we have to acquire the micro lock in order to locate the header
@@ -386,7 +386,7 @@
 diff --git a/src/share/vm/oops/oop.hpp b/src/share/vm/oops/oop.hpp
 --- a/src/share/vm/oops/oop.hpp
 +++ b/src/share/vm/oops/oop.hpp
-@@ -284,6 +284,7 @@
+@@ -278,6 +278,7 @@
    bool is_locked()   const;
    bool is_unlocked() const;
    bool has_bias_pattern() const;
@@ -397,7 +397,7 @@
 diff --git a/src/share/vm/oops/oop.inline.hpp b/src/share/vm/oops/oop.inline.hpp
 --- a/src/share/vm/oops/oop.inline.hpp
 +++ b/src/share/vm/oops/oop.inline.hpp
-@@ -602,6 +602,10 @@
+@@ -566,6 +566,10 @@
    return mark()->has_bias_pattern();
  }
  
@@ -408,7 +408,7 @@
  
  // used only for asserts
  inline bool oopDesc::is_oop(bool ignore_mark_word) const {
-@@ -716,7 +720,7 @@
+@@ -680,7 +684,7 @@
    // Fast case; if the object is unlocked and the hash value is set, no locking is needed
    // Note: The mark must be read into local variable to avoid concurrent updates.
    markOop mrk = mark();
@@ -420,7 +420,7 @@
 diff --git a/src/share/vm/prims/jvm.cpp b/src/share/vm/prims/jvm.cpp
 --- a/src/share/vm/prims/jvm.cpp
 +++ b/src/share/vm/prims/jvm.cpp
-@@ -512,10 +512,17 @@
+@@ -505,10 +505,17 @@
  // java.lang.Object ///////////////////////////////////////////////
  
  
@@ -443,7 +443,7 @@
 diff --git a/src/share/vm/prims/unsafe.cpp b/src/share/vm/prims/unsafe.cpp
 --- a/src/share/vm/prims/unsafe.cpp
 +++ b/src/share/vm/prims/unsafe.cpp
-@@ -1140,6 +1140,33 @@
+@@ -1159,6 +1159,33 @@
  UNSAFE_END
  
  
@@ -477,8 +477,8 @@
  UNSAFE_ENTRY(void, Unsafe_ThrowException(JNIEnv *env, jobject unsafe, jthrowable thr))
    UnsafeWrapper("Unsafe_ThrowException");
    {
-@@ -1582,6 +1609,11 @@
-     {CC"shouldBeInitialized",CC"("CLS")Z",               FN_PTR(Unsafe_ShouldBeInitialized)},
+@@ -1649,6 +1676,11 @@
+     {CC"fullFence",          CC"()V",                    FN_PTR(Unsafe_FullFence)},
  };
  
 +JNINativeMethod lockperm_methods[] = {
@@ -489,22 +489,17 @@
  #undef CC
  #undef FN_PTR
  
-@@ -1661,6 +1693,15 @@
-         env->ExceptionClear();
-       }
-     }
+@@ -1748,5 +1780,10 @@
+ 
+     // Fence methods
+     register_natives("1.8 fence methods", env, unsafecls, fence_methods, sizeof(fence_methods)/sizeof(JNINativeMethod));
++
++    // object locking methods
 +    if (EnableFinalObjects) {
-+      env->RegisterNatives(unsafecls, lockperm_methods, sizeof(lockperm_methods)/sizeof(JNINativeMethod));
-+      if (env->ExceptionOccurred()) {
-+        if (PrintMiscellaneous && (Verbose || WizardMode)) {
-+          tty->print_cr("Warning:  support for EnableFinalObjects in Unsafe not found.");
-+        }
-+        env->ExceptionClear();
-+      }
++      register_natives("1.X object locking methods", env, unsafecls, lockperm_methods, sizeof(lockperm_methods)/sizeof(JNINativeMethod));
 +    }
-     int status = env->RegisterNatives(unsafecls, methods, sizeof(methods)/sizeof(JNINativeMethod));
-     if (env->ExceptionOccurred()) {
-       if (PrintMiscellaneous && (Verbose || WizardMode)) {
+   }
+ JVM_END
 diff --git a/src/share/vm/runtime/biasedLocking.cpp b/src/share/vm/runtime/biasedLocking.cpp
 --- a/src/share/vm/runtime/biasedLocking.cpp
 +++ b/src/share/vm/runtime/biasedLocking.cpp
@@ -676,7 +671,7 @@
 diff --git a/src/share/vm/runtime/deoptimization.cpp b/src/share/vm/runtime/deoptimization.cpp
 --- a/src/share/vm/runtime/deoptimization.cpp
 +++ b/src/share/vm/runtime/deoptimization.cpp
-@@ -940,12 +940,12 @@
+@@ -949,12 +949,12 @@
        assert(mon_info->owner() != NULL, "reallocation was missed");
        Handle obj = Handle(mon_info->owner());
        markOop mark = obj->mark();
@@ -694,9 +689,9 @@
 diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
 --- a/src/share/vm/runtime/globals.hpp
 +++ b/src/share/vm/runtime/globals.hpp
-@@ -3565,6 +3565,12 @@
-   experimental(bool, TrustFinalNonStaticFields, false,                      \
-           "trust final non-static declarations for constant folding")       \
+@@ -3692,6 +3692,12 @@
+   experimental(bool, FoldStableValues, false,                               \
+           "Private flag to control optimizations for stable variables")     \
                                                                              \
 +  experimental(bool, EnableFinalObjects, false,                             \
 +          "support objects which are fully immutable")                      \
@@ -710,7 +705,7 @@
 diff --git a/src/share/vm/runtime/synchronizer.cpp b/src/share/vm/runtime/synchronizer.cpp
 --- a/src/share/vm/runtime/synchronizer.cpp
 +++ b/src/share/vm/runtime/synchronizer.cpp
-@@ -165,9 +165,20 @@
+@@ -162,9 +162,20 @@
  // some assembly copies of this code. Make sure update those code
  // if the following function is changed. The implementation is
  // extremely sensitive to race condition. Be careful.
@@ -732,7 +727,7 @@
      if (!SafepointSynchronize::is_at_safepoint()) {
        BiasedLocking::Condition cond = BiasedLocking::revoke_and_rebias(obj, attempt_rebias, THREAD);
        if (cond == BiasedLocking::BIAS_REVOKED_AND_REBIASED) {
-@@ -177,7 +188,7 @@
+@@ -174,7 +185,7 @@
        assert(!attempt_rebias, "can not rebias toward VM thread");
        BiasedLocking::revoke_at_safepoint(obj);
      }
@@ -741,7 +736,7 @@
   }
  
   slow_enter (obj, lock, THREAD) ;
-@@ -226,6 +237,9 @@
+@@ -223,6 +234,9 @@
  // failed in the interpreter/compiler code.
  void ObjectSynchronizer::slow_enter(Handle obj, BasicLock* lock, TRAPS) {
    markOop mark = obj->mark();
@@ -751,7 +746,7 @@
    assert(!mark->has_bias_pattern(), "should not see bias pattern here");
  
    if (mark->is_neutral()) {
-@@ -311,6 +325,9 @@
+@@ -308,6 +322,9 @@
  void ObjectSynchronizer::jni_enter(Handle obj, TRAPS) { // possible entry from jni enter
    // the current locking is from JNI instead of Java code
    TEVENT (jni_enter) ;
@@ -761,7 +756,7 @@
    if (UseBiasedLocking) {
      BiasedLocking::revoke_and_rebias(obj, false, THREAD);
      assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
-@@ -322,6 +339,9 @@
+@@ -319,6 +336,9 @@
  
  // NOTE: must use heavy weight monitor to handle jni monitor enter
  bool ObjectSynchronizer::jni_try_enter(Handle obj, Thread* THREAD) {
@@ -771,7 +766,7 @@
    if (UseBiasedLocking) {
      BiasedLocking::revoke_and_rebias(obj, false, THREAD);
      assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
-@@ -375,6 +395,9 @@
+@@ -374,6 +394,9 @@
  //  Wait/Notify/NotifyAll
  // NOTE: must use heavy weight monitor to handle wait()
  void ObjectSynchronizer::wait(Handle obj, jlong millis, TRAPS) {
@@ -781,7 +776,7 @@
    if (UseBiasedLocking) {
      BiasedLocking::revoke_and_rebias(obj, false, THREAD);
      assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
-@@ -394,6 +417,9 @@
+@@ -393,6 +416,9 @@
  }
  
  void ObjectSynchronizer::waitUninterruptibly (Handle obj, jlong millis, TRAPS) {
@@ -791,7 +786,7 @@
    if (UseBiasedLocking) {
      BiasedLocking::revoke_and_rebias(obj, false, THREAD);
      assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
-@@ -406,7 +432,10 @@
+@@ -405,7 +431,10 @@
  }
  
  void ObjectSynchronizer::notify(Handle obj, TRAPS) {
@@ -803,7 +798,7 @@
      BiasedLocking::revoke_and_rebias(obj, false, THREAD);
      assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
    }
-@@ -420,6 +449,9 @@
+@@ -419,6 +448,9 @@
  
  // NOTE: see comment of notify()
  void ObjectSynchronizer::notifyall(Handle obj, TRAPS) {
@@ -813,7 +808,7 @@
    if (UseBiasedLocking) {
      BiasedLocking::revoke_and_rebias(obj, false, THREAD);
      assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
-@@ -601,8 +633,8 @@
+@@ -598,8 +630,8 @@
    return value;
  }
  //
@@ -824,7 +819,7 @@
      // NOTE: many places throughout the JVM do not expect a safepoint
      // to be taken here, in particular most operations on perm gen
      // objects. However, we only ever bias Java instances and all of
-@@ -610,14 +642,18 @@
+@@ -607,14 +639,18 @@
      // been checked to make sure they can handle a safepoint. The
      // added check of the bias pattern is to avoid useless calls to
      // thread-local storage.
@@ -846,7 +841,7 @@
        obj = hobj() ;
        assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
      }
-@@ -628,9 +664,9 @@
+@@ -625,9 +661,9 @@
    assert (Universe::verify_in_progress() ||
            !SafepointSynchronize::is_at_safepoint(), "invariant") ;
    assert (Universe::verify_in_progress() ||
@@ -858,7 +853,7 @@
  
    ObjectMonitor* monitor = NULL;
    markOop temp, test;
-@@ -645,7 +681,7 @@
+@@ -642,7 +678,7 @@
      if (hash) {                       // if it has hash, just return it
        return hash;
      }
@@ -867,7 +862,7 @@
      temp = mark->copy_set_hash(hash); // merge the hash code into header
      // use (machine word version) atomic operation to install the hash
      test = (markOop) Atomic::cmpxchg_ptr(temp, obj->mark_addr(), mark);
-@@ -664,7 +700,7 @@
+@@ -661,7 +697,7 @@
        return hash;
      }
      // Skip to the following code to reduce code size
@@ -876,7 +871,7 @@
      temp = mark->displaced_mark_helper(); // this is a lightweight monitor owned
      assert (temp->is_neutral(), "invariant") ;
      hash = temp->hash();              // by current thread, check if the displaced
-@@ -683,13 +719,13 @@
+@@ -680,13 +716,13 @@
    }
  
    // Inflate the monitor to set hash code
@@ -892,7 +887,7 @@
      temp = mark->copy_set_hash(hash); // merge hash code into header
      assert (temp->is_neutral(), "invariant") ;
      test = (markOop) Atomic::cmpxchg_ptr(temp, monitor, mark);
-@@ -706,15 +742,83 @@
+@@ -703,15 +739,83 @@
    return hash;
  }
  
@@ -979,7 +974,7 @@
    if (UseBiasedLocking) {
      BiasedLocking::revoke_and_rebias(h_obj, false, thread);
      assert(!h_obj->mark()->has_bias_pattern(), "biases should be revoked by now");
-@@ -753,6 +857,9 @@
+@@ -750,6 +854,9 @@
  
    // Possible mark states: neutral, biased, stack-locked, inflated
  
@@ -989,7 +984,7 @@
    if (UseBiasedLocking && h_obj()->mark()->has_bias_pattern()) {
      // CASE: biased
      BiasedLocking::revoke_and_rebias(h_obj, false, self);
-@@ -787,6 +894,10 @@
+@@ -784,6 +891,10 @@
  
  // FIXME: jvmti should call this
  JavaThread* ObjectSynchronizer::get_lock_owner(Handle h_obj, bool doLock) {
@@ -1043,7 +1038,7 @@
 diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp
 --- a/src/share/vm/utilities/globalDefinitions.hpp
 +++ b/src/share/vm/utilities/globalDefinitions.hpp
-@@ -959,7 +959,8 @@
+@@ -993,7 +993,8 @@
  inline void clear_bits    (intptr_t& x, intptr_t m) { x &= ~m; }
  inline intptr_t mask_bits      (intptr_t  x, intptr_t m) { return x & m; }
  inline jlong    mask_long_bits (jlong     x, jlong    m) { return x & m; }