Merge

Fri, 30 Aug 2013 12:22:02 -0400

author
zgu
date
Fri, 30 Aug 2013 12:22:02 -0400
changeset 5617
491de79915eb
parent 5616
522d69638aa8
parent 5614
9758d9f36299
child 5618
ac2764460da7

Merge

src/share/vm/runtime/fprofiler.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/make/bsd/makefiles/gcc.make	Fri Aug 30 11:54:14 2013 -0400
     1.2 +++ b/make/bsd/makefiles/gcc.make	Fri Aug 30 12:22:02 2013 -0400
     1.3 @@ -139,6 +139,7 @@
     1.4      PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH)
     1.5      PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH)
     1.6      PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH)
     1.7 +    PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH)
     1.8    
     1.9    endif
    1.10  else # ($(USE_CLANG), true)
    1.11 @@ -306,6 +307,7 @@
    1.12  ifeq ($(USE_CLANG), true)
    1.13    ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
    1.14      OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
    1.15 +    OPT_CFLAGS/unsafe.o += -01
    1.16    endif
    1.17  else
    1.18    # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
     2.1 --- a/src/os/linux/vm/os_linux.cpp	Fri Aug 30 11:54:14 2013 -0400
     2.2 +++ b/src/os/linux/vm/os_linux.cpp	Fri Aug 30 12:22:02 2013 -0400
     2.3 @@ -2943,6 +2943,53 @@
     2.4    return res  != (uintptr_t) MAP_FAILED;
     2.5  }
     2.6  
     2.7 +static
     2.8 +address get_stack_commited_bottom(address bottom, size_t size) {
     2.9 +  address nbot = bottom;
    2.10 +  address ntop = bottom + size;
    2.11 +
    2.12 +  size_t page_sz = os::vm_page_size();
    2.13 +  unsigned pages = size / page_sz;
    2.14 +
    2.15 +  unsigned char vec[1];
    2.16 +  unsigned imin = 1, imax = pages + 1, imid;
    2.17 +  int mincore_return_value;
    2.18 +
    2.19 +  while (imin < imax) {
    2.20 +    imid = (imax + imin) / 2;
    2.21 +    nbot = ntop - (imid * page_sz);
    2.22 +
    2.23 +    // Use a trick with mincore to check whether the page is mapped or not.
    2.24 +    // mincore sets vec to 1 if page resides in memory and to 0 if page
    2.25 +    // is swapped output but if page we are asking for is unmapped
    2.26 +    // it returns -1,ENOMEM
    2.27 +    mincore_return_value = mincore(nbot, page_sz, vec);
    2.28 +
    2.29 +    if (mincore_return_value == -1) {
    2.30 +      // Page is not mapped go up
    2.31 +      // to find first mapped page
    2.32 +      if (errno != EAGAIN) {
    2.33 +        assert(errno == ENOMEM, "Unexpected mincore errno");
    2.34 +        imax = imid;
    2.35 +      }
    2.36 +    } else {
    2.37 +      // Page is mapped go down
    2.38 +      // to find first not mapped page
    2.39 +      imin = imid + 1;
    2.40 +    }
    2.41 +  }
    2.42 +
    2.43 +  nbot = nbot + page_sz;
    2.44 +
    2.45 +  // Adjust stack bottom one page up if last checked page is not mapped
    2.46 +  if (mincore_return_value == -1) {
    2.47 +    nbot = nbot + page_sz;
    2.48 +  }
    2.49 +
    2.50 +  return nbot;
    2.51 +}
    2.52 +
    2.53 +
    2.54  // Linux uses a growable mapping for the stack, and if the mapping for
    2.55  // the stack guard pages is not removed when we detach a thread the
    2.56  // stack cannot grow beyond the pages where the stack guard was
    2.57 @@ -2957,59 +3004,37 @@
    2.58  // So, we need to know the extent of the stack mapping when
    2.59  // create_stack_guard_pages() is called.
    2.60  
    2.61 -// Find the bounds of the stack mapping.  Return true for success.
    2.62 -//
    2.63  // We only need this for stacks that are growable: at the time of
    2.64  // writing thread stacks don't use growable mappings (i.e. those
    2.65  // creeated with MAP_GROWSDOWN), and aren't marked "[stack]", so this
    2.66  // only applies to the main thread.
    2.67  
    2.68 -static
    2.69 -bool get_stack_bounds(uintptr_t *bottom, uintptr_t *top) {
    2.70 -
    2.71 -  char buf[128];
    2.72 -  int fd, sz;
    2.73 -
    2.74 -  if ((fd = ::open("/proc/self/maps", O_RDONLY)) < 0) {
    2.75 -    return false;
    2.76 -  }
    2.77 -
    2.78 -  const char kw[] = "[stack]";
    2.79 -  const int kwlen = sizeof(kw)-1;
    2.80 -
    2.81 -  // Address part of /proc/self/maps couldn't be more than 128 bytes
    2.82 -  while ((sz = os::get_line_chars(fd, buf, sizeof(buf))) > 0) {
    2.83 -     if (sz > kwlen && ::memcmp(buf+sz-kwlen, kw, kwlen) == 0) {
    2.84 -        // Extract addresses
    2.85 -        if (sscanf(buf, "%" SCNxPTR "-%" SCNxPTR, bottom, top) == 2) {
    2.86 -           uintptr_t sp = (uintptr_t) __builtin_frame_address(0);
    2.87 -           if (sp >= *bottom && sp <= *top) {
    2.88 -              ::close(fd);
    2.89 -              return true;
    2.90 -           }
    2.91 -        }
    2.92 -     }
    2.93 -  }
    2.94 -
    2.95 - ::close(fd);
    2.96 -  return false;
    2.97 -}
    2.98 -
    2.99 -
   2.100  // If the (growable) stack mapping already extends beyond the point
   2.101  // where we're going to put our guard pages, truncate the mapping at
   2.102  // that point by munmap()ping it.  This ensures that when we later
   2.103  // munmap() the guard pages we don't leave a hole in the stack
   2.104 -// mapping. This only affects the main/initial thread, but guard
   2.105 -// against future OS changes
   2.106 +// mapping. This only affects the main/initial thread
   2.107 +
   2.108  bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
   2.109 -  uintptr_t stack_extent, stack_base;
   2.110 -  bool chk_bounds = NOT_DEBUG(os::Linux::is_initial_thread()) DEBUG_ONLY(true);
   2.111 -  if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) {
   2.112 -      assert(os::Linux::is_initial_thread(),
   2.113 -           "growable stack in non-initial thread");
   2.114 -    if (stack_extent < (uintptr_t)addr)
   2.115 -      ::munmap((void*)stack_extent, (uintptr_t)addr - stack_extent);
   2.116 +
   2.117 +  if (os::Linux::is_initial_thread()) {
   2.118 +    // As we manually grow stack up to bottom inside create_attached_thread(),
   2.119 +    // it's likely that os::Linux::initial_thread_stack_bottom is mapped and
   2.120 +    // we don't need to do anything special.
   2.121 +    // Check it first, before calling heavy function.
   2.122 +    uintptr_t stack_extent = (uintptr_t) os::Linux::initial_thread_stack_bottom();
   2.123 +    unsigned char vec[1];
   2.124 +
   2.125 +    if (mincore((address)stack_extent, os::vm_page_size(), vec) == -1) {
   2.126 +      // Fallback to slow path on all errors, including EAGAIN
   2.127 +      stack_extent = (uintptr_t) get_stack_commited_bottom(
   2.128 +                                    os::Linux::initial_thread_stack_bottom(),
   2.129 +                                    (size_t)addr - stack_extent);
   2.130 +    }
   2.131 +
   2.132 +    if (stack_extent < (uintptr_t)addr) {
   2.133 +      ::munmap((void*)stack_extent, (uintptr_t)(addr - stack_extent));
   2.134 +    }
   2.135    }
   2.136  
   2.137    return os::commit_memory(addr, size, !ExecMem);
   2.138 @@ -3018,13 +3043,13 @@
   2.139  // If this is a growable mapping, remove the guard pages entirely by
   2.140  // munmap()ping them.  If not, just call uncommit_memory(). This only
   2.141  // affects the main/initial thread, but guard against future OS changes
   2.142 +// It's safe to always unmap guard pages for initial thread because we
   2.143 +// always place it right after end of the mapped region
   2.144 +
   2.145  bool os::remove_stack_guard_pages(char* addr, size_t size) {
   2.146    uintptr_t stack_extent, stack_base;
   2.147 -  bool chk_bounds = NOT_DEBUG(os::Linux::is_initial_thread()) DEBUG_ONLY(true);
   2.148 -  if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) {
   2.149 -      assert(os::Linux::is_initial_thread(),
   2.150 -           "growable stack in non-initial thread");
   2.151 -
   2.152 +
   2.153 +  if (os::Linux::is_initial_thread()) {
   2.154      return ::munmap(addr, size) == 0;
   2.155    }
   2.156  
     3.1 --- a/src/os/posix/vm/os_posix.cpp	Fri Aug 30 11:54:14 2013 -0400
     3.2 +++ b/src/os/posix/vm/os_posix.cpp	Fri Aug 30 12:22:02 2013 -0400
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 -* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     3.6 +* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     3.7  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8  *
     3.9  * This code is free software; you can redistribute it and/or modify it
    3.10 @@ -30,6 +30,8 @@
    3.11  #include <unistd.h>
    3.12  #include <sys/resource.h>
    3.13  #include <sys/utsname.h>
    3.14 +#include <pthread.h>
    3.15 +#include <signal.h>
    3.16  
    3.17  
    3.18  // Check core dump limit and report possible place where core can be found
    3.19 @@ -271,11 +273,17 @@
    3.20   * The callback is supposed to provide the method that should be protected.
    3.21   */
    3.22  bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
    3.23 +  sigset_t saved_sig_mask;
    3.24 +
    3.25    assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
    3.26    assert(!WatcherThread::watcher_thread()->has_crash_protection(),
    3.27        "crash_protection already set?");
    3.28  
    3.29 -  if (sigsetjmp(_jmpbuf, 1) == 0) {
    3.30 +  // we cannot rely on sigsetjmp/siglongjmp to save/restore the signal mask
    3.31 +  // since on at least some systems (OS X) siglongjmp will restore the mask
    3.32 +  // for the process, not the thread
    3.33 +  pthread_sigmask(0, NULL, &saved_sig_mask);
    3.34 +  if (sigsetjmp(_jmpbuf, 0) == 0) {
    3.35      // make sure we can see in the signal handler that we have crash protection
    3.36      // installed
    3.37      WatcherThread::watcher_thread()->set_crash_protection(this);
    3.38 @@ -285,6 +293,7 @@
    3.39      return true;
    3.40    }
    3.41    // this happens when we siglongjmp() back
    3.42 +  pthread_sigmask(SIG_SETMASK, &saved_sig_mask, NULL);
    3.43    WatcherThread::watcher_thread()->set_crash_protection(NULL);
    3.44    return false;
    3.45  }
     4.1 --- a/src/share/vm/adlc/arena.cpp	Fri Aug 30 11:54:14 2013 -0400
     4.2 +++ b/src/share/vm/adlc/arena.cpp	Fri Aug 30 12:22:02 2013 -0400
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -24,7 +24,7 @@
    4.11  
    4.12  #include "adlc.hpp"
    4.13  
    4.14 -void* Chunk::operator new(size_t requested_size, size_t length) {
    4.15 +void* Chunk::operator new(size_t requested_size, size_t length) throw() {
    4.16    return CHeapObj::operator new(requested_size + length);
    4.17  }
    4.18  
    4.19 @@ -163,7 +163,7 @@
    4.20  //-----------------------------------------------------------------------------
    4.21  // CHeapObj
    4.22  
    4.23 -void* CHeapObj::operator new(size_t size){
    4.24 +void* CHeapObj::operator new(size_t size) throw() {
    4.25    return (void *) malloc(size);
    4.26  }
    4.27  
     5.1 --- a/src/share/vm/adlc/arena.hpp	Fri Aug 30 11:54:14 2013 -0400
     5.2 +++ b/src/share/vm/adlc/arena.hpp	Fri Aug 30 12:22:02 2013 -0400
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -42,7 +42,7 @@
    5.11  
    5.12  class CHeapObj {
    5.13   public:
    5.14 -  void* operator new(size_t size);
    5.15 +  void* operator new(size_t size) throw();
    5.16    void  operator delete(void* p);
    5.17    void* new_array(size_t size);
    5.18  };
    5.19 @@ -53,7 +53,7 @@
    5.20  
    5.21  class ValueObj {
    5.22   public:
    5.23 -  void* operator new(size_t size);
    5.24 +  void* operator new(size_t size) throw();
    5.25    void operator delete(void* p);
    5.26  };
    5.27  
    5.28 @@ -61,7 +61,7 @@
    5.29  
    5.30  class AllStatic {
    5.31   public:
    5.32 -  void* operator new(size_t size);
    5.33 +  void* operator new(size_t size) throw();
    5.34    void operator delete(void* p);
    5.35  };
    5.36  
    5.37 @@ -70,7 +70,7 @@
    5.38  // Linked list of raw memory chunks
    5.39  class Chunk: public CHeapObj {
    5.40   public:
    5.41 -  void* operator new(size_t size, size_t length);
    5.42 +  void* operator new(size_t size, size_t length) throw();
    5.43    void  operator delete(void* p, size_t length);
    5.44    Chunk(size_t length);
    5.45  
     6.1 --- a/src/share/vm/adlc/main.cpp	Fri Aug 30 11:54:14 2013 -0400
     6.2 +++ b/src/share/vm/adlc/main.cpp	Fri Aug 30 12:22:02 2013 -0400
     6.3 @@ -1,5 +1,5 @@
     6.4  /*
     6.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     6.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     6.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8   *
     6.9   * This code is free software; you can redistribute it and/or modify it
    6.10 @@ -485,7 +485,7 @@
    6.11  
    6.12  // VS2005 has its own definition, identical to this one.
    6.13  #if !defined(_WIN32) || defined(_WIN64) || _MSC_VER < 1400
    6.14 -void *operator new( size_t size, int, const char *, int ) {
    6.15 +void *operator new( size_t size, int, const char *, int ) throw() {
    6.16    return ::operator new( size );
    6.17  }
    6.18  #endif
     7.1 --- a/src/share/vm/asm/codeBuffer.hpp	Fri Aug 30 11:54:14 2013 -0400
     7.2 +++ b/src/share/vm/asm/codeBuffer.hpp	Fri Aug 30 12:22:02 2013 -0400
     7.3 @@ -1,5 +1,5 @@
     7.4  /*
     7.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     7.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     7.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.8   *
     7.9   * This code is free software; you can redistribute it and/or modify it
    7.10 @@ -296,8 +296,8 @@
    7.11    // CodeBuffers must be allocated on the stack except for a single
    7.12    // special case during expansion which is handled internally.  This
    7.13    // is done to guarantee proper cleanup of resources.
    7.14 -  void* operator new(size_t size) { return ResourceObj::operator new(size); }
    7.15 -  void  operator delete(void* p)  { ShouldNotCallThis(); }
    7.16 +  void* operator new(size_t size) throw() { return ResourceObj::operator new(size); }
    7.17 +  void  operator delete(void* p)          { ShouldNotCallThis(); }
    7.18  
    7.19   public:
    7.20    typedef int csize_t;  // code size type; would be size_t except for history
     8.1 --- a/src/share/vm/c1/c1_Compilation.hpp	Fri Aug 30 11:54:14 2013 -0400
     8.2 +++ b/src/share/vm/c1/c1_Compilation.hpp	Fri Aug 30 12:22:02 2013 -0400
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -279,8 +279,8 @@
    8.11  // Base class for objects allocated by the compiler in the compilation arena
    8.12  class CompilationResourceObj ALLOCATION_SUPER_CLASS_SPEC {
    8.13   public:
    8.14 -  void* operator new(size_t size) { return Compilation::current()->arena()->Amalloc(size); }
    8.15 -  void* operator new(size_t size, Arena* arena) {
    8.16 +  void* operator new(size_t size) throw() { return Compilation::current()->arena()->Amalloc(size); }
    8.17 +  void* operator new(size_t size, Arena* arena) throw() {
    8.18      return arena->Amalloc(size);
    8.19    }
    8.20    void  operator delete(void* p) {} // nothing to do
     9.1 --- a/src/share/vm/c1/c1_Instruction.hpp	Fri Aug 30 11:54:14 2013 -0400
     9.2 +++ b/src/share/vm/c1/c1_Instruction.hpp	Fri Aug 30 12:22:02 2013 -0400
     9.3 @@ -1,5 +1,5 @@
     9.4  /*
     9.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     9.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     9.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.8   *
     9.9   * This code is free software; you can redistribute it and/or modify it
    9.10 @@ -323,7 +323,7 @@
    9.11    }
    9.12  
    9.13   public:
    9.14 -  void* operator new(size_t size) {
    9.15 +  void* operator new(size_t size) throw() {
    9.16      Compilation* c = Compilation::current();
    9.17      void* res = c->arena()->Amalloc(size);
    9.18      ((Instruction*)res)->_id = c->get_next_id();
    9.19 @@ -1611,7 +1611,7 @@
    9.20    friend class SuxAndWeightAdjuster;
    9.21  
    9.22   public:
    9.23 -   void* operator new(size_t size) {
    9.24 +   void* operator new(size_t size) throw() {
    9.25      Compilation* c = Compilation::current();
    9.26      void* res = c->arena()->Amalloc(size);
    9.27      ((BlockBegin*)res)->_id = c->get_next_id();
    10.1 --- a/src/share/vm/classfile/verifier.cpp	Fri Aug 30 11:54:14 2013 -0400
    10.2 +++ b/src/share/vm/classfile/verifier.cpp	Fri Aug 30 12:22:02 2013 -0400
    10.3 @@ -2318,9 +2318,6 @@
    10.4        types = 1 << JVM_CONSTANT_InvokeDynamic;
    10.5        break;
    10.6      case Bytecodes::_invokespecial:
    10.7 -      types = (1 << JVM_CONSTANT_InterfaceMethodref) |
    10.8 -              (1 << JVM_CONSTANT_Methodref);
    10.9 -      break;
   10.10      case Bytecodes::_invokestatic:
   10.11        types = (_klass->major_version() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ?
   10.12          (1 << JVM_CONSTANT_Methodref) :
    11.1 --- a/src/share/vm/code/codeBlob.cpp	Fri Aug 30 11:54:14 2013 -0400
    11.2 +++ b/src/share/vm/code/codeBlob.cpp	Fri Aug 30 12:22:02 2013 -0400
    11.3 @@ -1,5 +1,5 @@
    11.4  /*
    11.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
    11.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    11.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8   *
    11.9   * This code is free software; you can redistribute it and/or modify it
   11.10 @@ -245,7 +245,7 @@
   11.11  }
   11.12  
   11.13  
   11.14 -void* BufferBlob::operator new(size_t s, unsigned size) {
   11.15 +void* BufferBlob::operator new(size_t s, unsigned size) throw() {
   11.16    void* p = CodeCache::allocate(size);
   11.17    return p;
   11.18  }
   11.19 @@ -347,14 +347,14 @@
   11.20  }
   11.21  
   11.22  
   11.23 -void* RuntimeStub::operator new(size_t s, unsigned size) {
   11.24 +void* RuntimeStub::operator new(size_t s, unsigned size) throw() {
   11.25    void* p = CodeCache::allocate(size, true);
   11.26    if (!p) fatal("Initial size of CodeCache is too small");
   11.27    return p;
   11.28  }
   11.29  
   11.30  // operator new shared by all singletons:
   11.31 -void* SingletonBlob::operator new(size_t s, unsigned size) {
   11.32 +void* SingletonBlob::operator new(size_t s, unsigned size) throw() {
   11.33    void* p = CodeCache::allocate(size, true);
   11.34    if (!p) fatal("Initial size of CodeCache is too small");
   11.35    return p;
    12.1 --- a/src/share/vm/code/codeBlob.hpp	Fri Aug 30 11:54:14 2013 -0400
    12.2 +++ b/src/share/vm/code/codeBlob.hpp	Fri Aug 30 12:22:02 2013 -0400
    12.3 @@ -1,5 +1,5 @@
    12.4  /*
    12.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
    12.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    12.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    12.8   *
    12.9   * This code is free software; you can redistribute it and/or modify it
   12.10 @@ -209,7 +209,7 @@
   12.11    BufferBlob(const char* name, int size);
   12.12    BufferBlob(const char* name, int size, CodeBuffer* cb);
   12.13  
   12.14 -  void* operator new(size_t s, unsigned size);
   12.15 +  void* operator new(size_t s, unsigned size) throw();
   12.16  
   12.17   public:
   12.18    // Creation
   12.19 @@ -283,7 +283,7 @@
   12.20      bool        caller_must_gc_arguments
   12.21    );
   12.22  
   12.23 -  void* operator new(size_t s, unsigned size);
   12.24 +  void* operator new(size_t s, unsigned size) throw();
   12.25  
   12.26   public:
   12.27    // Creation
   12.28 @@ -321,7 +321,7 @@
   12.29    friend class VMStructs;
   12.30  
   12.31   protected:
   12.32 -  void* operator new(size_t s, unsigned size);
   12.33 +  void* operator new(size_t s, unsigned size) throw();
   12.34  
   12.35   public:
   12.36     SingletonBlob(
    13.1 --- a/src/share/vm/code/debugInfoRec.cpp	Fri Aug 30 11:54:14 2013 -0400
    13.2 +++ b/src/share/vm/code/debugInfoRec.cpp	Fri Aug 30 12:22:02 2013 -0400
    13.3 @@ -1,5 +1,5 @@
    13.4  /*
    13.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
    13.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    13.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.8   *
    13.9   * This code is free software; you can redistribute it and/or modify it
   13.10 @@ -38,7 +38,7 @@
   13.11    int  _length; // number of bytes in the stream
   13.12    int  _hash;   // hash of stream bytes (for quicker reuse)
   13.13  
   13.14 -  void* operator new(size_t ignore, DebugInformationRecorder* dir) {
   13.15 +  void* operator new(size_t ignore, DebugInformationRecorder* dir) throw() {
   13.16      assert(ignore == sizeof(DIR_Chunk), "");
   13.17      if (dir->_next_chunk >= dir->_next_chunk_limit) {
   13.18        const int CHUNK = 100;
    14.1 --- a/src/share/vm/code/nmethod.cpp	Fri Aug 30 11:54:14 2013 -0400
    14.2 +++ b/src/share/vm/code/nmethod.cpp	Fri Aug 30 12:22:02 2013 -0400
    14.3 @@ -1,5 +1,5 @@
    14.4  /*
    14.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    14.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    14.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.8   *
    14.9   * This code is free software; you can redistribute it and/or modify it
   14.10 @@ -800,7 +800,7 @@
   14.11  }
   14.12  #endif // def HAVE_DTRACE_H
   14.13  
   14.14 -void* nmethod::operator new(size_t size, int nmethod_size) throw () {
   14.15 +void* nmethod::operator new(size_t size, int nmethod_size) throw() {
   14.16    // Not critical, may return null if there is too little continuous memory
   14.17    return CodeCache::allocate(nmethod_size);
   14.18  }
    15.1 --- a/src/share/vm/code/nmethod.hpp	Fri Aug 30 11:54:14 2013 -0400
    15.2 +++ b/src/share/vm/code/nmethod.hpp	Fri Aug 30 12:22:02 2013 -0400
    15.3 @@ -1,5 +1,5 @@
    15.4  /*
    15.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    15.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    15.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.8   *
    15.9   * This code is free software; you can redistribute it and/or modify it
   15.10 @@ -265,7 +265,7 @@
   15.11            int comp_level);
   15.12  
   15.13    // helper methods
   15.14 -  void* operator new(size_t size, int nmethod_size);
   15.15 +  void* operator new(size_t size, int nmethod_size) throw();
   15.16  
   15.17    const char* reloc_string_for(u_char* begin, u_char* end);
   15.18    // Returns true if this thread changed the state of the nmethod or
    16.1 --- a/src/share/vm/code/relocInfo.hpp	Fri Aug 30 11:54:14 2013 -0400
    16.2 +++ b/src/share/vm/code/relocInfo.hpp	Fri Aug 30 12:22:02 2013 -0400
    16.3 @@ -1,5 +1,5 @@
    16.4  /*
    16.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    16.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    16.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.8   *
    16.9   * This code is free software; you can redistribute it and/or modify it
   16.10 @@ -677,7 +677,7 @@
   16.11    }
   16.12  
   16.13   public:
   16.14 -  void* operator new(size_t size, const RelocationHolder& holder) {
   16.15 +  void* operator new(size_t size, const RelocationHolder& holder) throw() {
   16.16      if (size > sizeof(holder._relocbuf)) guarantee_size();
   16.17      assert((void* const *)holder.reloc() == &holder._relocbuf[0], "ptrs must agree");
   16.18      return holder.reloc();
    17.1 --- a/src/share/vm/code/vtableStubs.cpp	Fri Aug 30 11:54:14 2013 -0400
    17.2 +++ b/src/share/vm/code/vtableStubs.cpp	Fri Aug 30 12:22:02 2013 -0400
    17.3 @@ -1,5 +1,5 @@
    17.4  /*
    17.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    17.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    17.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.8   *
    17.9   * This code is free software; you can redistribute it and/or modify it
   17.10 @@ -49,7 +49,7 @@
   17.11  static int num_vtable_chunks = 0;
   17.12  
   17.13  
   17.14 -void* VtableStub::operator new(size_t size, int code_size) {
   17.15 +void* VtableStub::operator new(size_t size, int code_size) throw() {
   17.16    assert(size == sizeof(VtableStub), "mismatched size");
   17.17    num_vtable_chunks++;
   17.18    // compute real VtableStub size (rounded to nearest word)
    18.1 --- a/src/share/vm/code/vtableStubs.hpp	Fri Aug 30 11:54:14 2013 -0400
    18.2 +++ b/src/share/vm/code/vtableStubs.hpp	Fri Aug 30 12:22:02 2013 -0400
    18.3 @@ -1,5 +1,5 @@
    18.4  /*
    18.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    18.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    18.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.8   *
    18.9   * This code is free software; you can redistribute it and/or modify it
   18.10 @@ -46,7 +46,7 @@
   18.11    bool           _is_vtable_stub;    // True if vtable stub, false, is itable stub
   18.12    /* code follows here */            // The vtableStub code
   18.13  
   18.14 -  void* operator new(size_t size, int code_size);
   18.15 +  void* operator new(size_t size, int code_size) throw();
   18.16  
   18.17    VtableStub(bool is_vtable_stub, int index)
   18.18          : _next(NULL), _is_vtable_stub(is_vtable_stub),
    19.1 --- a/src/share/vm/gc_implementation/shared/gcUtil.hpp	Fri Aug 30 11:54:14 2013 -0400
    19.2 +++ b/src/share/vm/gc_implementation/shared/gcUtil.hpp	Fri Aug 30 12:22:02 2013 -0400
    19.3 @@ -1,5 +1,5 @@
    19.4  /*
    19.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
    19.6 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    19.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.8   *
    19.9   * This code is free software; you can redistribute it and/or modify it
   19.10 @@ -144,9 +144,9 @@
   19.11      _padded_avg(0.0), _deviation(0.0), _padding(padding) {}
   19.12  
   19.13    // Placement support
   19.14 -  void* operator new(size_t ignored, void* p) { return p; }
   19.15 +  void* operator new(size_t ignored, void* p) throw() { return p; }
   19.16    // Allocator
   19.17 -  void* operator new(size_t size) { return CHeapObj<mtGC>::operator new(size); }
   19.18 +  void* operator new(size_t size) throw() { return CHeapObj<mtGC>::operator new(size); }
   19.19  
   19.20    // Accessor
   19.21    float padded_average() const         { return _padded_avg; }
    20.1 --- a/src/share/vm/libadt/port.hpp	Fri Aug 30 11:54:14 2013 -0400
    20.2 +++ b/src/share/vm/libadt/port.hpp	Fri Aug 30 12:22:02 2013 -0400
    20.3 @@ -1,5 +1,5 @@
    20.4  /*
    20.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    20.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    20.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.8   *
    20.9   * This code is free software; you can redistribute it and/or modify it
   20.10 @@ -163,8 +163,8 @@
   20.11  extern void *safe_calloc (const char *file, unsigned line, unsigned nitems, unsigned size);
   20.12  extern void *safe_realloc(const char *file, unsigned line, void *ptr, unsigned size);
   20.13  extern char *safe_strdup (const char *file, unsigned line, const char *src);
   20.14 -inline void *operator new( size_t size ) { return malloc(size); }
   20.15 -inline void operator delete( void *ptr ) { free(ptr); }
   20.16 +inline void *operator new( size_t size ) throw() { return malloc(size); }
   20.17 +inline void operator delete( void *ptr )         { free(ptr); }
   20.18  #endif
   20.19  
   20.20  //-----------------------------------------------------------------------------
    21.1 --- a/src/share/vm/memory/allocation.cpp	Fri Aug 30 11:54:14 2013 -0400
    21.2 +++ b/src/share/vm/memory/allocation.cpp	Fri Aug 30 12:22:02 2013 -0400
    21.3 @@ -49,19 +49,19 @@
    21.4  # include "os_bsd.inline.hpp"
    21.5  #endif
    21.6  
    21.7 -void* StackObj::operator new(size_t size)       { ShouldNotCallThis(); return 0; }
    21.8 -void  StackObj::operator delete(void* p)        { ShouldNotCallThis(); }
    21.9 -void* StackObj::operator new [](size_t size)    { ShouldNotCallThis(); return 0; }
   21.10 -void  StackObj::operator delete [](void* p)     { ShouldNotCallThis(); }
   21.11 +void* StackObj::operator new(size_t size)     throw() { ShouldNotCallThis(); return 0; }
   21.12 +void  StackObj::operator delete(void* p)              { ShouldNotCallThis(); }
   21.13 +void* StackObj::operator new [](size_t size)  throw() { ShouldNotCallThis(); return 0; }
   21.14 +void  StackObj::operator delete [](void* p)           { ShouldNotCallThis(); }
   21.15  
   21.16 -void* _ValueObj::operator new(size_t size)      { ShouldNotCallThis(); return 0; }
   21.17 -void  _ValueObj::operator delete(void* p)       { ShouldNotCallThis(); }
   21.18 -void* _ValueObj::operator new [](size_t size)   { ShouldNotCallThis(); return 0; }
   21.19 -void  _ValueObj::operator delete [](void* p)    { ShouldNotCallThis(); }
   21.20 +void* _ValueObj::operator new(size_t size)    throw() { ShouldNotCallThis(); return 0; }
   21.21 +void  _ValueObj::operator delete(void* p)             { ShouldNotCallThis(); }
   21.22 +void* _ValueObj::operator new [](size_t size) throw() { ShouldNotCallThis(); return 0; }
   21.23 +void  _ValueObj::operator delete [](void* p)          { ShouldNotCallThis(); }
   21.24  
   21.25  void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data,
   21.26                                   size_t word_size, bool read_only,
   21.27 -                                 MetaspaceObj::Type type, TRAPS) {
   21.28 +                                 MetaspaceObj::Type type, TRAPS) throw() {
   21.29    // Klass has it's own operator new
   21.30    return Metaspace::allocate(loader_data, word_size, read_only,
   21.31                               type, CHECK_NULL);
   21.32 @@ -80,7 +80,7 @@
   21.33    st->print(" {"INTPTR_FORMAT"}", this);
   21.34  }
   21.35  
   21.36 -void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) {
   21.37 +void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
   21.38    address res;
   21.39    switch (type) {
   21.40     case C_HEAP:
   21.41 @@ -97,12 +97,12 @@
   21.42    return res;
   21.43  }
   21.44  
   21.45 -void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) {
   21.46 +void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) throw() {
   21.47    return (address) operator new(size, type, flags);
   21.48  }
   21.49  
   21.50  void* ResourceObj::operator new(size_t size, const std::nothrow_t&  nothrow_constant,
   21.51 -    allocation_type type, MEMFLAGS flags) {
   21.52 +    allocation_type type, MEMFLAGS flags) throw() {
   21.53    //should only call this with std::nothrow, use other operator new() otherwise
   21.54    address res;
   21.55    switch (type) {
   21.56 @@ -121,7 +121,7 @@
   21.57  }
   21.58  
   21.59  void* ResourceObj::operator new [](size_t size, const std::nothrow_t&  nothrow_constant,
   21.60 -    allocation_type type, MEMFLAGS flags) {
   21.61 +    allocation_type type, MEMFLAGS flags) throw() {
   21.62    return (address)operator new(size, nothrow_constant, type, flags);
   21.63  }
   21.64  
   21.65 @@ -370,7 +370,7 @@
   21.66  //--------------------------------------------------------------------------------------
   21.67  // Chunk implementation
   21.68  
   21.69 -void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode, size_t length) {
   21.70 +void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode, size_t length) throw() {
   21.71    // requested_size is equal to sizeof(Chunk) but in order for the arena
   21.72    // allocations to come out aligned as expected the size must be aligned
   21.73    // to expected arena alignment.
   21.74 @@ -478,18 +478,18 @@
   21.75    NOT_PRODUCT(Atomic::dec(&_instance_count);)
   21.76  }
   21.77  
   21.78 -void* Arena::operator new(size_t size) {
   21.79 +void* Arena::operator new(size_t size) throw() {
   21.80    assert(false, "Use dynamic memory type binding");
   21.81    return NULL;
   21.82  }
   21.83  
   21.84 -void* Arena::operator new (size_t size, const std::nothrow_t&  nothrow_constant) {
   21.85 +void* Arena::operator new (size_t size, const std::nothrow_t&  nothrow_constant) throw() {
   21.86    assert(false, "Use dynamic memory type binding");
   21.87    return NULL;
   21.88  }
   21.89  
   21.90    // dynamic memory type binding
   21.91 -void* Arena::operator new(size_t size, MEMFLAGS flags) {
   21.92 +void* Arena::operator new(size_t size, MEMFLAGS flags) throw() {
   21.93  #ifdef ASSERT
   21.94    void* p = (void*)AllocateHeap(size, flags|otArena, CALLER_PC);
   21.95    if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p);
   21.96 @@ -499,7 +499,7 @@
   21.97  #endif
   21.98  }
   21.99  
  21.100 -void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) {
  21.101 +void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() {
  21.102  #ifdef ASSERT
  21.103    void* p = os::malloc(size, flags|otArena, CALLER_PC);
  21.104    if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p);
  21.105 @@ -688,22 +688,22 @@
  21.106  // define ALLOW_OPERATOR_NEW_USAGE for platform on which global operator new allowed.
  21.107  //
  21.108  #ifndef ALLOW_OPERATOR_NEW_USAGE
  21.109 -void* operator new(size_t size){
  21.110 +void* operator new(size_t size) throw() {
  21.111    assert(false, "Should not call global operator new");
  21.112    return 0;
  21.113  }
  21.114  
  21.115 -void* operator new [](size_t size){
  21.116 +void* operator new [](size_t size) throw() {
  21.117    assert(false, "Should not call global operator new[]");
  21.118    return 0;
  21.119  }
  21.120  
  21.121 -void* operator new(size_t size, const std::nothrow_t&  nothrow_constant){
  21.122 +void* operator new(size_t size, const std::nothrow_t&  nothrow_constant) throw() {
  21.123    assert(false, "Should not call global operator new");
  21.124    return 0;
  21.125  }
  21.126  
  21.127 -void* operator new [](size_t size, std::nothrow_t&  nothrow_constant){
  21.128 +void* operator new [](size_t size, std::nothrow_t&  nothrow_constant) throw() {
  21.129    assert(false, "Should not call global operator new[]");
  21.130    return 0;
  21.131  }
    22.1 --- a/src/share/vm/memory/allocation.hpp	Fri Aug 30 11:54:14 2013 -0400
    22.2 +++ b/src/share/vm/memory/allocation.hpp	Fri Aug 30 12:22:02 2013 -0400
    22.3 @@ -204,12 +204,12 @@
    22.4  
    22.5  template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC {
    22.6   public:
    22.7 -  _NOINLINE_ void* operator new(size_t size, address caller_pc = 0);
    22.8 +  _NOINLINE_ void* operator new(size_t size, address caller_pc = 0) throw();
    22.9    _NOINLINE_ void* operator new (size_t size, const std::nothrow_t&  nothrow_constant,
   22.10 -                               address caller_pc = 0);
   22.11 -  _NOINLINE_ void* operator new [](size_t size, address caller_pc = 0);
   22.12 +                               address caller_pc = 0) throw();
   22.13 +  _NOINLINE_ void* operator new [](size_t size, address caller_pc = 0) throw();
   22.14    _NOINLINE_ void* operator new [](size_t size, const std::nothrow_t&  nothrow_constant,
   22.15 -                               address caller_pc = 0);
   22.16 +                               address caller_pc = 0) throw();
   22.17    void  operator delete(void* p);
   22.18    void  operator delete [] (void* p);
   22.19  };
   22.20 @@ -219,9 +219,9 @@
   22.21  
   22.22  class StackObj ALLOCATION_SUPER_CLASS_SPEC {
   22.23   private:
   22.24 -  void* operator new(size_t size);
   22.25 +  void* operator new(size_t size) throw();
   22.26    void  operator delete(void* p);
   22.27 -  void* operator new [](size_t size);
   22.28 +  void* operator new [](size_t size) throw();
   22.29    void  operator delete [](void* p);
   22.30  };
   22.31  
   22.32 @@ -245,9 +245,9 @@
   22.33  //
   22.34  class _ValueObj {
   22.35   private:
   22.36 -  void* operator new(size_t size);
   22.37 +  void* operator new(size_t size) throw();
   22.38    void  operator delete(void* p);
   22.39 -  void* operator new [](size_t size);
   22.40 +  void* operator new [](size_t size) throw();
   22.41    void  operator delete [](void* p);
   22.42  };
   22.43  
   22.44 @@ -316,7 +316,7 @@
   22.45  
   22.46    void* operator new(size_t size, ClassLoaderData* loader_data,
   22.47                       size_t word_size, bool read_only,
   22.48 -                     Type type, Thread* thread);
   22.49 +                     Type type, Thread* thread) throw();
   22.50                       // can't use TRAPS from this header file.
   22.51    void operator delete(void* p) { ShouldNotCallThis(); }
   22.52  };
   22.53 @@ -339,7 +339,7 @@
   22.54    Chunk*       _next;     // Next Chunk in list
   22.55    const size_t _len;      // Size of this Chunk
   22.56   public:
   22.57 -  void* operator new(size_t size, AllocFailType alloc_failmode, size_t length);
   22.58 +  void* operator new(size_t size, AllocFailType alloc_failmode, size_t length) throw();
   22.59    void  operator delete(void* p);
   22.60    Chunk(size_t length);
   22.61  
   22.62 @@ -422,12 +422,12 @@
   22.63    char* hwm() const             { return _hwm; }
   22.64  
   22.65    // new operators
   22.66 -  void* operator new (size_t size);
   22.67 -  void* operator new (size_t size, const std::nothrow_t& nothrow_constant);
   22.68 +  void* operator new (size_t size) throw();
   22.69 +  void* operator new (size_t size, const std::nothrow_t& nothrow_constant) throw();
   22.70  
   22.71    // dynamic memory type tagging
   22.72 -  void* operator new(size_t size, MEMFLAGS flags);
   22.73 -  void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags);
   22.74 +  void* operator new(size_t size, MEMFLAGS flags) throw();
   22.75 +  void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw();
   22.76    void  operator delete(void* p);
   22.77  
   22.78    // Fast allocate in the arena.  Common case is: pointer test + increment.
   22.79 @@ -583,44 +583,44 @@
   22.80  #endif // ASSERT
   22.81  
   22.82   public:
   22.83 -  void* operator new(size_t size, allocation_type type, MEMFLAGS flags);
   22.84 -  void* operator new [](size_t size, allocation_type type, MEMFLAGS flags);
   22.85 +  void* operator new(size_t size, allocation_type type, MEMFLAGS flags) throw();
   22.86 +  void* operator new [](size_t size, allocation_type type, MEMFLAGS flags) throw();
   22.87    void* operator new(size_t size, const std::nothrow_t&  nothrow_constant,
   22.88 -      allocation_type type, MEMFLAGS flags);
   22.89 +      allocation_type type, MEMFLAGS flags) throw();
   22.90    void* operator new [](size_t size, const std::nothrow_t&  nothrow_constant,
   22.91 -      allocation_type type, MEMFLAGS flags);
   22.92 +      allocation_type type, MEMFLAGS flags) throw();
   22.93  
   22.94 -  void* operator new(size_t size, Arena *arena) {
   22.95 +  void* operator new(size_t size, Arena *arena) throw() {
   22.96        address res = (address)arena->Amalloc(size);
   22.97        DEBUG_ONLY(set_allocation_type(res, ARENA);)
   22.98        return res;
   22.99    }
  22.100  
  22.101 -  void* operator new [](size_t size, Arena *arena) {
  22.102 +  void* operator new [](size_t size, Arena *arena) throw() {
  22.103        address res = (address)arena->Amalloc(size);
  22.104        DEBUG_ONLY(set_allocation_type(res, ARENA);)
  22.105        return res;
  22.106    }
  22.107  
  22.108 -  void* operator new(size_t size) {
  22.109 +  void* operator new(size_t size) throw() {
  22.110        address res = (address)resource_allocate_bytes(size);
  22.111        DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
  22.112        return res;
  22.113    }
  22.114  
  22.115 -  void* operator new(size_t size, const std::nothrow_t& nothrow_constant) {
  22.116 +  void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
  22.117        address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL);
  22.118        DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);)
  22.119        return res;
  22.120    }
  22.121  
  22.122 -  void* operator new [](size_t size) {
  22.123 +  void* operator new [](size_t size) throw() {
  22.124        address res = (address)resource_allocate_bytes(size);
  22.125        DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
  22.126        return res;
  22.127    }
  22.128  
  22.129 -  void* operator new [](size_t size, const std::nothrow_t& nothrow_constant) {
  22.130 +  void* operator new [](size_t size, const std::nothrow_t& nothrow_constant) throw() {
  22.131        address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL);
  22.132        DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);)
  22.133        return res;
    23.1 --- a/src/share/vm/memory/allocation.inline.hpp	Fri Aug 30 11:54:14 2013 -0400
    23.2 +++ b/src/share/vm/memory/allocation.inline.hpp	Fri Aug 30 12:22:02 2013 -0400
    23.3 @@ -85,7 +85,7 @@
    23.4  
    23.5  
    23.6  template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
    23.7 -      address caller_pc){
    23.8 +      address caller_pc) throw() {
    23.9      void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
   23.10  #ifdef ASSERT
   23.11      if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
   23.12 @@ -94,7 +94,7 @@
   23.13    }
   23.14  
   23.15  template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
   23.16 -  const std::nothrow_t&  nothrow_constant, address caller_pc) {
   23.17 +  const std::nothrow_t&  nothrow_constant, address caller_pc) throw() {
   23.18    void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
   23.19        AllocFailStrategy::RETURN_NULL);
   23.20  #ifdef ASSERT
   23.21 @@ -104,12 +104,12 @@
   23.22  }
   23.23  
   23.24  template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
   23.25 -      address caller_pc){
   23.26 +      address caller_pc) throw() {
   23.27      return CHeapObj<F>::operator new(size, caller_pc);
   23.28  }
   23.29  
   23.30  template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
   23.31 -  const std::nothrow_t&  nothrow_constant, address caller_pc) {
   23.32 +  const std::nothrow_t&  nothrow_constant, address caller_pc) throw() {
   23.33      return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc);
   23.34  }
   23.35  
    24.1 --- a/src/share/vm/memory/memRegion.cpp	Fri Aug 30 11:54:14 2013 -0400
    24.2 +++ b/src/share/vm/memory/memRegion.cpp	Fri Aug 30 12:22:02 2013 -0400
    24.3 @@ -1,5 +1,5 @@
    24.4  /*
    24.5 - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    24.6 + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    24.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    24.8   *
    24.9   * This code is free software; you can redistribute it and/or modify it
   24.10 @@ -102,11 +102,11 @@
   24.11    return MemRegion();
   24.12  }
   24.13  
   24.14 -void* MemRegion::operator new(size_t size) {
   24.15 +void* MemRegion::operator new(size_t size) throw() {
   24.16    return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
   24.17  }
   24.18  
   24.19 -void* MemRegion::operator new [](size_t size) {
   24.20 +void* MemRegion::operator new [](size_t size) throw() {
   24.21    return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
   24.22  }
   24.23  void  MemRegion::operator delete(void* p) {
    25.1 --- a/src/share/vm/memory/memRegion.hpp	Fri Aug 30 11:54:14 2013 -0400
    25.2 +++ b/src/share/vm/memory/memRegion.hpp	Fri Aug 30 12:22:02 2013 -0400
    25.3 @@ -1,5 +1,5 @@
    25.4  /*
    25.5 - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
    25.6 + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    25.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    25.8   *
    25.9   * This code is free software; you can redistribute it and/or modify it
   25.10 @@ -94,8 +94,8 @@
   25.11    size_t word_size() const { return _word_size; }
   25.12  
   25.13    bool is_empty() const { return word_size() == 0; }
   25.14 -  void* operator new(size_t size);
   25.15 -  void* operator new [](size_t size);
   25.16 +  void* operator new(size_t size) throw();
   25.17 +  void* operator new [](size_t size) throw();
   25.18    void  operator delete(void* p);
   25.19    void  operator delete [](void* p);
   25.20  };
   25.21 @@ -111,13 +111,13 @@
   25.22  
   25.23  class MemRegionClosureRO: public MemRegionClosure {
   25.24  public:
   25.25 -  void* operator new(size_t size, ResourceObj::allocation_type type, MEMFLAGS flags) {
   25.26 +  void* operator new(size_t size, ResourceObj::allocation_type type, MEMFLAGS flags) throw() {
   25.27          return ResourceObj::operator new(size, type, flags);
   25.28    }
   25.29 -  void* operator new(size_t size, Arena *arena) {
   25.30 +  void* operator new(size_t size, Arena *arena) throw() {
   25.31          return ResourceObj::operator new(size, arena);
   25.32    }
   25.33 -  void* operator new(size_t size) {
   25.34 +  void* operator new(size_t size) throw() {
   25.35          return ResourceObj::operator new(size);
   25.36    }
   25.37  
    26.1 --- a/src/share/vm/oops/klass.cpp	Fri Aug 30 11:54:14 2013 -0400
    26.2 +++ b/src/share/vm/oops/klass.cpp	Fri Aug 30 12:22:02 2013 -0400
    26.3 @@ -139,7 +139,7 @@
    26.4    return NULL;
    26.5  }
    26.6  
    26.7 -void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) {
    26.8 +void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw() {
    26.9    return Metaspace::allocate(loader_data, word_size, /*read_only*/false,
   26.10                               MetaspaceObj::ClassType, CHECK_NULL);
   26.11  }
    27.1 --- a/src/share/vm/oops/klass.hpp	Fri Aug 30 11:54:14 2013 -0400
    27.2 +++ b/src/share/vm/oops/klass.hpp	Fri Aug 30 12:22:02 2013 -0400
    27.3 @@ -179,7 +179,7 @@
    27.4    // Constructor
    27.5    Klass();
    27.6  
    27.7 -  void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS);
    27.8 +  void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw();
    27.9  
   27.10   public:
   27.11    bool is_klass() const volatile { return true; }
    28.1 --- a/src/share/vm/oops/symbol.cpp	Fri Aug 30 11:54:14 2013 -0400
    28.2 +++ b/src/share/vm/oops/symbol.cpp	Fri Aug 30 12:22:02 2013 -0400
    28.3 @@ -41,19 +41,19 @@
    28.4    }
    28.5  }
    28.6  
    28.7 -void* Symbol::operator new(size_t sz, int len, TRAPS) {
    28.8 +void* Symbol::operator new(size_t sz, int len, TRAPS) throw() {
    28.9    int alloc_size = size(len)*HeapWordSize;
   28.10    address res = (address) AllocateHeap(alloc_size, mtSymbol);
   28.11    return res;
   28.12  }
   28.13  
   28.14 -void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) {
   28.15 +void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) throw() {
   28.16    int alloc_size = size(len)*HeapWordSize;
   28.17    address res = (address)arena->Amalloc(alloc_size);
   28.18    return res;
   28.19  }
   28.20  
   28.21 -void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) {
   28.22 +void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) throw() {
   28.23    address res;
   28.24    int alloc_size = size(len)*HeapWordSize;
   28.25    res = (address) Metaspace::allocate(loader_data, size(len), true,
    29.1 --- a/src/share/vm/oops/symbol.hpp	Fri Aug 30 11:54:14 2013 -0400
    29.2 +++ b/src/share/vm/oops/symbol.hpp	Fri Aug 30 12:22:02 2013 -0400
    29.3 @@ -136,9 +136,9 @@
    29.4    }
    29.5  
    29.6    Symbol(const u1* name, int length, int refcount);
    29.7 -  void* operator new(size_t size, int len, TRAPS);
    29.8 -  void* operator new(size_t size, int len, Arena* arena, TRAPS);
    29.9 -  void* operator new(size_t size, int len, ClassLoaderData* loader_data, TRAPS);
   29.10 +  void* operator new(size_t size, int len, TRAPS) throw();
   29.11 +  void* operator new(size_t size, int len, Arena* arena, TRAPS) throw();
   29.12 +  void* operator new(size_t size, int len, ClassLoaderData* loader_data, TRAPS) throw();
   29.13  
   29.14    void  operator delete(void* p);
   29.15  
    30.1 --- a/src/share/vm/opto/callGenerator.hpp	Fri Aug 30 11:54:14 2013 -0400
    30.2 +++ b/src/share/vm/opto/callGenerator.hpp	Fri Aug 30 12:22:02 2013 -0400
    30.3 @@ -1,5 +1,5 @@
    30.4  /*
    30.5 - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
    30.6 + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    30.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    30.8   *
    30.9   * This code is free software; you can redistribute it and/or modify it
   30.10 @@ -260,7 +260,7 @@
   30.11    // Because WarmInfo objects live over the entire lifetime of the
   30.12    // Compile object, they are allocated into the comp_arena, which
   30.13    // does not get resource marked or reset during the compile process
   30.14 -  void *operator new( size_t x, Compile* C ) { return C->comp_arena()->Amalloc(x); }
   30.15 +  void *operator new( size_t x, Compile* C ) throw() { return C->comp_arena()->Amalloc(x); }
   30.16    void operator delete( void * ) { } // fast deallocation
   30.17  
   30.18    static WarmCallInfo* always_hot();
    31.1 --- a/src/share/vm/opto/callnode.hpp	Fri Aug 30 11:54:14 2013 -0400
    31.2 +++ b/src/share/vm/opto/callnode.hpp	Fri Aug 30 12:22:02 2013 -0400
    31.3 @@ -1,5 +1,5 @@
    31.4  /*
    31.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    31.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    31.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    31.8   *
    31.9   * This code is free software; you can redistribute it and/or modify it
   31.10 @@ -216,7 +216,7 @@
   31.11    // Because JVMState objects live over the entire lifetime of the
   31.12    // Compile object, they are allocated into the comp_arena, which
   31.13    // does not get resource marked or reset during the compile process
   31.14 -  void *operator new( size_t x, Compile* C ) { return C->comp_arena()->Amalloc(x); }
   31.15 +  void *operator new( size_t x, Compile* C ) throw() { return C->comp_arena()->Amalloc(x); }
   31.16    void operator delete( void * ) { } // fast deallocation
   31.17  
   31.18    // Create a new JVMState, ready for abstract interpretation.
    32.1 --- a/src/share/vm/opto/machnode.hpp	Fri Aug 30 11:54:14 2013 -0400
    32.2 +++ b/src/share/vm/opto/machnode.hpp	Fri Aug 30 12:22:02 2013 -0400
    32.3 @@ -1,5 +1,5 @@
    32.4  /*
    32.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    32.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    32.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    32.8   *
    32.9   * This code is free software; you can redistribute it and/or modify it
   32.10 @@ -58,7 +58,7 @@
   32.11  class MachOper : public ResourceObj {
   32.12  public:
   32.13    // Allocate right next to the MachNodes in the same arena
   32.14 -  void *operator new( size_t x, Compile* C ) { return C->node_arena()->Amalloc_D(x); }
   32.15 +  void *operator new( size_t x, Compile* C ) throw() { return C->node_arena()->Amalloc_D(x); }
   32.16  
   32.17    // Opcode
   32.18    virtual uint opcode() const = 0;
    33.1 --- a/src/share/vm/opto/node.hpp	Fri Aug 30 11:54:14 2013 -0400
    33.2 +++ b/src/share/vm/opto/node.hpp	Fri Aug 30 12:22:02 2013 -0400
    33.3 @@ -1,5 +1,5 @@
    33.4  /*
    33.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    33.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    33.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    33.8   *
    33.9   * This code is free software; you can redistribute it and/or modify it
   33.10 @@ -211,7 +211,7 @@
   33.11  
   33.12    // New Operator that takes a Compile pointer, this will eventually
   33.13    // be the "new" New operator.
   33.14 -  inline void* operator new( size_t x, Compile* C) {
   33.15 +  inline void* operator new( size_t x, Compile* C) throw() {
   33.16      Node* n = (Node*)C->node_arena()->Amalloc_D(x);
   33.17  #ifdef ASSERT
   33.18      n->_in = (Node**)n; // magic cookie for assertion check
    34.1 --- a/src/share/vm/opto/type.hpp	Fri Aug 30 11:54:14 2013 -0400
    34.2 +++ b/src/share/vm/opto/type.hpp	Fri Aug 30 12:22:02 2013 -0400
    34.3 @@ -1,5 +1,5 @@
    34.4  /*
    34.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    34.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    34.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    34.8   *
    34.9   * This code is free software; you can redistribute it and/or modify it
   34.10 @@ -169,7 +169,7 @@
   34.11  
   34.12  public:
   34.13  
   34.14 -  inline void* operator new( size_t x ) {
   34.15 +  inline void* operator new( size_t x ) throw() {
   34.16      Compile* compile = Compile::current();
   34.17      compile->set_type_last_size(x);
   34.18      void *temp = compile->type_arena()->Amalloc_D(x);
    35.1 --- a/src/share/vm/runtime/fprofiler.cpp	Fri Aug 30 11:54:14 2013 -0400
    35.2 +++ b/src/share/vm/runtime/fprofiler.cpp	Fri Aug 30 12:22:02 2013 -0400
    35.3 @@ -264,7 +264,7 @@
    35.4  
    35.5   public:
    35.6  
    35.7 -  void* operator new(size_t size, ThreadProfiler* tp);
    35.8 +  void* operator new(size_t size, ThreadProfiler* tp) throw();
    35.9    void  operator delete(void* p);
   35.10  
   35.11    ProfilerNode() {
   35.12 @@ -373,7 +373,7 @@
   35.13    }
   35.14  };
   35.15  
   35.16 -void* ProfilerNode::operator new(size_t size, ThreadProfiler* tp){
   35.17 +void* ProfilerNode::operator new(size_t size, ThreadProfiler* tp) throw() {
   35.18    void* result = (void*) tp->area_top;
   35.19    tp->area_top += size;
   35.20  
    36.1 --- a/src/share/vm/runtime/handles.cpp	Fri Aug 30 11:54:14 2013 -0400
    36.2 +++ b/src/share/vm/runtime/handles.cpp	Fri Aug 30 12:22:02 2013 -0400
    36.3 @@ -1,5 +1,5 @@
    36.4  /*
    36.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    36.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    36.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    36.8   *
    36.9   * This code is free software; you can redistribute it and/or modify it
   36.10 @@ -179,11 +179,11 @@
   36.11    _thread->set_last_handle_mark(previous_handle_mark());
   36.12  }
   36.13  
   36.14 -void* HandleMark::operator new(size_t size) {
   36.15 +void* HandleMark::operator new(size_t size) throw() {
   36.16    return AllocateHeap(size, mtThread);
   36.17  }
   36.18  
   36.19 -void* HandleMark::operator new [] (size_t size) {
   36.20 +void* HandleMark::operator new [] (size_t size) throw() {
   36.21    return AllocateHeap(size, mtThread);
   36.22  }
   36.23  
    37.1 --- a/src/share/vm/runtime/handles.hpp	Fri Aug 30 11:54:14 2013 -0400
    37.2 +++ b/src/share/vm/runtime/handles.hpp	Fri Aug 30 12:22:02 2013 -0400
    37.3 @@ -309,8 +309,8 @@
    37.4    // called in the destructor of HandleMarkCleaner
    37.5    void pop_and_restore();
    37.6    // overloaded operators
    37.7 -  void* operator new(size_t size);
    37.8 -  void* operator new [](size_t size);
    37.9 +  void* operator new(size_t size) throw();
   37.10 +  void* operator new [](size_t size) throw();
   37.11    void operator delete(void* p);
   37.12    void operator delete[](void* p);
   37.13  };
    38.1 --- a/src/share/vm/runtime/interfaceSupport.hpp	Fri Aug 30 11:54:14 2013 -0400
    38.2 +++ b/src/share/vm/runtime/interfaceSupport.hpp	Fri Aug 30 12:22:02 2013 -0400
    38.3 @@ -1,5 +1,5 @@
    38.4  /*
    38.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    38.6 + * Copyright (c) 1997, 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 @@ -56,7 +56,7 @@
   38.11    }
   38.12  
   38.13   private:
   38.14 -  inline void* operator new(size_t size, void* ptr) {
   38.15 +  inline void* operator new(size_t size, void* ptr) throw() {
   38.16      return ptr;
   38.17    }
   38.18  };
    39.1 --- a/src/share/vm/runtime/objectMonitor.hpp	Fri Aug 30 11:54:14 2013 -0400
    39.2 +++ b/src/share/vm/runtime/objectMonitor.hpp	Fri Aug 30 12:22:02 2013 -0400
    39.3 @@ -312,10 +312,10 @@
    39.4   public:
    39.5    static int Knob_Verbose;
    39.6    static int Knob_SpinLimit;
    39.7 -  void* operator new (size_t size) {
    39.8 +  void* operator new (size_t size) throw() {
    39.9      return AllocateHeap(size, mtInternal);
   39.10    }
   39.11 -  void* operator new[] (size_t size) {
   39.12 +  void* operator new[] (size_t size) throw() {
   39.13      return operator new (size);
   39.14    }
   39.15    void operator delete(void* p) {
    40.1 --- a/src/share/vm/runtime/os.cpp	Fri Aug 30 11:54:14 2013 -0400
    40.2 +++ b/src/share/vm/runtime/os.cpp	Fri Aug 30 12:22:02 2013 -0400
    40.3 @@ -1424,44 +1424,6 @@
    40.4    return result;
    40.5  }
    40.6  
    40.7 -// Read file line by line, if line is longer than bsize,
    40.8 -// skip rest of line.
    40.9 -int os::get_line_chars(int fd, char* buf, const size_t bsize){
   40.10 -  size_t sz, i = 0;
   40.11 -
   40.12 -  // read until EOF, EOL or buf is full
   40.13 -  while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-2) && buf[i] != '\n') {
   40.14 -     ++i;
   40.15 -  }
   40.16 -
   40.17 -  if (buf[i] == '\n') {
   40.18 -    // EOL reached so ignore EOL character and return
   40.19 -
   40.20 -    buf[i] = 0;
   40.21 -    return (int) i;
   40.22 -  }
   40.23 -
   40.24 -  buf[i+1] = 0;
   40.25 -
   40.26 -  if (sz != 1) {
   40.27 -    // EOF reached. if we read chars before EOF return them and
   40.28 -    // return EOF on next call otherwise return EOF
   40.29 -
   40.30 -    return (i == 0) ? -1 : (int) i;
   40.31 -  }
   40.32 -
   40.33 -  // line is longer than size of buf, skip to EOL
   40.34 -  char ch;
   40.35 -  while (read(fd, &ch, 1) == 1 && ch != '\n') {
   40.36 -    // Do nothing
   40.37 -  }
   40.38 -
   40.39 -  // return initial part of line that fits in buf.
   40.40 -  // If we reached EOF, it will be returned on next call.
   40.41 -
   40.42 -  return (int) i;
   40.43 -}
   40.44 -
   40.45  void os::SuspendedThreadTask::run() {
   40.46    assert(Threads_lock->owned_by_self() || (_thread == VMThread::vm_thread()), "must have threads lock to call this");
   40.47    internal_do_task();
    41.1 --- a/src/share/vm/runtime/os.hpp	Fri Aug 30 11:54:14 2013 -0400
    41.2 +++ b/src/share/vm/runtime/os.hpp	Fri Aug 30 12:22:02 2013 -0400
    41.3 @@ -725,10 +725,6 @@
    41.4    // Hook for os specific jvm options that we don't want to abort on seeing
    41.5    static bool obsolete_option(const JavaVMOption *option);
    41.6  
    41.7 -  // Read file line by line. If line is longer than bsize,
    41.8 -  // rest of line is skipped. Returns number of bytes read or -1 on EOF
    41.9 -  static int get_line_chars(int fd, char *buf, const size_t bsize);
   41.10 -
   41.11    // Extensions
   41.12  #include "runtime/os_ext.hpp"
   41.13  
    42.1 --- a/src/share/vm/runtime/park.cpp	Fri Aug 30 11:54:14 2013 -0400
    42.2 +++ b/src/share/vm/runtime/park.cpp	Fri Aug 30 12:22:02 2013 -0400
    42.3 @@ -1,5 +1,5 @@
    42.4  /*
    42.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    42.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    42.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    42.8   *
    42.9   * This code is free software; you can redistribute it and/or modify it
   42.10 @@ -140,7 +140,7 @@
   42.11  // well as bank access imbalance on Niagara-like platforms,
   42.12  // although Niagara's hash function should help.
   42.13  
   42.14 -void * ParkEvent::operator new (size_t sz) {
   42.15 +void * ParkEvent::operator new (size_t sz) throw() {
   42.16    return (void *) ((intptr_t (AllocateHeap(sz + 256, mtInternal, CALLER_PC)) + 256) & -256) ;
   42.17  }
   42.18  
    43.1 --- a/src/share/vm/runtime/park.hpp	Fri Aug 30 11:54:14 2013 -0400
    43.2 +++ b/src/share/vm/runtime/park.hpp	Fri Aug 30 12:22:02 2013 -0400
    43.3 @@ -1,5 +1,5 @@
    43.4  /*
    43.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    43.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    43.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    43.8   *
    43.9   * This code is free software; you can redistribute it and/or modify it
   43.10 @@ -166,7 +166,7 @@
   43.11      // aligned on 256-byte address boundaries.  This ensures that the least
   43.12      // significant byte of a ParkEvent address is always 0.
   43.13  
   43.14 -    void * operator new (size_t sz) ;
   43.15 +    void * operator new (size_t sz) throw();
   43.16      void operator delete (void * a) ;
   43.17  
   43.18    public:
    44.1 --- a/src/share/vm/runtime/thread.hpp	Fri Aug 30 11:54:14 2013 -0400
    44.2 +++ b/src/share/vm/runtime/thread.hpp	Fri Aug 30 12:22:02 2013 -0400
    44.3 @@ -113,8 +113,9 @@
    44.4    // Support for forcing alignment of thread objects for biased locking
    44.5    void*       _real_malloc_address;
    44.6   public:
    44.7 -  void* operator new(size_t size) { return allocate(size, true); }
    44.8 -  void* operator new(size_t size, const std::nothrow_t& nothrow_constant) { return allocate(size, false); }
    44.9 +  void* operator new(size_t size) throw() { return allocate(size, true); }
   44.10 +  void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
   44.11 +    return allocate(size, false); }
   44.12    void  operator delete(void* p);
   44.13  
   44.14   protected:
    45.1 --- a/src/share/vm/services/memRecorder.hpp	Fri Aug 30 11:54:14 2013 -0400
    45.2 +++ b/src/share/vm/services/memRecorder.hpp	Fri Aug 30 12:22:02 2013 -0400
    45.3 @@ -53,13 +53,13 @@
    45.4      }
    45.5    }
    45.6  
    45.7 -  void* operator new(size_t size, const std::nothrow_t& nothrow_constant) {
    45.8 +  void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
    45.9      // the instance is part of memRecorder, needs to be tagged with 'otNMTRecorder'
   45.10      // to avoid recursion
   45.11      return os::malloc(size, (mtNMT | otNMTRecorder));
   45.12    }
   45.13  
   45.14 -  void* operator new(size_t size) {
   45.15 +  void* operator new(size_t size) throw() {
   45.16      assert(false, "use nothrow version");
   45.17      return NULL;
   45.18    }
    46.1 --- a/src/share/vm/services/memTrackWorker.cpp	Fri Aug 30 11:54:14 2013 -0400
    46.2 +++ b/src/share/vm/services/memTrackWorker.cpp	Fri Aug 30 12:22:02 2013 -0400
    46.3 @@ -1,5 +1,5 @@
    46.4  /*
    46.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    46.6 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    46.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    46.8   *
    46.9   * This code is free software; you can redistribute it and/or modify it
   46.10 @@ -63,12 +63,12 @@
   46.11    }
   46.12  }
   46.13  
   46.14 -void* MemTrackWorker::operator new(size_t size) {
   46.15 +void* MemTrackWorker::operator new(size_t size) throw() {
   46.16    assert(false, "use nothrow version");
   46.17    return NULL;
   46.18  }
   46.19  
   46.20 -void* MemTrackWorker::operator new(size_t size, const std::nothrow_t& nothrow_constant) {
   46.21 +void* MemTrackWorker::operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
   46.22    return allocate(size, false, mtNMT);
   46.23  }
   46.24  
    47.1 --- a/src/share/vm/services/memTrackWorker.hpp	Fri Aug 30 11:54:14 2013 -0400
    47.2 +++ b/src/share/vm/services/memTrackWorker.hpp	Fri Aug 30 12:22:02 2013 -0400
    47.3 @@ -1,5 +1,5 @@
    47.4  /*
    47.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    47.6 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    47.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    47.8   *
    47.9   * This code is free software; you can redistribute it and/or modify it
   47.10 @@ -90,8 +90,8 @@
   47.11   public:
   47.12    MemTrackWorker(MemSnapshot* snapshot);
   47.13    ~MemTrackWorker();
   47.14 -  _NOINLINE_ void* operator new(size_t size);
   47.15 -  _NOINLINE_ void* operator new(size_t size, const std::nothrow_t& nothrow_constant);
   47.16 +  _NOINLINE_ void* operator new(size_t size) throw();
   47.17 +  _NOINLINE_ void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw();
   47.18  
   47.19    void start();
   47.20    void run();
    48.1 --- a/src/share/vm/utilities/array.hpp	Fri Aug 30 11:54:14 2013 -0400
    48.2 +++ b/src/share/vm/utilities/array.hpp	Fri Aug 30 12:22:02 2013 -0400
    48.3 @@ -317,7 +317,7 @@
    48.4    Array(const Array<T>&);
    48.5    void operator=(const Array<T>&);
    48.6  
    48.7 -  void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) {
    48.8 +  void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) throw() {
    48.9      size_t word_size = Array::size(length);
   48.10      return (void*) Metaspace::allocate(loader_data, word_size, read_only,
   48.11                                         MetaspaceObj::array_type(sizeof(T)), CHECK_NULL);
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/test/runtime/InitialThreadOverflow/DoOverflow.java	Fri Aug 30 12:22:02 2013 -0400
    49.3 @@ -0,0 +1,41 @@
    49.4 +/*
    49.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    49.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    49.7 + *
    49.8 + * This code is free software; you can redistribute it and/or modify it
    49.9 + * under the terms of the GNU General Public License version 2 only, as
   49.10 + * published by the Free Software Foundation.
   49.11 + *
   49.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   49.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   49.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   49.15 + * version 2 for more details (a copy is included in the LICENSE file that
   49.16 + * accompanied this code).
   49.17 + *
   49.18 + * You should have received a copy of the GNU General Public License version
   49.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   49.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   49.21 + *
   49.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   49.23 + * or visit www.oracle.com if you need additional information or have any
   49.24 + * questions.
   49.25 + */
   49.26 +
   49.27 +public class DoOverflow {
   49.28 +
   49.29 +    static int count;
   49.30 +
   49.31 +    public void overflow() {
   49.32 +        count+=1;
   49.33 +        overflow();
   49.34 +    }
   49.35 +
   49.36 +    public static void printIt() {
   49.37 +        System.out.println("Going to overflow stack");
   49.38 +        try {
   49.39 +            new DoOverflow().overflow();
   49.40 +        } catch(java.lang.StackOverflowError e) {
   49.41 +            System.out.println("Overflow OK " + count);
   49.42 +        }
   49.43 +    }
   49.44 +}
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/test/runtime/InitialThreadOverflow/invoke.cxx	Fri Aug 30 12:22:02 2013 -0400
    50.3 @@ -0,0 +1,70 @@
    50.4 +/*
    50.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    50.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    50.7 + *
    50.8 + * This code is free software; you can redistribute it and/or modify it
    50.9 + * under the terms of the GNU General Public License version 2 only, as
   50.10 + * published by the Free Software Foundation.
   50.11 + *
   50.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   50.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   50.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   50.15 + * version 2 for more details (a copy is included in the LICENSE file that
   50.16 + * accompanied this code).
   50.17 + *
   50.18 + * You should have received a copy of the GNU General Public License version
   50.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   50.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   50.21 + *
   50.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   50.23 + * or visit www.oracle.com if you need additional information or have any
   50.24 + * questions.
   50.25 + */
   50.26 +
   50.27 +#include <assert.h>
   50.28 +#include <jni.h>
   50.29 +
   50.30 +#include <pthread.h>
   50.31 +
   50.32 +JavaVM* jvm;
   50.33 +
   50.34 +void *
   50.35 +floobydust (void *p) {
   50.36 +  JNIEnv *env;
   50.37 +
   50.38 +  jvm->AttachCurrentThread((void**)&env, NULL);
   50.39 +
   50.40 +  jclass class_id = env->FindClass ("DoOverflow");
   50.41 +  assert (class_id);
   50.42 +
   50.43 +  jmethodID method_id = env->GetStaticMethodID(class_id, "printIt", "()V");
   50.44 +  assert (method_id);
   50.45 +
   50.46 +  env->CallStaticVoidMethod(class_id, method_id, NULL);
   50.47 +
   50.48 +  jvm->DetachCurrentThread();
   50.49 +}
   50.50 +
   50.51 +int
   50.52 +main (int argc, const char** argv) {
   50.53 +  JavaVMOption options[1];
   50.54 +  options[0].optionString = (char*) "-Xss320k";
   50.55 +
   50.56 +  JavaVMInitArgs vm_args;
   50.57 +  vm_args.version = JNI_VERSION_1_2;
   50.58 +  vm_args.ignoreUnrecognized = JNI_TRUE;
   50.59 +  vm_args.options = options;
   50.60 +  vm_args.nOptions = 1;
   50.61 +
   50.62 +  JNIEnv* env;
   50.63 +  jint result = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
   50.64 +  assert(result >= 0);
   50.65 +
   50.66 +  pthread_t thr;
   50.67 +  pthread_create(&thr, NULL, floobydust, NULL);
   50.68 +  pthread_join(thr, NULL);
   50.69 +
   50.70 +  floobydust(NULL);
   50.71 +
   50.72 +  return 0;
   50.73 +}
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/test/runtime/InitialThreadOverflow/testme.sh	Fri Aug 30 12:22:02 2013 -0400
    51.3 @@ -0,0 +1,73 @@
    51.4 +#!/bin/sh
    51.5 +
    51.6 +# Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
    51.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    51.8 +#
    51.9 +# This code is free software; you can redistribute it and/or modify it
   51.10 +# under the terms of the GNU General Public License version 2 only, as
   51.11 +# published by the Free Software Foundation.
   51.12 +#
   51.13 +# This code is distributed in the hope that it will be useful, but WITHOUT
   51.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   51.15 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   51.16 +# version 2 for more details (a copy is included in the LICENSE file that
   51.17 +# accompanied this code).
   51.18 +#
   51.19 +# You should have received a copy of the GNU General Public License version
   51.20 +# 2 along with this work; if not, write to the Free Software Foundation,
   51.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   51.22 +#
   51.23 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   51.24 +# or visit www.oracle.com if you need additional information or have any
   51.25 +# questions.
   51.26 +
   51.27 +# @test testme.sh
   51.28 +# @bug 8009062
   51.29 +# @summary Poor performance of JNI AttachCurrentThread after fix for 7017193
   51.30 +# @compile DoOverflow.java
   51.31 +# @run shell testme.sh
   51.32 +
   51.33 +set -x
   51.34 +if [ "${TESTSRC}" = "" ]
   51.35 +then
   51.36 +  TESTSRC=${PWD}
   51.37 +  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
   51.38 +fi
   51.39 +echo "TESTSRC=${TESTSRC}"
   51.40 +## Adding common setup Variables for running shell tests.
   51.41 +. ${TESTSRC}/../../test_env.sh
   51.42 +
   51.43 +if [ "${VM_OS}" != "linux" ]
   51.44 +then
   51.45 +  echo "Test only valid for Linux"
   51.46 +  exit 0
   51.47 +fi
   51.48 +
   51.49 +gcc_cmd=`which gcc`
   51.50 +if [ "x$gcc_cmd" == "x" ]; then
   51.51 +    echo "WARNING: gcc not found. Cannot execute test." 2>&1
   51.52 +    exit 0;
   51.53 +fi
   51.54 +
   51.55 +CFLAGS="-m${VM_BITS}"
   51.56 +
   51.57 +LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
   51.58 +export LD_LIBRARY_PATH
   51.59 +
   51.60 +cp ${TESTSRC}${FS}invoke.cxx .
   51.61 +
   51.62 +# Copy the result of our @compile action:
   51.63 +cp ${TESTCLASSES}${FS}DoOverflow.class .
   51.64 +
   51.65 +echo "Compilation flag: ${COMP_FLAG}"
   51.66 +# Note pthread may not be found thus invoke creation will fail to be created.
   51.67 +# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
   51.68 +# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
   51.69 +
   51.70 +$gcc_cmd -DLINUX ${CFLAGS} -o invoke \
   51.71 +    -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
   51.72 +    -L${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
   51.73 +    -ljvm -lpthread invoke.cxx
   51.74 +
   51.75 +./invoke
   51.76 +exit $?

mercurial