Merge

Thu, 11 Apr 2013 16:35:34 +0200

author
mgerdin
date
Thu, 11 Apr 2013 16:35:34 +0200
changeset 4905
480d934f62a8
parent 4904
7b835924c31c
parent 4898
e437668ced9d
child 4913
7a5aec879506

Merge

src/share/vm/runtime/arguments.cpp file | annotate | diff | comparison | revisions
test/runtime/NMT/AllocTestType.java file | annotate | diff | comparison | revisions
     1.1 --- a/.hgtags	Wed Apr 10 14:26:49 2013 +0200
     1.2 +++ b/.hgtags	Thu Apr 11 16:35:34 2013 +0200
     1.3 @@ -330,3 +330,4 @@
     1.4  8d0f263a370c5f3e61791bb06054560804117288 hs25-b25
     1.5  af788b85010ebabbc1e8f52c6766e08c7a95cf99 jdk8-b84
     1.6  a947f40fb536e5b9e0aa210cf26abb430f80887a hs25-b26
     1.7 +09b0d3e9ba6cdf7da07d4010d2d1df14596f6864 hs25-b27
     2.1 --- a/make/hotspot_version	Wed Apr 10 14:26:49 2013 +0200
     2.2 +++ b/make/hotspot_version	Thu Apr 11 16:35:34 2013 +0200
     2.3 @@ -35,7 +35,7 @@
     2.4  
     2.5  HS_MAJOR_VER=25
     2.6  HS_MINOR_VER=0
     2.7 -HS_BUILD_NUMBER=27
     2.8 +HS_BUILD_NUMBER=28
     2.9  
    2.10  JDK_MAJOR_VER=1
    2.11  JDK_MINOR_VER=8
     3.1 --- a/make/linux/makefiles/gcc.make	Wed Apr 10 14:26:49 2013 +0200
     3.2 +++ b/make/linux/makefiles/gcc.make	Thu Apr 11 16:35:34 2013 +0200
     3.3 @@ -126,14 +126,12 @@
     3.4  # Compiler warnings are treated as errors
     3.5  WARNINGS_ARE_ERRORS = -Werror
     3.6  
     3.7 -# Except for a few acceptable ones
     3.8 +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function
     3.9 +
    3.10  # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
    3.11 -# conversions which might affect the values. To avoid that, we need to turn
    3.12 -# it off explicitly. 
    3.13 -ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
    3.14 -WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
    3.15 -else
    3.16 -WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
    3.17 +# conversions which might affect the values. Only enable it in earlier versions.
    3.18 +ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
    3.19 +WARNING_FLAGS += -Wconversion
    3.20  endif
    3.21  
    3.22  CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
     4.1 --- a/src/cpu/x86/vm/assembler_x86.cpp	Wed Apr 10 14:26:49 2013 +0200
     4.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp	Thu Apr 11 16:35:34 2013 +0200
     4.3 @@ -214,14 +214,6 @@
     4.4    return enc;
     4.5  }
     4.6  
     4.7 -static int encode(XMMRegister r) {
     4.8 -  int enc = r->encoding();
     4.9 -  if (enc >= 8) {
    4.10 -    enc -= 8;
    4.11 -  }
    4.12 -  return enc;
    4.13 -}
    4.14 -
    4.15  void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
    4.16    assert(dst->has_byte_register(), "must have byte register");
    4.17    assert(isByte(op1) && isByte(op2), "wrong opcode");
     5.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Apr 10 14:26:49 2013 +0200
     5.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Thu Apr 11 16:35:34 2013 +0200
     5.3 @@ -41,11 +41,6 @@
     5.4  
     5.5  #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
     5.6  
     5.7 -// Workaround for C++ overloading nastiness on '0' for RegisterOrConstant.
     5.8 -static RegisterOrConstant constant(int value) {
     5.9 -  return RegisterOrConstant(value);
    5.10 -}
    5.11 -
    5.12  void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg) {
    5.13    if (VerifyMethodHandles)
    5.14      verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class),
     6.1 --- a/src/cpu/x86/vm/x86_64.ad	Wed Apr 10 14:26:49 2013 +0200
     6.2 +++ b/src/cpu/x86/vm/x86_64.ad	Thu Apr 11 16:35:34 2013 +0200
     6.3 @@ -1693,17 +1693,6 @@
     6.4    return PTR_RBP_REG_mask();
     6.5  }
     6.6  
     6.7 -static Address build_address(int b, int i, int s, int d) {
     6.8 -  Register index = as_Register(i);
     6.9 -  Address::ScaleFactor scale = (Address::ScaleFactor)s;
    6.10 -  if (index == rsp) {
    6.11 -    index = noreg;
    6.12 -    scale = Address::no_scale;
    6.13 -  }
    6.14 -  Address addr(as_Register(b), index, scale, d);
    6.15 -  return addr;
    6.16 -}
    6.17 -
    6.18  %}
    6.19  
    6.20  //----------ENCODING BLOCK-----------------------------------------------------
     7.1 --- a/src/os/bsd/vm/os_bsd.cpp	Wed Apr 10 14:26:49 2013 +0200
     7.2 +++ b/src/os/bsd/vm/os_bsd.cpp	Thu Apr 11 16:35:34 2013 +0200
     7.3 @@ -152,7 +152,6 @@
     7.4  // utility functions
     7.5  
     7.6  static int SR_initialize();
     7.7 -static int SR_finalize();
     7.8  
     7.9  julong os::available_memory() {
    7.10    return Bsd::available_memory();
    7.11 @@ -1200,6 +1199,9 @@
    7.12    } else if (strchr(pname, *os::path_separator()) != NULL) {
    7.13      int n;
    7.14      char** pelements = split_path(pname, &n);
    7.15 +    if (pelements == NULL) {
    7.16 +      return false;
    7.17 +    }
    7.18      for (int i = 0 ; i < n ; i++) {
    7.19        // Really shouldn't be NULL, but check can't hurt
    7.20        if (pelements[i] == NULL || strlen(pelements[i]) == 0) {
    7.21 @@ -2766,10 +2768,6 @@
    7.22    return 0;
    7.23  }
    7.24  
    7.25 -static int SR_finalize() {
    7.26 -  return 0;
    7.27 -}
    7.28 -
    7.29  
    7.30  // returns true on success and false on error - really an error is fatal
    7.31  // but this seems the normal response to library errors
    7.32 @@ -3578,16 +3576,6 @@
    7.33  ////////////////////////////////////////////////////////////////////////////////
    7.34  // debug support
    7.35  
    7.36 -static address same_page(address x, address y) {
    7.37 -  int page_bits = -os::vm_page_size();
    7.38 -  if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
    7.39 -    return x;
    7.40 -  else if (x > y)
    7.41 -    return (address)(intptr_t(y) | ~page_bits) + 1;
    7.42 -  else
    7.43 -    return (address)(intptr_t(y) & page_bits);
    7.44 -}
    7.45 -
    7.46  bool os::find(address addr, outputStream* st) {
    7.47    Dl_info dlinfo;
    7.48    memset(&dlinfo, 0, sizeof(dlinfo));
    7.49 @@ -3611,8 +3599,8 @@
    7.50  
    7.51      if (Verbose) {
    7.52        // decode some bytes around the PC
    7.53 -      address begin = same_page(addr-40, addr);
    7.54 -      address end   = same_page(addr+40, addr);
    7.55 +      address begin = clamp_address_in_page(addr-40, addr, os::vm_page_size());
    7.56 +      address end   = clamp_address_in_page(addr+40, addr, os::vm_page_size());
    7.57        address       lowest = (address) dlinfo.dli_sname;
    7.58        if (!lowest)  lowest = (address) dlinfo.dli_fbase;
    7.59        if (begin < lowest)  begin = lowest;
     8.1 --- a/src/os/bsd/vm/perfMemory_bsd.cpp	Wed Apr 10 14:26:49 2013 +0200
     8.2 +++ b/src/os/bsd/vm/perfMemory_bsd.cpp	Thu Apr 11 16:35:34 2013 +0200
     8.3 @@ -672,15 +672,15 @@
     8.4    RESTARTABLE(::open(filename, oflags), result);
     8.5    if (result == OS_ERR) {
     8.6      if (errno == ENOENT) {
     8.7 -      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
     8.8 -                  "Process not found");
     8.9 +      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
    8.10 +                  "Process not found", OS_ERR);
    8.11      }
    8.12      else if (errno == EACCES) {
    8.13 -      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
    8.14 -                  "Permission denied");
    8.15 +      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
    8.16 +                  "Permission denied", OS_ERR);
    8.17      }
    8.18      else {
    8.19 -      THROW_MSG_0(vmSymbols::java_io_IOException(), strerror(errno));
    8.20 +      THROW_MSG_(vmSymbols::java_io_IOException(), strerror(errno), OS_ERR);
    8.21      }
    8.22    }
    8.23  
    8.24 @@ -828,7 +828,7 @@
    8.25    char* mapAddress;
    8.26    int result;
    8.27    int fd;
    8.28 -  size_t size;
    8.29 +  size_t size = 0;
    8.30    const char* luser = NULL;
    8.31  
    8.32    int mmap_prot;
    8.33 @@ -899,9 +899,12 @@
    8.34  
    8.35    if (*sizep == 0) {
    8.36      size = sharedmem_filesize(fd, CHECK);
    8.37 -    assert(size != 0, "unexpected size");
    8.38 +  } else {
    8.39 +    size = *sizep;
    8.40    }
    8.41  
    8.42 +  assert(size > 0, "unexpected size <= 0");
    8.43 +
    8.44    mapAddress = (char*)::mmap((char*)0, size, mmap_prot, MAP_SHARED, fd, 0);
    8.45  
    8.46    // attempt to close the file - restart if it gets interrupted,
     9.1 --- a/src/os/linux/vm/os_linux.cpp	Wed Apr 10 14:26:49 2013 +0200
     9.2 +++ b/src/os/linux/vm/os_linux.cpp	Thu Apr 11 16:35:34 2013 +0200
     9.3 @@ -176,7 +176,6 @@
     9.4  // utility functions
     9.5  
     9.6  static int SR_initialize();
     9.7 -static int SR_finalize();
     9.8  
     9.9  julong os::available_memory() {
    9.10    return Linux::available_memory();
    9.11 @@ -1633,6 +1632,9 @@
    9.12    } else if (strchr(pname, *os::path_separator()) != NULL) {
    9.13      int n;
    9.14      char** pelements = split_path(pname, &n);
    9.15 +    if (pelements == NULL) {
    9.16 +      return false;
    9.17 +    }
    9.18      for (int i = 0 ; i < n ; i++) {
    9.19        // Really shouldn't be NULL, but check can't hurt
    9.20        if (pelements[i] == NULL || strlen(pelements[i]) == 0) {
    9.21 @@ -3655,10 +3657,6 @@
    9.22    return 0;
    9.23  }
    9.24  
    9.25 -static int SR_finalize() {
    9.26 -  return 0;
    9.27 -}
    9.28 -
    9.29  
    9.30  // returns true on success and false on error - really an error is fatal
    9.31  // but this seems the normal response to library errors
    9.32 @@ -4500,16 +4498,6 @@
    9.33  ////////////////////////////////////////////////////////////////////////////////
    9.34  // debug support
    9.35  
    9.36 -static address same_page(address x, address y) {
    9.37 -  int page_bits = -os::vm_page_size();
    9.38 -  if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
    9.39 -    return x;
    9.40 -  else if (x > y)
    9.41 -    return (address)(intptr_t(y) | ~page_bits) + 1;
    9.42 -  else
    9.43 -    return (address)(intptr_t(y) & page_bits);
    9.44 -}
    9.45 -
    9.46  bool os::find(address addr, outputStream* st) {
    9.47    Dl_info dlinfo;
    9.48    memset(&dlinfo, 0, sizeof(dlinfo));
    9.49 @@ -4533,8 +4521,8 @@
    9.50  
    9.51      if (Verbose) {
    9.52        // decode some bytes around the PC
    9.53 -      address begin = same_page(addr-40, addr);
    9.54 -      address end   = same_page(addr+40, addr);
    9.55 +      address begin = clamp_address_in_page(addr-40, addr, os::vm_page_size());
    9.56 +      address end   = clamp_address_in_page(addr+40, addr, os::vm_page_size());
    9.57        address       lowest = (address) dlinfo.dli_sname;
    9.58        if (!lowest)  lowest = (address) dlinfo.dli_fbase;
    9.59        if (begin < lowest)  begin = lowest;
    10.1 --- a/src/os/linux/vm/perfMemory_linux.cpp	Wed Apr 10 14:26:49 2013 +0200
    10.2 +++ b/src/os/linux/vm/perfMemory_linux.cpp	Thu Apr 11 16:35:34 2013 +0200
    10.3 @@ -672,15 +672,15 @@
    10.4    RESTARTABLE(::open(filename, oflags), result);
    10.5    if (result == OS_ERR) {
    10.6      if (errno == ENOENT) {
    10.7 -      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
    10.8 -                  "Process not found");
    10.9 +      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
   10.10 +                  "Process not found", OS_ERR);
   10.11      }
   10.12      else if (errno == EACCES) {
   10.13 -      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
   10.14 -                  "Permission denied");
   10.15 +      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
   10.16 +                  "Permission denied", OS_ERR);
   10.17      }
   10.18      else {
   10.19 -      THROW_MSG_0(vmSymbols::java_io_IOException(), strerror(errno));
   10.20 +      THROW_MSG_(vmSymbols::java_io_IOException(), strerror(errno), OS_ERR);
   10.21      }
   10.22    }
   10.23  
   10.24 @@ -828,7 +828,7 @@
   10.25    char* mapAddress;
   10.26    int result;
   10.27    int fd;
   10.28 -  size_t size;
   10.29 +  size_t size = 0;
   10.30    const char* luser = NULL;
   10.31  
   10.32    int mmap_prot;
   10.33 @@ -899,9 +899,12 @@
   10.34  
   10.35    if (*sizep == 0) {
   10.36      size = sharedmem_filesize(fd, CHECK);
   10.37 -    assert(size != 0, "unexpected size");
   10.38 +  } else {
   10.39 +    size = *sizep;
   10.40    }
   10.41  
   10.42 +  assert(size > 0, "unexpected size <= 0");
   10.43 +
   10.44    mapAddress = (char*)::mmap((char*)0, size, mmap_prot, MAP_SHARED, fd, 0);
   10.45  
   10.46    // attempt to close the file - restart if it gets interrupted,
    11.1 --- a/src/os/solaris/vm/os_solaris.cpp	Wed Apr 10 14:26:49 2013 +0200
    11.2 +++ b/src/os/solaris/vm/os_solaris.cpp	Thu Apr 11 16:35:34 2013 +0200
    11.3 @@ -1885,6 +1885,9 @@
    11.4    } else if (strchr(pname, *os::path_separator()) != NULL) {
    11.5      int n;
    11.6      char** pelements = split_path(pname, &n);
    11.7 +    if (pelements == NULL) {
    11.8 +      return false;
    11.9 +    }
   11.10      for (int i = 0 ; i < n ; i++) {
   11.11        // really shouldn't be NULL but what the heck, check can't hurt
   11.12        if (pelements[i] == NULL || strlen(pelements[i]) == 0) {
   11.13 @@ -5787,16 +5790,6 @@
   11.14  
   11.15  //---------------------------------------------------------------------------------
   11.16  
   11.17 -static address same_page(address x, address y) {
   11.18 -  intptr_t page_bits = -os::vm_page_size();
   11.19 -  if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
   11.20 -    return x;
   11.21 -  else if (x > y)
   11.22 -    return (address)(intptr_t(y) | ~page_bits) + 1;
   11.23 -  else
   11.24 -    return (address)(intptr_t(y) & page_bits);
   11.25 -}
   11.26 -
   11.27  bool os::find(address addr, outputStream* st) {
   11.28    Dl_info dlinfo;
   11.29    memset(&dlinfo, 0, sizeof(dlinfo));
   11.30 @@ -5822,8 +5815,8 @@
   11.31  
   11.32      if (Verbose) {
   11.33        // decode some bytes around the PC
   11.34 -      address begin = same_page(addr-40, addr);
   11.35 -      address end   = same_page(addr+40, addr);
   11.36 +      address begin = clamp_address_in_page(addr-40, addr, os::vm_page_size());
   11.37 +      address end   = clamp_address_in_page(addr+40, addr, os::vm_page_size());
   11.38        address       lowest = (address) dlinfo.dli_sname;
   11.39        if (!lowest)  lowest = (address) dlinfo.dli_fbase;
   11.40        if (begin < lowest)  begin = lowest;
    12.1 --- a/src/os/solaris/vm/perfMemory_solaris.cpp	Wed Apr 10 14:26:49 2013 +0200
    12.2 +++ b/src/os/solaris/vm/perfMemory_solaris.cpp	Thu Apr 11 16:35:34 2013 +0200
    12.3 @@ -687,15 +687,15 @@
    12.4    RESTARTABLE(::open(filename, oflags), result);
    12.5    if (result == OS_ERR) {
    12.6      if (errno == ENOENT) {
    12.7 -      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
    12.8 -                  "Process not found");
    12.9 +      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
   12.10 +                  "Process not found", OS_ERR);
   12.11      }
   12.12      else if (errno == EACCES) {
   12.13 -      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
   12.14 -                  "Permission denied");
   12.15 +      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
   12.16 +                  "Permission denied", OS_ERR);
   12.17      }
   12.18      else {
   12.19 -      THROW_MSG_0(vmSymbols::java_io_IOException(), strerror(errno));
   12.20 +      THROW_MSG_(vmSymbols::java_io_IOException(), strerror(errno), OS_ERR);
   12.21      }
   12.22    }
   12.23  
   12.24 @@ -843,7 +843,7 @@
   12.25    char* mapAddress;
   12.26    int result;
   12.27    int fd;
   12.28 -  size_t size;
   12.29 +  size_t size = 0;
   12.30    const char* luser = NULL;
   12.31  
   12.32    int mmap_prot;
   12.33 @@ -914,9 +914,12 @@
   12.34  
   12.35    if (*sizep == 0) {
   12.36      size = sharedmem_filesize(fd, CHECK);
   12.37 -    assert(size != 0, "unexpected size");
   12.38 +  } else {
   12.39 +    size = *sizep;
   12.40    }
   12.41  
   12.42 +  assert(size > 0, "unexpected size <= 0");
   12.43 +
   12.44    mapAddress = (char*)::mmap((char*)0, size, mmap_prot, MAP_SHARED, fd, 0);
   12.45  
   12.46    // attempt to close the file - restart if it gets interrupted,
    13.1 --- a/src/os/windows/vm/os_windows.cpp	Wed Apr 10 14:26:49 2013 +0200
    13.2 +++ b/src/os/windows/vm/os_windows.cpp	Thu Apr 11 16:35:34 2013 +0200
    13.3 @@ -1182,6 +1182,9 @@
    13.4    } else if (strchr(pname, *os::path_separator()) != NULL) {
    13.5      int n;
    13.6      char** pelements = split_path(pname, &n);
    13.7 +    if (pelements == NULL) {
    13.8 +      return false;
    13.9 +    }
   13.10      for (int i = 0 ; i < n ; i++) {
   13.11        char* path = pelements[i];
   13.12        // Really shouldn't be NULL, but check can't hurt
    14.1 --- a/src/os/windows/vm/perfMemory_windows.cpp	Wed Apr 10 14:26:49 2013 +0200
    14.2 +++ b/src/os/windows/vm/perfMemory_windows.cpp	Thu Apr 11 16:35:34 2013 +0200
    14.3 @@ -1581,7 +1581,7 @@
    14.4    ResourceMark rm;
    14.5  
    14.6    void *mapAddress = 0;
    14.7 -  size_t size;
    14.8 +  size_t size = 0;
    14.9    HANDLE fmh;
   14.10    DWORD ofm_access;
   14.11    DWORD mv_access;
   14.12 @@ -1652,9 +1652,12 @@
   14.13  
   14.14    if (*sizep == 0) {
   14.15      size = sharedmem_filesize(rfilename, CHECK);
   14.16 -    assert(size != 0, "unexpected size");
   14.17 +  } else {
   14.18 +    size = *sizep;
   14.19    }
   14.20  
   14.21 +  assert(size > 0, "unexpected size <= 0");
   14.22 +
   14.23    // Open the file mapping object with the given name
   14.24    fmh = open_sharedmem_object(robjectname, ofm_access, CHECK);
   14.25  
    15.1 --- a/src/share/tools/launcher/wildcard.c	Wed Apr 10 14:26:49 2013 +0200
    15.2 +++ b/src/share/tools/launcher/wildcard.c	Thu Apr 11 16:35:34 2013 +0200
    15.3 @@ -368,8 +368,10 @@
    15.4      const char *basename;
    15.5      FileList fl = FileList_new(16);
    15.6      WildcardIterator it = WildcardIterator_for(wildcard);
    15.7 -    if (it == NULL)
    15.8 +    if (it == NULL) {
    15.9 +        FileList_free(fl);
   15.10          return NULL;
   15.11 +    }
   15.12      while ((basename = WildcardIterator_next(it)) != NULL)
   15.13          if (isJarFileName(basename))
   15.14              FileList_add(fl, wildcardConcat(wildcard, basename));
    16.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Apr 10 14:26:49 2013 +0200
    16.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Thu Apr 11 16:35:34 2013 +0200
    16.3 @@ -711,25 +711,6 @@
    16.4    }
    16.5  }
    16.6  
    16.7 -static Value maxvalue(IfOp* ifop) {
    16.8 -  switch (ifop->cond()) {
    16.9 -    case If::eql: return NULL;
   16.10 -    case If::neq: return NULL;
   16.11 -    case If::lss: // x <  y ? x : y
   16.12 -    case If::leq: // x <= y ? x : y
   16.13 -      if (ifop->x() == ifop->tval() &&
   16.14 -          ifop->y() == ifop->fval()) return ifop->y();
   16.15 -      return NULL;
   16.16 -
   16.17 -    case If::gtr: // x >  y ? y : x
   16.18 -    case If::geq: // x >= y ? y : x
   16.19 -      if (ifop->x() == ifop->tval() &&
   16.20 -          ifop->y() == ifop->fval()) return ifop->y();
   16.21 -      return NULL;
   16.22 -
   16.23 -  }
   16.24 -}
   16.25 -
   16.26  static ciType* phi_declared_type(Phi* phi) {
   16.27    ciType* t = phi->operand_at(0)->declared_type();
   16.28    if (t == NULL) {
    17.1 --- a/src/share/vm/classfile/verifier.cpp	Wed Apr 10 14:26:49 2013 +0200
    17.2 +++ b/src/share/vm/classfile/verifier.cpp	Thu Apr 11 16:35:34 2013 +0200
    17.3 @@ -63,6 +63,7 @@
    17.4  
    17.5  #define NOFAILOVER_MAJOR_VERSION                       51
    17.6  #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION  51
    17.7 +#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION       52
    17.8  
    17.9  // Access to external entry for VerifyClassCodes - old byte code verifier
   17.10  
   17.11 @@ -2320,6 +2321,11 @@
   17.12        types = (1 << JVM_CONSTANT_InterfaceMethodref) |
   17.13                (1 << JVM_CONSTANT_Methodref);
   17.14        break;
   17.15 +    case Bytecodes::_invokestatic:
   17.16 +      types = (_klass->major_version() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ?
   17.17 +        (1 << JVM_CONSTANT_Methodref) :
   17.18 +        ((1 << JVM_CONSTANT_InterfaceMethodref) | (1 << JVM_CONSTANT_Methodref));
   17.19 +      break;
   17.20      default:
   17.21        types = 1 << JVM_CONSTANT_Methodref;
   17.22    }
    18.1 --- a/src/share/vm/compiler/compileLog.cpp	Wed Apr 10 14:26:49 2013 +0200
    18.2 +++ b/src/share/vm/compiler/compileLog.cpp	Thu Apr 11 16:35:34 2013 +0200
    18.3 @@ -60,28 +60,6 @@
    18.4  }
    18.5  
    18.6  
    18.7 -// Advance kind up to a null or space, return this tail.
    18.8 -// Make sure kind is null-terminated, not space-terminated.
    18.9 -// Use the buffer if necessary.
   18.10 -static const char* split_attrs(const char* &kind, char* buffer) {
   18.11 -  const char* attrs = strchr(kind, ' ');
   18.12 -  // Tease apart the first word from the rest:
   18.13 -  if (attrs == NULL) {
   18.14 -    return "";  // no attrs, no split
   18.15 -  } else if (kind == buffer) {
   18.16 -    ((char*) attrs)[-1] = 0;
   18.17 -    return attrs;
   18.18 -  } else {
   18.19 -    // park it in the buffer, so we can put a null on the end
   18.20 -    assert(!(kind >= buffer && kind < buffer+100), "not obviously in buffer");
   18.21 -    int klen = attrs - kind;
   18.22 -    strncpy(buffer, kind, klen);
   18.23 -    buffer[klen] = 0;
   18.24 -    kind = buffer;  // return by reference
   18.25 -    return attrs;
   18.26 -  }
   18.27 -}
   18.28 -
   18.29  // see_tag, pop_tag:  Override the default do-nothing methods on xmlStream.
   18.30  // These methods provide a hook for managing the the extra context markup.
   18.31  void CompileLog::see_tag(const char* tag, bool push) {
    19.1 --- a/src/share/vm/compiler/compilerOracle.cpp	Wed Apr 10 14:26:49 2013 +0200
    19.2 +++ b/src/share/vm/compiler/compilerOracle.cpp	Thu Apr 11 16:35:34 2013 +0200
    19.3 @@ -237,13 +237,6 @@
    19.4    "help"
    19.5  };
    19.6  
    19.7 -static const char * command_name(OracleCommand command) {
    19.8 -  if (command < OracleFirstCommand || command >= OracleCommandCount) {
    19.9 -    return "unknown command";
   19.10 -  }
   19.11 -  return command_names[command];
   19.12 -}
   19.13 -
   19.14  class MethodMatcher;
   19.15  static MethodMatcher* lists[OracleCommandCount] = { 0, };
   19.16  
    20.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed Apr 10 14:26:49 2013 +0200
    20.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Thu Apr 11 16:35:34 2013 +0200
    20.3 @@ -1359,18 +1359,6 @@
    20.4  #endif // PRODUCT
    20.5  }
    20.6  
    20.7 -#ifndef PRODUCT
    20.8 -// for debugging, bit of a hack...
    20.9 -static char*
   20.10 -region_num_to_mbs(int length) {
   20.11 -  static char buffer[64];
   20.12 -  double bytes = (double) (length * HeapRegion::GrainBytes);
   20.13 -  double mbs = bytes / (double) (1024 * 1024);
   20.14 -  sprintf(buffer, "%7.2lfMB", mbs);
   20.15 -  return buffer;
   20.16 -}
   20.17 -#endif // PRODUCT
   20.18 -
   20.19  uint G1CollectorPolicy::max_regions(int purpose) {
   20.20    switch (purpose) {
   20.21      case GCAllocForSurvived:
    21.1 --- a/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Wed Apr 10 14:26:49 2013 +0200
    21.2 +++ b/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Thu Apr 11 16:35:34 2013 +0200
    21.3 @@ -53,15 +53,6 @@
    21.4  }
    21.5  
    21.6  
    21.7 -static int byte_index_to_index(int ind) {
    21.8 -  assert((ind % oopSize) == 0, "Invariant.");
    21.9 -  return ind / oopSize;
   21.10 -}
   21.11 -
   21.12 -static int index_to_byte_index(int byte_ind) {
   21.13 -  return byte_ind * oopSize;
   21.14 -}
   21.15 -
   21.16  void PtrQueue::enqueue_known_active(void* ptr) {
   21.17    assert(0 <= _index && _index <= _sz, "Invariant.");
   21.18    assert(_index == 0 || _buf != NULL, "invariant");
    22.1 --- a/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Apr 10 14:26:49 2013 +0200
    22.2 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Thu Apr 11 16:35:34 2013 +0200
    22.3 @@ -557,11 +557,6 @@
    22.4  // be shared by method invocation and synchronized blocks.
    22.5  //%note synchronization_3
    22.6  
    22.7 -static void trace_locking(Handle& h_locking_obj, bool is_locking) {
    22.8 -  ObjectSynchronizer::trace_locking(h_locking_obj, false, true, is_locking);
    22.9 -}
   22.10 -
   22.11 -
   22.12  //%note monitor_1
   22.13  IRT_ENTRY_NO_ASYNC(void, InterpreterRuntime::monitorenter(JavaThread* thread, BasicObjectLock* elem))
   22.14  #ifdef ASSERT
    23.1 --- a/src/share/vm/memory/heap.cpp	Wed Apr 10 14:26:49 2013 +0200
    23.2 +++ b/src/share/vm/memory/heap.cpp	Thu Apr 11 16:35:34 2013 +0200
    23.3 @@ -79,13 +79,6 @@
    23.4  }
    23.5  
    23.6  
    23.7 -static size_t align_to_allocation_size(size_t size) {
    23.8 -  const size_t alignment = (size_t)os::vm_allocation_granularity();
    23.9 -  assert(is_power_of_2(alignment), "no kidding ???");
   23.10 -  return (size + alignment - 1) & ~(alignment - 1);
   23.11 -}
   23.12 -
   23.13 -
   23.14  void CodeHeap::on_code_mapping(char* base, size_t size) {
   23.15  #ifdef LINUX
   23.16    extern void linux_wrap_code(char* base, size_t size);
    24.1 --- a/src/share/vm/memory/universe.cpp	Wed Apr 10 14:26:49 2013 +0200
    24.2 +++ b/src/share/vm/memory/universe.cpp	Thu Apr 11 16:35:34 2013 +0200
    24.3 @@ -1326,6 +1326,8 @@
    24.4  static uintptr_t _verify_klass_data[2] = {0, (uintptr_t)-1};
    24.5  
    24.6  
    24.7 +#ifndef PRODUCT
    24.8 +
    24.9  static void calculate_verify_data(uintptr_t verify_data[2],
   24.10                                    HeapWord* low_boundary,
   24.11                                    HeapWord* high_boundary) {
   24.12 @@ -1360,9 +1362,7 @@
   24.13    verify_data[1] = bits;
   24.14  }
   24.15  
   24.16 -
   24.17  // Oop verification (see MacroAssembler::verify_oop)
   24.18 -#ifndef PRODUCT
   24.19  
   24.20  uintptr_t Universe::verify_oop_mask() {
   24.21    MemRegion m = heap()->reserved_region();
    25.1 --- a/src/share/vm/oops/constantPool.cpp	Wed Apr 10 14:26:49 2013 +0200
    25.2 +++ b/src/share/vm/oops/constantPool.cpp	Thu Apr 11 16:35:34 2013 +0200
    25.3 @@ -1378,12 +1378,13 @@
    25.4  
    25.5  // JVMTI GetConstantPool support
    25.6  
    25.7 -// For temporary use until code is stable.
    25.8 -#define DBG(code)
    25.9 +// For debugging of constant pool
   25.10 +const bool debug_cpool = false;
   25.11  
   25.12 -static const char* WARN_MSG = "Must not be such entry!";
   25.13 +#define DBG(code) do { if (debug_cpool) { (code); } } while(0)
   25.14  
   25.15  static void print_cpool_bytes(jint cnt, u1 *bytes) {
   25.16 +  const char* WARN_MSG = "Must not be such entry!";
   25.17    jint size = 0;
   25.18    u2   idx1, idx2;
   25.19  
   25.20 @@ -1669,8 +1670,7 @@
   25.21          idx1 = tbl->symbol_to_value(sym);
   25.22          assert(idx1 != 0, "Have not found a hashtable entry");
   25.23          Bytes::put_Java_u2((address) (bytes+1), idx1);
   25.24 -        DBG(char *str = sym->as_utf8());
   25.25 -        DBG(printf("JVM_CONSTANT_String: idx=#%03hd, %s", idx1, str));
   25.26 +        DBG(printf("JVM_CONSTANT_String: idx=#%03hd, %s", idx1, sym->as_utf8()));
   25.27          break;
   25.28        }
   25.29        case JVM_CONSTANT_Fieldref:
   25.30 @@ -1745,6 +1745,8 @@
   25.31    return (int)(bytes - start_bytes);
   25.32  } /* end copy_cpool_bytes */
   25.33  
   25.34 +#undef DBG
   25.35 +
   25.36  
   25.37  void ConstantPool::set_on_stack(const bool value) {
   25.38    if (value) {
    26.1 --- a/src/share/vm/oops/instanceKlass.cpp	Wed Apr 10 14:26:49 2013 +0200
    26.2 +++ b/src/share/vm/oops/instanceKlass.cpp	Thu Apr 11 16:35:34 2013 +0200
    26.3 @@ -3157,7 +3157,7 @@
    26.4      Array<int>* method_ordering = this->method_ordering();
    26.5      int length = method_ordering->length();
    26.6      if (JvmtiExport::can_maintain_original_method_order() ||
    26.7 -        (UseSharedSpaces && length != 0)) {
    26.8 +        ((UseSharedSpaces || DumpSharedSpaces) && length != 0)) {
    26.9        guarantee(length == methods()->length(), "invalid method ordering length");
   26.10        jlong sum = 0;
   26.11        for (int j = 0; j < length; j++) {
    27.1 --- a/src/share/vm/opto/block.cpp	Wed Apr 10 14:26:49 2013 +0200
    27.2 +++ b/src/share/vm/opto/block.cpp	Thu Apr 11 16:35:34 2013 +0200
    27.3 @@ -1028,26 +1028,6 @@
    27.4  }
    27.5  
    27.6  #ifndef PRODUCT
    27.7 -static void edge_dump(GrowableArray<CFGEdge *> *edges) {
    27.8 -  tty->print_cr("---- Edges ----");
    27.9 -  for (int i = 0; i < edges->length(); i++) {
   27.10 -    CFGEdge *e = edges->at(i);
   27.11 -    if (e != NULL) {
   27.12 -      edges->at(i)->dump();
   27.13 -    }
   27.14 -  }
   27.15 -}
   27.16 -
   27.17 -static void trace_dump(Trace *traces[], int count) {
   27.18 -  tty->print_cr("---- Traces ----");
   27.19 -  for (int i = 0; i < count; i++) {
   27.20 -    Trace *tr = traces[i];
   27.21 -    if (tr != NULL) {
   27.22 -      tr->dump();
   27.23 -    }
   27.24 -  }
   27.25 -}
   27.26 -
   27.27  void Trace::dump( ) const {
   27.28    tty->print_cr("Trace (freq %f)", first_block()->_freq);
   27.29    for (Block *b = first_block(); b != NULL; b = next(b)) {
    28.1 --- a/src/share/vm/opto/compile.cpp	Wed Apr 10 14:26:49 2013 +0200
    28.2 +++ b/src/share/vm/opto/compile.cpp	Thu Apr 11 16:35:34 2013 +0200
    28.3 @@ -2326,12 +2326,14 @@
    28.4    int  get_inner_loop_count() const { return _inner_loop_count; }
    28.5  };
    28.6  
    28.7 +#ifdef ASSERT
    28.8  static bool oop_offset_is_sane(const TypeInstPtr* tp) {
    28.9    ciInstanceKlass *k = tp->klass()->as_instance_klass();
   28.10    // Make sure the offset goes inside the instance layout.
   28.11    return k->contains_field_offset(tp->offset());
   28.12    // Note that OffsetBot and OffsetTop are very negative.
   28.13  }
   28.14 +#endif
   28.15  
   28.16  // Eliminate trivially redundant StoreCMs and accumulate their
   28.17  // precedence edges.
    29.1 --- a/src/share/vm/opto/connode.cpp	Wed Apr 10 14:26:49 2013 +0200
    29.2 +++ b/src/share/vm/opto/connode.cpp	Thu Apr 11 16:35:34 2013 +0200
    29.3 @@ -465,29 +465,6 @@
    29.4    return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
    29.5  }
    29.6  
    29.7 -// Determine whether "n" is a node which can cause an alias of one of its inputs.  Node types
    29.8 -// which can create aliases are: CheckCastPP, Phi, and any store (if there is also a load from
    29.9 -// the location.)
   29.10 -// Note:  this checks for aliases created in this compilation, not ones which may
   29.11 -//        be potentially created at call sites.
   29.12 -static bool can_cause_alias(Node *n, PhaseTransform *phase) {
   29.13 -  bool possible_alias = false;
   29.14 -
   29.15 -  if (n->is_Store()) {
   29.16 -    possible_alias = !n->as_Store()->value_never_loaded(phase);
   29.17 -  } else {
   29.18 -    int opc = n->Opcode();
   29.19 -    possible_alias = n->is_Phi() ||
   29.20 -        opc == Op_CheckCastPP ||
   29.21 -        opc == Op_StorePConditional ||
   29.22 -        opc == Op_CompareAndSwapP ||
   29.23 -        opc == Op_CompareAndSwapN ||
   29.24 -        opc == Op_GetAndSetP ||
   29.25 -        opc == Op_GetAndSetN;
   29.26 -  }
   29.27 -  return possible_alias;
   29.28 -}
   29.29 -
   29.30  //------------------------------Value------------------------------------------
   29.31  // Take 'join' of input and cast-up type, unless working with an Interface
   29.32  const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const {
    30.1 --- a/src/share/vm/opto/subnode.cpp	Wed Apr 10 14:26:49 2013 +0200
    30.2 +++ b/src/share/vm/opto/subnode.cpp	Thu Apr 11 16:35:34 2013 +0200
    30.3 @@ -1078,16 +1078,6 @@
    30.4    return (_test._test == b->_test._test);
    30.5  }
    30.6  
    30.7 -//------------------------------clone_cmp--------------------------------------
    30.8 -// Clone a compare/bool tree
    30.9 -static Node *clone_cmp( Node *cmp, Node *cmp1, Node *cmp2, PhaseGVN *gvn, BoolTest::mask test ) {
   30.10 -  Node *ncmp = cmp->clone();
   30.11 -  ncmp->set_req(1,cmp1);
   30.12 -  ncmp->set_req(2,cmp2);
   30.13 -  ncmp = gvn->transform( ncmp );
   30.14 -  return new (gvn->C) BoolNode( ncmp, test );
   30.15 -}
   30.16 -
   30.17  //-------------------------------make_predicate--------------------------------
   30.18  Node* BoolNode::make_predicate(Node* test_value, PhaseGVN* phase) {
   30.19    if (test_value->is_Con())   return test_value;
    31.1 --- a/src/share/vm/prims/jni.cpp	Wed Apr 10 14:26:49 2013 +0200
    31.2 +++ b/src/share/vm/prims/jni.cpp	Thu Apr 11 16:35:34 2013 +0200
    31.3 @@ -1289,32 +1289,6 @@
    31.4    JNI_NONVIRTUAL
    31.5  };
    31.6  
    31.7 -static methodHandle jni_resolve_interface_call(Handle recv, methodHandle method, TRAPS) {
    31.8 -  assert(!method.is_null() , "method should not be null");
    31.9 -
   31.10 -  KlassHandle recv_klass; // Default to NULL (use of ?: can confuse gcc)
   31.11 -  if (recv.not_null()) recv_klass = KlassHandle(THREAD, recv->klass());
   31.12 -  KlassHandle spec_klass (THREAD, method->method_holder());
   31.13 -  Symbol*  name  = method->name();
   31.14 -  Symbol*  signature  = method->signature();
   31.15 -  CallInfo info;
   31.16 -  LinkResolver::resolve_interface_call(info, recv, recv_klass,  spec_klass, name, signature, KlassHandle(), false, true, CHECK_(methodHandle()));
   31.17 -  return info.selected_method();
   31.18 -}
   31.19 -
   31.20 -static methodHandle jni_resolve_virtual_call(Handle recv, methodHandle method, TRAPS) {
   31.21 -  assert(!method.is_null() , "method should not be null");
   31.22 -
   31.23 -  KlassHandle recv_klass; // Default to NULL (use of ?: can confuse gcc)
   31.24 -  if (recv.not_null()) recv_klass = KlassHandle(THREAD, recv->klass());
   31.25 -  KlassHandle spec_klass (THREAD, method->method_holder());
   31.26 -  Symbol*  name  = method->name();
   31.27 -  Symbol*  signature  = method->signature();
   31.28 -  CallInfo info;
   31.29 -  LinkResolver::resolve_virtual_call(info, recv, recv_klass,  spec_klass, name, signature, KlassHandle(), false, true, CHECK_(methodHandle()));
   31.30 -  return info.selected_method();
   31.31 -}
   31.32 -
   31.33  
   31.34  
   31.35  static void jni_invoke_static(JNIEnv *env, JavaValue* result, jobject receiver, JNICallType call_type, jmethodID method_id, JNI_ArgumentPusher *args, TRAPS) {
   31.36 @@ -5053,6 +5027,7 @@
   31.37  void execute_internal_vm_tests() {
   31.38    if (ExecuteInternalVMTests) {
   31.39      tty->print_cr("Running internal VM tests");
   31.40 +    run_unit_test(GlobalDefinitions::test_globals());
   31.41      run_unit_test(arrayOopDesc::test_max_array_length());
   31.42      run_unit_test(CollectedHeap::test_is_in());
   31.43      run_unit_test(QuickSort::test_quick_sort());
    32.1 --- a/src/share/vm/prims/jniCheck.hpp	Wed Apr 10 14:26:49 2013 +0200
    32.2 +++ b/src/share/vm/prims/jniCheck.hpp	Thu Apr 11 16:35:34 2013 +0200
    32.3 @@ -33,7 +33,7 @@
    32.4    // within IN_VM macro), one to be called when in NATIVE state.
    32.5  
    32.6    // When in VM state:
    32.7 -  static void ReportJNIFatalError(JavaThread* thr, const char *msg) {
    32.8 +  static inline void ReportJNIFatalError(JavaThread* thr, const char *msg) {
    32.9      tty->print_cr("FATAL ERROR in native method: %s", msg);
   32.10      thr->print_stack();
   32.11      os::abort(true);
    33.1 --- a/src/share/vm/prims/whitebox.cpp	Wed Apr 10 14:26:49 2013 +0200
    33.2 +++ b/src/share/vm/prims/whitebox.cpp	Thu Apr 11 16:35:34 2013 +0200
    33.3 @@ -118,45 +118,46 @@
    33.4  #endif // INCLUDE_ALL_GCS
    33.5  
    33.6  #ifdef INCLUDE_NMT
    33.7 -// Keep track of the 3 allocations in NMTAllocTest so we can free them later
    33.8 -// on and verify that they're not visible anymore
    33.9 -static void* nmtMtTest1 = NULL, *nmtMtTest2 = NULL, *nmtMtTest3 = NULL;
   33.10 -
   33.11  // Alloc memory using the test memory type so that we can use that to see if
   33.12  // NMT picks it up correctly
   33.13 -WB_ENTRY(jboolean, WB_NMTAllocTest(JNIEnv* env))
   33.14 -  void *mem;
   33.15 +WB_ENTRY(jlong, WB_NMTMalloc(JNIEnv* env, jobject o, jlong size))
   33.16 +  jlong addr = 0;
   33.17  
   33.18 -  if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) {
   33.19 -    return false;
   33.20 +  if (MemTracker::is_on() && !MemTracker::shutdown_in_progress()) {
   33.21 +    addr = (jlong)(uintptr_t)os::malloc(size, mtTest);
   33.22    }
   33.23  
   33.24 -  // Allocate 2 * 128k + 256k + 1024k and free the 1024k one to make sure we track
   33.25 -  // everything correctly. Total should be 512k held alive.
   33.26 -  nmtMtTest1 = os::malloc(128 * 1024, mtTest);
   33.27 -  mem = os::malloc(1024 * 1024, mtTest);
   33.28 -  nmtMtTest2 = os::malloc(256 * 1024, mtTest);
   33.29 -  os::free(mem, mtTest);
   33.30 -  nmtMtTest3 = os::malloc(128 * 1024, mtTest);
   33.31 -
   33.32 -  return true;
   33.33 +  return addr;
   33.34  WB_END
   33.35  
   33.36  // Free the memory allocated by NMTAllocTest
   33.37 -WB_ENTRY(jboolean, WB_NMTFreeTestMemory(JNIEnv* env))
   33.38 +WB_ENTRY(void, WB_NMTFree(JNIEnv* env, jobject o, jlong mem))
   33.39 +  os::free((void*)(uintptr_t)mem, mtTest);
   33.40 +WB_END
   33.41  
   33.42 -  if (nmtMtTest1 == NULL || nmtMtTest2 == NULL || nmtMtTest3 == NULL) {
   33.43 -    return false;
   33.44 +WB_ENTRY(jlong, WB_NMTReserveMemory(JNIEnv* env, jobject o, jlong size))
   33.45 +  jlong addr = 0;
   33.46 +
   33.47 +  if (MemTracker::is_on() && !MemTracker::shutdown_in_progress()) {
   33.48 +    addr = (jlong)(uintptr_t)os::reserve_memory(size);
   33.49 +    MemTracker::record_virtual_memory_type((address)addr, mtTest);
   33.50    }
   33.51  
   33.52 -  os::free(nmtMtTest1, mtTest);
   33.53 -  nmtMtTest1 = NULL;
   33.54 -  os::free(nmtMtTest2, mtTest);
   33.55 -  nmtMtTest2 = NULL;
   33.56 -  os::free(nmtMtTest3, mtTest);
   33.57 -  nmtMtTest3 = NULL;
   33.58 +  return addr;
   33.59 +WB_END
   33.60  
   33.61 -  return true;
   33.62 +
   33.63 +WB_ENTRY(void, WB_NMTCommitMemory(JNIEnv* env, jobject o, jlong addr, jlong size))
   33.64 +  os::commit_memory((char *)(uintptr_t)addr, size);
   33.65 +  MemTracker::record_virtual_memory_type((address)(uintptr_t)addr, mtTest);
   33.66 +WB_END
   33.67 +
   33.68 +WB_ENTRY(void, WB_NMTUncommitMemory(JNIEnv* env, jobject o, jlong addr, jlong size))
   33.69 +  os::uncommit_memory((char *)(uintptr_t)addr, size);
   33.70 +WB_END
   33.71 +
   33.72 +WB_ENTRY(void, WB_NMTReleaseMemory(JNIEnv* env, jobject o, jlong addr, jlong size))
   33.73 +  os::release_memory((char *)(uintptr_t)addr, size);
   33.74  WB_END
   33.75  
   33.76  // Block until the current generation of NMT data to be merged, used to reliably test the NMT feature
   33.77 @@ -340,9 +341,13 @@
   33.78    {CC"g1RegionSize",       CC"()I",                   (void*)&WB_G1RegionSize      },
   33.79  #endif // INCLUDE_ALL_GCS
   33.80  #ifdef INCLUDE_NMT
   33.81 -  {CC"NMTAllocTest",       CC"()Z",                   (void*)&WB_NMTAllocTest      },
   33.82 -  {CC"NMTFreeTestMemory",  CC"()Z",                   (void*)&WB_NMTFreeTestMemory },
   33.83 -  {CC"NMTWaitForDataMerge",CC"()Z",                   (void*)&WB_NMTWaitForDataMerge},
   33.84 +  {CC"NMTMalloc",           CC"(J)J",                 (void*)&WB_NMTMalloc          },
   33.85 +  {CC"NMTFree",             CC"(J)V",                 (void*)&WB_NMTFree            },
   33.86 +  {CC"NMTReserveMemory",    CC"(J)J",                 (void*)&WB_NMTReserveMemory   },
   33.87 +  {CC"NMTCommitMemory",     CC"(JJ)V",                (void*)&WB_NMTCommitMemory    },
   33.88 +  {CC"NMTUncommitMemory",   CC"(JJ)V",                (void*)&WB_NMTUncommitMemory  },
   33.89 +  {CC"NMTReleaseMemory",    CC"(JJ)V",                (void*)&WB_NMTReleaseMemory   },
   33.90 +  {CC"NMTWaitForDataMerge", CC"()Z",                  (void*)&WB_NMTWaitForDataMerge},
   33.91  #endif // INCLUDE_NMT
   33.92    {CC"deoptimizeAll",      CC"()V",                   (void*)&WB_DeoptimizeAll     },
   33.93    {CC"deoptimizeMethod",   CC"(Ljava/lang/reflect/Method;)I",
    34.1 --- a/src/share/vm/runtime/arguments.cpp	Wed Apr 10 14:26:49 2013 +0200
    34.2 +++ b/src/share/vm/runtime/arguments.cpp	Thu Apr 11 16:35:34 2013 +0200
    34.3 @@ -1754,11 +1754,15 @@
    34.4    return false;
    34.5  }
    34.6  
    34.7 +#if !INCLUDE_ALL_GCS
    34.8 +#ifdef ASSERT
    34.9  static bool verify_serial_gc_flags() {
   34.10    return (UseSerialGC &&
   34.11          !(UseParNewGC || (UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC ||
   34.12            UseParallelGC || UseParallelOldGC));
   34.13  }
   34.14 +#endif // ASSERT
   34.15 +#endif // INCLUDE_ALL_GCS
   34.16  
   34.17  // check if do gclog rotation
   34.18  // +UseGCLogFileRotation is a must,
   34.19 @@ -3093,6 +3097,7 @@
   34.20    }                                                                   \
   34.21  } while(0)
   34.22  
   34.23 +#if !INCLUDE_ALL_GCS
   34.24  static void force_serial_gc() {
   34.25    FLAG_SET_DEFAULT(UseSerialGC, true);
   34.26    FLAG_SET_DEFAULT(CMSIncrementalMode, false);  // special CMS suboption
   34.27 @@ -3102,6 +3107,7 @@
   34.28    UNSUPPORTED_GC_OPTION(UseConcMarkSweepGC);
   34.29    UNSUPPORTED_GC_OPTION(UseParNewGC);
   34.30  }
   34.31 +#endif // INCLUDE_ALL_GCS
   34.32  
   34.33  // Parse entry point called from JNI_CreateJavaVM
   34.34  
    35.1 --- a/src/share/vm/runtime/safepoint.cpp	Wed Apr 10 14:26:49 2013 +0200
    35.2 +++ b/src/share/vm/runtime/safepoint.cpp	Thu Apr 11 16:35:34 2013 +0200
    35.3 @@ -735,6 +735,9 @@
    35.4  // Exception handlers
    35.5  
    35.6  #ifndef PRODUCT
    35.7 +
    35.8 +#ifdef SPARC
    35.9 +
   35.10  #ifdef _LP64
   35.11  #define PTR_PAD ""
   35.12  #else
   35.13 @@ -755,7 +758,6 @@
   35.14                  newptr, is_oop?"oop":"   ", (wasoop && !is_oop) ? "STALE" : ((wasoop==false&&is_oop==false&&oldptr !=newptr)?"STOMP":"     "));
   35.15  }
   35.16  
   35.17 -#ifdef SPARC
   35.18  static void print_me(intptr_t *new_sp, intptr_t *old_sp, bool *was_oops) {
   35.19  #ifdef _LP64
   35.20    tty->print_cr("--------+------address-----+------before-----------+-------after----------+");
    36.1 --- a/src/share/vm/runtime/synchronizer.cpp	Wed Apr 10 14:26:49 2013 +0200
    36.2 +++ b/src/share/vm/runtime/synchronizer.cpp	Thu Apr 11 16:35:34 2013 +0200
    36.3 @@ -449,8 +449,6 @@
    36.4  // and explicit fences (barriers) to control for architectural reordering performed
    36.5  // by the CPU(s) or platform.
    36.6  
    36.7 -static int  MBFence (int x) { OrderAccess::fence(); return x; }
    36.8 -
    36.9  struct SharedGlobals {
   36.10      // These are highly shared mostly-read variables.
   36.11      // To avoid false-sharing they need to be the sole occupants of a $ line.
   36.12 @@ -1639,11 +1637,6 @@
   36.13  
   36.14  #ifndef PRODUCT
   36.15  
   36.16 -void ObjectSynchronizer::trace_locking(Handle locking_obj, bool is_compiled,
   36.17 -                                       bool is_method, bool is_locking) {
   36.18 -  // Don't know what to do here
   36.19 -}
   36.20 -
   36.21  // Verify all monitors in the monitor cache, the verification is weak.
   36.22  void ObjectSynchronizer::verify() {
   36.23    ObjectMonitor* block = gBlockList;
    37.1 --- a/src/share/vm/runtime/synchronizer.hpp	Wed Apr 10 14:26:49 2013 +0200
    37.2 +++ b/src/share/vm/runtime/synchronizer.hpp	Thu Apr 11 16:35:34 2013 +0200
    37.3 @@ -121,7 +121,6 @@
    37.4    static void oops_do(OopClosure* f);
    37.5  
    37.6    // debugging
    37.7 -  static void trace_locking(Handle obj, bool is_compiled, bool is_method, bool is_locking) PRODUCT_RETURN;
    37.8    static void verify() PRODUCT_RETURN;
    37.9    static int  verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
   37.10  
    38.1 --- a/src/share/vm/services/memTracker.cpp	Wed Apr 10 14:26:49 2013 +0200
    38.2 +++ b/src/share/vm/services/memTracker.cpp	Thu Apr 11 16:35:34 2013 +0200
    38.3 @@ -1,5 +1,5 @@
    38.4  /*
    38.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    38.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    38.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    38.8   *
    38.9   * This code is free software; you can redistribute it and/or modify it
   38.10 @@ -127,12 +127,15 @@
   38.11    assert(_state == NMT_bootstrapping_multi_thread, "wrong state");
   38.12  
   38.13    _snapshot = new (std::nothrow)MemSnapshot();
   38.14 -  if (_snapshot != NULL && !_snapshot->out_of_memory()) {
   38.15 -    if (start_worker()) {
   38.16 +  if (_snapshot != NULL) {
   38.17 +    if (!_snapshot->out_of_memory() && start_worker()) {
   38.18        _state = NMT_started;
   38.19        NMT_track_callsite = (_tracking_level == NMT_detail && can_walk_stack());
   38.20        return;
   38.21      }
   38.22 +
   38.23 +    delete _snapshot;
   38.24 +    _snapshot = NULL;
   38.25    }
   38.26  
   38.27    // fail to start native memory tracking, shut it down
   38.28 @@ -544,7 +547,10 @@
   38.29    assert(_worker_thread == NULL, "Just Check");
   38.30    _worker_thread = new (std::nothrow) MemTrackWorker();
   38.31    if (_worker_thread == NULL || _worker_thread->has_error()) {
   38.32 -    shutdown(NMT_initialization);
   38.33 +    if (_worker_thread != NULL) {
   38.34 +      delete _worker_thread;
   38.35 +      _worker_thread = NULL;
   38.36 +    }
   38.37      return false;
   38.38    }
   38.39    _worker_thread->start();
    39.1 --- a/src/share/vm/utilities/debug.cpp	Wed Apr 10 14:26:49 2013 +0200
    39.2 +++ b/src/share/vm/utilities/debug.cpp	Thu Apr 11 16:35:34 2013 +0200
    39.3 @@ -608,18 +608,6 @@
    39.4    return  CodeCache::find_nmethod((address)addr);
    39.5  }
    39.6  
    39.7 -static address same_page(address x, address y) {
    39.8 -  intptr_t page_bits = -os::vm_page_size();
    39.9 -  if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits)) {
   39.10 -    return x;
   39.11 -  } else if (x > y) {
   39.12 -    return (address)(intptr_t(y) | ~page_bits) + 1;
   39.13 -  } else {
   39.14 -    return (address)(intptr_t(y) & page_bits);
   39.15 -  }
   39.16 -}
   39.17 -
   39.18 -
   39.19  // Another interface that isn't ambiguous in dbx.
   39.20  // Can we someday rename the other find to hsfind?
   39.21  extern "C" void hsfind(intptr_t x) {
    40.1 --- a/src/share/vm/utilities/globalDefinitions.cpp	Wed Apr 10 14:26:49 2013 +0200
    40.2 +++ b/src/share/vm/utilities/globalDefinitions.cpp	Thu Apr 11 16:35:34 2013 +0200
    40.3 @@ -355,3 +355,33 @@
    40.4  
    40.5      return size_t(result);
    40.6  }
    40.7 +
    40.8 +#ifndef PRODUCT
    40.9 +
   40.10 +void GlobalDefinitions::test_globals() {
   40.11 +  intptr_t page_sizes[] = { os::vm_page_size(), 4096, 8192, 65536, 2*1024*1024 };
   40.12 +  const int num_page_sizes = sizeof(page_sizes) / sizeof(page_sizes[0]);
   40.13 +
   40.14 +  for (int i = 0; i < num_page_sizes; i++) {
   40.15 +    intptr_t page_size = page_sizes[i];
   40.16 +
   40.17 +    address a_page = (address)(10*page_size);
   40.18 +
   40.19 +    // Check that address within page is returned as is
   40.20 +    assert(clamp_address_in_page(a_page, a_page, page_size) == a_page, "incorrect");
   40.21 +    assert(clamp_address_in_page(a_page + 128, a_page, page_size) == a_page + 128, "incorrect");
   40.22 +    assert(clamp_address_in_page(a_page + page_size - 1, a_page, page_size) == a_page + page_size - 1, "incorrect");
   40.23 +
   40.24 +    // Check that address above page returns start of next page
   40.25 +    assert(clamp_address_in_page(a_page + page_size, a_page, page_size) == a_page + page_size, "incorrect");
   40.26 +    assert(clamp_address_in_page(a_page + page_size + 1, a_page, page_size) == a_page + page_size, "incorrect");
   40.27 +    assert(clamp_address_in_page(a_page + page_size*5 + 1, a_page, page_size) == a_page + page_size, "incorrect");
   40.28 +
   40.29 +    // Check that address below page returns start of page
   40.30 +    assert(clamp_address_in_page(a_page - 1, a_page, page_size) == a_page, "incorrect");
   40.31 +    assert(clamp_address_in_page(a_page - 2*page_size - 1, a_page, page_size) == a_page, "incorrect");
   40.32 +    assert(clamp_address_in_page(a_page - 5*page_size - 1, a_page, page_size) == a_page, "incorrect");
   40.33 +  }
   40.34 +}
   40.35 +
   40.36 +#endif // PRODUCT
    41.1 --- a/src/share/vm/utilities/globalDefinitions.hpp	Wed Apr 10 14:26:49 2013 +0200
    41.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp	Thu Apr 11 16:35:34 2013 +0200
    41.3 @@ -419,6 +419,24 @@
    41.4    return align_size_up(offset, HeapWordsPerLong);
    41.5  }
    41.6  
    41.7 +// Clamp an address to be within a specific page
    41.8 +// 1. If addr is on the page it is returned as is
    41.9 +// 2. If addr is above the page_address the start of the *next* page will be returned
   41.10 +// 3. Otherwise, if addr is below the page_address the start of the page will be returned
   41.11 +inline address clamp_address_in_page(address addr, address page_address, intptr_t page_size) {
   41.12 +  if (align_size_down(intptr_t(addr), page_size) == align_size_down(intptr_t(page_address), page_size)) {
   41.13 +    // address is in the specified page, just return it as is
   41.14 +    return addr;
   41.15 +  } else if (addr > page_address) {
   41.16 +    // address is above specified page, return start of next page
   41.17 +    return (address)align_size_down(intptr_t(page_address), page_size) + page_size;
   41.18 +  } else {
   41.19 +    // address is below specified page, return start of page
   41.20 +    return (address)align_size_down(intptr_t(page_address), page_size);
   41.21 +  }
   41.22 +}
   41.23 +
   41.24 +
   41.25  // The expected size in bytes of a cache line, used to pad data structures.
   41.26  #define DEFAULT_CACHE_LINE_SIZE 64
   41.27  
   41.28 @@ -1296,4 +1314,15 @@
   41.29    return *(void**)addr;
   41.30  }
   41.31  
   41.32 +
   41.33 +#ifndef PRODUCT
   41.34 +
   41.35 +// For unit testing only
   41.36 +class GlobalDefinitions {
   41.37 +public:
   41.38 +  static void test_globals();
   41.39 +};
   41.40 +
   41.41 +#endif // PRODUCT
   41.42 +
   41.43  #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
    42.1 --- a/test/runtime/NMT/AllocTestType.java	Wed Apr 10 14:26:49 2013 +0200
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,73 +0,0 @@
    42.4 -/*
    42.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    42.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    42.7 - *
    42.8 - * This code is free software; you can redistribute it and/or modify it
    42.9 - * under the terms of the GNU General Public License version 2 only, as
   42.10 - * published by the Free Software Foundation.
   42.11 - *
   42.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   42.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   42.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   42.15 - * version 2 for more details (a copy is included in the LICENSE file that
   42.16 - * accompanied this code).
   42.17 - *
   42.18 - * You should have received a copy of the GNU General Public License version
   42.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   42.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   42.21 - *
   42.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   42.23 - * or visit www.oracle.com if you need additional information or have any
   42.24 - * questions.
   42.25 - */
   42.26 -
   42.27 -/*
   42.28 - * @test
   42.29 - * @summary Test consistency of NMT by leaking a few select allocations of the Test type and then verify visibility with jcmd
   42.30 - * @key nmt jcmd
   42.31 - * @library /testlibrary /testlibrary/whitebox
   42.32 - * @build AllocTestType
   42.33 - * @run main ClassFileInstaller sun.hotspot.WhiteBox
   42.34 - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail AllocTestType
   42.35 - */
   42.36 -
   42.37 -import com.oracle.java.testlibrary.*;
   42.38 -import sun.hotspot.WhiteBox;
   42.39 -
   42.40 -public class AllocTestType {
   42.41 -
   42.42 -  public static void main(String args[]) throws Exception {
   42.43 -    OutputAnalyzer output;
   42.44 -
   42.45 -    // Grab my own PID
   42.46 -    String pid = Integer.toString(ProcessTools.getProcessId());
   42.47 -    ProcessBuilder pb = new ProcessBuilder();
   42.48 -
   42.49 -    // Use WB API to alloc with the mtTest type
   42.50 -    if (!WhiteBox.getWhiteBox().NMTAllocTest()) {
   42.51 -      throw new Exception("Call to WB API NMTAllocTest() failed");
   42.52 -    }
   42.53 -
   42.54 -    // Use WB API to ensure that all data has been merged before we continue
   42.55 -    if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) {
   42.56 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   42.57 -    }
   42.58 -
   42.59 -    // Run 'jcmd <pid> VM.native_memory summary'
   42.60 -    pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
   42.61 -    output = new OutputAnalyzer(pb.start());
   42.62 -    output.shouldContain("Test (reserved=512KB, committed=512KB)");
   42.63 -
   42.64 -    // Free the memory allocated by NMTAllocTest
   42.65 -    if (!WhiteBox.getWhiteBox().NMTFreeTestMemory()) {
   42.66 -      throw new Exception("Call to WB API NMTFreeTestMemory() failed");
   42.67 -    }
   42.68 -
   42.69 -    // Use WB API to ensure that all data has been merged before we continue
   42.70 -    if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) {
   42.71 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   42.72 -    }
   42.73 -    output = new OutputAnalyzer(pb.start());
   42.74 -    output.shouldNotContain("Test (reserved=");
   42.75 -  }
   42.76 -}
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/test/runtime/NMT/MallocTestType.java	Thu Apr 11 16:35:34 2013 +0200
    43.3 @@ -0,0 +1,74 @@
    43.4 +/*
    43.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    43.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    43.7 + *
    43.8 + * This code is free software; you can redistribute it and/or modify it
    43.9 + * under the terms of the GNU General Public License version 2 only, as
   43.10 + * published by the Free Software Foundation.
   43.11 + *
   43.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   43.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   43.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   43.15 + * version 2 for more details (a copy is included in the LICENSE file that
   43.16 + * accompanied this code).
   43.17 + *
   43.18 + * You should have received a copy of the GNU General Public License version
   43.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   43.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   43.21 + *
   43.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   43.23 + * or visit www.oracle.com if you need additional information or have any
   43.24 + * questions.
   43.25 + */
   43.26 +
   43.27 +/*
   43.28 + * @test
   43.29 + * @summary Test consistency of NMT by leaking a few select allocations of the Test type and then verify visibility with jcmd
   43.30 + * @key nmt jcmd
   43.31 + * @library /testlibrary /testlibrary/whitebox
   43.32 + * @build MallocTestType
   43.33 + * @run main ClassFileInstaller sun.hotspot.WhiteBox
   43.34 + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType
   43.35 + */
   43.36 +
   43.37 +import com.oracle.java.testlibrary.*;
   43.38 +import sun.hotspot.WhiteBox;
   43.39 +
   43.40 +public class MallocTestType {
   43.41 +
   43.42 +  public static void main(String args[]) throws Exception {
   43.43 +    OutputAnalyzer output;
   43.44 +    WhiteBox wb = WhiteBox.getWhiteBox();
   43.45 +
   43.46 +    // Grab my own PID
   43.47 +    String pid = Integer.toString(ProcessTools.getProcessId());
   43.48 +    ProcessBuilder pb = new ProcessBuilder();
   43.49 +
   43.50 +    // Use WB API to alloc and free with the mtTest type
   43.51 +    long memAlloc3 = wb.NMTMalloc(128 * 1024);
   43.52 +    long memAlloc2 = wb.NMTMalloc(256 * 1024);
   43.53 +    wb.NMTFree(memAlloc3);
   43.54 +    long memAlloc1 = wb.NMTMalloc(512 * 1024);
   43.55 +    wb.NMTFree(memAlloc2);
   43.56 +
   43.57 +    // Use WB API to ensure that all data has been merged before we continue
   43.58 +    if (!wb.NMTWaitForDataMerge()) {
   43.59 +      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   43.60 +    }
   43.61 +
   43.62 +    // Run 'jcmd <pid> VM.native_memory summary'
   43.63 +    pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
   43.64 +    output = new OutputAnalyzer(pb.start());
   43.65 +    output.shouldContain("Test (reserved=512KB, committed=512KB)");
   43.66 +
   43.67 +    // Free the memory allocated by NMTAllocTest
   43.68 +    wb.NMTFree(memAlloc1);
   43.69 +
   43.70 +    // Use WB API to ensure that all data has been merged before we continue
   43.71 +    if (!wb.NMTWaitForDataMerge()) {
   43.72 +      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   43.73 +    }
   43.74 +    output = new OutputAnalyzer(pb.start());
   43.75 +    output.shouldNotContain("Test (reserved=");
   43.76 +  }
   43.77 +}
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/test/runtime/NMT/ThreadedMallocTestType.java	Thu Apr 11 16:35:34 2013 +0200
    44.3 @@ -0,0 +1,91 @@
    44.4 +/*
    44.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    44.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44.7 + *
    44.8 + * This code is free software; you can redistribute it and/or modify it
    44.9 + * under the terms of the GNU General Public License version 2 only, as
   44.10 + * published by the Free Software Foundation.
   44.11 + *
   44.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   44.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   44.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   44.15 + * version 2 for more details (a copy is included in the LICENSE file that
   44.16 + * accompanied this code).
   44.17 + *
   44.18 + * You should have received a copy of the GNU General Public License version
   44.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   44.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   44.21 + *
   44.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   44.23 + * or visit www.oracle.com if you need additional information or have any
   44.24 + * questions.
   44.25 + */
   44.26 +
   44.27 +/*
   44.28 + * @test
   44.29 + * @key nmt jcmd
   44.30 + * @library /testlibrary /testlibrary/whitebox
   44.31 + * @build ThreadedMallocTestType
   44.32 + * @run main ClassFileInstaller sun.hotspot.WhiteBox
   44.33 + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType
   44.34 + */
   44.35 +
   44.36 +import com.oracle.java.testlibrary.*;
   44.37 +import sun.hotspot.WhiteBox;
   44.38 +
   44.39 +public class ThreadedMallocTestType {
   44.40 +  public static long memAlloc1;
   44.41 +  public static long memAlloc2;
   44.42 +  public static long memAlloc3;
   44.43 +
   44.44 +  public static void main(String args[]) throws Exception {
   44.45 +    OutputAnalyzer output;
   44.46 +    final WhiteBox wb = WhiteBox.getWhiteBox();
   44.47 +
   44.48 +    // Grab my own PID
   44.49 +    String pid = Integer.toString(ProcessTools.getProcessId());
   44.50 +    ProcessBuilder pb = new ProcessBuilder();
   44.51 +
   44.52 +    Thread allocThread = new Thread() {
   44.53 +      public void run() {
   44.54 +        // Alloc memory using the WB api
   44.55 +        memAlloc1 = wb.NMTMalloc(128 * 1024);
   44.56 +        memAlloc2 = wb.NMTMalloc(256 * 1024);
   44.57 +        memAlloc3 = wb.NMTMalloc(512 * 1024);
   44.58 +      }
   44.59 +    };
   44.60 +
   44.61 +    allocThread.start();
   44.62 +    allocThread.join();
   44.63 +
   44.64 +    // Use WB API to ensure that all data has been merged before we continue
   44.65 +    if (!wb.NMTWaitForDataMerge()) {
   44.66 +      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   44.67 +    }
   44.68 +
   44.69 +    // Run 'jcmd <pid> VM.native_memory summary'
   44.70 +    pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
   44.71 +    output = new OutputAnalyzer(pb.start());
   44.72 +    output.shouldContain("Test (reserved=896KB, committed=896KB)");
   44.73 +
   44.74 +    Thread freeThread = new Thread() {
   44.75 +      public void run() {
   44.76 +        // Free the memory allocated by NMTMalloc
   44.77 +        wb.NMTFree(memAlloc1);
   44.78 +        wb.NMTFree(memAlloc2);
   44.79 +        wb.NMTFree(memAlloc3);
   44.80 +      }
   44.81 +    };
   44.82 +
   44.83 +    freeThread.start();
   44.84 +    freeThread.join();
   44.85 +
   44.86 +    // Use WB API to ensure that all data has been merged before we continue
   44.87 +    if (!wb.NMTWaitForDataMerge()) {
   44.88 +      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   44.89 +    }
   44.90 +
   44.91 +    output = new OutputAnalyzer(pb.start());
   44.92 +    output.shouldNotContain("Test (reserved=");
   44.93 +  }
   44.94 +}
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Thu Apr 11 16:35:34 2013 +0200
    45.3 @@ -0,0 +1,112 @@
    45.4 +/*
    45.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    45.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    45.7 + *
    45.8 + * This code is free software; you can redistribute it and/or modify it
    45.9 + * under the terms of the GNU General Public License version 2 only, as
   45.10 + * published by the Free Software Foundation.
   45.11 + *
   45.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   45.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   45.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   45.15 + * version 2 for more details (a copy is included in the LICENSE file that
   45.16 + * accompanied this code).
   45.17 + *
   45.18 + * You should have received a copy of the GNU General Public License version
   45.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   45.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   45.21 + *
   45.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   45.23 + * or visit www.oracle.com if you need additional information or have any
   45.24 + * questions.
   45.25 + */
   45.26 +
   45.27 +/*
   45.28 + * @test
   45.29 + * @key nmt jcmd
   45.30 + * @library /testlibrary /testlibrary/whitebox
   45.31 + * @build ThreadedVirtualAllocTestType
   45.32 + * @run main ClassFileInstaller sun.hotspot.WhiteBox
   45.33 + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType
   45.34 + */
   45.35 +
   45.36 +import com.oracle.java.testlibrary.*;
   45.37 +import sun.hotspot.WhiteBox;
   45.38 +
   45.39 +public class ThreadedVirtualAllocTestType {
   45.40 +  public static long addr;
   45.41 +  public static final WhiteBox wb = WhiteBox.getWhiteBox();
   45.42 +  public static final long commitSize = 128 * 1024;
   45.43 +  public static final long reserveSize = 512 * 1024;
   45.44 +
   45.45 +  public static void main(String args[]) throws Exception {
   45.46 +    OutputAnalyzer output;
   45.47 +
   45.48 +    String pid = Integer.toString(ProcessTools.getProcessId());
   45.49 +    ProcessBuilder pb = new ProcessBuilder();
   45.50 +
   45.51 +    Thread reserveThread = new Thread() {
   45.52 +      public void run() {
   45.53 +        addr = wb.NMTReserveMemory(reserveSize);
   45.54 +      }
   45.55 +    };
   45.56 +    reserveThread.start();
   45.57 +    reserveThread.join();
   45.58 +
   45.59 +    mergeData();
   45.60 +
   45.61 +    pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"});
   45.62 +    output = new OutputAnalyzer(pb.start());
   45.63 +    output.shouldContain("Test (reserved=512KB, committed=0KB)");
   45.64 +    output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved 512KB for Test");
   45.65 +
   45.66 +    Thread commitThread = new Thread() {
   45.67 +      public void run() {
   45.68 +        wb.NMTCommitMemory(addr, commitSize);
   45.69 +      }
   45.70 +    };
   45.71 +    commitThread.start();
   45.72 +    commitThread.join();
   45.73 +
   45.74 +    mergeData();
   45.75 +
   45.76 +    output = new OutputAnalyzer(pb.start());
   45.77 +    output.shouldContain("Test (reserved=512KB, committed=128KB)");
   45.78 +    output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed 128KB");
   45.79 +
   45.80 +    Thread uncommitThread = new Thread() {
   45.81 +      public void run() {
   45.82 +        wb.NMTUncommitMemory(addr, commitSize);
   45.83 +      }
   45.84 +    };
   45.85 +    uncommitThread.start();
   45.86 +    uncommitThread.join();
   45.87 +
   45.88 +    mergeData();
   45.89 +
   45.90 +    output = new OutputAnalyzer(pb.start());
   45.91 +    output.shouldContain("Test (reserved=512KB, committed=0KB)");
   45.92 +    output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed");
   45.93 +
   45.94 +    Thread releaseThread = new Thread() {
   45.95 +      public void run() {
   45.96 +        wb.NMTReleaseMemory(addr, reserveSize);
   45.97 +      }
   45.98 +    };
   45.99 +    releaseThread.start();
  45.100 +    releaseThread.join();
  45.101 +
  45.102 +    mergeData();
  45.103 +
  45.104 +    output = new OutputAnalyzer(pb.start());
  45.105 +    output.shouldNotContain("Test (reserved=");
  45.106 +    output.shouldNotContain("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved");
  45.107 +  }
  45.108 +
  45.109 +  public static void mergeData() throws Exception {
  45.110 +    // Use WB API to ensure that all data has been merged before we continue
  45.111 +    if (!wb.NMTWaitForDataMerge()) {
  45.112 +      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
  45.113 +    }
  45.114 +  }
  45.115 +}
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/test/runtime/NMT/VirtualAllocTestType.java	Thu Apr 11 16:35:34 2013 +0200
    46.3 @@ -0,0 +1,88 @@
    46.4 +/*
    46.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    46.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    46.7 + *
    46.8 + * This code is free software; you can redistribute it and/or modify it
    46.9 + * under the terms of the GNU General Public License version 2 only, as
   46.10 + * published by the Free Software Foundation.
   46.11 + *
   46.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   46.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   46.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   46.15 + * version 2 for more details (a copy is included in the LICENSE file that
   46.16 + * accompanied this code).
   46.17 + *
   46.18 + * You should have received a copy of the GNU General Public License version
   46.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   46.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   46.21 + *
   46.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   46.23 + * or visit www.oracle.com if you need additional information or have any
   46.24 + * questions.
   46.25 + */
   46.26 +
   46.27 +/*
   46.28 + * @test
   46.29 + * @summary Test Reserve/Commit/Uncommit/Release of virtual memory and that we track it correctly
   46.30 + * @key nmt jcmd
   46.31 + * @library /testlibrary /testlibrary/whitebox
   46.32 + * @build VirtualAllocTestType
   46.33 + * @run main ClassFileInstaller sun.hotspot.WhiteBox
   46.34 + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType
   46.35 + */
   46.36 +
   46.37 +import com.oracle.java.testlibrary.*;
   46.38 +import sun.hotspot.WhiteBox;
   46.39 +
   46.40 +public class VirtualAllocTestType {
   46.41 +
   46.42 +  public static WhiteBox wb = WhiteBox.getWhiteBox();
   46.43 +  public static void main(String args[]) throws Exception {
   46.44 +    OutputAnalyzer output;
   46.45 +    long commitSize = 128 * 1024;
   46.46 +    long reserveSize = 256 * 1024;
   46.47 +    long addr;
   46.48 +
   46.49 +    String pid = Integer.toString(ProcessTools.getProcessId());
   46.50 +    ProcessBuilder pb = new ProcessBuilder();
   46.51 +
   46.52 +    addr = wb.NMTReserveMemory(reserveSize);
   46.53 +    mergeData();
   46.54 +
   46.55 +    pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"});
   46.56 +    output = new OutputAnalyzer(pb.start());
   46.57 +    output.shouldContain("Test (reserved=256KB, committed=0KB)");
   46.58 +    output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved 256KB for Test");
   46.59 +
   46.60 +    wb.NMTCommitMemory(addr, commitSize);
   46.61 +
   46.62 +    mergeData();
   46.63 +
   46.64 +    output = new OutputAnalyzer(pb.start());
   46.65 +    output.shouldContain("Test (reserved=256KB, committed=128KB)");
   46.66 +    output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed 128KB");
   46.67 +
   46.68 +    wb.NMTUncommitMemory(addr, commitSize);
   46.69 +
   46.70 +    mergeData();
   46.71 +
   46.72 +    output = new OutputAnalyzer(pb.start());
   46.73 +    output.shouldContain("Test (reserved=256KB, committed=0KB)");
   46.74 +    output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed");
   46.75 +
   46.76 +    wb.NMTReleaseMemory(addr, reserveSize);
   46.77 +
   46.78 +    mergeData();
   46.79 +
   46.80 +    output = new OutputAnalyzer(pb.start());
   46.81 +    output.shouldNotContain("Test (reserved=");
   46.82 +    output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved");
   46.83 +  }
   46.84 +
   46.85 +  public static void mergeData() throws Exception {
   46.86 +    // Use WB API to ensure that all data has been merged before we continue
   46.87 +    if (!wb.NMTWaitForDataMerge()) {
   46.88 +      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   46.89 +    }
   46.90 +  }
   46.91 +}
    47.1 --- a/test/testlibrary/OutputAnalyzerTest.java	Wed Apr 10 14:26:49 2013 +0200
    47.2 +++ b/test/testlibrary/OutputAnalyzerTest.java	Thu Apr 11 16:35:34 2013 +0200
    47.3 @@ -36,6 +36,11 @@
    47.4      String stdout = "aaaaaa";
    47.5      String stderr = "bbbbbb";
    47.6  
    47.7 +    // Regexps used for testing pattern matching of the test input
    47.8 +    String stdoutPattern = "[a]";
    47.9 +    String stderrPattern = "[b]";
   47.10 +    String nonExistingPattern = "[c]";
   47.11 +
   47.12      OutputAnalyzer output = new OutputAnalyzer(stdout, stderr);
   47.13  
   47.14      if (!stdout.equals(output.getStdout())) {
   47.15 @@ -99,10 +104,73 @@
   47.16      }
   47.17  
   47.18      try {
   47.19 -      output.stderrShouldNotContain(stderr);
   47.20 -      throw new Exception("shouldContain() failed to throw exception");
   47.21 +        output.stderrShouldNotContain(stderr);
   47.22 +        throw new Exception("shouldContain() failed to throw exception");
   47.23      } catch (RuntimeException e) {
   47.24 -      // expected
   47.25 +        // expected
   47.26 +    }
   47.27 +
   47.28 +    // Should match
   47.29 +    try {
   47.30 +        output.shouldMatch(stdoutPattern);
   47.31 +        output.stdoutShouldMatch(stdoutPattern);
   47.32 +        output.shouldMatch(stderrPattern);
   47.33 +        output.stderrShouldMatch(stderrPattern);
   47.34 +    } catch (RuntimeException e) {
   47.35 +        throw new Exception("shouldMatch() failed", e);
   47.36 +    }
   47.37 +
   47.38 +    try {
   47.39 +        output.shouldMatch(nonExistingPattern);
   47.40 +        throw new Exception("shouldMatch() failed to throw exception");
   47.41 +    } catch (RuntimeException e) {
   47.42 +        // expected
   47.43 +    }
   47.44 +
   47.45 +    try {
   47.46 +        output.stdoutShouldMatch(stderrPattern);
   47.47 +        throw new Exception(
   47.48 +                "stdoutShouldMatch() failed to throw exception");
   47.49 +    } catch (RuntimeException e) {
   47.50 +        // expected
   47.51 +    }
   47.52 +
   47.53 +    try {
   47.54 +        output.stderrShouldMatch(stdoutPattern);
   47.55 +        throw new Exception(
   47.56 +                "stderrShouldMatch() failed to throw exception");
   47.57 +    } catch (RuntimeException e) {
   47.58 +        // expected
   47.59 +    }
   47.60 +
   47.61 +    // Should not match
   47.62 +    try {
   47.63 +        output.shouldNotMatch(nonExistingPattern);
   47.64 +        output.stdoutShouldNotMatch(nonExistingPattern);
   47.65 +        output.stderrShouldNotMatch(nonExistingPattern);
   47.66 +    } catch (RuntimeException e) {
   47.67 +        throw new Exception("shouldNotMatch() failed", e);
   47.68 +    }
   47.69 +
   47.70 +    try {
   47.71 +        output.shouldNotMatch(stdoutPattern);
   47.72 +        throw new Exception("shouldNotMatch() failed to throw exception");
   47.73 +    } catch (RuntimeException e) {
   47.74 +        // expected
   47.75 +    }
   47.76 +
   47.77 +    try {
   47.78 +        output.stdoutShouldNotMatch(stdoutPattern);
   47.79 +        throw new Exception("shouldNotMatch() failed to throw exception");
   47.80 +    } catch (RuntimeException e) {
   47.81 +        // expected
   47.82 +    }
   47.83 +
   47.84 +    try {
   47.85 +        output.stderrShouldNotMatch(stderrPattern);
   47.86 +        throw new Exception("shouldNotMatch() failed to throw exception");
   47.87 +    } catch (RuntimeException e) {
   47.88 +        // expected
   47.89      }
   47.90    }
   47.91  }
    48.1 --- a/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java	Wed Apr 10 14:26:49 2013 +0200
    48.2 +++ b/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java	Thu Apr 11 16:35:34 2013 +0200
    48.3 @@ -24,6 +24,8 @@
    48.4  package com.oracle.java.testlibrary;
    48.5  
    48.6  import java.io.IOException;
    48.7 +import java.util.regex.Matcher;
    48.8 +import java.util.regex.Pattern;
    48.9  
   48.10  public final class OutputAnalyzer {
   48.11  
   48.12 @@ -142,15 +144,112 @@
   48.13    }
   48.14  
   48.15    /**
   48.16 +   * Verify that the stdout and stderr contents of output buffer matches
   48.17 +   * the pattern
   48.18 +   *
   48.19 +   * @param pattern
   48.20 +   * @throws RuntimeException If the pattern was not found
   48.21 +   */
   48.22 +  public void shouldMatch(String pattern) {
   48.23 +      Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
   48.24 +      Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
   48.25 +      if (!stdoutMatcher.find() && !stderrMatcher.find()) {
   48.26 +          throw new RuntimeException("'" + pattern
   48.27 +                  + "' missing from stdout/stderr: [" + stdout + stderr
   48.28 +                  + "]\n");
   48.29 +      }
   48.30 +  }
   48.31 +
   48.32 +  /**
   48.33 +   * Verify that the stdout contents of output buffer matches the
   48.34 +   * pattern
   48.35 +   *
   48.36 +   * @param pattern
   48.37 +   * @throws RuntimeException If the pattern was not found
   48.38 +   */
   48.39 +  public void stdoutShouldMatch(String pattern) {
   48.40 +      Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
   48.41 +      if (!matcher.find()) {
   48.42 +          throw new RuntimeException("'" + pattern
   48.43 +                  + "' missing from stdout: [" + stdout + "]\n");
   48.44 +      }
   48.45 +  }
   48.46 +
   48.47 +  /**
   48.48 +   * Verify that the stderr contents of output buffer matches the
   48.49 +   * pattern
   48.50 +   *
   48.51 +   * @param pattern
   48.52 +   * @throws RuntimeException If the pattern was not found
   48.53 +   */
   48.54 +  public void stderrShouldMatch(String pattern) {
   48.55 +      Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
   48.56 +      if (!matcher.find()) {
   48.57 +          throw new RuntimeException("'" + pattern
   48.58 +                  + "' missing from stderr: [" + stderr + "]\n");
   48.59 +      }
   48.60 +  }
   48.61 +
   48.62 +  /**
   48.63 +   * Verify that the stdout and stderr contents of output buffer does not
   48.64 +   * match the pattern
   48.65 +   *
   48.66 +   * @param pattern
   48.67 +   * @throws RuntimeException If the pattern was found
   48.68 +   */
   48.69 +  public void shouldNotMatch(String pattern) {
   48.70 +      Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
   48.71 +      if (matcher.find()) {
   48.72 +          throw new RuntimeException("'" + pattern
   48.73 +                  + "' found in stdout: [" + stdout + "]\n");
   48.74 +      }
   48.75 +      matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
   48.76 +      if (matcher.find()) {
   48.77 +          throw new RuntimeException("'" + pattern
   48.78 +                  + "' found in stderr: [" + stderr + "]\n");
   48.79 +      }
   48.80 +  }
   48.81 +
   48.82 +  /**
   48.83 +   * Verify that the stdout contents of output buffer does not match the
   48.84 +   * pattern
   48.85 +   *
   48.86 +   * @param pattern
   48.87 +   * @throws RuntimeException If the pattern was found
   48.88 +   */
   48.89 +  public void stdoutShouldNotMatch(String pattern) {
   48.90 +      Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
   48.91 +      if (matcher.find()) {
   48.92 +          throw new RuntimeException("'" + pattern
   48.93 +                  + "' found in stdout: [" + stdout + "]\n");
   48.94 +      }
   48.95 +  }
   48.96 +
   48.97 +  /**
   48.98 +   * Verify that the stderr contents of output buffer does not match the
   48.99 +   * pattern
  48.100 +   *
  48.101 +   * @param pattern
  48.102 +   * @throws RuntimeException If the pattern was found
  48.103 +   */
  48.104 +  public void stderrShouldNotMatch(String pattern) {
  48.105 +      Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
  48.106 +      if (matcher.find()) {
  48.107 +          throw new RuntimeException("'" + pattern
  48.108 +                  + "' found in stderr: [" + stderr + "]\n");
  48.109 +      }
  48.110 +  }
  48.111 +
  48.112 +  /**
  48.113     * Verifiy the exit value of the process
  48.114     *
  48.115     * @param expectedExitValue Expected exit value from process
  48.116     * @throws RuntimeException If the exit value from the process did not match the expected value
  48.117     */
  48.118    public void shouldHaveExitValue(int expectedExitValue) {
  48.119 -    if (getExitValue() != expectedExitValue) {
  48.120 -      throw new RuntimeException("Exit value " + getExitValue() + " , expected to get " + expectedExitValue);
  48.121 -    }
  48.122 +      if (getExitValue() != expectedExitValue) {
  48.123 +          throw new RuntimeException("Exit value " + getExitValue() + " , expected to get " + expectedExitValue);
  48.124 +      }
  48.125    }
  48.126  
  48.127    /**
    49.1 --- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Apr 10 14:26:49 2013 +0200
    49.2 +++ b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Thu Apr 11 16:35:34 2013 +0200
    49.3 @@ -80,8 +80,12 @@
    49.4    public native Object[]    parseCommandLine(String commandline, DiagnosticCommand[] args);
    49.5  
    49.6    // NMT
    49.7 -  public native boolean NMTAllocTest();
    49.8 -  public native boolean NMTFreeTestMemory();
    49.9 +  public native long NMTMalloc(long size);
   49.10 +  public native void NMTFree(long mem);
   49.11 +  public native long NMTReserveMemory(long size);
   49.12 +  public native void NMTCommitMemory(long addr, long size);
   49.13 +  public native void NMTUncommitMemory(long addr, long size);
   49.14 +  public native void NMTReleaseMemory(long addr, long size);
   49.15    public native boolean NMTWaitForDataMerge();
   49.16  
   49.17    // Compiler

mercurial