changeset 6924:b808a03aa0b7

Merge
author zgu
date Tue, 19 Aug 2014 10:04:29 -0400
parents 56ff43213a78 83b971c5423f
children 73cf3098bd73 865c90cfd688 6ae3b7da7952
files src/share/vm/services/virtualMemoryTracker.cpp test/runtime/NMT/MallocTestType.java test/runtime/NMT/PrintNMTStatistics.java test/runtime/NMT/ReleaseCommittedMemory.java test/runtime/NMT/SummarySanityCheck.java test/runtime/NMT/ThreadedMallocTestType.java test/runtime/NMT/ThreadedVirtualAllocTestType.java test/runtime/NMT/VirtualAllocTestType.java
diffstat 159 files changed, 642 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Aug 19 06:47:28 2014 -0700
+++ b/.hgtags	Tue Aug 19 10:04:29 2014 -0400
@@ -428,3 +428,4 @@
 dd472cdacc32e3afc7c5bfa7ef16ea0e0befb7fa jdk9-b23
 dde2d03b0ea46a27650839e3a1d212c7c1f7b4c8 jdk9-b24
 6de94e8693240cec8aae11f6b42f43433456a733 jdk9-b25
+48b95a073d752d6891cc0d1d2836b321ecf3ce0c jdk9-b26
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -731,7 +731,7 @@
     if (method->is_static())
       object = method->constants()->pool_holder()->java_mirror();
     else
-      object = (oop) locals[0];
+      object = (oop) (void*)locals[0];
     monitor->set_obj(object);
   }
 
--- a/src/cpu/zero/vm/frame_zero.inline.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/cpu/zero/vm/frame_zero.inline.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -26,6 +26,8 @@
 #ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
 #define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
 
+#include "code/codeCache.hpp"
+
 // Constructors
 
 inline frame::frame() {
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -2582,15 +2582,12 @@
 
 // Iteration functions.
 
-// Iterates an OopClosure over all ref-containing fields of objects
-// within a HeapRegion.
+// Applies an ExtendedOopClosure onto all references of objects within a HeapRegion.
 
 class IterateOopClosureRegionClosure: public HeapRegionClosure {
-  MemRegion _mr;
   ExtendedOopClosure* _cl;
 public:
-  IterateOopClosureRegionClosure(MemRegion mr, ExtendedOopClosure* cl)
-    : _mr(mr), _cl(cl) {}
+  IterateOopClosureRegionClosure(ExtendedOopClosure* cl) : _cl(cl) {}
   bool doHeapRegion(HeapRegion* r) {
     if (!r->continuesHumongous()) {
       r->oop_iterate(_cl);
@@ -2600,12 +2597,7 @@
 };
 
 void G1CollectedHeap::oop_iterate(ExtendedOopClosure* cl) {
-  IterateOopClosureRegionClosure blk(_g1_committed, cl);
-  heap_region_iterate(&blk);
-}
-
-void G1CollectedHeap::oop_iterate(MemRegion mr, ExtendedOopClosure* cl) {
-  IterateOopClosureRegionClosure blk(mr, cl);
+  IterateOopClosureRegionClosure blk(cl);
   heap_region_iterate(&blk);
 }
 
@@ -4792,11 +4784,6 @@
   Mutex _stats_lock;
   Mutex* stats_lock() { return &_stats_lock; }
 
-  size_t getNCards() {
-    return (_g1h->capacity() + G1BlockOffsetSharedArray::N_bytes - 1)
-      / G1BlockOffsetSharedArray::N_bytes;
-  }
-
 public:
   G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues)
     : AbstractGangTask("G1 collection"),
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -1395,9 +1395,6 @@
   // "cl.do_oop" on each.
   virtual void oop_iterate(ExtendedOopClosure* cl);
 
-  // Same as above, restricted to a memory region.
-  void oop_iterate(MemRegion mr, ExtendedOopClosure* cl);
-
   // Iterate over all objects, calling "cl.do_object" on each.
   virtual void object_iterate(ObjectClosure* cl);
 
--- a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -237,8 +237,10 @@
   _last_gc_worker_times_ms.verify();
   _last_gc_worker_other_times_ms.verify();
 
-  _last_redirty_logged_cards_time_ms.verify();
-  _last_redirty_logged_cards_processed_cards.verify();
+  if (G1DeferredRSUpdate) {
+    _last_redirty_logged_cards_time_ms.verify();
+    _last_redirty_logged_cards_processed_cards.verify();
+  }
 }
 
 void G1GCPhaseTimes::note_string_dedup_fixup_start() {
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -3402,7 +3402,7 @@
   tty->print_cr("osr._osr_buf: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_buf);
   tty->print_cr("osr._osr_entry: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_entry);
   tty->print_cr("prev_link: " INTPTR_FORMAT, (uintptr_t) this->_prev_link);
-  tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) this->_oop_temp);
+  tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) p2i(this->_oop_temp));
   tty->print_cr("stack_base: " INTPTR_FORMAT, (uintptr_t) this->_stack_base);
   tty->print_cr("stack_limit: " INTPTR_FORMAT, (uintptr_t) this->_stack_limit);
   tty->print_cr("monitor_base: " INTPTR_FORMAT, (uintptr_t) this->_monitor_base);
--- a/src/share/vm/memory/collectorPolicy.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/memory/collectorPolicy.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -176,13 +176,9 @@
 
   size_t alignment = GenRemSet::max_alignment_constraint();
 
-  // Parallel GC does its own alignment of the generations to avoid requiring a
-  // large page (256M on some platforms) for the permanent generation.  The
-  // other collectors should also be updated to do their own alignment and then
-  // this use of lcm() should be removed.
-  if (UseLargePages && !UseParallelGC) {
+  if (UseLargePages) {
       // In presence of large pages we have to make sure that our
-      // alignment is large page aware
+      // alignment is large page aware.
       alignment = lcm(os::large_page_size(), alignment);
   }
 
--- a/src/share/vm/prims/whitebox.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/prims/whitebox.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -601,6 +601,15 @@
   return NULL;
 WB_END
 
+WB_ENTRY(jobject, WB_GetSizeTVMFlag(JNIEnv* env, jobject o, jstring name))
+  uintx result;
+  if (GetVMFlag <size_t> (thread, env, name, &result, &CommandLineFlags::size_tAt)) {
+    ThreadToNativeFromVM ttnfv(thread);   // can't be in VM when we call JNI
+    return longBox(thread, env, result);
+  }
+  return NULL;
+WB_END
+
 WB_ENTRY(jobject, WB_GetDoubleVMFlag(JNIEnv* env, jobject o, jstring name))
   double result;
   if (GetVMFlag <double> (thread, env, name, &result, &CommandLineFlags::doubleAt)) {
@@ -641,6 +650,11 @@
   SetVMFlag <uint64_t> (thread, env, name, &result, &CommandLineFlags::uint64_tAtPut);
 WB_END
 
+WB_ENTRY(void, WB_SetSizeTVMFlag(JNIEnv* env, jobject o, jstring name, jlong value))
+  size_t result = value;
+  SetVMFlag <size_t> (thread, env, name, &result, &CommandLineFlags::size_tAtPut);
+WB_END
+
 WB_ENTRY(void, WB_SetDoubleVMFlag(JNIEnv* env, jobject o, jstring name, jdouble value))
   double result = value;
   SetVMFlag <double> (thread, env, name, &result, &CommandLineFlags::doubleAtPut);
@@ -885,6 +899,7 @@
   {CC"setIntxVMFlag",      CC"(Ljava/lang/String;J)V",(void*)&WB_SetIntxVMFlag},
   {CC"setUintxVMFlag",     CC"(Ljava/lang/String;J)V",(void*)&WB_SetUintxVMFlag},
   {CC"setUint64VMFlag",    CC"(Ljava/lang/String;J)V",(void*)&WB_SetUint64VMFlag},
+  {CC"setSizeTVMFlag",     CC"(Ljava/lang/String;J)V",(void*)&WB_SetSizeTVMFlag},
   {CC"setDoubleVMFlag",    CC"(Ljava/lang/String;D)V",(void*)&WB_SetDoubleVMFlag},
   {CC"setStringVMFlag",    CC"(Ljava/lang/String;Ljava/lang/String;)V",
                                                       (void*)&WB_SetStringVMFlag},
@@ -896,6 +911,8 @@
                                                       (void*)&WB_GetUintxVMFlag},
   {CC"getUint64VMFlag",    CC"(Ljava/lang/String;)Ljava/lang/Long;",
                                                       (void*)&WB_GetUint64VMFlag},
+  {CC"getSizeTVMFlag",     CC"(Ljava/lang/String;)Ljava/lang/Long;",
+                                                      (void*)&WB_GetSizeTVMFlag},
   {CC"getDoubleVMFlag",    CC"(Ljava/lang/String;)Ljava/lang/Double;",
                                                       (void*)&WB_GetDoubleVMFlag},
   {CC"getStringVMFlag",    CC"(Ljava/lang/String;)Ljava/lang/String;",
--- a/src/share/vm/runtime/arguments.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -693,6 +693,10 @@
   if (!is_neg && CommandLineFlags::uint64_tAtPut(name, &uint64_t_v, origin)) {
     return true;
   }
+  size_t size_t_v = (size_t) v;
+  if (!is_neg && CommandLineFlags::size_tAtPut(name, &size_t_v, origin)) {
+    return true;
+  }
   return false;
 }
 
--- a/src/share/vm/runtime/globals.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/runtime/globals.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -131,6 +131,19 @@
   *((uint64_t*) _addr) = value;
 }
 
+bool Flag::is_size_t() const {
+  return strcmp(_type, "size_t") == 0;
+}
+
+size_t Flag::get_size_t() const {
+  return *((size_t*) _addr);
+}
+
+void Flag::set_size_t(size_t value) {
+  check_writable();
+  *((size_t*) _addr) = value;
+}
+
 bool Flag::is_double() const {
   return strcmp(_type, "double") == 0;
 }
@@ -306,6 +319,9 @@
   if (is_uint64_t()) {
     st->print("%-16lu", get_uint64_t());
   }
+  if (is_size_t()) {
+    st->print(SIZE_FORMAT_W(-16), get_size_t());
+  }
   if (is_double()) {
     st->print("%-16f", get_double());
   }
@@ -395,6 +411,8 @@
     st->print("-XX:%s=" UINTX_FORMAT, _name, get_uintx());
   } else if (is_uint64_t()) {
     st->print("-XX:%s=" UINT64_FORMAT, _name, get_uint64_t());
+  } else if (is_size_t()) {
+    st->print("-XX:%s=" SIZE_FORMAT, _name, get_size_t());
   } else if (is_double()) {
     st->print("-XX:%s=%f", _name, get_double());
   } else if (is_ccstr()) {
@@ -723,6 +741,34 @@
   faddr->set_origin(origin);
 }
 
+bool CommandLineFlags::size_tAt(const char* name, size_t len, size_t* value) {
+  Flag* result = Flag::find_flag(name, len);
+  if (result == NULL) return false;
+  if (!result->is_size_t()) return false;
+  *value = result->get_size_t();
+  return true;
+}
+
+bool CommandLineFlags::size_tAtPut(const char* name, size_t len, size_t* value, Flag::Flags origin) {
+  Flag* result = Flag::find_flag(name, len);
+  if (result == NULL) return false;
+  if (!result->is_size_t()) return false;
+  size_t old_value = result->get_size_t();
+  trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
+  result->set_size_t(*value);
+  *value = old_value;
+  result->set_origin(origin);
+  return true;
+}
+
+void CommandLineFlagsEx::size_tAtPut(CommandLineFlagWithType flag, size_t value, Flag::Flags origin) {
+  Flag* faddr = address_of_flag(flag);
+  guarantee(faddr != NULL && faddr->is_size_t(), "wrong flag type");
+  trace_flag_changed<EventUnsignedLongFlagChanged, u8>(faddr->_name, faddr->get_size_t(), value, origin);
+  faddr->set_size_t(value);
+  faddr->set_origin(origin);
+}
+
 bool CommandLineFlags::doubleAt(const char* name, size_t len, double* value) {
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return false;
--- a/src/share/vm/runtime/globals.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/runtime/globals.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -275,6 +275,10 @@
   uint64_t get_uint64_t() const;
   void set_uint64_t(uint64_t value);
 
+  bool is_size_t() const;
+  size_t get_size_t() const;
+  void set_size_t(size_t value);
+
   bool is_double() const;
   double get_double() const;
   void set_double(double value);
@@ -350,7 +354,6 @@
   ~UIntFlagSetting()                         { *flag = val; }
 };
 
-
 class DoubleFlagSetting {
   double val;
   double* flag;
@@ -359,6 +362,14 @@
   ~DoubleFlagSetting()                           { *flag = val; }
 };
 
+class SizeTFlagSetting {
+  size_t val;
+  size_t* flag;
+ public:
+  SizeTFlagSetting(size_t& fl, size_t newValue) { flag = &fl; val = fl; fl = newValue; }
+  ~SizeTFlagSetting()                           { *flag = val; }
+};
+
 
 class CommandLineFlags {
  public:
@@ -377,6 +388,11 @@
   static bool uintxAtPut(const char* name, size_t len, uintx* value, Flag::Flags origin);
   static bool uintxAtPut(const char* name, uintx* value, Flag::Flags origin) { return uintxAtPut(name, strlen(name), value, origin); }
 
+  static bool size_tAt(const char* name, size_t len, size_t* value);
+  static bool size_tAt(const char* name, size_t* value)    { return size_tAt(name, strlen(name), value); }
+  static bool size_tAtPut(const char* name, size_t len, size_t* value, Flag::Flags origin);
+  static bool size_tAtPut(const char* name, size_t* value, Flag::Flags origin) { return size_tAtPut(name, strlen(name), value, origin); }
+
   static bool uint64_tAt(const char* name, size_t len, uint64_t* value);
   static bool uint64_tAt(const char* name, uint64_t* value) { return uint64_tAt(name, strlen(name), value); }
   static bool uint64_tAtPut(const char* name, size_t len, uint64_t* value, Flag::Flags origin);
@@ -3899,8 +3915,8 @@
   product(ccstr, ExtraSharedClassListFile, NULL,                            \
           "Extra classlist for building the CDS archive file")              \
                                                                             \
-  experimental(uintx, ArrayAllocatorMallocLimit,                            \
-          SOLARIS_ONLY(64*K) NOT_SOLARIS(max_uintx),                        \
+  experimental(size_t, ArrayAllocatorMallocLimit,                           \
+          SOLARIS_ONLY(64*K) NOT_SOLARIS((size_t)-1),                       \
           "Allocation less than this value will be allocated "              \
           "using malloc. Larger allocations will use mmap.")                \
                                                                             \
--- a/src/share/vm/runtime/globals_extension.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/runtime/globals_extension.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -200,6 +200,7 @@
   static void intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin);
   static void uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin);
   static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin);
+  static void size_tAtPut(CommandLineFlagWithType flag, size_t value, Flag::Flags origin);
   static void doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin);
   // Contract:  Flag will make private copy of the incoming value
   static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin);
--- a/src/share/vm/services/attachListener.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/attachListener.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -320,6 +320,25 @@
   return res? JNI_OK : JNI_ERR;
 }
 
+// set a size_t global flag using value from AttachOperation
+static jint set_size_t_flag(const char* name, AttachOperation* op, outputStream* out) {
+  size_t value;
+  const char* arg1;
+  if ((arg1 = op->arg(1)) != NULL) {
+    int n = sscanf(arg1, SIZE_FORMAT, &value);
+    if (n != 1) {
+      out->print_cr("flag value must be an unsigned integer");
+      return JNI_ERR;
+    }
+  }
+  bool res = CommandLineFlags::size_tAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND);
+  if (! res) {
+    out->print_cr("setting flag %s failed", name);
+  }
+
+  return res? JNI_OK : JNI_ERR;
+}
+
 // set a string global flag using value from AttachOperation
 static jint set_ccstr_flag(const char* name, AttachOperation* op, outputStream* out) {
   const char* value;
@@ -356,6 +375,8 @@
       return set_uintx_flag(name, op, out);
     } else if (f->is_uint64_t()) {
       return set_uint64_t_flag(name, op, out);
+    } else if (f->is_size_t()) {
+      return set_size_t_flag(name, op, out);
     } else if (f->is_ccstr()) {
       return set_ccstr_flag(name, op, out);
     } else {
--- a/src/share/vm/services/mallocSiteTable.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/mallocSiteTable.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -32,13 +32,14 @@
 #include "services/allocationSite.hpp"
 #include "services/mallocTracker.hpp"
 #include "services/nmtCommon.hpp"
+#include "utilities/nativeCallStack.hpp"
 
 // MallocSite represents a code path that eventually calls
 // os::malloc() to allocate memory
 class MallocSite : public AllocationSite<MemoryCounter> {
  public:
   MallocSite() :
-    AllocationSite<MemoryCounter>(emptyStack) { }
+    AllocationSite<MemoryCounter>(NativeCallStack::EMPTY_STACK) { }
 
   MallocSite(const NativeCallStack& stack) :
     AllocationSite<MemoryCounter>(stack) { }
--- a/src/share/vm/services/management.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/management.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -1696,6 +1696,9 @@
   } else if (flag->is_uint64_t()) {
     global->value.j = (jlong)flag->get_uint64_t();
     global->type = JMM_VMGLOBAL_TYPE_JLONG;
+  } else if (flag->is_size_t()) {
+    global->value.j = (jlong)flag->get_size_t();
+    global->type = JMM_VMGLOBAL_TYPE_JLONG;
   } else if (flag->is_ccstr()) {
     Handle str = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_false);
     global->value.l = (jobject)JNIHandles::make_local(env, str());
@@ -1851,6 +1854,9 @@
   } else if (flag->is_uint64_t()) {
     uint64_t uvalue = (uint64_t)new_value.j;
     succeed = CommandLineFlags::uint64_tAtPut(name, &uvalue, Flag::MANAGEMENT);
+  } else if (flag->is_size_t()) {
+    size_t svalue = (size_t)new_value.j;
+    succeed = CommandLineFlags::size_tAtPut(name, &svalue, Flag::MANAGEMENT);
   } else if (flag->is_ccstr()) {
     oop str = JNIHandles::resolve_external_guard(new_value.l);
     if (str == NULL) {
--- a/src/share/vm/services/memTracker.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/memTracker.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -39,8 +39,6 @@
 volatile NMT_TrackingLevel MemTracker::_tracking_level = NMT_unknown;
 NMT_TrackingLevel MemTracker::_cmdline_tracking_level = NMT_unknown;
 
-NativeCallStack emptyStack(0, false);
-
 MemBaseline MemTracker::_baseline;
 Mutex*      MemTracker::_query_lock = NULL;
 bool MemTracker::_is_nmt_env_valid = true;
@@ -69,6 +67,10 @@
     os::unsetenv(buf);
   }
 
+  // Construct NativeCallStack::EMPTY_STACK. It may get constructed twice,
+  // but it is benign, the results are the same.
+  ::new ((void*)&NativeCallStack::EMPTY_STACK) NativeCallStack(0, false);
+
   if (!MallocTracker::initialize(level) ||
       !VirtualMemoryTracker::initialize(level)) {
     level = NMT_off;
--- a/src/share/vm/services/memTracker.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/memTracker.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -26,14 +26,13 @@
 #define SHARE_VM_SERVICES_MEM_TRACKER_HPP
 
 #include "services/nmtCommon.hpp"
+#include "utilities/nativeCallStack.hpp"
 
-class NativeCallStack;
-extern NativeCallStack emptyStack;
 
 #if !INCLUDE_NMT
 
-#define CURRENT_PC   emptyStack
-#define CALLER_PC    emptyStack
+#define CURRENT_PC   NativeCallStack::EMPTY_STACK
+#define CALLER_PC    NativeCallStack::EMPTY_STACK
 
 class Tracker : public StackObj {
  public:
@@ -83,9 +82,9 @@
 extern volatile bool NMT_stack_walkable;
 
 #define CURRENT_PC ((MemTracker::tracking_level() == NMT_detail && NMT_stack_walkable) ? \
-                    NativeCallStack(0, true) : emptyStack)
+                    NativeCallStack(0, true) : NativeCallStack::EMPTY_STACK)
 #define CALLER_PC  ((MemTracker::tracking_level() == NMT_detail && NMT_stack_walkable) ?  \
-                    NativeCallStack(1, true) : emptyStack)
+                    NativeCallStack(1, true) : NativeCallStack::EMPTY_STACK)
 
 class MemBaseline;
 class Mutex;
--- a/src/share/vm/services/nmtCommon.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/nmtCommon.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -50,9 +50,6 @@
 // build time decision.
 const int NMT_TrackingStackDepth = 4;
 
-class NativeCallStack;
-extern NativeCallStack emptyStack;
-
 // A few common utilities for native memory tracking
 class NMTUtil : AllStatic {
  public:
--- a/src/share/vm/services/virtualMemoryTracker.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/virtualMemoryTracker.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -167,7 +167,7 @@
           // higher part
           address high_base = addr + sz;
           size_t  high_size = top - high_base;
-          CommittedMemoryRegion high_rgn(high_base, high_size, emptyStack);
+          CommittedMemoryRegion high_rgn(high_base, high_size, NativeCallStack::EMPTY_STACK);
           return add_committed_region(high_rgn);
         } else {
           return false;
--- a/src/share/vm/services/virtualMemoryTracker.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/services/virtualMemoryTracker.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -320,7 +320,7 @@
 
 
   ReservedMemoryRegion(address base, size_t size) :
-    VirtualMemoryRegion(base, size), _stack(emptyStack), _flag(mtNone),
+    VirtualMemoryRegion(base, size), _stack(NativeCallStack::EMPTY_STACK), _flag(mtNone),
     _all_committed(false) { }
 
   // Copy constructor
--- a/src/share/vm/utilities/bitMap.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/utilities/bitMap.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -567,7 +567,7 @@
   }
 
   static void testResizeNonResource() {
-    const uintx bitmap_bytes = BITMAP_SIZE / BitsPerByte;
+    const size_t bitmap_bytes = BITMAP_SIZE / BitsPerByte;
 
     // Test the default behavior
     testResize(false);
@@ -575,13 +575,13 @@
     {
       // Make sure that AllocatorMallocLimit is larger than our allocation request
       // forcing it to call standard malloc()
-      UIntFlagSetting fs(ArrayAllocatorMallocLimit, bitmap_bytes * 4);
+      SizeTFlagSetting fs(ArrayAllocatorMallocLimit, bitmap_bytes * 4);
       testResize(false);
     }
     {
       // Make sure that AllocatorMallocLimit is smaller than our allocation request
       // forcing it to call mmap() (or equivalent)
-      UIntFlagSetting fs(ArrayAllocatorMallocLimit, bitmap_bytes / 4);
+      SizeTFlagSetting fs(ArrayAllocatorMallocLimit, bitmap_bytes / 4);
       testResize(false);
     }
   }
--- a/src/share/vm/utilities/nativeCallStack.cpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/utilities/nativeCallStack.cpp	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/nativeCallStack.hpp"
 
+const NativeCallStack NativeCallStack::EMPTY_STACK(0, false);
 
 NativeCallStack::NativeCallStack(int toSkip, bool fillStack) :
   _hash_value(0) {
--- a/src/share/vm/utilities/nativeCallStack.hpp	Tue Aug 19 06:47:28 2014 -0700
+++ b/src/share/vm/utilities/nativeCallStack.hpp	Tue Aug 19 10:04:29 2014 -0400
@@ -52,6 +52,9 @@
  *    from it.
  */
 class NativeCallStack : public StackObj {
+ public:
+  static const NativeCallStack EMPTY_STACK;
+
  private:
   address   _stack[NMT_TrackingStackDepth];
   int       _hash_value;
--- a/test/compiler/8009761/Test8009761.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/8009761/Test8009761.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
  * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
  * @build Test8009761
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss256K Test8009761
  */
 public class Test8009761 {
--- a/test/compiler/8010927/Test8010927.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/8010927/Test8010927.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
  * @library /testlibrary/whitebox /testlibrary
  * @build Test8010927
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xmx64m -XX:NewSize=20971520 -XX:MaxNewSize=32m -XX:-UseTLAB -XX:-UseParNewGC -XX:-UseAdaptiveSizePolicy Test8010927
  */
 
--- a/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build TestUseBMI1InstructionsOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseBMI1InstructionsOnSupportedCPU
  */
--- a/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build TestUseBMI1InstructionsOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseBMI1InstructionsOnUnsupportedCPU
  */
--- a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build TestUseCountLeadingZerosInstructionOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestUseCountLeadingZerosInstructionOnSupportedCPU
--- a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build TestUseCountLeadingZerosInstructionOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestUseCountLeadingZerosInstructionOnUnsupportedCPU
--- a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build TestUseCountTrailingZerosInstructionOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestUseCountTrailingZerosInstructionOnSupportedCPU
--- a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestUseCountTrailingZerosInstructionOnUnsupportedCPU
--- a/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java	Tue Aug 19 10:04:29 2014 -0400
@@ -35,6 +35,7 @@
  * @build TestMethodUnloading
  * @build WorkerClass
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation -XX:-UseCompressedOops -XX:+UseParallelGC -XX:CompileOnly=TestMethodUnloading::doWork TestMethodUnloading
  */
 public class TestMethodUnloading {
--- a/test/compiler/intrinsics/bmi/TestAndnI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestAndnI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestAndnI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestAndnI
  */
--- a/test/compiler/intrinsics/bmi/TestAndnL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestAndnL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestAndnL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestAndnL
  */
--- a/test/compiler/intrinsics/bmi/TestBlsiI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestBlsiI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestBlsiI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestBlsiI
  */
--- a/test/compiler/intrinsics/bmi/TestBlsiL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestBlsiL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestBlsiL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestBlsiL
  */
--- a/test/compiler/intrinsics/bmi/TestBlsmskI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestBlsmskI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestBlsmskI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestBlsmskI
  */
--- a/test/compiler/intrinsics/bmi/TestBlsmskL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestBlsmskL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestBlsmskL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestBlsmskL
  */
--- a/test/compiler/intrinsics/bmi/TestBlsrI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestBlsrI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestBlsrI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestBlsrI
  */
--- a/test/compiler/intrinsics/bmi/TestBlsrL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestBlsrL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestBlsrL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestBlsrL
  */
--- a/test/compiler/intrinsics/bmi/TestLzcntI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestLzcntI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestLzcntI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestLzcntI
  */
--- a/test/compiler/intrinsics/bmi/TestLzcntL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestLzcntL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestLzcntL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestLzcntL
  */
--- a/test/compiler/intrinsics/bmi/TestTzcntI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestTzcntI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestTzcntI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestTzcntI
  */
--- a/test/compiler/intrinsics/bmi/TestTzcntL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/TestTzcntL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestTzcntL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestTzcntL
  */
--- a/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build AddnTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestI
  */
--- a/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build AddnTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestL
  */
--- a/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build BlsiTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestI
  */
--- a/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build BlsiTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestL
  */
--- a/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build BlsmskTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestI
  */
--- a/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build BlsmskTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestL
  */
--- a/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build BlsrTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestI
  */
--- a/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build BlsrTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestL
  */
--- a/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build LZcntTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestI
  */
--- a/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build LZcntTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL
  */
--- a/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build TZcntTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestI
  */
--- a/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
  * @build TZcntTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL
  */
--- a/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build AddExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build AddExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build DecrementExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build DecrementExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build IncrementExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build IncrementExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build MultiplyExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build MultiplyExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build NegateExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build NegateExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build SubtractExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build SubtractExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
--- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
--- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                 TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
--- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMAbortRatioOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnSupportedConfig
  */
--- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMAbortRatioOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnUnsupportedConfig
  */
--- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMTotalCountIncrRateOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestRTMTotalCountIncrRateOptionOnSupportedConfig
--- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -35,6 +35,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
--- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMDeoptOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnSupportedConfig
  */
--- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMDeoptOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnUnsupportedConfig
  */
--- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMForStackLocksOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   TestUseRTMForStackLocksOptionOnSupportedConfig
--- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMForStackLocksOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                    TestUseRTMForStackLocksOptionOnUnsupportedConfig
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMLockingOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnSupportedConfig
  */
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMLockingOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedCPU
  */
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMLockingOptionOnUnsupportedVM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedVM
  */
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMLockingOptionWithBiasedLocking
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionWithBiasedLocking
  */
--- a/test/compiler/rtm/locking/TestRTMAbortRatio.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMAbortRatio.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMAbortRatio
  */
--- a/test/compiler/rtm/locking/TestRTMAbortThreshold.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMAbortThreshold.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMAbortThreshold
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMAbortThreshold
  */
--- a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Tue Aug 19 10:04:29 2014 -0400
@@ -32,6 +32,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMAfterNonRTMDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMAfterNonRTMDeopt
  */
--- a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMDeoptOnHighAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMDeoptOnHighAbortRatio
  */
--- a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMDeoptOnLowAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMDeoptOnLowAbortRatio
  */
--- a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMLockingCalculationDelay
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMLockingCalculationDelay
  */
--- a/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMLockingThreshold
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMLockingThreshold
  */
--- a/test/compiler/rtm/locking/TestRTMRetryCount.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMRetryCount.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMRetryCount
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMRetryCount
  */
--- a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMSpinLoopCount
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMSpinLoopCount
  */
--- a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestRTMTotalCountIncrRate
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestRTMTotalCountIncrRate
  */
--- a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMAfterLockInflation
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMAfterLockInflation
  */
--- a/test/compiler/rtm/locking/TestUseRTMDeopt.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestUseRTMDeopt.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMDeopt
  */
--- a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMForInflatedLocks
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMForInflatedLocks
  */
--- a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMForStackLocks
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMForStackLocks
  */
--- a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMXendForLockBusy
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMXendForLockBusy
  */
--- a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestNoRTMLockElidingOption
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestNoRTMLockElidingOption
  */
--- a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java	Tue Aug 19 10:04:29 2014 -0400
@@ -31,6 +31,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestUseRTMLockElidingOption
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestUseRTMLockElidingOption
  */
--- a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java	Tue Aug 19 10:04:29 2014 -0400
@@ -32,6 +32,7 @@
  * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
  * @build TestPrintPreciseRTMLockingStatistics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI TestPrintPreciseRTMLockingStatistics
  */
--- a/test/compiler/tiered/NonTieredLevelsTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/tiered/NonTieredLevelsTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @ignore 8046268
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:CompileCommand=compileonly,SimpleTestCase$Helper::*
--- a/test/compiler/tiered/TieredLevelsTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/tiered/TieredLevelsTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @ignore 8046268
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:CompileCommand=compileonly,SimpleTestCase$Helper::*
--- a/test/compiler/types/correctness/CorrectnessTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/types/correctness/CorrectnessTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  *          execution/MethodHandleDelegate.java
  * @build CorrectnessTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
--- a/test/compiler/types/correctness/OffTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/types/correctness/OffTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @build CorrectnessTest
  * @build OffTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/timeout=1200 OffTest
  */
 
--- a/test/compiler/whitebox/ClearMethodStateTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/ClearMethodStateTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -30,6 +30,7 @@
  * @ignore 8046268
  * @build ClearMethodStateTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* ClearMethodStateTest
  * @summary testing of WB::clearMethodState()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/DeoptimizeAllTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/DeoptimizeAllTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @ignore 8046268
  * @build DeoptimizeAllTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeAllTest
  * @summary testing of WB::deoptimizeAll()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/DeoptimizeMethodTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/DeoptimizeMethodTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @ignore 8046268
  * @build DeoptimizeMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeMethodTest
  * @summary testing of WB::deoptimizeMethod()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @ignore 8046268
  * @build EnqueueMethodForCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* EnqueueMethodForCompilationTest
  * @summary testing of WB::enqueueMethodForCompilation()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/GetNMethodTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/GetNMethodTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -31,6 +31,7 @@
  * @ignore 8046268
  * @build GetNMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* GetNMethodTest
  * @summary testing of WB::getNMethod()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/IsMethodCompilableTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/IsMethodCompilableTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /testlibrary/com/oracle/java/testlibrary
  * @build IsMethodCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
  * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:PerMethodRecompilationCutoff=3 -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* IsMethodCompilableTest
  * @summary testing of WB::isMethodCompilable()
--- a/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @ignore 8046268
  * @build MakeMethodNotCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest
  * @summary testing of WB::makeMethodNotCompilable()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/SetDontInlineMethodTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/SetDontInlineMethodTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build SetDontInlineMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* SetDontInlineMethodTest
  * @summary testing of WB::testSetDontInlineMethod()
  * @author igor.ignatyev@oracle.com
--- a/test/compiler/whitebox/SetForceInlineMethodTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/compiler/whitebox/SetForceInlineMethodTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build SetForceInlineMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* SetForceInlineMethodTest
  * @summary testing of WB::testSetForceInlineMethod()
  * @author igor.ignatyev@oracle.com
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/gc/arguments/TestArrayAllocatorMallocLimit.java	Tue Aug 19 10:04:29 2014 -0400
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestArrayAllocatorMallocLimit
+ * @summary Sanity check that the ArrayAllocatorMallocLimit flag can be set.
+ * The test helps verifying that size_t flags can be set/read.
+ * @bug 8054823
+ * @key gc
+ * @library /testlibrary
+ * @run driver TestArrayAllocatorMallocLimit
+ */
+
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+import java.math.BigInteger;
+
+public class TestArrayAllocatorMallocLimit {
+  public static void main(String [] args) throws Exception {
+    testDefaultValue();
+    testSetValue();
+  }
+
+  private static final String flagName = "ArrayAllocatorMallocLimit";
+
+  //     size_t ArrayAllocatorMallocLimit                 = 18446744073709551615{experimental}
+  private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *";
+
+  public static void testDefaultValue()  throws Exception {
+    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+      "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version");
+
+    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+    String value = output.firstMatch(printFlagsFinalPattern, 1);
+
+    try {
+      Asserts.assertNotNull(value, "Couldn't find size_t flag " + flagName);
+
+      // A size_t is not always parseable with Long.parseValue,
+      // use BigInteger instead.
+      BigInteger biValue = new BigInteger(value);
+
+      // Sanity check that we got a non-zero value.
+      Asserts.assertNotEquals(biValue, "0");
+
+      output.shouldHaveExitValue(0);
+    } catch (Exception e) {
+      System.err.println(output.getOutput());
+      throw e;
+    }
+  }
+
+  public static void testSetValue() throws Exception {
+    long flagValue = 2048;
+
+    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+      "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "-XX:+PrintFlagsFinal", "-version");
+
+    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+    String value = output.firstMatch(printFlagsFinalPattern, 1);
+
+    try {
+      Asserts.assertNotNull("Couldn't find size_t flag " + flagName);
+
+      long longValue = Long.parseLong(value);
+
+      Asserts.assertEquals(longValue, flagValue);
+
+      output.shouldHaveExitValue(0);
+    } catch (Exception e) {
+      System.err.println(output.getOutput());
+      throw e;
+    }
+  }
+
+}
--- a/test/gc/arguments/TestCMSHeapSizeFlags.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/arguments/TestCMSHeapSizeFlags.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestCMSHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestCMSHeapSizeFlags
  * @author thomas.schatzl@oracle.com
  */
--- a/test/gc/arguments/TestG1HeapSizeFlags.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/arguments/TestG1HeapSizeFlags.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestG1HeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestG1HeapSizeFlags
  * @author thomas.schatzl@oracle.com
  */
--- a/test/gc/arguments/TestMinInitialErgonomics.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/arguments/TestMinInitialErgonomics.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestMinInitialErgonomics TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestMinInitialErgonomics
  * @author thomas.schatzl@oracle.com
  */
--- a/test/gc/arguments/TestParallelHeapSizeFlags.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/arguments/TestParallelHeapSizeFlags.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestParallelHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestParallelHeapSizeFlags
  * @author thomas.schatzl@oracle.com
  */
--- a/test/gc/arguments/TestSerialHeapSizeFlags.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/arguments/TestSerialHeapSizeFlags.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestSerialHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestSerialHeapSizeFlags
  * @author thomas.schatzl@oracle.com
  */
--- a/test/gc/arguments/TestUseCompressedOopsErgo.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/arguments/TestUseCompressedOopsErgo.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestUseCompressedOopsErgo TestUseCompressedOopsErgoTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseG1GC
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseParallelGC
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseParallelGC -XX:-UseParallelOldGC
--- a/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestCMSClassUnloadingEnabledHWM AllocateBeyondMetaspaceSize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver TestCMSClassUnloadingEnabledHWM
  * @summary Test that -XX:-CMSClassUnloadingEnabled will trigger a Full GC when more than MetaspaceSize metadata is allocated.
  */
--- a/test/gc/class_unloading/TestG1ClassUnloadingHWM.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/class_unloading/TestG1ClassUnloadingHWM.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestG1ClassUnloadingHWM AllocateBeyondMetaspaceSize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver TestG1ClassUnloadingHWM
  * @summary Test that -XX:-ClassUnloadingWithConcurrentMark will trigger a Full GC when more than MetaspaceSize metadata is allocated.
  */
--- a/test/gc/g1/TestDeferredRSUpdate.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/g1/TestDeferredRSUpdate.java	Tue Aug 19 10:04:29 2014 -0400
@@ -23,7 +23,7 @@
 
 /*
  * @test TestDeferredRSUpdate
- * @bug 8040977
+ * @bug 8040977 8052170
  * @summary Ensure that running with -XX:-G1DeferredRSUpdate does not crash the VM
  * @key gc
  * @library /testlibrary
@@ -38,6 +38,7 @@
 
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
                                                               "-Xmx10M",
+                                                              "-XX:+PrintGCDetails",
                                                               // G1DeferredRSUpdate is a develop option, but we cannot limit execution of this test to only debug VMs.
                                                               "-XX:+IgnoreUnrecognizedVMOptions",
                                                               "-XX:-G1DeferredRSUpdate",
--- a/test/gc/g1/TestHumongousCodeCacheRoots.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/gc/g1/TestHumongousCodeCacheRoots.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build TestHumongousCodeCacheRoots
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @summary Humongous objects may have references from the code cache
  * @run main TestHumongousCodeCacheRoots
 */
--- a/test/runtime/ClassUnload/KeepAliveClass.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/ClassUnload/KeepAliveClass.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @build KeepAliveClass test.Empty
  * @build ClassUnloadCommon
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveClass
  */
 
--- a/test/runtime/ClassUnload/KeepAliveClassLoader.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/ClassUnload/KeepAliveClassLoader.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @build KeepAliveClassLoader test.Empty
  * @build ClassUnloadCommon
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveClassLoader
  */
 
--- a/test/runtime/ClassUnload/KeepAliveObject.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/ClassUnload/KeepAliveObject.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @build KeepAliveObject test.Empty
  * @build ClassUnloadCommon
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveObject
  */
 
--- a/test/runtime/ClassUnload/KeepAliveSoftReference.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/ClassUnload/KeepAliveSoftReference.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @build KeepAliveSoftReference test.Empty
  * @build ClassUnloadCommon
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveSoftReference
  */
 
--- a/test/runtime/ClassUnload/UnloadTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/ClassUnload/UnloadTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
  * @build ClassUnloadCommon test.Empty
  * @build UnloadTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI UnloadTest
  */
 import sun.hotspot.WhiteBox;
--- a/test/runtime/NMT/MallocTestType.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/MallocTestType.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build MallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType
  */
 
--- a/test/runtime/NMT/PrintNMTStatistics.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/PrintNMTStatistics.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build PrintNMTStatistics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main PrintNMTStatistics
  */
 
--- a/test/runtime/NMT/ReleaseCommittedMemory.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/ReleaseCommittedMemory.java	Tue Aug 19 10:04:29 2014 -0400
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build ReleaseCommittedMemory
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ReleaseCommittedMemory
  */
 
--- a/test/runtime/NMT/SummarySanityCheck.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/SummarySanityCheck.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build SummarySanityCheck
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
  */
 
--- a/test/runtime/NMT/ThreadedMallocTestType.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/ThreadedMallocTestType.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build ThreadedMallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType
  */
 
--- a/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build ThreadedVirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType
  */
 
--- a/test/runtime/NMT/VirtualAllocTestType.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/NMT/VirtualAllocTestType.java	Tue Aug 19 10:04:29 2014 -0400
@@ -28,6 +28,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build VirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType
  */
 
--- a/test/runtime/interned/SanityTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/interned/SanityTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build SanityTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SanityTest
  */
 
--- a/test/runtime/memory/ReadFromNoaccessArea.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/memory/ReadFromNoaccessArea.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build ReadFromNoaccessArea
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ReadFromNoaccessArea
  */
 
--- a/test/runtime/memory/ReserveMemory.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/memory/ReserveMemory.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build ReserveMemory
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ReserveMemory
  */
 
--- a/test/runtime/memory/RunUnitTestsConcurrently.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/memory/RunUnitTestsConcurrently.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build RunUnitTestsConcurrently
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI RunUnitTestsConcurrently 30 15000
  */
 
--- a/test/runtime/memory/StressVirtualSpaceResize.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/memory/StressVirtualSpaceResize.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build StressVirtualSpaceResize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI StressVirtualSpaceResize
  */
 
--- a/test/runtime/whitebox/WBStackSize.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/runtime/whitebox/WBStackSize.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build WBStackSize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xss512k WBStackSize
  */
 
--- a/test/sanity/WBApi.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/sanity/WBApi.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build WBApi
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI WBApi
  */
 
--- a/test/sanity/WhiteBox.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/sanity/WhiteBox.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @library /testlibrary
  * @compile WhiteBox.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI sun.hotspot.WhiteBox
  * @clean sun.hotspot.WhiteBox
  */
--- a/test/serviceability/ParserTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/serviceability/ParserTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.parser.*
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ParserTest
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/serviceability/attach/AttachSetGetFlag.java	Tue Aug 19 10:04:29 2014 -0400
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8054823
+ * @summary Tests the setFlag and printFlag attach command
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.* AttachSetGetFlag
+ * @run driver AttachSetGetFlag
+ */
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import sun.tools.attach.HotSpotVirtualMachine;
+
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.Platform;
+import com.oracle.java.testlibrary.ProcessTools;
+import com.sun.tools.attach.VirtualMachine;
+
+public class AttachSetGetFlag {
+
+  public static void main(String... args) throws Exception {
+    // Test a manageable uintx flag.
+    testGetFlag("MaxHeapFreeRatio", "60");
+    testSetFlag("MaxHeapFreeRatio", "50", "60");
+
+    // Test a non-manageable size_t flag.
+    // Since it is not manageable, we can't test the setFlag functionality.
+    testGetFlag("ArrayAllocatorMallocLimit", "128");
+    // testSetFlag("ArrayAllocatorMallocLimit", "64", "128");
+  }
+
+  public static ProcessBuilder runTarget(String flagName, String flagValue) throws Exception {
+    return ProcessTools.createJavaProcessBuilder(
+        "-XX:+UnlockExperimentalVMOptions",
+        "-XX:" + flagName + "=" + flagValue,
+        "AttachSetGetFlag$Target");
+  }
+
+  public static void testGetFlag(String flagName, String flagValue) throws Exception {
+    ProcessBuilder pb = runTarget(flagName, flagValue);
+
+    Process target = pb.start();
+
+    try {
+      waitForReady(target);
+
+      int pid = (int)target.getPid();
+
+      HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
+
+      // Test Get
+      BufferedReader remoteDataReader = new BufferedReader(new InputStreamReader(
+          vm.printFlag(flagName)));
+
+      boolean foundExpectedLine = false;
+
+      String line = null;
+      while((line = remoteDataReader.readLine()) != null) {
+        System.out.println("printFlag: " + line);
+        if (line.equals("-XX:" + flagName + "=" + flagValue)) {
+          foundExpectedLine = true;
+        }
+      }
+
+      Asserts.assertTrue(foundExpectedLine, "Didn't get the expected output: '-XX:" + flagName + "=" + flagValue + "'");
+
+      vm.detach();
+    }
+    finally {
+      target.destroy();
+      target.waitFor();
+    }
+  }
+
+  public static void testSetFlag(String flagName, String initialFlagValue, String flagValue) throws Exception {
+    ProcessBuilder pb = runTarget(flagName, initialFlagValue);
+
+    Process target = pb.start();
+
+    try {
+      waitForReady(target);
+
+      int pid = (int)target.getPid();
+
+      HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
+
+      // First set the value.
+      BufferedReader remoteDataReader = new BufferedReader(new InputStreamReader(
+          vm.setFlag(flagName, flagValue)));
+
+      String line;
+      while((line = remoteDataReader.readLine()) != null) {
+        System.out.println("setFlag: " + line);
+        // Just empty the stream.
+      }
+      remoteDataReader.close();
+
+      // Then read and make sure we get back the set value.
+      remoteDataReader = new BufferedReader(new InputStreamReader(vm.printFlag(flagName)));
+
+      boolean foundExpectedLine = false;
+      line = null;
+      while((line = remoteDataReader.readLine()) != null) {
+        System.out.println("getFlag: " + line);
+        if (line.equals("-XX:" + flagName + "=" + flagValue)) {
+          foundExpectedLine = true;
+        }
+      }
+
+      Asserts.assertTrue(foundExpectedLine, "Didn't get the expected output: '-XX:" + flagName + "=" + flagValue + "'");
+
+      vm.detach();
+
+    } finally {
+      target.destroy();
+      target.waitFor();
+    }
+  }
+
+  private static void waitForReady(Process target) throws Exception {
+    InputStream os = target.getInputStream();
+    try (BufferedReader reader = new BufferedReader(new InputStreamReader(os))) {
+      String line;
+      while ((line = reader.readLine()) != null) {
+        if ("Ready".equals(line)) {
+          return;
+        }
+      }
+    }
+  }
+
+
+  public static class Target {
+    public static void main(String [] args) throws Exception {
+      System.out.println("Ready");
+      System.out.flush();
+      while (true) {
+        Thread.sleep(1000);
+      }
+    }
+  }
+}
--- a/test/testlibrary/ctw/test/ClassesDirTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary/ctw/test/ClassesDirTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassesDirTest prepare
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes
  * @run main ClassesDirTest check ctw.log
--- a/test/testlibrary/ctw/test/ClassesListTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary/ctw/test/ClassesListTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassesListTest prepare
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes.lst
  * @run main ClassesListTest check ctw.log
--- a/test/testlibrary/ctw/test/JarDirTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary/ctw/test/JarDirTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main JarDirTest prepare
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld jars/*
  * @run main JarDirTest check ctw.log
--- a/test/testlibrary/ctw/test/JarsTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary/ctw/test/JarsTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main JarsTest prepare
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld foo.jar bar.jar
  * @run main JarsTest check ctw.log
--- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Tue Aug 19 10:04:29 2014 -0400
@@ -168,17 +168,20 @@
   public native void    setIntxVMFlag(String name, long value);
   public native void    setUintxVMFlag(String name, long value);
   public native void    setUint64VMFlag(String name, long value);
+  public native void    setSizeTVMFlag(String name, long value);
   public native void    setStringVMFlag(String name, String value);
   public native void    setDoubleVMFlag(String name, double value);
   public native Boolean getBooleanVMFlag(String name);
   public native Long    getIntxVMFlag(String name);
   public native Long    getUintxVMFlag(String name);
   public native Long    getUint64VMFlag(String name);
+  public native Long    getSizeTVMFlag(String name);
   public native String  getStringVMFlag(String name);
   public native Double  getDoubleVMFlag(String name);
   private final List<Function<String,Object>> flagsGetters = Arrays.asList(
     this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag,
-    this::getUint64VMFlag, this::getStringVMFlag, this::getDoubleVMFlag);
+    this::getUint64VMFlag, this::getSizeTVMFlag, this::getStringVMFlag,
+    this::getDoubleVMFlag);
 
   public Object getVMFlag(String name) {
     return flagsGetters.stream()
--- a/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI BooleanTest
  * @summary testing of WB::set/getBooleanVMFlag()
  * @author igor.ignatyev@oracle.com
--- a/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build DoubleTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DoubleTest
  * @summary testing of WB::set/getDoubleVMFlag()
  * @author igor.ignatyev@oracle.com
--- a/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build IntxTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI IntxTest
  * @summary testing of WB::set/getIntxVMFlag()
  * @author igor.ignatyev@oracle.com
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test SizeTTest
+ * @bug 8054823
+ * @library /testlibrary /testlibrary/whitebox
+ * @build SizeTTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions SizeTTest
+ * @summary testing of WB::set/getSizeTVMFlag()
+ */
+import com.oracle.java.testlibrary.Platform;
+
+public class SizeTTest {
+    private static final String FLAG_NAME = "ArrayAllocatorMallocLimit";
+    private static final Long[] TESTS = {0L, 100L, (long) Integer.MAX_VALUE,
+        (1L << 32L) - 1L, 1L << 32L};
+    private static final Long[] EXPECTED_64 = TESTS;
+    private static final Long[] EXPECTED_32 = {0L, 100L,
+        (long) Integer.MAX_VALUE, (1L << 32L) - 1L, 0L};
+
+    public static void main(String[] args) throws Exception {
+        VmFlagTest.runTest(FLAG_NAME, TESTS,
+            Platform.is64bit() ? EXPECTED_64 : EXPECTED_32,
+            VmFlagTest.WHITE_BOX::setSizeTVMFlag,
+            VmFlagTest.WHITE_BOX::getSizeTVMFlag);
+    }
+}
--- a/test/testlibrary_tests/whitebox/vm_flags/StringTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary_tests/whitebox/vm_flags/StringTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build StringTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI StringTest
  * @summary testing of WB::set/getStringVMFlag()
  * @author igor.ignatyev@oracle.com
--- a/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build Uint64Test
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI Uint64Test
  * @summary testing of WB::set/getUint64VMFlag()
  * @author igor.ignatyev@oracle.com
--- a/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java	Tue Aug 19 06:47:28 2014 -0700
+++ b/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java	Tue Aug 19 10:04:29 2014 -0400
@@ -27,6 +27,7 @@
  * @library /testlibrary /testlibrary/whitebox
  * @build UintxTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI UintxTest
  * @summary testing of WB::set/getUintxVMFlag()
  * @author igor.ignatyev@oracle.com